head 1.9; access; symbols Initial:1.1.1.1 bule:1.1.1; locks; strict; comment @# @; 1.9 date 2003.10.20.00.21.45; author bule; state Exp; branches; next 1.8; 1.8 date 2003.10.18.00.33.41; author bule; state Exp; branches; next 1.7; 1.7 date 2003.10.06.00.39.26; author bule; state Exp; branches; next 1.6; 1.6 date 2003.10.01.06.51.29; author bule; state Exp; branches; next 1.5; 1.5 date 2003.09.04.07.26.59; author bule; state Exp; branches; next 1.4; 1.4 date 2003.09.03.07.11.10; author bule; state Exp; branches; next 1.3; 1.3 date 2003.09.02.07.07.24; author bule; state Exp; branches; next 1.2; 1.2 date 2003.08.19.06.42.07; author bule; state Exp; branches; next 1.1; 1.1 date 2003.08.12.19.18.23; author bule; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2003.08.12.19.18.23; author bule; state Exp; branches; next ; desc @@ 1.9 log @*** empty log message *** @ text @redirect("login.php"); exit; } $indonesia = new Indonesia(); $status = $indonesia->get_dictionary_status(); if ($status["status"] == 1 || $status["status"] == 2) { $web->redirect("admin.php"); exit; } ?> Bahasa Indonesia Dictionary: Delete Word(s) show_logo("Delete Word(s)"); ?> Administration

\n" . "\n" . "\n"; } if ( ($_SESSION['NODUP_DELETES']) && (isset($_POST['id'])) && (isset($_POST['delete_all'])) && ($_SESSION['NODUP_DELETES'] == $_POST['id'])) { //Do nothing...prevents refresh duplication of last action } else if ( ($_SESSION['NODUP_DELETES']) && (isset($_POST['id'])) && (isset($_POST['delete_selected'])) && ($_SESSION['NODUP_DELETES'] == $_POST['id'])) { //Do nothing...prevents refresh duplication of last action } else if ( (isset($_POST['editor'])) && (isset($_POST['pkey']))) { search_pkey($web, $indonesia, $_POST['pkey']); } else if ( (isset($_POST['delete_selected'])) && (isset($_POST['id'])) && (isset($_POST['stokenx'])) && (isset($_POST['password']))) { if ( (!$_SESSION['NODUP_DELETES'] || (($_SESSION['NODUP_DELETES']) && ($_SESSION['NODUP_DELETES'] != $_POST['id'])))) { if ($_SESSION['NODUP_DELETES']) { unset($_SESSION['NODUP_DELETES']); } $errstr = $indonesia->login($_SESSION['ADMIN'], $_POST['password']); if ($errstr != "") { print "

Permission denied!
\n"; } else { $deleted_count = 0; $error_flag = 0; foreach($_POST as $name => $value) { $name = $web->strip($name); $value = $web->strip($value); if ($value == "delete_entry") { $errstr = $indonesia->delete_entry($name); if ($errstr != "") { print "

" . "${errstr}
\n"; $error_flag = 1; break; } $deleted_count++; if ($deleted_count == 1) { $_SESSION['NODUP_DELETES'] = $_POST['id']; } } } if ($error_flag == 0) { if ($deleted_count == 0) { print "

" . "You need to select at least " . "one entry to delete!

\n"; search_all( $web, $indonesia, $_POST['stokenx']); } else if ($deleted_count == 1) { print "

" . "Successfully deleted " . "${deleted_count} " . "entry!

\n"; } else { print "

" . "Successfully deleted " . "${deleted_count} " . "entries!

\n"; } } } } } else if ( (isset($_POST['delete_all'])) && (isset($_POST['id'])) && (isset($_POST['password']))) { if ( (!$_SESSION['NODUP_DELETES'] || (($_SESSION['NODUP_DELETES']) && ($_SESSION['NODUP_DELETES'] != $_POST['id'])))) { if ($_SESSION['NODUP_DELETES']) { unset($_SESSION['NODUP_DELETES']); } $errstr = $indonesia->login($_SESSION['ADMIN'], $_POST['password']); if ($errstr != "") { print "

