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
/
delete.php,v
< prev
next >
Wrap
Text File
|
2003-10-20
|
26KB
|
1,290 lines
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
@<?
session_start();
require_once("../php/Indonesia.php");
require_once("../php/Web.php");
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// Project Name: Bahasa Indonesia Dictionary
// Directory: bahasa/web
// File Name: delete.php
// Author(s): John L. Whiteman
// Created: June 23, 2003
// Modified: October 19, 2003
// Description: The purpose of this restricted access PHP web
// client page is to allow deletion of an entry
// in the dictionary table of the database.
//
// Copyright (c) 2003 John L. Whiteman
//
// Permission is herby granted, free of charge, to any person obtaining a
// copy of this software, data, and associated documentation files
// (the "Software"), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
// ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHERE IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING IN THE SOFTWARE.
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
$web = new Web();
if (!$_SESSION['ADMIN']) {
$web->redirect("login.php");
exit;
}
$indonesia = new Indonesia();
$status = $indonesia->get_dictionary_status();
if ($status["status"] == 1 || $status["status"] == 2) {
$web->redirect("admin.php");
exit;
}
?>
<html>
<head>
<title>Bahasa Indonesia Dictionary: Delete Word(s)</title>
<link href="bahasa.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="bahasa.js"></script>
<script language="Javascript" type="text/javascript">
<!--
//////////////////////////////////////////////////////////////////////////////
function verify_delete_all() {
password = document.delete_all.password.value;
if (is_white_space(password)) {
alert("You must enter a password value!");
document.delete_all.password.focus();
return(false);
}
return(true);
}
//////////////////////////////////////////////////////////////////////////////
function verify_delete_selected() {
password = document.delete_entries.password.value;
if (is_white_space(password)) {
alert("You must enter a password value!");
document.delete_entries.password.focus();
return(false);
}
return(true);
}
//////////////////////////////////////////////////////////////////////////////
function verify_search() {
stoken = document.search.stoken.value;
stoken = trim(stoken);
if (is_white_space(stoken)) {
alert("You need to specify a search word value!");
document.search.stoken.focus();
return(false);
}
if (stoken.length > 255) {
alert(
"You need to specify a search word 1 to 255 characters " +
"in length!");
document.search.stoken.focus();
return(false);
}
return(true);
}
//////////////////////////////////////////////////////////////////////////////
// -->
</script>
</head>
<body>
<?
$web->show_logo("Delete Word(s)");
?>
<a href="admin.php">Administration</a>
<br><br>
<?
show_search_form($web, $indonesia);
if (isset($_POST['editor'])) {
print
"<form name=\"editor\" method=\"post\" action=\"editor.php\">\n" .
"<input type=\"submit\" value=\"Go Back to Search Dictionary!\">\n" .
"</form>\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 "<br><hr><b>Permission denied!</b><hr>\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
"<br><hr><b>" .
"${errstr}</b><hr>\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
"<br><hr><b>" .
"You need to select at least " .
"one entry to delete!</b><hr><br>\n";
search_all(
$web, $indonesia, $_POST['stokenx']);
} else if ($deleted_count == 1) {
print
"<br><hr><b>" .
"Successfully deleted " .
"${deleted_count} " .
"entry!</b><hr><br>\n";
} else {
print
"<br><hr><b>" .
"Successfully deleted " .
"${deleted_count} " .
"entries!</b><hr><br>\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 "<br><hr><b>Permission denied!</b><hr>\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
"<br><hr><b>" .
"${errstr}</b><hr>\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
"<br><hr><b>" .
"Successfully deleted " .
"${deleted_count} " .
"entry!</b><hr><br>\n";
} else {
print
"<br><hr><b>" .
"Successfully deleted " .
"${deleted_count} " .
"entries!</b><hr><br>\n";
}
}
}
}
} else if (isset($_POST['stoken'])) {
search_all($web, $indonesia, $_POST['stoken']);
}
?>
</body>
</html>
<?
///////////////////////////////////////////////////////////////////////////////
function search_all($web, $indonesia, $stoken) {
$results = array();
$id = uniqid(rand(), true);
$stoken = $web->strip($stoken);
if ($stoken == "") {
print
"<hr><b>You must specify a search value!" .
"</b><hr><br>\n" .
"<script language=\"Javascript\" type=\"text/javascript\">\n" .
"document.search.stoken.focus();\n" .
"</script>\n";
return;
}
$errstr = $indonesia->search_all($results, $stoken);
if ($errstr != "") {
print "<hr><b>${errstr}</b><hr><br>\n";
return;
}
$total_results = count($results);
print
"<hr><b>Found ${total_results} match(es) for search entry: " .
"'${stoken}'</b>" .
"<hr>\n";
if ($total_results == 0) {
return;
}
$results_str = "";
$pkeys = "";
$results_str .=
"<form name=\"delete_entries\" method=\"post\" " .
"onSubmit='return verify_delete_selected()'>\n" .
"<input type=\"hidden\" name=\"id\" value=\"${id}\">\n" .
"<input type=\"hidden\" name=\"delete_selected\" value=\"1\">\n" .
"<input type=\"hidden\" name=\"stokenx\" value=\"${stoken}\">\n" .
"<table cellpadding=\"3\" cellspacing=\"3\" border=\"1\">\n";
for($i = 0; $i < $total_results; $i++) {
if ($i == 0) {
$results_str .=
"<tr>\n" .
"<th>PKEY</th>\n" .
"<th>Language</th>\n" .
"<th>English</th>\n" .
"<th>Indonesian</th>\n" .
"<th>Part of Speech</th>\n" .
"<th>Pronunciation</th>\n" .
"<th>IPA</th>\n" .
"<th>Comments</th>\n" .
"<th>Created</th>\n" .
"<th>Modified</th>\n" .
"<th>\n" .
"<input type=\"submit\" " .
"value=\"Delete Selected Entries!\" " .
"onClick='return verify_delete_selected()'>" .
"<br>\n" .
"Password:<br>\n" .
"<input type=\"password\" " .
"name=\"password\">\n" .
"</th>\n" .
"</tr>\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 .=
"<input type=\"hidden\" name=\"${pkey}\" " .
"value=\"delete_entry\">\n";
$results_str .=
"<tr>\n" .
"<td>${pkey} </td>\n" .
"<td>${language} </td>\n" .
"<td>${english} </td>\n" .
"<td>${indonesian} </td>\n" .
"<td>${pos} </td>\n" .
"<td>${pronunciation} </td>\n" .
"<td>${ipa} </td>\n" .
"<td>${comments} </td>\n" .
"<td>${created} </td>\n" .
"<td>${modified} </td>\n" .
"<td>Delete: \n" .
"<input type=\"checkbox\" name=\"${pkey}\" " .
"value=\"delete_entry\"></td>\n" .
"</tr>\n";
}
$results_str .= "</table></form>\n";
if ($total_results > 1) {
print
"<form name=\"delete_all\" method=\"post\" " .
"onSubmit='return verify_delete_all()'>\n" .
"<table cellpadding=\"3\" cellspacing=\"3\" border=\"0\">\n" .
"<tr>\n" .
"<td>Password:</td>\n" .
"<td><input type=\"password\" name=\"password\"></td>\n" .
"<td>\n " .
"<input type=\"submit\" value=\"Delete All Entries!\">\n" .
"</td></tr></table>\n" .
"<input type=\"hidden\" name=\"delete_all\" value=\"1\">\n" .
"<input type=\"hidden\" name=\"id\" value=\"${id}\">\n" .
"${pkeys}" .
"</form><hr>\n";
}
print $results_str;
return;
}
///////////////////////////////////////////////////////////////////////////////
function search_pkey($web, $indonesia, $spkey) {
$results = array();
$id = uniqid(rand(), true);
$spkey = $web->strip($spkey);
if ($spkey == "") {
print
"<hr><b>No primary key specified!" .
"</b><hr><br>\n" .
"<script language=\"Javascript\" type=\"text/javascript\">\n" .
"document.search.stoken.focus();\n" .
"</script>\n";
return;
}
$errstr = $indonesia->search_pkey($results, $spkey);
if ($errstr != "") {
print "<hr><b>${errstr}</b><hr><br>\n";
return;
}
$total_results = count($results);
print
"<hr><b>Found ${total_results} match(es) for " .
"primary key: '${spkey}'</b>" .
"<hr>\n";
if ($total_results == 0) {
return;
}
$results_str = "";
$pkeys = "";
$results_str .=
"<form name=\"delete_entries\" method=\"post\" " .
"onSubmit='return verify_delete_selected()'>\n" .
"<input type=\"hidden\" name=\"id\" value=\"${id}\">\n" .
"<input type=\"hidden\" name=\"delete_selected\" value=\"1\">\n" .
"<input type=\"hidden\" name=\"editor\" value=\"1\">\n" .
"<input type=\"hidden\" name=\"stokenx\" value=\"1\">\n" .
"<table cellpadding=\"3\" cellspacing=\"3\" border=\"1\">\n";
for($i = 0; $i < $total_results; $i++) {
if ($i == 0) {
$results_str .=
"<tr>\n" .
"<th>PKEY</th>\n" .
"<th>English</th>\n" .
"<th>Indonesian</th>\n" .
"<th>Part of Speech</th>\n" .
"<th>Pronunciation</th>\n" .
"<th>IPA</th>\n" .
"<th>Comments</th>\n" .
"<th>Created</th>\n" .
"<th>Modified</th>\n" .
"<th>\n" .
"<input type=\"submit\" " .
"value=\"Delete Selected Entries!\" " .
"onClick='return verify_delete_selected()'>" .
"<br>\n" .
"Password:<br>\n" .
"<input type=\"password\" " .
"name=\"password\">\n" .
"</th>\n" .
"</tr>\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 .=
"<input type=\"hidden\" name=\"${pkey}\" " .
"value=\"delete_entry\">\n";
$results_str .=
"<tr>\n" .
"<td>${pkey} </td>\n" .
"<td>${english} </td>\n" .
"<td>${indonesian} </td>\n" .
"<td>${pos} </td>\n" .
"<td>${pronunciation} </td>\n" .
"<td>${ipa} </td>\n" .
"<td>${comments} </td>\n" .
"<td>${created} </td>\n" .
"<td>${modified} </td>\n" .
"<td>Delete: \n" .
"<input type=\"checkbox\" name=\"${pkey}\" " .
"value=\"delete_entry\" checked></td>\n" .
"</tr>\n";
}
$results_str .=
"</table></form>\n " .
"<script language=\"Javascript\" type=\"text/javascript\">\n" .
"document.delete_entries.password.focus();\"\n" .
"</script>\n";
print $results_str;
return;
}
///////////////////////////////////////////////////////////////////////////////
function show_search_form($web, $indonesia) {
print <<<EOFSSF
<form name="search" method="post" onSubmit='return verify_search()'>
<table cellpadding="3" cellspacing="3" border="0">
<tr>
<td>Enter search entry to delete:</td>
<td>
<input type="text" name="stoken" maxlength="255" size="30">
</td>
</tr><tr>
<td colspan="2" align="right">
<input type="submit" value="Search Dictionary!">
</td>
</tr>
</table>
</form>
<script language="Javascript" type="text/javascript">
document.search.stoken.focus();
</script>
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
<h2>Bahasa Indonesia Dictionary: Delete Word(s)</h2>
@
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
"<form name=\"delete_all\" method=\"post\" " .
"onSubmit='return verify_delete_all()'>\n" .
"<table cellpadding=\"3\" cellspacing=\"3\" border=\"0\">\n" .
"<tr>\n" .
"<td>Password:</td>\n" .
"<td><input type=\"password\" name=\"password\"></td>\n" .
"<td>\n " .
"<input type=\"submit\" value=\"Delete All Entries!\">\n" .
"</td></tr></table>\n" .
"<input type=\"hidden\" name=\"delete_all\" value=\"1\">\n" .
"<input type=\"hidden\" name=\"id\" value=\"${id}\">\n" .
"${pkeys}" .
"</form><hr>\n";
@
1.3
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: September 01, 2003
d62 1
a62 1
<title>Bahasa Indonesia Dictionary: Delete Entry</title>
d165 8
d190 6
d408 2
a409 1
"<hr><b>Found ${total_results} match(es) for: '${stoken}'</b>" .
d512 123
d637 1
a637 1
print <<<EOFSSF
d641 1
a641 1
<td>Enter search word(s) to delete:</td>
@
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
<h2>Bahasa Indonesia Dictionary: Delete Entry</h2>
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 "<b>Permission denied!</b>\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 "<br><hr><b>${errstr}</b><hr><br>\n";
d249 2
a250 1
} else {
d252 7
a258 1
print "<br><hr><b>Delete successful!</b><hr><br>\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();
}
?>
</body>
</html>
d297 1
a297 5
<?
///////////////////////////////////////////////////////////////////////////////
//
///////////////////////////////////////////////////////////////////////////////
function search($web, $indonesia, $stoken, $method, $language) {
d299 1
a299 1
$stoken = trim($stoken);
d301 1
a301 1
if ($stoken == "") {
d303 2
a304 1
print "You must enter a search value.";
d306 7
a312 2
return;
}
d314 2
a315 1
$method = trim($method);
d317 1
a317 1
if ($method == "") {
d319 1
a319 1
print "You must choose a search method.";
d321 2
a322 2
return;
}
d324 5
a328 1
$language = trim($language);
d330 1
a330 1
if ($method == "exact") {
d332 7
a338 1
search_exact($web, $indonesia, $stoken, $language);
d340 1
a340 1
} else if ($method == "fuzzy") {
d342 8
a349 1
print "This feature has not been implemented yet.";
d352 3
a354 1
return;
d356 5
d362 1
a362 3
//
///////////////////////////////////////////////////////////////////////////////
function search_exact($web, $indonesia, $stoken, $language) {
d366 3
a368 1
$language = strtolower($language);
d370 8
a377 2
$sql =
"SELECT * FROM dictionary WHERE ${language}=\"$stoken\"";
d379 4
a382 1
$errstr = $indonesia->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 "<h3>Found ${matches} matches!</h3>";
d402 3
a404 3
print
"<h3>Found ${matches} exact " .
"matches for ${language} word(s) ${stoken}!</h3>\n";
d406 7
a412 4
print
"<hr>" .
"<table cellpadding=\"3\" cellspacing=\"3\" border=\"1\" " .
"width=\"50%\">\n";
d414 1
a414 1
for($i = 0; $i < $matches; $i++) {
d418 1
a418 1
print
d421 1
d425 3
d430 9
a438 5
"<th>Spelling Flag</th>\n" .
"<th>Pronunciation</th>\n" .
"<th>IPA Pronunciation</th>\n" .
"<th>Comments</th>\n" .
"<th>Action</th>\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
"<td>${eng} </td>\n" .
"<td>${indo} </td>\n" .
d464 3
d469 3
a471 14
"<td>${spelling_flag} </td>\n" .
"<td>${p} </td>\n" .
"<td>${pipa} </td>\n" .
"<td>${comments} </td>\n" .
"<td>\n" .
"<form name=\"delete.php\" method=\"post\">\n" .
"<input type=\"submit\" value=\"Delete!\">\n" .
"<input type=\"hidden\" name=\"pkey\" " .
"value=\"${pkey}\"> " .
"<input type=\"hidden\" name=\"entry\" " .
"value=\"${stoken}\"> " .
"<input type=\"hidden\" name=\"language\" " .
"value=\"${language}\"> " .
"</form></td>\n" .
d473 1
a473 1
}
d475 1
a475 1
print "</table><hr>\n";
d477 14
a490 6
return;
}
///////////////////////////////////////////////////////////////////////////////
//
///////////////////////////////////////////////////////////////////////////////
function show_verify_form($web, $indonesia, $pkey, $entry, $language) {
d492 1
a492 26
$language = ucfirst($language);
print <<<EOFSCF
<b>WARNING:</b><br>
The following ${language} dictionary entry will be permanently removed:<br>
Primary Key = ${pkey} <br>
Entry = ${entry}<br>
<form method="post" name="verify"
onSubmit="return verify_delete()">
<table cellpadding="3" cellspacing="3" border="0">
<tr>
<td>
<input type="submit" value="Delete Entry">
</td>
<td>
Password:
</td>
<td>
<input type="password" name="password">
</td>
</tr>
</table>
<input type="hidden" name="delete_flag" value="1">
<input type="hidden" name="pkey" value="${pkey}">
</form>
EOFSCF;
d497 1
a497 3
//
///////////////////////////////////////////////////////////////////////////////
function show_search_form() {
d499 2
a500 2
print <<<EOFSSF
<form name="deletee" method="post" onsubmit='return verify()'>
d503 1
a503 17
<td colspan="2">Enter Search Word(s) to DELETE:
</td>
</tr><tr>
<td colspan="2">
<textarea name="stoken" rows="5" cols="50" wrap="soft"></textarea>
</td>
</tr><tr>
<td>
<input type="radio" name="method" value="exact" checked>
</td>
<td>
Search dictionary for exact matches only
</td>
</tr><tr>
<td>
<input type="radio" name="method" value="fuzzy">
</td>
d505 1
a505 1
Search dictionary for exact and/or close matches
d508 2
a509 6
<td colspan="2"></td>
</tr><tr>
<td align="right" colspan="2">
<input type="submit" name="language" value="English">
<input type="submit" name="language" value="Indonesian">
d515 2
a516 2
document.deletee.stoken.focus();
</script>
a517 1
d520 2
@
1.1
log
@Initial revision
@
text
@d5 33
@
1.1.1.1
log
@Bahasa Indonesia Dictionary
@
text
@@