head 1.13; access; symbols Initial:1.1.1.1 bule:1.1.1; locks; strict; comment @# @; 1.13 date 2003.10.26.01.53.10; author bule; state Exp; branches; next 1.12; 1.12 date 2003.10.20.00.21.45; author bule; state Exp; branches; next 1.11; 1.11 date 2003.10.18.00.33.41; author bule; state Exp; branches; next 1.10; 1.10 date 2003.10.06.00.39.26; author bule; state Exp; branches; next 1.9; 1.9 date 2003.10.01.06.51.29; author bule; state Exp; branches; next 1.8; 1.8 date 2003.09.04.07.27.00; author bule; state Exp; branches; next 1.7; 1.7 date 2003.09.02.07.07.24; author bule; state Exp; branches; next 1.6; 1.6 date 2003.08.31.00.02.48; author bule; state Exp; branches; next 1.5; 1.5 date 2003.08.30.00.33.38; author bule; state Exp; branches; next 1.4; 1.4 date 2003.08.30.00.31.53; author bule; state Exp; branches; next 1.3; 1.3 date 2003.08.28.20.04.48; author bule; state Exp; branches; next 1.2; 1.2 date 2003.08.19.19.05.16; 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.13 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; } $title = ""; $insert_flag = -1; if (isset($_GET['insert_missed_entry'])) { $title = "Insert Missed Entry"; $insert_flag = 0; } else if (isset($_GET['insert_requested_entry'])) { $title = "Insert Requested Entry"; $insert_flag = 1; } else if ( (isset($_POST['insert_new_entry'])) && (isset($_POST['language']))) { $title = "Insert New $_POST[language] Entry"; $insert_flag = 2; } else { $title = "Insert New Entry"; $insert_flag = 3; } ?> Bahasa Indonesia Dictionary: <? echo "$title"; ?> show_logo("$title"); ?> Administration  |  Search \n" . "\n" . "\n"; } else if ($insert_flag == 1) { print "
\n" . "\n" . "
\n"; } else if ($insert_flag == 2) { print "
\n" . "\n" . "
\n"; } if ( ($_SESSION['NODUP_INSERT_ENTRY']) && (isset($_POST['id'])) && ($_SESSION['NODUP_INSERT_ENTRY'] == $_POST['id'])) { show_insert_new_form($web, $indonesia); //HERE WE DO A NEW INSERT FROM A WORD SUBMITTED BY EITHER misses.php or //requests.php } else if ( (isset($_POST['english'])) && (isset($_POST['indonesian'])) && (isset($_POST['pos'])) && (isset($_POST['id'])) && (isset($_POST['spelling_flag'])) && (isset($_POST['new_insert']))) { $rc = insert($web, $indonesia, $_POST['english'], $_POST['indonesian'], $_POST['pos'], $_POST['spelling_flag'], $_POST['pronunciation'], $_POST['pronunciation_ipa'], $_POST['comments']); if (!$rc) { $_SESSION['NODUP_INSERT_ENTRY'] = $_POST['id']; } show_insert_new_form($web, $indonesia); //HERE WE DO AN UPDATE OF EXISTING WORD } else if ( (isset($_POST['english'])) && (isset($_POST['indonesian'])) && (isset($_POST['pos'])) && (isset($_POST['id'])) && (isset($_POST['spelling_flag'])) && (isset($_POST['replace_insert']))) { $pkey = $_POST['replace_insert']; $rc = replace( $web, $indonesia, $pkey, $_POST['english'], $_POST['indonesian'], $_POST['pos'], $_POST['spelling_flag'], $_POST['pronunciation'], $_POST['pronunciation_ipa'], $_POST['comments']); if (!$rc) { $_SESSION['NODUP_INSERT_ENTRY'] = $_POST['id']; } show_insert_new_form($web, $indonesia); //HERE WE DO A NEW INSERT } else if ( (isset($_POST['english'])) && (isset($_POST['indonesian'])) && (isset($_POST['pos'])) && (isset($_POST['id'])) && (isset($_POST['spelling_flag'])) && (isset($_POST['password']))) { $errstr = $indonesia->login($_SESSION['ADMIN'], $_POST['password']); if ($errstr != "") { print "
Permission denied!
\n"; } else { $delete_flag = ""; if (isset($_POST['delete_miss'])) { $delete_flag = ""; } else if (isset($_POST['delete_request'])) { $delete_flag = ""; } $dups = check_for_duplicates( $web, $indonesia, $_POST['english'], $_POST['indonesian'], $_POST['pos'], $_POST['spelling_flag'], $_POST['pronunciation'], $_POST['pronunciation_ipa'], $_POST['comments'], $_POST['id'], $delete_flag); if ($dups == 0) { $rc = insert($web, $indonesia, $_POST['english'], $_POST['indonesian'], $_POST['pos'], $_POST['spelling_flag'], $_POST['pronunciation'], $_POST['pronunciation_ipa'], $_POST['comments']); if (!$rc) { $_SESSION['NODUP_INSERT_ENTRY'] = $_POST['id']; show_insert_new_form($web, $indonesia); } } } } else { if ($insert_flag == 0) { show_insert_missed_form( $web, $indonesia, $_GET['insert_missed_entry']); } else if ($insert_flag == 1) { show_insert_request_form( $web, $indonesia, $_GET['insert_requested_entry']); } else if ($insert_flag == 2) { show_dictionary_editor_form( $web, $indonesia, $_POST['insert_new_entry'], $_POST['language']); } else { show_insert_new_form($web, $indonesia); } } ?> strip($english); $indonesian = $web->strip($indonesian); $pos = $web->strip($pos); $spelling_flag = $web->strip($spelling_flag); $pronunciation = $web->strip($pronunciation); $pronunciation_ipa = $web->strip($pronunciation_ipa); $comments = $web->strip($comments); $id = $web->strip($id); $hidden = "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "${delete_flag}\n"; $errstr = $indonesia->check_for_duplicate_entries( $duplicates, $english, $indonesian, $pos, $spelling_flag); if ($errstr != "") { print "

${errstr}

\n"; return(0); } $dup_count = count($duplicates); if ($dup_count == 0) { return(0); } $english = $web->tohtml($english); $indonesian = $web->tohtml($indonesian); $pos = $web->tohtml($pos); $spelling_flag = $web->tohtml($spelling_flag); $pronunciation = $web->tohtml($pronunciation); $pronunciation_ipa = $web->tohtml($pronunciation_ipa); $comments = $web->tohtml($comments); $parts_of_speech = array(); $errstr = $indonesia->get_pos($parts_of_speech, 0); $poss = $parts_of_speech[$pos]; $spelling = "Modern"; if ($spelling_flag == 1) { $spelling = "Pre 1972"; } $commentss = $comments; if ($commentss == "") { $commentss = "N/A"; } print "
Found ${dup_count} exact and/or similar " . "existing entries in the dictionary database!
\n"; print "
\n" . "\n" . "
\n"; print "
\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "
EnglishIndonesianPart of SpeechSpellingPronounceIPACommentsAction
${english} ${indonesian} ${poss} ${spelling} ${pronunciation} ${pronunciation_ipa} ${commentss} 
\n" . "\n" . "${hidden}" . "
\n"; print "\n"; for ($i = 0; $i < $dup_count; $i++) { if ($i == 0) { print "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n"; } $pkey = $web->tohtml($duplicates[$i]["pkey"]); $eng= $web->tohtml($duplicates[$i]["english"]); $indo = $web->tohtml($duplicates[$i]["indonesian"]); $posx= $web->tohtml($duplicates[$i]["pos"]); $created = $web->tohtml($duplicates[$i]["created"]); $modified = $web->tohtml($duplicates[$i]["modified"]); $spflg = $web->tohtml($duplicates[$i]["spelling"]); $p = $web->tohtml($duplicates[$i]["pronunciation"]); $pipa = $web->tohtml($duplicates[$i]["pronunciation_ipa"]); $comments = $web->tohtml($duplicates[$i]["comments"]); print "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n" . "\n"; } print "
PKEYEnglishIndonesianPart of SpeechCreatedModifiedSpelling FlagPronunciationIPACommentsAction
${pkey} ${eng} ${indo} ${posx} ${created} ${modified} ${spflg} ${p} ${pipa} ${comments} 
\n" . "\n" . "\n" . "${hidden}
\n"; return(1); } ////////////////////////////////////////////////////////////////////////////// function insert($web, $indonesia, $english, $indonesian, $pos, $spelling_flag, $pronunciation, $pronunciation_ipa, $comments) { $errstr = $indonesia->insert_entry( $english, $indonesian, $spelling_flag, $pos, $pronunciation, $pronunciation_ipa, $comments); if ($errstr != "") { print "

${errstr}

\n"; return(1); } else { print "

Successful Insertion!

\n"; } return(0); } ////////////////////////////////////////////////////////////////////////////// function replace($web, $indonesia, $pkey, $english, $indonesian, $pos, $spelling_flag, $pronunciation, $pronunciation_ipa, $comments) { $errstr = $indonesia->update_entry($pkey, $english, $indonesian, $spelling_flag, $pos, $pronunciation, $pronunciation_ipa, $comments); if ($errstr != "") { print "

${errstr}

\n"; return(1); } print "

Successful Replacement!

\n"; return(0); } ////////////////////////////////////////////////////////////////////////////// function show_dictionary_editor_form($web, $indonesia, $token, $language) { $pos = array(); $id = uniqid(rand(), true); $pos_select = "\n"; $token = $web->tohtml($token); $language = $web->tohtml($language); $english = ""; $indonesian = ""; $focus = "english"; if ($language == "English") { $english = $token; $focus = "indonesian"; } else { $indonesian = $token; $focus = "english"; } print <<
English (1 to 255 characters):

Indonesian (1 to 255 characters):

Spelling Convention:
Before 1972    Modern

Part of Speech:
$pos_select

Pronunciation (1 to 255 characters):

International Phonetic Alphabet (1 to 255 characters):

Comments:

Password:

  
EOFDEF; return; } ////////////////////////////////////////////////////////////////////////////// function show_insert_missed_form($web, $indonesia, $pkey) { $miss = array(); $id = uniqid(rand(), true); $errstr = $indonesia->get_miss($miss, $pkey); if ($errstr != "") { print "