Permission denied!
\n"; } else { $deleted_count = 0; $error_flag = 0; foreach($_POST as $name => $value) { $name = $web->strip($name); $value = $web->strip($value); if ($value == "delete_entry") { $errstr = $indonesia->delete_entry($name); if ($errstr != "") { print "

" . "${errstr}
\n"; $error_flag = 1; break; } $deleted_count++; if ($deleted_count == 1) { $_SESSION['NODUP_DELETES'] = $_POST['id']; } } } if ($error_flag == 0) { if ($deleted_count == 1) { print "

" . "Successfully deleted " . "${deleted_count} " . "entry!

\n"; } else { print "

" . "Successfully deleted " . "${deleted_count} " . "entries!

\n"; } } } } } else if (isset($_POST['stoken'])) { search_all($web, $indonesia, $_POST['stoken']); } ?> strip($stoken); if ($stoken == "") { print "
You must specify a search value!" . "

\n" . "\n"; return; } $errstr = $indonesia->search_all($results, $stoken); if ($errstr != "") { print "
${errstr}

\n"; return; } $total_results = count($results); print "
Found ${total_results} match(es) for search entry: " . "'${stoken}'" . "
\n"; if ($total_results == 0) { return; } $results_str = ""; $pkeys = ""; $results_str .= "
\n" . "\n" . "\n" . "\n" . "\n"; for($i = 0; $i < $total_results; $i++) { if ($i == 0) { $results_str .= "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n"; } $pkey = $web->tohtml($results[$i]["pkey"]); $language = $web->tohtml($results[$i]["language"]); $english = $web->tohtml($results[$i]["english"]); $indonesian = $web->tohtml($results[$i]["indonesian"]); $pos = $web->tohtml($results[$i]["pos"]); $pronunciation = $web->tohtml($results[$i]["pronunciation"]); $ipa = $web->tohtml($results[$i]["ipa"]); $comments = $web->tohtml($results[$i]["comments"]); $created = $web->tohtml($results[$i]["created"]); $modified = $web->tohtml($results[$i]["modified"]); $pkeys .= "\n"; $results_str .= "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n"; } $results_str .= "
PKEYLanguageEnglishIndonesianPart of SpeechPronunciationIPACommentsCreatedModified\n" . "" . "
\n" . "Password:
\n" . "\n" . "
${pkey} ${language} ${english} ${indonesian} ${pos} ${pronunciation} ${ipa} ${comments} ${created} ${modified} Delete:  \n" . "
\n"; if ($total_results > 1) { print "
\n" . "\n" . "\n" . "\n" . "\n" . "
Password:\n " . "\n" . "
\n" . "\n" . "\n" . "${pkeys}" . "

\n"; } print $results_str; return; } /////////////////////////////////////////////////////////////////////////////// function search_pkey($web, $indonesia, $spkey) { $results = array(); $id = uniqid(rand(), true); $spkey = $web->strip($spkey); if ($spkey == "") { print "
No primary key specified!" . "

\n" . "\n"; return; } $errstr = $indonesia->search_pkey($results, $spkey); if ($errstr != "") { print "
${errstr}

