home *** CD-ROM | disk | FTP | other *** search
/ ftp.ee.pdx.edu / 2014.02.ftp.ee.pdx.edu.tar / ftp.ee.pdx.edu / oss / cvs-2004 / bahasa / web / insert.php,v < prev    next >
Text File  |  2003-10-26  |  40KB  |  2,084 lines

  1. head    1.13;
  2. access;
  3. symbols
  4.     Initial:1.1.1.1 bule:1.1.1;
  5. locks; strict;
  6. comment    @# @;
  7.  
  8.  
  9. 1.13
  10. date    2003.10.26.01.53.10;    author bule;    state Exp;
  11. branches;
  12. next    1.12;
  13.  
  14. 1.12
  15. date    2003.10.20.00.21.45;    author bule;    state Exp;
  16. branches;
  17. next    1.11;
  18.  
  19. 1.11
  20. date    2003.10.18.00.33.41;    author bule;    state Exp;
  21. branches;
  22. next    1.10;
  23.  
  24. 1.10
  25. date    2003.10.06.00.39.26;    author bule;    state Exp;
  26. branches;
  27. next    1.9;
  28.  
  29. 1.9
  30. date    2003.10.01.06.51.29;    author bule;    state Exp;
  31. branches;
  32. next    1.8;
  33.  
  34. 1.8
  35. date    2003.09.04.07.27.00;    author bule;    state Exp;
  36. branches;
  37. next    1.7;
  38.  
  39. 1.7
  40. date    2003.09.02.07.07.24;    author bule;    state Exp;
  41. branches;
  42. next    1.6;
  43.  
  44. 1.6
  45. date    2003.08.31.00.02.48;    author bule;    state Exp;
  46. branches;
  47. next    1.5;
  48.  
  49. 1.5
  50. date    2003.08.30.00.33.38;    author bule;    state Exp;
  51. branches;
  52. next    1.4;
  53.  
  54. 1.4
  55. date    2003.08.30.00.31.53;    author bule;    state Exp;
  56. branches;
  57. next    1.3;
  58.  
  59. 1.3
  60. date    2003.08.28.20.04.48;    author bule;    state Exp;
  61. branches;
  62. next    1.2;
  63.  
  64. 1.2
  65. date    2003.08.19.19.05.16;    author bule;    state Exp;
  66. branches;
  67. next    1.1;
  68.  
  69. 1.1
  70. date    2003.08.12.19.18.23;    author bule;    state Exp;
  71. branches
  72.     1.1.1.1;
  73. next    ;
  74.  
  75. 1.1.1.1
  76. date    2003.08.12.19.18.23;    author bule;    state Exp;
  77. branches;
  78. next    ;
  79.  
  80.  
  81. desc
  82. @@
  83.  
  84.  
  85. 1.13
  86. log
  87. @*** empty log message ***
  88. @
  89. text
  90. @<?
  91. session_start();
  92. require_once("../php/Indonesia.php");
  93. require_once("../php/Web.php");
  94. //////////////////////////////////////////////////////////////////////////////
  95. //////////////////////////////////////////////////////////////////////////////
  96. // Project Name: Bahasa Indonesia Dictionary
  97. // Directory:    bahasa/web
  98. // File Name:    insert.php
  99. // Author(s):    John L. Whiteman
  100. // Created:      June 23, 2003  
  101. // Modified:     October 25, 2003
  102. // Description:  The purpose of this restricted access PHP web 
  103. //               client page is allow an administrator to insert
  104. //               new entries into the dictionary table of the 
  105. //               database.  This page also works with misses.php 
  106. //               and requests.php regarding new inserts. 
  107. // 
  108. // Copyright (c) 2003 John L. Whiteman
  109. //
  110. // Permission is herby granted, free of charge, to any person obtaining a 
  111. // copy of this software, data, and associated documentation files 
  112. // (the "Software"), to deal in the Software without restriction, 
  113. // including without limitation the rights to use, copy, modify, merge, 
  114. // publish, distribute, sublicense, and/or sell copies of Software, and to
  115. // permit persons to whom the Software is furnished to do so, subject to 
  116. // the following conditions:
  117. //
  118. // The above copyright notice and this permission notice shall be 
  119. // included in all copies or substantial portions of the Software.
  120. //
  121. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
  122. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
  123. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  124. // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 
  125. // ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHERE IN AN ACTION OF CONTRACT,
  126. // TORT OR OTHERWISE, ARISING IN THE SOFTWARE.  
  127. //////////////////////////////////////////////////////////////////////////////
  128. //////////////////////////////////////////////////////////////////////////////
  129.  
  130. $web = new Web(); 
  131.  
  132. if (!$_SESSION['ADMIN']) {
  133.  
  134.     $web->redirect("login.php");
  135.  
  136.     exit;
  137. }
  138.  
  139. $indonesia = new Indonesia();
  140.  
  141. $status = $indonesia->get_dictionary_status();
  142.  
  143. if ($status["status"] == 1 || $status["status"] == 2) {
  144.  
  145.     $web->redirect("admin.php");
  146.  
  147.     exit;
  148. }
  149.  
  150. $title = "";
  151. $insert_flag = -1;
  152.  
  153. if (isset($_GET['insert_missed_entry'])) {
  154.  
  155.     $title = "Insert Missed Entry";
  156.  
  157.     $insert_flag = 0;
  158.  
  159. } else if (isset($_GET['insert_requested_entry'])) {
  160.  
  161.     $title = "Insert Requested Entry";
  162.  
  163.     $insert_flag = 1;
  164.  
  165. } else if (
  166. (isset($_POST['insert_new_entry'])) &&
  167. (isset($_POST['language']))) {
  168.  
  169.     $title = "Insert New $_POST[language] Entry";
  170.  
  171.     $insert_flag = 2;
  172.  
  173. } else {
  174.  
  175.     $title = "Insert New Entry";
  176.  
  177.     $insert_flag = 3;
  178. }
  179. ?>
  180. <html>
  181. <head>
  182. <title>Bahasa Indonesia Dictionary: <? echo "$title"; ?></title>
  183.  
  184. <link href="bahasa.css" rel="stylesheet" type="text/css">
  185.  
  186. <script type="text/javascript" src="bahasa.js"></script>
  187.  
  188. <script language="JavaScript" type="text/javascript">
  189. <!--
  190. //////////////////////////////////////////////////////////////////////////////
  191. function verify() {
  192.  
  193.     english = document.insert.english.value;
  194.  
  195.     english = trim(english);
  196.  
  197.     if (is_white_space(english)) {
  198.  
  199.         alert(
  200.         "You must enter an English value!");
  201.  
  202.         document.insert.english.focus();
  203.  
  204.         return(false);
  205.     }
  206.  
  207.     if (english.length > 255) {
  208.  
  209.         alert(
  210.         "The English value must be 255 characters or less!");
  211.  
  212.         document.insert.english.focus();
  213.  
  214.         return(false);
  215.     }
  216.  
  217.     indonesian = document.insert.indonesian.value;
  218.  
  219.     indonesian = trim(indonesian);
  220.  
  221.     if (is_white_space(indonesian)) {
  222.  
  223.         alert(
  224.         "You must enter an Indonesian value!");
  225.  
  226.         document.insert.indonesian.focus();
  227.  
  228.         return(false);
  229.     }
  230.  
  231.     if (indonesian.length > 255) {
  232.  
  233.         alert(
  234.         "The Indonesian value must be 255 characters or less!");
  235.  
  236.         document.insert.indonesian.focus();
  237.  
  238.         return(false);
  239.     }
  240.  
  241.     if (document.insert.pos.value == "") {
  242.  
  243.         alert(
  244.         "You must select a Part of Speech Category!");
  245.  
  246.         document.insert.pos.focus();
  247.  
  248.         return(false);
  249.     }
  250.  
  251.     pronunciation = document.insert.pronunciation.value;
  252.  
  253.     if (pronunciation.length > 255) {
  254.  
  255.         alert(
  256.         "The Pronunciation value must be 255 characters or less!");
  257.  
  258.         document.insert.pronunciation.focus();
  259.  
  260.         return(false);
  261.     }
  262.  
  263.     ipa = document.insert.pronunciation_ipa.value;
  264.  
  265.     if (ipa.length > 255) {
  266.  
  267.         alert(
  268.         "The International Phonetic Alphabet (IPA) value " + 
  269.         "must be 255 characters or less!");
  270.  
  271.         document.insert.pronunciation_ipa.focus();
  272.  
  273.         return(false);
  274.     }
  275.  
  276.     password = document.insert.password.value;
  277.  
  278.     if (is_white_space(password)) {
  279.  
  280.         alert(
  281.         "You must enter a password value!");
  282.  
  283.         document.insert.password.focus();
  284.  
  285.         return(false);
  286.     }    
  287.  
  288.     return(true);
  289. }
  290. //////////////////////////////////////////////////////////////////////////////
  291. // -->
  292. </script>
  293. </head>
  294. <body>
  295. <?
  296. $web->show_logo("$title");
  297. ?>
  298.  
  299. <a href="admin.php">Administration</a>
  300.  | 
  301. <a href="editor.php">Search</a>
  302.  
  303. <?
  304. if ($insert_flag == 0) {
  305.  
  306.     print
  307.     "<form name=\"misses\" method=\"post\" " .
  308.     "action=\"misses.php\">\n" .
  309.     "<input type=\"submit\" " .
  310.     "value=\"Go Back to Missed Search Entries!\">\n" .
  311.     "</form>\n"; 
  312.  
  313. } else if ($insert_flag == 1) {
  314.  
  315.     print
  316.     "<form name=\"requests\" method=\"post\" " .
  317.     "action=\"requests.php\">\n" .
  318.     "<input type=\"submit\" " .
  319.     "value=\"Go Back to Requested New Entries!\">\n" .
  320.     "</form>\n"; 
  321.  
  322. } else if ($insert_flag == 2) { 
  323.  
  324.     print
  325.     "<form name=\"requests\" method=\"post\" " .
  326.     "action=\"editor.php\">\n" .
  327.     "<input type=\"submit\" " .
  328.     "value=\"Go Back to Dictionary Editor!\">\n" .
  329.     "</form>\n"; 
  330.  
  331. if (
  332. ($_SESSION['NODUP_INSERT_ENTRY']) &&
  333. (isset($_POST['id'])) &&
  334. ($_SESSION['NODUP_INSERT_ENTRY'] == $_POST['id'])) {
  335.  
  336.     show_insert_new_form($web, $indonesia);
  337.  
  338. //HERE WE DO A NEW INSERT FROM A WORD SUBMITTED BY EITHER misses.php or
  339. //requests.php
  340. } else if ( 
  341. (isset($_POST['english'])) &&
  342. (isset($_POST['indonesian'])) &&
  343. (isset($_POST['pos'])) && 
  344. (isset($_POST['id'])) &&
  345. (isset($_POST['spelling_flag'])) &&
  346. (isset($_POST['new_insert']))) {
  347.  
  348.     $rc = insert($web, $indonesia,
  349.     $_POST['english'], $_POST['indonesian'],
  350.     $_POST['pos'], $_POST['spelling_flag'],
  351.     $_POST['pronunciation'], $_POST['pronunciation_ipa'],
  352.     $_POST['comments']);
  353.  
  354.     if (!$rc) {
  355.  
  356.         $_SESSION['NODUP_INSERT_ENTRY'] = $_POST['id'];
  357.     }
  358.  
  359.     show_insert_new_form($web, $indonesia);
  360.  
  361. //HERE WE DO AN UPDATE OF EXISTING WORD
  362. } else if (
  363. (isset($_POST['english'])) &&
  364. (isset($_POST['indonesian'])) &&
  365. (isset($_POST['pos'])) && 
  366. (isset($_POST['id'])) &&
  367. (isset($_POST['spelling_flag'])) &&
  368. (isset($_POST['replace_insert']))) {
  369.  
  370.     $pkey = $_POST['replace_insert'];
  371.  
  372.     $rc = 
  373.     replace(
  374.     $web, $indonesia, $pkey,
  375.     $_POST['english'], $_POST['indonesian'],
  376.     $_POST['pos'], $_POST['spelling_flag'],
  377.     $_POST['pronunciation'], $_POST['pronunciation_ipa'],
  378.     $_POST['comments']);
  379.  
  380.     if (!$rc) {
  381.  
  382.         $_SESSION['NODUP_INSERT_ENTRY'] = $_POST['id'];
  383.     }
  384.  
  385.     show_insert_new_form($web, $indonesia);
  386.  
  387. //HERE WE DO A NEW INSERT
  388. } else if (
  389. (isset($_POST['english'])) &&
  390. (isset($_POST['indonesian'])) &&
  391. (isset($_POST['pos'])) && 
  392. (isset($_POST['id'])) &&
  393. (isset($_POST['spelling_flag'])) &&
  394. (isset($_POST['password']))) {
  395.  
  396.     $errstr = $indonesia->login($_SESSION['ADMIN'], $_POST['password']);
  397.  
  398.     if ($errstr != "") {
  399.  
  400.         print "<hr><b>Permission denied!</b><hr>\n";
  401.  
  402.     } else {
  403.  
  404.         $delete_flag = "";
  405.  
  406.         if (isset($_POST['delete_miss'])) {
  407.  
  408.             $delete_flag = 
  409.             "<input type=\"hidden\" " .
  410.             "name=\"delete_miss\" " .
  411.             "value=\"" . $_POST['delete_miss'] .
  412.             "\">";
  413.             
  414.         } else if (isset($_POST['delete_request'])) {
  415.  
  416.             $delete_flag = 
  417.             "<input type=\"hidden\" " .
  418.             "name=\"delete_request\" " .
  419.             "value=\"" . $_POST['delete_request'] .
  420.             "\">";
  421.         }
  422.  
  423.         $dups = 
  424.         check_for_duplicates(
  425.         $web, $indonesia, $_POST['english'], $_POST['indonesian'],
  426.         $_POST['pos'], $_POST['spelling_flag'], 
  427.         $_POST['pronunciation'], $_POST['pronunciation_ipa'],
  428.         $_POST['comments'], $_POST['id'], $delete_flag);  
  429.  
  430.  
  431.         if ($dups == 0) {
  432.  
  433.             $rc = insert($web, $indonesia,
  434.             $_POST['english'], $_POST['indonesian'],
  435.             $_POST['pos'], $_POST['spelling_flag'],
  436.             $_POST['pronunciation'], $_POST['pronunciation_ipa'],
  437.             $_POST['comments']);
  438.  
  439.             if (!$rc) {
  440.  
  441.                 $_SESSION['NODUP_INSERT_ENTRY'] = $_POST['id'];
  442.  
  443.                 show_insert_new_form($web, $indonesia);
  444.             }
  445.         }
  446.     }
  447.  
  448. } else {
  449.  
  450.     if ($insert_flag == 0) {
  451.  
  452.         show_insert_missed_form(
  453.         $web, $indonesia, $_GET['insert_missed_entry']);
  454.  
  455.     } else if ($insert_flag == 1) {
  456.  
  457.         show_insert_request_form(
  458.         $web, $indonesia, $_GET['insert_requested_entry']);
  459.  
  460.     } else if ($insert_flag == 2) {
  461.  
  462.         show_dictionary_editor_form(
  463.         $web, $indonesia, $_POST['insert_new_entry'], 
  464.         $_POST['language']);
  465.  
  466.     } else {
  467.  
  468.         show_insert_new_form($web, $indonesia);
  469.     }
  470. }
  471. ?>
  472. </body>
  473. </html>
  474.  
  475. <?
  476. //////////////////////////////////////////////////////////////////////////////
  477. function check_for_duplicates(
  478. $web, $indonesia, $english, $indonesian, $pos, $spelling_flag,
  479. $pronunciation, $pronunciation_ipa, $comments, $id, $delete_flag="") {
  480.  
  481.     $duplicates = array();
  482.  
  483.     $english = $web->strip($english);
  484.     $indonesian = $web->strip($indonesian);
  485.     $pos = $web->strip($pos);
  486.     $spelling_flag = $web->strip($spelling_flag);
  487.     $pronunciation = $web->strip($pronunciation);
  488.     $pronunciation_ipa = $web->strip($pronunciation_ipa);
  489.     $comments = $web->strip($comments);
  490.     $id = $web->strip($id);
  491.  
  492.     $hidden = 
  493.     "<input type=\"hidden\" name=\"english\" " .
  494.     "value=\"${english}\">\n" .
  495.     "<input type=\"hidden\" name=\"indonesian\" " .
  496.     "value=\"${indonesian}\">\n" . 
  497.     "<input type=\"hidden\" name=\"pos\" " .
  498.     "value=\"${pos}\">\n" .
  499.     "<input type=\"hidden\" name=\"spelling_flag\" " .
  500.     "value=\"${spelling_flag}\">\n" .
  501.     "<input type=\"hidden\" name=\"pronunciation\" " .
  502.     "value=\"${pronunciation}\">\n" .
  503.     "<input type=\"hidden\" name=\"pronunciation_ipa\" " .
  504.     "value=\"${pronunciation_ipa}\">\n" .
  505.     "<input type=\"hidden\" name=\"comments\" " .
  506.     "value=\"${comments}\">\n" .
  507.     "<input type=\"hidden\" name=\"id\" " .
  508.     "value=\"${id}\">\n" .
  509.     "${delete_flag}\n";
  510.  
  511.     $errstr = 
  512.     $indonesia->check_for_duplicate_entries(
  513.     $duplicates, $english, $indonesian, $pos, $spelling_flag);
  514.  
  515.     if ($errstr != "") {
  516.  
  517.         print "<br><hr><b>${errstr}</b><hr><br>\n";
  518.  
  519.         return(0);
  520.     }
  521.  
  522.     $dup_count = count($duplicates);
  523.  
  524.     if ($dup_count == 0) {
  525.  
  526.         return(0);
  527.     }
  528.  
  529.     $english = $web->tohtml($english);
  530.     $indonesian = $web->tohtml($indonesian);
  531.     $pos = $web->tohtml($pos);
  532.     $spelling_flag = $web->tohtml($spelling_flag);
  533.     $pronunciation = $web->tohtml($pronunciation);
  534.     $pronunciation_ipa = $web->tohtml($pronunciation_ipa);
  535.     $comments = $web->tohtml($comments);
  536.  
  537.     $parts_of_speech = array();
  538.  
  539.     $errstr = $indonesia->get_pos($parts_of_speech, 0);
  540.  
  541.     $poss = $parts_of_speech[$pos];
  542.  
  543.     $spelling = "Modern";
  544.  
  545.     if ($spelling_flag == 1) {
  546.  
  547.         $spelling = "Pre 1972";
  548.     }
  549.  
  550.     $commentss = $comments;
  551.  
  552.     if ($commentss == "") {
  553.  
  554.         $commentss = "N/A";
  555.     }
  556.  
  557.     print
  558.     "<hr><b>Found ${dup_count} exact and/or similar " .
  559.     "existing entries in the dictionary database!</b><hr>\n";
  560.  
  561.     print 
  562.     "<form name=\"abort_insert\" method=\"post\" " .
  563.     "action=\"insert.php\">\n" .
  564.     "<input type=\"submit\" " .
  565.     "value=\"I've changed my mind and want to cancel this insert!\">\n" .
  566.     "</form>\n";
  567.  
  568.     print 
  569.     "<form name=\"insert_new\" method=\"post\">\n" .
  570.     "<table cellpadding=\"3\" cellspacing=\"3\" border=\"1\">\n" .
  571.     "<tr>\n" .
  572.     "<th>English</th>\n" .
  573.     "<th>Indonesian</th>\n" .
  574.     "<th>Part of Speech</th>\n" .
  575.     "<th>Spelling</th>\n" .
  576.     "<th>Pronounce</th>\n" .
  577.     "<th>IPA</th>\n" .
  578.     "<th>Comments</th>\n" .
  579.     "<th>Action</th>\n" .
  580.     "</tr><tr>\n" .
  581.     "<td>${english} </td>\n" .
  582.     "<td>${indonesian} </td>\n" .
  583.     "<td>${poss} </td>\n" .
  584.     "<td>${spelling} </td>\n" .
  585.     "<td>${pronunciation} </td>\n" .
  586.     "<td>${pronunciation_ipa} </td>\n" .
  587.     "<td>${commentss} </td>\n" .
  588.     "<td><input type=\"submit\" value=\"Insert as a new entry!\"></td>\n" .
  589.     "</tr></table>\n" .
  590.     "<input type=\"hidden\" name=\"new_insert\" value=\"1\">\n" .
  591.     "${hidden}" .
  592.     "</form>\n";
  593.     
  594.     print
  595.     "<table cellpadding=\"3\" cellspacing=\"3\" border=\"1\">\n";
  596.  
  597.     for ($i = 0; $i < $dup_count; $i++) {
  598.  
  599.         if ($i == 0) {
  600.  
  601.             print
  602.             "<tr>\n" .
  603.             "<th>PKEY</th>\n" .
  604.             "<th>English</th>\n" .
  605.             "<th>Indonesian</th>\n" .
  606.             "<th>Part of Speech</th>\n" .
  607.             "<th>Created</th>\n" .
  608.             "<th>Modified</th>\n" .
  609.             "<th>Spelling Flag</th>\n" .
  610.             "<th>Pronunciation</th>\n" .
  611.             "<th>IPA</th>\n" .
  612.             "<th>Comments</th>\n" .
  613.             "<th>Action</th>\n" .
  614.             "</tr>\n"; 
  615.         }
  616.  
  617.         $pkey = $web->tohtml($duplicates[$i]["pkey"]);
  618.         $eng= $web->tohtml($duplicates[$i]["english"]);
  619.         $indo = $web->tohtml($duplicates[$i]["indonesian"]);
  620.         $posx= $web->tohtml($duplicates[$i]["pos"]);
  621.         $created = $web->tohtml($duplicates[$i]["created"]);
  622.         $modified = $web->tohtml($duplicates[$i]["modified"]);
  623.         $spflg = $web->tohtml($duplicates[$i]["spelling"]);
  624.         $p = $web->tohtml($duplicates[$i]["pronunciation"]);
  625.         $pipa = $web->tohtml($duplicates[$i]["pronunciation_ipa"]);
  626.         $comments = $web->tohtml($duplicates[$i]["comments"]);
  627.  
  628.         print
  629.         "<tr>\n" .
  630.         "<td>${pkey} </td>\n" .
  631.         "<td>${eng} </td>\n" .
  632.         "<td>${indo} </td>\n" .
  633.         "<td>${posx} </td>\n" .
  634.         "<td>${created} </td>\n" .
  635.         "<td>${modified} </td>\n" .
  636.         "<td>${spflg} </td>\n" .
  637.         "<td>${p} </td>\n" .
  638.         "<td>${pipa} </td>\n" .
  639.         "<td>${comments} </td>\n" .
  640.         "<td><form name=\"replace\" method=\"post\">\n" .
  641.         "<input type=\"submit\" value=\"Replace!\">\n" .
  642.         "<input type=\"hidden\" name=\"replace_insert\" " .
  643.         "value=\"${pkey}\">\n" .
  644.         "${hidden}</form></td></tr>\n";
  645.     } 
  646.  
  647.     print "</table>\n";
  648.  
  649.     return(1);
  650. }
  651. //////////////////////////////////////////////////////////////////////////////
  652. function insert($web, $indonesia, 
  653. $english, $indonesian, $pos, $spelling_flag, 
  654. $pronunciation, $pronunciation_ipa, $comments) {
  655.  
  656.     $errstr = 
  657.     $indonesia->insert_entry(
  658.     $english, $indonesian, $spelling_flag,
  659.     $pos, $pronunciation,
  660.     $pronunciation_ipa, $comments);
  661.  
  662.     if ($errstr != "") {
  663.  
  664.         print "<br><hr><b>${errstr}</b><hr><br>\n";
  665.  
  666.         return(1);
  667.  
  668.     } else {
  669.  
  670.         print 
  671.         "<br><hr><b>Successful Insertion!</b><hr><br>\n";
  672.     }
  673.  
  674.     return(0);
  675. }
  676. //////////////////////////////////////////////////////////////////////////////
  677. function replace($web, $indonesia, $pkey,
  678. $english, $indonesian, $pos, $spelling_flag,
  679. $pronunciation, $pronunciation_ipa, $comments) { 
  680.  
  681.     $errstr = 
  682.     $indonesia->update_entry($pkey,
  683.     $english, $indonesian, $spelling_flag,
  684.     $pos, $pronunciation,
  685.     $pronunciation_ipa, $comments);
  686.  
  687.     if ($errstr != "") {
  688.  
  689.         print "<br><hr><b>${errstr}</b><hr><br>\n";
  690.  
  691.         return(1);
  692.     }
  693.  
  694.     print "<br><hr><b>Successful Replacement!</b><hr><br>\n";
  695.  
  696.     return(0);
  697. }
  698. //////////////////////////////////////////////////////////////////////////////
  699. function show_dictionary_editor_form($web, $indonesia, $token, $language) { 
  700.  
  701.     $pos = array();
  702.  
  703.     $id = uniqid(rand(), true);
  704.  
  705.     $pos_select = 
  706.     "<select name=\"pos\">\n" .
  707.     "<option value=\"\">\n";
  708.  
  709.     $errstr = $indonesia->get_parts_of_speech($pos);
  710.  
  711.     $total_pos = count($pos);
  712.  
  713.     for($i = 0; $i < $total_pos; $i++) {
  714.  
  715.         $pos_pkey = $web->tohtml($pos[$i]["pkey"]);
  716.  
  717.         $pos_pos = $web->tohtml($pos[$i]["part_of_speech"]);
  718.  
  719.         $pos_select .= "<option value=\"${pos_pkey}\">${pos_pos}\n";
  720.     } 
  721.  
  722.     $pos_select .= "</select>\n";
  723.  
  724.     $token = $web->tohtml($token);
  725.  
  726.     $language = $web->tohtml($language);
  727.  
  728.     $english = "";
  729.  
  730.     $indonesian = "";
  731.  
  732.     $focus = "english";
  733.  
  734.     if ($language == "English") {
  735.  
  736.         $english = $token;
  737.  
  738.         $focus = "indonesian";
  739.  
  740.     } else {
  741.  
  742.         $indonesian = $token;
  743.  
  744.         $focus = "english";
  745.     }
  746.  
  747. print <<<EOFDEF
  748. <form name="insert" method="post" onSubmit='return verify()'>
  749. <table cellpadding="3" cellspacing="5" border="0">
  750.  
  751. <tr>
  752. <td>English (1 to 255 characters):</td>
  753. </tr><tr>
  754. <td>
  755. <input type="text" name="english" value="${english}"
  756. maxlength="255" size="50">
  757. </td>
  758.  
  759. </tr><tr>
  760. <td><hr></td>
  761.  
  762. </tr><tr>
  763. <td>Indonesian (1 to 255 characters):</td>
  764. </tr><tr>
  765. <td>
  766. <input type="text" name="indonesian" value="${indonesian}"
  767. maxlength="255" size="50">
  768. </td>
  769.  
  770. </tr><tr>
  771. <td><hr></td>
  772.  
  773. </tr><tr>
  774. <td>Spelling Convention:</td>
  775. </tr><tr>
  776. <td>
  777. <input type="radio" name="spelling_flag" value="1">Before 1972
  778.   
  779. <input type="radio" name="spelling_flag" value="0" checked>Modern
  780. </td>
  781.  
  782. </tr><tr>
  783. <td><hr></td>
  784.  
  785. </tr><tr>
  786. <td>Part of Speech:</td>
  787. </tr><tr>
  788. <td>
  789. $pos_select
  790. </td>
  791.  
  792. </tr><tr>
  793. <td><hr></td>
  794.  
  795. </tr><tr>
  796. <td>Pronunciation (1 to 255 characters):</td>
  797. </tr><tr>
  798. <td>
  799. <input type="text" name="pronunciation" 
  800. maxlength="255" size="50">
  801. </td>
  802.  
  803. </tr><tr>
  804. <td><hr></td>
  805.  
  806. </tr><tr>
  807. <td>International Phonetic Alphabet (1 to 255 characters):</td>
  808. </tr><tr>
  809. <td>
  810. <input type="text" name="pronunciation_ipa" 
  811. maxlength="255" size="50">
  812. </td>
  813.  
  814. </tr><tr>
  815. <td><hr></td>
  816.  
  817. </tr><tr>
  818. <td>Comments:</td>
  819. </tr><tr>
  820. <td>
  821. <textarea name="comments" wrap="soft" rows="5" cols="55"></textarea>
  822. </td>
  823.  
  824. </tr><tr>
  825. <td><hr></td>
  826.  
  827. </tr><tr>
  828. <td>Password:</td>
  829. </tr><tr>
  830. <td>
  831. <input type="password" name="password" size="50">
  832. </td>
  833.  
  834. </tr><tr>
  835. <td><hr></td>
  836.  
  837. </tr><tr>
  838. <td align="right">
  839. <input type="reset" value="Clear Form">
  840.   
  841. <input type="submit" value="Insert into Dictionary">
  842. </td>
  843.  
  844. </tr>
  845. </table>
  846. <input type="hidden" name="id" value="${id}">
  847. </form>
  848. <script language="Javascript" type="text/javascript">
  849. document.insert.${focus}.focus();
  850. </script>
  851. EOFDEF;
  852.  
  853.     return;
  854. }
  855. //////////////////////////////////////////////////////////////////////////////
  856. function show_insert_missed_form($web, $indonesia, $pkey) {
  857.  
  858.     $miss = array();
  859.  
  860.     $id = uniqid(rand(), true);
  861.  
  862.     $errstr =
  863.     $indonesia->get_miss($miss, $pkey);
  864.  
  865.     if ($errstr != "") {
  866.  
  867.         print "<br><hr><b>${errstr}</b><hr><br>\n";
  868.  
  869.         return;
  870.     }
  871.  
  872.     $miss_count = count($miss);
  873.  
  874.     if ($miss_count != 1) {
  875.  
  876.         return;
  877.     }
  878.  
  879.     $entry = $web->tohtml($miss[0]->entry);
  880.  
  881.     $language = $web->tohtml($miss[0]->language);
  882.  
  883.     $english_word = "";
  884.  
  885.     $indonesian_word = "";
  886.  
  887.     $focus = "english";
  888.  
  889.     if ($language == 0) {
  890.  
  891.         $english_word = $entry;
  892.  
  893.         $focus = "indonesian";
  894.  
  895.     } else {
  896.  
  897.         $indonesian_word = $entry;
  898.  
  899.         $focus = "english";
  900.     }
  901.  
  902.     $pos = array();
  903.  
  904.     $pos_select = 
  905.     "\n<select name=\"pos\">\n" .
  906.     "<option value=\"\">\n";
  907.  
  908.     $errstr = $indonesia->get_parts_of_speech($pos);
  909.  
  910.     $total_pos = count($pos);
  911.  
  912.     for($i = 0; $i < $total_pos; $i++) {
  913.  
  914.         $pos_pkey = $web->tohtml($pos[$i]["pkey"]);
  915.  
  916.         $pos_pos = $web->tohtml($pos[$i]["part_of_speech"]);
  917.  
  918.         $pos_select .= "<option value=\"${pos_pkey}\">${pos_pos}\n";
  919.     } 
  920.  
  921.     $pos_select .= "</select>\n";
  922.  
  923. print <<<EOFSIMF
  924. <form name="insert" method="post" onSubmit='return verify()'>
  925. <table cellpadding="3" cellspacing="5" border="0">
  926.  
  927. <tr>
  928. <td>English (1 to 255 characters):</td>
  929. </tr><tr>
  930. <td>
  931. <input type="text" name="english" 
  932. maxlength="255" size="50" value="${english_word}">
  933. </td>
  934.  
  935. </tr><tr>
  936. <td><hr></td>
  937.  
  938. </tr><tr>
  939. <td>Indonesian (1 to 255 characters):</td>
  940. </tr><tr>
  941. <td>
  942. <input type="text" name="indonesian" 
  943. maxlength="255" size="50" value="${indonesian_word}">
  944. </td>
  945.  
  946. </tr><tr>
  947. <td><hr></td>
  948.  
  949. </tr><tr>
  950. <td>Spelling Convention:</td>
  951. </tr><tr>
  952. <td>
  953. <input type="radio" name="spelling_flag" value="1">Before 1972
  954.   
  955. <input type="radio" name="spelling_flag" value="0" checked>Modern
  956. </td>
  957.  
  958. </tr><tr>
  959. <td><hr></td>
  960.  
  961. </tr><tr>
  962. <td>Part of Speech:</td>
  963. </tr><tr>
  964. <td>
  965. $pos_select
  966. </td>
  967.  
  968. </tr><tr>
  969. <td><hr></td>
  970.  
  971. </tr><tr>
  972. <td>Pronunciation (1 to 255 characters):</td>
  973. </tr><tr>
  974. <td>
  975. <input type="text" name="pronunciation" 
  976. maxlength="255" size="50">
  977. </td>
  978.  
  979. </tr><tr>
  980. <td><hr></td>
  981.  
  982. </tr><tr>
  983. <td>International Phonetic Alphabet (1 to 255 characters):</td>
  984. </tr><tr>
  985. <td>
  986. <input type="text" name="pronunciation_ipa" 
  987. maxlength="255" size="50">
  988. </td>
  989.  
  990. </tr><tr>
  991. <td><hr></td>
  992.  
  993. </tr><tr>
  994. <td>Comments:</td>
  995. </tr><tr>
  996. <td>
  997. <textarea name="comments" wrap="soft" rows="5" cols="55"></textarea>
  998. </td>
  999.  
  1000. </tr><tr>
  1001. <td><hr></td>
  1002.  
  1003. </tr><tr>
  1004. <td>Password:</td>
  1005. </tr><tr>
  1006. <td>
  1007. <input type="password" name="password" size="50">
  1008. </td>
  1009.  
  1010. </tr><tr>
  1011. <td><hr></td>
  1012.  
  1013. </tr><tr>
  1014. <td align="right">
  1015. <input type="reset" value="Clear Form">
  1016.   
  1017. <input type="submit" value="Insert Entry!">
  1018. </td></tr>
  1019. </table>
  1020. <input type="hidden" name="delete_miss" value="$pkey">
  1021. <input type="hidden" name="id" value="${id}">
  1022. </form>
  1023. <script language="Javascript" type="text/javascript">
  1024. document.insert.${focus}.focus();
  1025. </script>
  1026. EOFSIMF;
  1027.  
  1028.     return;
  1029. }
  1030. //////////////////////////////////////////////////////////////////////////////
  1031. function show_insert_request_form($web, $indonesia, $pkey) {
  1032.  
  1033.     $request = array();
  1034.  
  1035.     $id = uniqid(rand(), true);
  1036.  
  1037.     $errstr =
  1038.     $indonesia->get_request($request, $pkey);
  1039.  
  1040.     if ($errstr != "") {
  1041.  
  1042.         print "<br><hr><b>${errstr}</b><hr><br>\n";
  1043.  
  1044.         return;
  1045.     }
  1046.  
  1047.     $request_count = count($request);
  1048.  
  1049.     if ($request_count != 1) {
  1050.  
  1051.         return;
  1052.     }
  1053.  
  1054.     $english = $web->tohtml($request[0]->english);
  1055.  
  1056.     $indonesian = $web->tohtml($request[0]->indonesian);
  1057.  
  1058.     $part_of_speech = $web->tohtml($request[0]->part_of_speech);
  1059.  
  1060.     $spelling_flag = $web->tohtml($request[0]->spelling_flag);
  1061.  
  1062.     $comments = $web->tohtml($request[0]->comments);
  1063.  
  1064.     $spelling_html = "";
  1065.  
  1066.     if ($spelling_flag == 0) {
  1067.  
  1068.         $spelling_html =
  1069.         "<input type=\"radio\" name=\"spelling_flag\" value=\"1\">" .
  1070.         "Before 1972" .
  1071.         "  " .
  1072.         "<input type=\"radio\" name=\"spelling_flag\" value=\"0\" " .
  1073.         "checked>Modern\n";
  1074.  
  1075.     } else {
  1076.  
  1077.         $spelling_html =
  1078.         "<input type=\"radio\" name=\"spelling_flag\" value=\"1\" " .
  1079.         "checked>Before 1972" .
  1080.         "  " .
  1081.         "<input type=\"radio\" name=\"spelling_flag\" value=\"0\">" .
  1082.         "Modern\n";
  1083.     }
  1084.  
  1085.     $pos = array();
  1086.  
  1087.     $pos_select = 
  1088.     "\n<select name=\"pos\">\n" .
  1089.     "<option value=\"\">\n";
  1090.  
  1091.     $errstr = $indonesia->get_parts_of_speech($pos);
  1092.  
  1093.     $total_pos = count($pos);
  1094.  
  1095.     for($i = 0; $i < $total_pos; $i++) {
  1096.  
  1097.         $pos_pkey = $web->tohtml($pos[$i]["pkey"]);
  1098.  
  1099.         $pos_pos = $web->tohtml($pos[$i]["part_of_speech"]);
  1100.  
  1101.         if ($pos_pkey != $part_of_speech) {
  1102.  
  1103.             $pos_select .= 
  1104.             "<option value=\"${pos_pkey}\">${pos_pos}\n";
  1105.  
  1106.         } else {
  1107.  
  1108.             $pos_select .= 
  1109.             "<option value=\"${pos_pkey}\" selected>" .
  1110.             "${pos_pos}\n";
  1111.         }
  1112.     } 
  1113.  
  1114.     $pos_select .= "</select>\n";
  1115.  
  1116. print <<<EOFSIRF
  1117. <form name="insert" method="post" onSubmit='return verify()'>
  1118. <table cellpadding="3" cellspacing="5" border="0">
  1119.  
  1120. <tr>
  1121. <td>English (1 to 255 characters):</td>
  1122. </tr><tr>
  1123. <td>
  1124. <input type="text" name="english" 
  1125. maxlength="255" size="50" value="${english}">
  1126. </td>
  1127.  
  1128. </tr><tr>
  1129. <td><hr></td>
  1130.  
  1131. </tr><tr>
  1132. <td>Indonesian (1 to 255 characters):</td>
  1133. </tr><tr>
  1134. <td>
  1135. <input type="text" name="indonesian" 
  1136. maxlength="255" size="50" value="${indonesian}">
  1137. </td>
  1138.  
  1139. </tr><tr>
  1140. <td><hr></td>
  1141.  
  1142. </tr><tr>
  1143. <td>Spelling Convention:</td>
  1144. </tr><tr>
  1145. <td>${spelling_html}</td>
  1146.  
  1147. </tr><tr>
  1148. <td><hr></td>
  1149.  
  1150. </tr><tr>
  1151. <td>Part of Speech:</td>
  1152. </tr><tr>
  1153. <td>
  1154. $pos_select
  1155. </td>
  1156.  
  1157. </tr><tr>
  1158. <td><hr></td>
  1159.  
  1160. </tr><tr>
  1161. <td>Pronunciation (1 to 255 characters):</td>
  1162. </tr><tr>
  1163. <td>
  1164. <input type="text" name="pronunciation" 
  1165. maxlength="255" size="50">
  1166. </td>
  1167.  
  1168. </tr><tr>
  1169. <td><hr></td>
  1170.  
  1171. </tr><tr>
  1172. <td>International Phonetic Alphabet (1 to 255 characters):</td>
  1173. </tr><tr>
  1174. <td>
  1175. <input type="text" name="pronunciation_ipa" 
  1176. maxlength="255" size="50">
  1177. </td>
  1178.  
  1179. </tr><tr>
  1180. <td><hr></td>
  1181.  
  1182. </tr><tr>
  1183. <td>Comments:</td>
  1184. </tr><tr>
  1185. <td>
  1186. <textarea name="comments" wrap="soft"
  1187. rows="5" cols="55">${comments}</textarea>
  1188. </td>
  1189.  
  1190. </tr><tr>
  1191. <td><hr></td>
  1192.  
  1193. </tr><tr>
  1194. <td>Password:</td>
  1195. </tr><tr>
  1196. <td>
  1197. <input type="password" name="password" size="50">
  1198. </td>
  1199.  
  1200. </tr><tr>
  1201. <td><hr></td>
  1202.  
  1203. </tr><tr>
  1204. <td align="right">
  1205. <input type="reset" value="Clear Form">
  1206.   
  1207. <input type="submit" value="Insert Entry!">
  1208. </td></tr>
  1209. </table>
  1210. <input type="hidden" name="delete_request" value="$pkey">
  1211. <input type="hidden" name="id" value="${id}">
  1212. </form>
  1213. <script language="Javascript" type="text/javascript">
  1214. document.insert.english.focus();
  1215. </script>
  1216. EOFSIRF;
  1217.  
  1218.     return;
  1219. }
  1220. //////////////////////////////////////////////////////////////////////////////
  1221. function show_insert_new_form($web, $indonesia) {
  1222.  
  1223.     $pos = array();
  1224.  
  1225.     $id = uniqid(rand(), true);
  1226.  
  1227.     $pos_select = 
  1228.     "<select name=\"pos\">\n" .
  1229.     "<option value=\"\">\n";
  1230.  
  1231.     $errstr = $indonesia->get_parts_of_speech($pos);
  1232.  
  1233.     $total_pos = count($pos);
  1234.  
  1235.     for($i = 0; $i < $total_pos; $i++) {
  1236.  
  1237.         $pos_pkey = $web->tohtml($pos[$i]["pkey"]);
  1238.  
  1239.         $pos_pos = $web->tohtml($pos[$i]["part_of_speech"]);
  1240.  
  1241.         $pos_select .= "<option value=\"${pos_pkey}\">${pos_pos}\n";
  1242.     } 
  1243.  
  1244.     $pos_select .= "</select>\n";
  1245.  
  1246. print <<<EOFSINF
  1247. <form name="insert" method="post" onSubmit='return verify()'>
  1248. <table cellpadding="3" cellspacing="5" border="0">
  1249.  
  1250. <tr>
  1251. <td>English (1 to 255 characters):</td>
  1252. </tr><tr>
  1253. <td>
  1254. <input type="text" name="english" maxlength="255" size="50">
  1255. </td>
  1256.  
  1257. </tr><tr>
  1258. <td><hr></td>
  1259.  
  1260. </tr><tr>
  1261. <td>Indonesian (1 to 255 characters):</td>
  1262. </tr><tr>
  1263. <td>
  1264. <input type="text" name="indonesian" maxlength="255" size="50">
  1265. </td>
  1266.  
  1267. </tr><tr>
  1268. <td><hr></td>
  1269.  
  1270. </tr><tr>
  1271. <td>Spelling Convention:</td>
  1272. </tr><tr>
  1273. <td>
  1274. <input type="radio" name="spelling_flag" value="1">Before 1972
  1275.   
  1276. <input type="radio" name="spelling_flag" value="0" checked>Modern
  1277. </td>
  1278.  
  1279. </tr><tr>
  1280. <td><hr></td>
  1281.  
  1282. </tr><tr>
  1283. <td>Part of Speech:</td>
  1284. </tr><tr>
  1285. <td>
  1286. $pos_select
  1287. </td>
  1288.  
  1289. </tr><tr>
  1290. <td><hr></td>
  1291.  
  1292. </tr><tr>
  1293. <td>Pronunciation (1 to 255 characters):</td>
  1294. </tr><tr>
  1295. <td>
  1296. <input type="text" name="pronunciation" maxlength="255" size="50">
  1297. </td>
  1298.  
  1299. </tr><tr>
  1300. <td><hr></td>
  1301.  
  1302. </tr><tr>
  1303. <td>International Phonetic Alphabet (1 to 255 characters):</td>
  1304. </tr><tr>
  1305. <td>
  1306. <input type="text" name="pronunciation_ipa" maxlength="255" size="50">
  1307. </td>
  1308.  
  1309. </tr><tr>
  1310. <td><hr></td>
  1311.  
  1312. </tr><tr>
  1313. <td>Comments:</td>
  1314. </tr><tr>
  1315. <td>
  1316. <textarea name="comments" wrap="soft" rows="5" cols="55"></textarea>
  1317. </td>
  1318.  
  1319. </tr><tr>
  1320. <td><hr></td>
  1321.  
  1322. </tr><tr>
  1323. <td>Password:</td>
  1324. </tr><tr>
  1325. <td>
  1326. <input type="password" name="password" size="50">
  1327. </td>
  1328.  
  1329. </tr><tr>
  1330. <td><hr></td>
  1331.  
  1332. </tr><tr>
  1333. <td align="right">
  1334. <input type="reset" value="Clear Form">
  1335.   
  1336. <input type="submit" value="Insert into Dictionary">
  1337. </td>
  1338.  
  1339. </tr>
  1340. </table>
  1341. <input type="hidden" name="id" value="${id}">
  1342. </form>
  1343. <script language="Javascript" type="text/javascript">
  1344. document.insert.english.focus();
  1345. </script>
  1346. EOFSINF;
  1347.  
  1348.     return;
  1349. }
  1350. //////////////////////////////////////////////////////////////////////////////
  1351. //////////////////////////////////////////////////////////////////////////////
  1352. ?>
  1353. @
  1354.  
  1355.  
  1356. 1.12
  1357. log
  1358. @*** empty log message ***
  1359. @
  1360. text
  1361. @d12 1
  1362. a12 1
  1363. // Modified:     October 19, 2003
  1364. d425 1
  1365. a425 1
  1366.     $duplicates, $english, $indonesia, $pos, $spelling_flag);
  1367. @
  1368.  
  1369.  
  1370. 1.11
  1371. log
  1372. @*** empty log message ***
  1373. @
  1374. text
  1375. @d12 1
  1376. a12 1
  1377. // Modified:     October 17, 2003
  1378. d94 2
  1379. @
  1380.  
  1381.  
  1382. 1.10
  1383. log
  1384. @*** empty log message ***
  1385. @
  1386. text
  1387. @d12 1
  1388. a12 1
  1389. // Modified:     October 05, 2003
  1390. d93 3
  1391. a95 3
  1392. <title>
  1393. Bahasa Indonesia Dictionary: <? echo "$title"; ?>
  1394. </title>
  1395. d98 1
  1396. a98 25
  1397. //////////////////////////////////////////////////////////////////////////////
  1398. function is_white_space(stoken) {
  1399.  
  1400.     if (stoken == null) return(true);
  1401.  
  1402.     if (stoken == '') return(true);
  1403.  
  1404.     if (stoken == "") return(true);
  1405.  
  1406.     return(false); 
  1407. }
  1408. //////////////////////////////////////////////////////////////////////////////
  1409. function trim(stoken) {
  1410.  
  1411.     if (is_white_space(stoken)) {
  1412.  
  1413.         return(stoken);
  1414.     }
  1415.  
  1416.     stoken = stoken.replace(/^\s*/, "");
  1417.  
  1418.     stoken = stoken.replace(/\s*$/, "");
  1419.  
  1420.     return(stoken);
  1421. }
  1422. d199 2
  1423. a200 2
  1424.  
  1425.  
  1426. @
  1427.  
  1428.  
  1429. 1.9
  1430. log
  1431. @*** empty log message ***
  1432. @
  1433. text
  1434. @d12 1
  1435. a12 1
  1436. // Modified:     September 30, 2003
  1437. d228 3
  1438. a230 1
  1439. <h2>Bahasa Indonesia Dictionary: <? echo "$title"; ?></h2>
  1440. @
  1441.  
  1442.  
  1443. 1.8
  1444. log
  1445. @*** empty log message ***
  1446. @
  1447. text
  1448. @d12 1
  1449. a12 1
  1450. // Modified:     September 03, 2003
  1451. d43 1
  1452. a43 1
  1453. if (!session_is_registered("ADMIN")) {
  1454. d264 1
  1455. a264 1
  1456. (session_is_registered("NODUP_INSERT_ENTRY")) &&
  1457. d288 1
  1458. a288 3
  1459.         $NODUP_INSERT_ENTRY = $_POST['id'];
  1460.  
  1461.         session_register("NODUP_INSERT_ENTRY");
  1462. d314 1
  1463. a314 3
  1464.         $NODUP_INSERT_ENTRY = $_POST['id'];
  1465.  
  1466.         session_register("NODUP_INSERT_ENTRY");
  1467. d373 1
  1468. a373 3
  1469.                 $NODUP_INSERT_ENTRY = $_POST['id'];
  1470.  
  1471.                 session_register("NODUP_INSERT_ENTRY");
  1472. @
  1473.  
  1474.  
  1475. 1.7
  1476. log
  1477. @*** empty log message ***
  1478. @
  1479. text
  1480. @d12 1
  1481. a12 1
  1482. // Modified:     September 01, 2003
  1483. d70 1
  1484. a70 1
  1485. } else if (isset($_POST['insert_request_entry'])) {
  1486. d72 1
  1487. a72 1
  1488.     $title = "Insert Request Entry";
  1489. d196 1
  1490. a196 1
  1491.     ipa = document.insert.ipa.value;
  1492. d204 1
  1493. a204 1
  1494.         document.insert.ipa.focus();
  1495. d268 1
  1496. a268 1
  1497.     show_insert_new_form($indonesia);
  1498. d293 1
  1499. a293 1
  1500.     show_insert_new_form($indonesia);
  1501. d321 1
  1502. a321 1
  1503.     show_insert_new_form($indonesia);
  1504. d336 1
  1505. a336 1
  1506.         print "<br><hr><b>Permission denied!</b><hr><br>\n";
  1507. d381 1
  1508. a381 1
  1509.                 show_insert_new_form($indonesia);
  1510. d396 1
  1511. a396 1
  1512.         $web, $indonesia, $_POST['insert_request_entry']);
  1513. d406 1
  1514. a406 1
  1515.         show_insert_new_form($indonesia);
  1516. a638 2
  1517.     $id = uniqid(rand(), true);
  1518.  
  1519. d649 5
  1520. a653 1
  1521.     foreach($pos as $p) {
  1522. d655 3
  1523. a657 2
  1524.         $pos_select .= 
  1525.         "<option value=\"$p->pkey\">$p->part_of_speech\n";
  1526. d690 1
  1527. a690 1
  1528. <td>English (255 characters maximum):</td>
  1529. d693 2
  1530. a694 2
  1531. <textarea name="english" wrap="soft" 
  1532. rows="2" cols="55">${english}</textarea>
  1533. d701 1
  1534. a701 1
  1535. <td>Indonesian (255 characters maximum):</td>
  1536. d704 2
  1537. a705 2
  1538. <textarea name="indonesian" wrap="soft" 
  1539. rows="2" cols="55">${indonesian}</textarea>
  1540. d734 1
  1541. a734 1
  1542. <td>Pronunciation (255 characters maximum):</td>
  1543. d737 2
  1544. a738 1
  1545. <textarea name="pronunciation" wrap="soft" rows="2" cols="55"></textarea>
  1546. d745 1
  1547. a745 1
  1548. <td>International Phonetic Alphabet (255 characters maximum):</td>
  1549. d748 2
  1550. a749 1
  1551. <textarea name="ipa" wrap="soft" rows="2" cols="55"></textarea>
  1552. d769 1
  1553. a769 1
  1554. <input type="password" name="password">
  1555. d848 5
  1556. a852 1
  1557.     foreach($pos as $p) {
  1558. d854 3
  1559. a856 2
  1560.         $pos_select .= 
  1561.         "<option value=\"$p->pkey\">$p->part_of_speech\n";
  1562. d866 1
  1563. a866 1
  1564. <td>English (255 characters maximum):</td>
  1565. d869 2
  1566. a870 2
  1567. <textarea name="english" wrap="soft" rows="2" 
  1568. cols="55">${english_word}</textarea>
  1569. d877 1
  1570. a877 1
  1571. <td>Indonesian (255 characters maximum):</td>
  1572. d880 2
  1573. a881 2
  1574. <textarea name="indonesian" wrap="soft" rows="2"
  1575. cols="55">${indonesian_word}</textarea>
  1576. d910 1
  1577. a910 1
  1578. <td>Pronunciation (255 characters maximum):</td>
  1579. d913 2
  1580. a914 1
  1581. <textarea name="pronunciation" wrap="soft" rows="2" cols="55"></textarea>
  1582. d921 1
  1583. a921 1
  1584. <td>International Phonetic Alphabet (255 characters maximum):</td>
  1585. d924 2
  1586. a925 1
  1587. <textarea name="ipa" wrap="soft" rows="2" cols="55"></textarea>
  1588. d945 1
  1589. a945 1
  1590. <input type="password" name="password">
  1591. d1031 7
  1592. a1037 1
  1593.     foreach($pos as $p) {
  1594. d1039 1
  1595. a1039 1
  1596.         if ($p->pkey != $part_of_speech) {
  1597. d1042 1
  1598. a1042 1
  1599.             "<option value=\"$p->pkey\">$p->part_of_speech\n";
  1600. d1047 2
  1601. a1048 2
  1602.             "<option value=\"$p->pkey\" selected>" .
  1603.             "$p->part_of_speech\n";
  1604. d1059 1
  1605. a1059 1
  1606. <td>English (255 characters maximum):</td>
  1607. d1062 2
  1608. a1063 2
  1609. <textarea name="english" wrap="soft" rows="2" 
  1610. cols="55">${english}</textarea>
  1611. d1070 1
  1612. a1070 1
  1613. <td>Indonesian (255 characters maximum):</td>
  1614. d1073 2
  1615. a1074 2
  1616. <textarea name="indonesian" wrap="soft" rows="2"
  1617. cols="55">${indonesian}</textarea>
  1618. d1099 1
  1619. a1099 1
  1620. <td>Pronunciation (255 characters maximum):</td>
  1621. d1102 2
  1622. a1103 1
  1623. <textarea name="pronunciation" wrap="soft" rows="2" cols="55"></textarea>
  1624. d1110 1
  1625. a1110 1
  1626. <td>International Phonetic Alphabet (255 characters maximum):</td>
  1627. d1113 2
  1628. a1114 1
  1629. <textarea name="ipa" wrap="soft" rows="2" cols="55"></textarea>
  1630. d1135 1
  1631. a1135 1
  1632. <input type="password" name="password">
  1633. d1159 1
  1634. a1159 1
  1635. function show_insert_new_form($indonesia) {
  1636. d1171 7
  1637. a1177 1
  1638.     foreach($pos as $p) {
  1639. d1179 1
  1640. a1179 2
  1641.         $pos_select .= 
  1642.         "<option value=\"$p->pkey\">$p->part_of_speech\n";
  1643. d1189 1
  1644. a1189 1
  1645. <td>English (255 characters maximum):</td>
  1646. d1192 1
  1647. a1192 1
  1648. <textarea name="english" wrap="soft" rows="2" cols="55"></textarea>
  1649. d1199 1
  1650. a1199 1
  1651. <td>Indonesian (255 characters maximum):</td>
  1652. d1202 1
  1653. a1202 1
  1654. <textarea name="indonesian" wrap="soft" rows="2" cols="55"></textarea>
  1655. d1231 1
  1656. a1231 1
  1657. <td>Pronunciation (255 characters maximum):</td>
  1658. d1234 1
  1659. a1234 1
  1660. <textarea name="pronunciation" wrap="soft" rows="2" cols="55"></textarea>
  1661. d1241 1
  1662. a1241 1
  1663. <td>International Phonetic Alphabet (255 characters maximum):</td>
  1664. d1244 1
  1665. a1244 1
  1666. <textarea name="ipa" wrap="soft" rows="2" cols="55"></textarea>
  1667. d1264 1
  1668. a1264 1
  1669. <input type="password" name="password">
  1670. @
  1671.  
  1672.  
  1673. 1.6
  1674. log
  1675. @*** empty log message ***
  1676. @
  1677. text
  1678. @d12 1
  1679. a12 1
  1680. // Modified:     August 30, 2003
  1681. d76 8
  1682. d88 1
  1683. a88 1
  1684.     $insert_flag = 2;
  1685. d231 2
  1686. d252 9
  1687. d366 1
  1688. d398 6
  1689. d455 3
  1690. a457 1
  1691.         print "ERROR: $errstr <br>";
  1692. d548 1
  1693. a548 1
  1694.             "<th>Pronounce</th>\n" .
  1695. d637 152
  1696. a793 1
  1697.  
  1698. d820 1
  1699. a820 1
  1700.     $focus;
  1701. @
  1702.  
  1703.  
  1704. 1.5
  1705. log
  1706. @*** empty log message ***
  1707. @
  1708. text
  1709. @d12 1
  1710. a12 1
  1711. // Modified:     August 29, 2003
  1712. d225 19
  1713. a268 34
  1714.         if (isset($_POST['delete_miss'])) {
  1715.  
  1716.             $errstr = 
  1717.             $indonesia->delete_miss(
  1718.             $_POST['delete_miss']);
  1719.  
  1720.             if ($errstr != "") {
  1721.  
  1722.                 print 
  1723.                 "<br><hr><b>WARNING: ${errstr}" .
  1724.                 "</b><hr><br>\n";
  1725.             }
  1726.  
  1727.         } else if (isset($_POST['delete_request'])) {
  1728.  
  1729.             $errstr = 
  1730.             $indonesia->delete_request(
  1731.             $_POST['delete_request']);
  1732.  
  1733.             if ($errstr != "") {
  1734.  
  1735.                 print 
  1736.                 "<br><hr><b>WARNING: ${errstr}" .
  1737.                 "</b><hr><br>\n";
  1738.             }
  1739.  
  1740.             print
  1741.             "<form name=\"requests\" method=\"post\" " .
  1742.             "action=\"requests.php\">\n" .
  1743.             "<input type=\"submit\" " .
  1744.             "value=\"Go Back to Requested New Entries!\">\n" .
  1745.             "</form>\n"; 
  1746.         }
  1747.  
  1748. a273 19
  1749.     if ($insert_flag == 0) {
  1750.  
  1751.         print
  1752.         "<form name=\"misses\" method=\"post\" " .
  1753.         "action=\"misses.php\">\n" .
  1754.         "<input type=\"submit\" " .
  1755.         "value=\"Go Back to Missed Search Entries!\">\n" .
  1756.         "</form>\n"; 
  1757.  
  1758.     } else if ($insert_flag == 1) {
  1759.  
  1760.         print
  1761.         "<form name=\"requests\" method=\"post\" " .
  1762.         "action=\"requests.php\">\n" .
  1763.         "<input type=\"submit\" " .
  1764.         "value=\"Go Back to Requested New Entries!\">\n" .
  1765.         "</form>\n"; 
  1766.     } 
  1767.  
  1768. a296 27
  1769.         if (isset($_POST['delete_miss'])) {
  1770.  
  1771.             $errstr = 
  1772.             $indonesia->delete_miss(
  1773.             $_POST['delete_miss']);
  1774.  
  1775.             if ($errstr != "") {
  1776.  
  1777.                 print 
  1778.                 "<br><hr><b>WARNING: ${errstr}" .
  1779.                 "</b><hr><br>\n";
  1780.             }
  1781.  
  1782.         } else if (isset($_POST['delete_request'])) {
  1783.  
  1784.             $errstr = 
  1785.             $indonesia->delete_request(
  1786.             $_POST['delete_request']);
  1787.  
  1788.             if ($errstr != "") {
  1789.  
  1790.                 print 
  1791.                 "<br><hr><b>WARNING: ${errstr}" .
  1792.                 "</b><hr><br>\n";
  1793.             }
  1794.         }
  1795.  
  1796. a301 19
  1797.     if ($insert_flag == 0) {
  1798.  
  1799.         print
  1800.         "<form name=\"misses\" method=\"post\" " .
  1801.         "action=\"misses.php\">\n" .
  1802.         "<input type=\"submit\" " .
  1803.         "value=\"Go Back to Missed Search Entries!\">\n" .
  1804.         "</form>\n"; 
  1805.  
  1806.     } else if ($insert_flag == 1) {
  1807.  
  1808.         print
  1809.         "<form name=\"requests\" method=\"post\" " .
  1810.         "action=\"requests.php\">\n" .
  1811.         "<input type=\"submit\" " .
  1812.         "value=\"Go Back to Requested New Entries!\">\n" .
  1813.         "</form>\n"; 
  1814.     } 
  1815.  
  1816. a356 28
  1817.                 if (isset($_POST['delete_miss'])) {
  1818.  
  1819.                     $errstr = 
  1820.                     $indonesia->delete_miss(
  1821.                     $_POST['delete_miss']);
  1822.  
  1823.                 if ($errstr != "") {
  1824.  
  1825.                     print 
  1826.                     "<br><hr><b>WARNING: ${errstr}" .
  1827.                     "</b><hr><br>\n";
  1828.                 }
  1829.  
  1830.                 } else if (isset($_POST['delete_request'])) {
  1831.  
  1832.                     $errstr = 
  1833.                     $indonesia->delete_request(
  1834.                     $_POST['delete_request']);
  1835.  
  1836.                     if ($errstr != "") {
  1837.  
  1838.                         print 
  1839.                         "<br><hr><b>" . 
  1840.                         "WARNING: ${errstr}" .
  1841.                         "</b><hr><br>\n";
  1842.                     }
  1843.                 }
  1844.  
  1845. a363 23
  1846.  
  1847.         if ($insert_flag == 0) {
  1848.  
  1849.             print
  1850.             "<form name=\"misses\" " .
  1851.             "method=\"post\" " .
  1852.             "action=\"misses.php\">\n" .
  1853.             "<input type=\"submit\" " .
  1854.             "value=\"Go Back to Missed " .
  1855.             "Search Entries!\">\n" .
  1856.             "</form>\n"; 
  1857.  
  1858.         } else if ($insert_flag == 1) {
  1859.  
  1860.             print
  1861.             "<form name=\"requests\" " .
  1862.             "method=\"post\" " .
  1863.             "action=\"requests.php\">\n" .
  1864.             "<input type=\"submit\" " .
  1865.             "value=\"Go Back to Requested " .
  1866.             "New Entries!\">\n" .
  1867.             "</form>\n"; 
  1868.         } 
  1869. d395 9
  1870. d439 28
  1871. d468 1
  1872. a468 1
  1873.     "<br><hr><b>Found ${dup_count} exact and/or similar " .
  1874. d471 6
  1875. a476 2
  1876.     //WE NEED TO DO PARTS OF SPEECH TRANSLATION HERE! 
  1877.  
  1878. d485 1
  1879. a485 1
  1880.     "<th>Spelling Flag</th>\n" .
  1881. d487 1
  1882. a487 1
  1883.     "<th>IPA Pronounce</th>\n" .
  1884. d493 2
  1885. a494 2
  1886.     "<td>${pos} </td>\n" .
  1887.     "<td>${spelling_flag} </td>\n" .
  1888. d497 2
  1889. a498 2
  1890.     "<td>${comments} </td>\n" .
  1891.     "<td><input type=\"submit\" value=\"Insert as New\"></td>\n" .
  1892. d521 1
  1893. a521 1
  1894.             "<th>IPA Pronounce</th>\n" .
  1895. d527 10
  1896. a536 10
  1897.         $pkey = $web->tohtml($duplicates[$i]->pkey);
  1898.         $eng= $web->tohtml($duplicates[$i]->english);
  1899.         $indo = $web->tohtml($duplicates[$i]->indonesian);
  1900.         $posx= $web->tohtml($duplicates[$i]->part_of_speech);
  1901.         $created = $web->tohtml($duplicates[$i]->created);
  1902.         $modiified = $web->tohtml($duplicates[$i]->modified);
  1903.         $spflg = $web->tohtml($duplicates[$i]->spelling_flag);
  1904.         $p = $web->tohtml($duplicates[$i]->pronunciation);
  1905.         $pipa = $web->tohtml($duplicates[$i]->pronunciation_ipa);
  1906.         $comments = $web->tohtml($duplicates[$i]->comments);
  1907. a671 9
  1908.     print
  1909.     "<form name=\"misses\" " .
  1910.     "method=\"post\" " .
  1911.     "action=\"misses.php\">\n" .
  1912.     "<input type=\"submit\" " .
  1913.     "value=\"Go Back to Missed " .
  1914.     "Search Entries!\">\n" .
  1915.     "</form>\n"; 
  1916.  
  1917. a855 9
  1918.  
  1919.     print
  1920.     "<form name=\"requests\" " .
  1921.     "method=\"post\" " .
  1922.     "action=\"requests.php\">\n" .
  1923.     "<input type=\"submit\" " .
  1924.     "value=\"Go Back to Requested " .
  1925.     "New Entries!\">\n" .
  1926.     "</form>\n"; 
  1927. @
  1928.  
  1929.  
  1930. 1.4
  1931. log
  1932. @*** empty log message ***
  1933. @
  1934. text
  1935. @d12 1
  1936. a12 1
  1937. // Modified:     August 28, 2003
  1938. d232 2
  1939. d275 7
  1940. d289 19
  1941. d310 1
  1942. d363 19
  1943. d384 1
  1944. d468 2
  1945. d471 3
  1946. d475 10
  1947. a484 7
  1948.             //print
  1949.             //"<form name=\"misses\" method=\"post\" " .
  1950.             //"action=\"misses.php\">\n" .
  1951.             //"<input type=\"submit\" " .
  1952.             //"value=\"Go Back to Missed Search Entries!\">\n" .
  1953.             //"</form>\n"; 
  1954.         }
  1955. d486 9
  1956. a494 1
  1957.         show_insert_new_form($indonesia);
  1958. d562 4
  1959. a565 2
  1960.     "<h3>Found ${dup_count} similar " .
  1961.     "existing entries in the dictionary!</h3>\n";
  1962. a566 6
  1963.     print
  1964.     "You can do one of two things:<br>\n" .
  1965.     "<ul>\n" .
  1966.     "<li>Insert as a new entry\n" .
  1967.     "<li>Overwrite an existing entry displayed below\n" .
  1968.     "</ul>\n"; 
  1969. d595 1
  1970. a595 2
  1971.     "<table cellpadding=\"3\" cellspacing=\"3\" border=\"1\" " .
  1972.     "width=\"25%\">\n"; 
  1973. d704 1
  1974. d762 9
  1975. d955 9
  1976. @
  1977.  
  1978.  
  1979. 1.3
  1980. log
  1981. @*** empty log message ***
  1982. @
  1983. text
  1984. @d16 2
  1985. a17 1
  1986. //               database. 
  1987. a49 9
  1988. if (session_is_registered("NODUP_INSERT_ENTRY")) {
  1989.  
  1990.     session_unregister("NODUP_INSERT_ENTRY");
  1991.  
  1992.     $web->redirect("admin.php");
  1993.  
  1994.     exit;
  1995. }
  1996.  
  1997. d225 6
  1998. d232 1
  1999. a232 1
  2000. if ( 
  2001. d236 1
  2002. d275 1
  2003. a275 1
  2004.         $NODUP_INSERT_ENTRY = 1;
  2005. d280 2
  2006. d286 1
  2007. d329 1
  2008. a329 1
  2009.         $NODUP_INSERT_ENTRY = 1;
  2010. d334 2
  2011. d340 1
  2012. d376 1
  2013. a376 1
  2014.         $_POST['comments'], $delete_flag);  
  2015. d416 1
  2016. a416 1
  2017.                 $NODUP_INSERT_ENTRY = 1;
  2018. d421 6
  2019. a426 6
  2020.             print
  2021.             "<form name=\"misses\" method=\"post\" " .
  2022.             "action=\"misses.php\">\n" .
  2023.             "<input type=\"submit\" " .
  2024.             "value=\"Go Back to Missed Search Entries!\">\n" .
  2025.             "</form>\n"; 
  2026. d428 2
  2027. d457 1
  2028. a457 1
  2029. $pronunciation, $pronunciation_ipa, $comments, $delete_flag="") {
  2030. d476 2
  2031. d643 2
  2032. d797 1
  2033. d811 2
  2034. d979 1
  2035. d993 2
  2036. d1104 1
  2037. @
  2038.  
  2039.  
  2040. 1.2
  2041. log
  2042. @*** empty log message ***
  2043. @
  2044. text
  2045. @d12 1
  2046. a12 1
  2047. // Modified:     August 19, 2003
  2048. a39 1
  2049.  
  2050. d72 1
  2051. a72 1
  2052. if (isset($_POST['insert_missed_entry'])) {
  2053. d343 1
  2054. a343 1
  2055.         print "<br><br><b>Permission denied!</b>";
  2056. d415 7
  2057. d430 1
  2058. a430 1
  2059.         $web, $indonesia, $_POST['insert_missed_entry']);
  2060. d602 1
  2061. a602 1
  2062.         "<hr><br><b>Successful Insertion!</b><hr><br>\n";
  2063. @
  2064.  
  2065.  
  2066. 1.1
  2067. log
  2068. @Initial revision
  2069. @
  2070. text
  2071. @d5 35
  2072. a1091 1
  2073.  
  2074. @
  2075.  
  2076.  
  2077. 1.1.1.1
  2078. log
  2079. @Bahasa Indonesia Dictionary
  2080. @
  2081. text
  2082. @@
  2083.