${errstr}

\n"; return; } $miss_count = count($miss); if ($miss_count != 1) { return; } $entry = $web->tohtml($miss[0]->entry); $language = $web->tohtml($miss[0]->language); $english_word = ""; $indonesian_word = ""; $focus = "english"; if ($language == 0) { $english_word = $entry; $focus = "indonesian"; } else { $indonesian_word = $entry; $focus = "english"; } $pos = array(); $pos_select = "\n\n"; print <<
English (1 to 255 characters):

Indonesian (1 to 255 characters):

Spelling Convention:
Before 1972    Modern

Part of Speech:
$pos_select

Pronunciation (1 to 255 characters):

International Phonetic Alphabet (1 to 255 characters):

Comments:

Password:

  
EOFSIMF; return; } ////////////////////////////////////////////////////////////////////////////// function show_insert_request_form($web, $indonesia, $pkey) { $request = array(); $id = uniqid(rand(), true); $errstr = $indonesia->get_request($request, $pkey); if ($errstr != "") { print "

${errstr}

\n"; return; } $request_count = count($request); if ($request_count != 1) { return; } $english = $web->tohtml($request[0]->english); $indonesian = $web->tohtml($request[0]->indonesian); $part_of_speech = $web->tohtml($request[0]->part_of_speech); $spelling_flag = $web->tohtml($request[0]->spelling_flag); $comments = $web->tohtml($request[0]->comments); $spelling_html = ""; if ($spelling_flag == 0) { $spelling_html = "" . "Before 1972" . "  " . "Modern\n"; } else { $spelling_html = "Before 1972" . "  " . "" . "Modern\n"; } $pos = array(); $pos_select = "\n\n"; print <<
English (1 to 255 characters):