\n"; return; } $total_results = count($results); print "
Found ${total_results} match(es) for " . "primary key: '${spkey}'" . "
\n"; if ($total_results == 0) { return; } $results_str = ""; $pkeys = ""; $results_str .= "
\n" . "\n" . "\n" . "\n" . "\n" . "\n"; for($i = 0; $i < $total_results; $i++) { if ($i == 0) { $results_str .= "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n"; } $pkey = $web->tohtml($results[$i]["pkey"]); $english = $web->tohtml($results[$i]["english"]); $indonesian = $web->tohtml($results[$i]["indonesian"]); $pos = $web->tohtml($results[$i]["pos"]); $pronunciation = $web->tohtml($results[$i]["pronunciation"]); $ipa = $web->tohtml($results[$i]["ipa"]); $comments = $web->tohtml($results[$i]["comments"]); $created = $web->tohtml($results[$i]["created"]); $modified = $web->tohtml($results[$i]["modified"]); $pkeys .= "\n"; $results_str .= "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n"; } $results_str .= "
PKEYEnglishIndonesianPart of SpeechPronunciationIPACommentsCreatedModified\n" . "" . "
\n" . "Password:
\n" . "\n" . "
${pkey} ${english} ${indonesian} ${pos} ${pronunciation} ${ipa} ${comments} ${created} ${modified} Delete:  \n" . "
\n " . "\n"; print $results_str; return; } /////////////////////////////////////////////////////////////////////////////// function show_search_form($web, $indonesia) { print <<
Enter search entry to delete:
EOFSSF; return; } /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// ?> @ 1.8 log @*** empty log message *** @ text @d12 1 a12 1 // Modified: October 17, 2003 d63 2 @ 1.7 log @*** empty log message *** @ text @d12 1 a12 1 // Modified: October 05, 2003 d64 2 d67 2 a68 27 /////////////////////////////////////////////////////////////////////////////// function is_white_space(stoken) { if (stoken == null) return(true); if (stoken == '') return(true); if (stoken == "") return(true); return(false); } /////////////////////////////////////////////////////////////////////////////// function trim(stoken) { if (is_white_space(stoken)) { return(stoken); } stoken = stoken.replace(/^\s*/, ""); stoken = stoken.replace(/\s*$/, ""); return(stoken); } /////////////////////////////////////////////////////////////////////////////// d84 1 a84 1 /////////////////////////////////////////////////////////////////////////////// d129 2 a130 2 /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// @ 1.6 log @*** empty log message *** @ text @d12 1 a12 1 // Modified: September 30, 2003 d157 3 a159 1

Bahasa Indonesia Dictionary: Delete Word(s)

@ 1.5 log @*** empty log message *** @ text @d12 1 a12 1 // Modified: September 03, 2003 d41 1 a41 1 if (!session_is_registered("ADMIN")) { d174 1 a174 1 (session_is_registered("NODUP_DELETES")) && d182 1 a182 1 (session_is_registered("NODUP_DELETES")) && d202 2 a203 2 (!session_is_registered("NODUP_DELETES") || ((session_is_registered("NODUP_DELETES")) && d206 1 a206 1 if (session_is_registered("NODUP_DELETES")) { d208 1 a208 1 session_unregister("NODUP_DELETES"); d250 2 a251 5 $NODUP_DELETES = $_POST['id']; session_register( "NODUP_DELETES"); d294 2 a295 2 (!session_is_registered("NODUP_DELETES") || ((session_is_registered("NODUP_DELETES")) && d298 1 a298 1 if (session_is_registered("NODUP_DELETES")) { d300 1 a300 1 session_unregister("NODUP_DELETES"); d342 2 a343 5 $NODUP_DELETES = $_POST['id']; session_register( "NODUP_DELETES"); @ 1.4 log @*** empty log message *** @ text @d12 1 a12 1 // Modified: September 02, 2003 d206 5 d301 5 d502 17 a518 14 print "
\n" . "\n" . "\n" . "\n" . "\n" . "
Password:\n " . "\n" . "
\n" . "\n" . "\n" . "${pkeys}" . "

\n"; @ 1.3 log @*** empty log message *** @ text @d12 1 a12 1 // Modified: September 01, 2003 d62 1 a62 1 Bahasa Indonesia Dictionary: Delete Entry d165 8 d190 6 d408 2 a409 1 "
Found ${total_results} match(es) for: '${stoken}'" . d512 123 d637 1 a637 1 print <<Enter search word(s) to delete: @ 1.2 log @*** empty log message *** @ text @d12 1 a12 1 // Modified: August 18, 2003 a47 9 if (session_is_registered("NODUP_DELETE_ENTRY")) { session_unregister("NODUP_DELETE_ENTRY"); $web->redirect("admin.php"); exit; } d66 1 d77 1 a77 1 d91 6 d98 6 a103 1 function verify() { d105 4 a108 1 var stoken = document.deletee.stoken.value; d110 1 a110 1 stoken = trim(stoken); d112 1 a112 1 if (is_white_space(stoken)) { d114 1 a114 1 alert("You must enter a search value."); d116 1 a116 1 document.deletee.stoken.focus(); d123 2 d126 1 a126 1 function verify_delete() { d128 1 a128 1 var password = document.verify.password.value; d130 10 a139 1 if (is_white_space(password)) { d141 3 a143 1 alert("You must enter your password."); d145 1 a145 1 document.verify.password.focus(); d152 2 d157 1 a157 1