Indonesian (1 to 255 characters):

Spelling Convention:
${spelling_html}

Part of Speech:
$pos_select

Pronunciation (1 to 255 characters):

International Phonetic Alphabet (1 to 255 characters):

Comments:

Password:

  
EOFSIRF; return; } ////////////////////////////////////////////////////////////////////////////// function show_insert_new_form($web, $indonesia) { $pos = array(); $id = uniqid(rand(), true); $pos_select = "\n"; print <<
English (1 to 255 characters):

Indonesian (1 to 255 characters):

Spelling Convention:
Before 1972    Modern

Part of Speech:
$pos_select

Pronunciation (1 to 255 characters):

International Phonetic Alphabet (1 to 255 characters):

Comments:

Password:

  
EOFSINF; return; } ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// ?> @ 1.12 log @*** empty log message *** @ text @d12 1 a12 1 // Modified: October 19, 2003 d425 1 a425 1 $duplicates, $english, $indonesia, $pos, $spelling_flag); @ 1.11 log @*** empty log message *** @ text @d12 1 a12 1 // Modified: October 17, 2003 d94 2 @ 1.10 log @*** empty log message *** @ text @d12 1 a12 1 // Modified: October 05, 2003 d93 3 a95 3 Bahasa Indonesia Dictionary: <? echo "$title"; ?> d98 1 a98 25 ////////////////////////////////////////////////////////////////////////////// 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); } d199 2 a200 2 @ 1.9 log @*** empty log message *** @ text @d12 1 a12 1 // Modified: September 30, 2003 d228 3 a230 1

Bahasa Indonesia Dictionary:

@ 1.8 log @*** empty log message *** @ text @d12 1 a12 1 // Modified: September 03, 2003 d43 1 a43 1 if (!session_is_registered("ADMIN")) { d264 1 a264 1 (session_is_registered("NODUP_INSERT_ENTRY")) && d288 1 a288 3 $NODUP_INSERT_ENTRY = $_POST['id']; session_register("NODUP_INSERT_ENTRY"); d314 1 a314 3 $NODUP_INSERT_ENTRY = $_POST['id']; session_register("NODUP_INSERT_ENTRY"); d373 1 a373 3 $NODUP_INSERT_ENTRY = $_POST['id']; session_register("NODUP_INSERT_ENTRY"); @ 1.7 log @*** empty log message *** @ text @d12 1 a12 1 // Modified: September 01, 2003 d70 1 a70 1 } else if (isset($_POST['insert_request_entry'])) { d72 1 a72 1 $title = "Insert Request Entry"; d196 1 a196 1 ipa = document.insert.ipa.value; d204 1 a204 1 document.insert.ipa.focus(); d268 1 a268 1 show_insert_new_form($indonesia); d293 1 a293 1 show_insert_new_form($indonesia); d321 1 a321 1 show_insert_new_form($indonesia); d336 1 a336 1 print "

Permission denied!

\n"; d381 1 a381 1 show_insert_new_form($indonesia); d396 1 a396 1 $web, $indonesia, $_POST['insert_request_entry']); d406 1 a406 1 show_insert_new_form($indonesia); a638 2 $id = uniqid(rand(), true); d649 5 a653 1 foreach($pos as $p) { d655 3 a657 2 $pos_select .= "