Bahasa Indonesia Dictionary: Delete Entry

d163 2 d166 46 a211 2 (isset($_POST['pkey'])) && (isset($_POST['delete_flag']))) { d213 2 a214 3 $errstr = $indonesia->login( $_SESSION['ADMIN'], $_POST['password']); d216 14 a229 1 if ($errstr != "") { d231 2 a232 1 print "Permission denied!\n"; d234 5 a238 1 } else { d240 1 a240 2 $errstr = $indonesia->delete_entry($_POST['pkey']); d242 1 a242 1 if ($errstr != "") { d244 4 a247 1 print "

${errstr}

\n"; d249 2 a250 1 } else { d252 7 a258 1 print "

Delete successful!

\n"; d260 1 a260 1 $NODUP_DELETE_ENTRY = 1; d262 8 a269 2 session_register("NODUP_DELETE_ENTRY"); } d273 13 a285 7 (isset($_POST['pkey'])) && (isset($_POST['entry'])) && (isset($_POST['language']))) { show_verify_form( $web, $indonesia, $_POST['pkey'], $_POST['entry'], $_POST['language']); d287 1 a287 4 } else if ( (isset($_POST['stoken'])) && (isset($_POST['method'])) && (isset($_POST['language']))) { d289 1 a289 1 show_search_form(); d291 1 a291 3 search( $web, $indonesia, $_POST['stoken'], $_POST['method'], $_POST['language']); d293 1 a293 1 } else { d295 1 a295 5 show_search_form(); } ?> d297 1 a297 5 search($sql, $results); d386 1 a386 1 print "$errstr"; d391 1 a391 1 $matches = count($results); d393 3 a395 1 if (!$matches) { d397 1 a397 1 print "

Found ${matches} matches!

"; d402 3 a404 3 print "

Found ${matches} exact " . "matches for ${language} word(s) ${stoken}!

\n"; d406 7 a412 4 print "
" . "\n"; d414 1 a414 1 for($i = 0; $i < $matches; $i++) { d418 1 a418 1 print d421 1 d425 3 d430 9 a438 5 "\n" . "\n" . "\n" . "\n" . "\n" . d440 1 a440 1 } d442 14 a455 10 $pkey = $web->tohtml($results[$i]->pkey); $eng = $web->tohtml($results[$i]->english); $indo = $web->tohtml($results[$i]->indonesian); $pos = $web->tohtml($results[$i]->part_of_speech); $created = $web->tohtml($results[$i]->created); $modified = $web->tohtml($results[$i]->modified); $spelling_flag = $web->tohtml($results[$i]->spelling_flag); $p = $web->tohtml($results[$i]->pronunciation); $pipa = $web->tohtml($results[$i]->pronunciation_ipa); $comments = $web->tohtml($results[$i]->comments); d457 1 a457 1 print d460 3 a462 2 "\n" . "\n" . d464 3 d469 3 a471 14 "\n" . "\n" . "\n" . "\n" . "\n" . d473 1 a473 1 } d475 1 a475 1 print "
Spelling FlagPronunciationIPA PronunciationCommentsAction${eng} ${indo} ${spelling_flag} ${p} ${pipa} ${comments} \n" . "
\n" . "\n" . " " . " " . " " . "

\n"; d477 14 a490 6 return; } /////////////////////////////////////////////////////////////////////////////// // /////////////////////////////////////////////////////////////////////////////// function show_verify_form($web, $indonesia, $pkey, $entry, $language) { d492 1 a492 26 $language = ucfirst($language); print <<WARNING:
The following ${language} dictionary entry will be permanently removed:
Primary Key = ${pkey}
Entry = ${entry}
Password:
EOFSCF; d497 1 a497 3 // /////////////////////////////////////////////////////////////////////////////// function show_search_form() { d499 2 a500 2 print << d503 1 a503 17 Enter Search Word(s) to DELETE: Search dictionary for exact matches only d505 1 a505 1 Search dictionary for exact and/or close matches d508 2 a509 6     d515 2 a516 2 document.deletee.stoken.focus(); a517 1 d520 2 @ 1.1 log @Initial revision @ text @d5 33 @ 1.1.1.1 log @Bahasa Indonesia Dictionary @ text @@