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
/
misses.php,v
< prev
next >
Wrap
Text File
|
2003-10-20
|
16KB
|
845 lines
head 1.12;
access;
symbols
Initial:1.1.1.1 bule:1.1.1;
locks; strict;
comment @# @;
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.42; author bule; state Exp;
branches;
next 1.10;
1.10
date 2003.10.06.00.39.27; 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.12
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: misses.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 allow an administrator to view
// words that were missed (not found in dictionary)
// during client searches. It then allows them to
// insert these words as new entries or delete them
// if they look like bogus entries.
//
// 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;
}
if (
(isset($_POST['missed_entries'])) &&
(isset($_POST['id']))) {
foreach($_POST as $name => $value) {
if ($value == "Insert!") {
$pkey = $name;
$web->redirect(
"insert.php?insert_missed_entry=${pkey}");
exit;
}
}
}
?>
<html>
<head>
<title>Bahasa Indonesia Dictionary: Missed Search Entries</title>
<link href="bahasa.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="bahasa.js"></script>
<script language="Javascript" type="text/javascript">
<!--
var no_send_flag = 0;
//////////////////////////////////////////////////////////////////////////////
function verify() {
if (no_send_flag) {
no_send_flag = 0;
return(false);
}
return(true);
}
//////////////////////////////////////////////////////////////////////////////
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.missed_entries.password.value;
if (is_white_space(password)) {
alert(
"You must enter a password value!");
document.missed_entries.password.focus();
no_send_flag = 1;
return(false);
}
return(true);
}
//////////////////////////////////////////////////////////////////////////////
// -->
</script>
</head>
<body>
<?
$web->show_logo("Missed Search Entries");
?>
<a href="admin.php">Administration</a>
<?
if (
($_SESSION['NODUP_MISSES']) &&
(isset($_POST['id'])) &&
(isset($_POST['missed_entries'])) &&
($_SESSION['NODUP_MISSES'] == $_POST['id'])) {
//Do nothing...prevents refresh duplication of last action
} else if (
(isset($_POST['missed_entries'])) &&
(isset($_POST['id'])) &&
(isset($_POST['password']))) {
if ($_SESSION['NODUP_MISSES']) {
unset($_SESSION['NODUP_MISSES']);
}
$errstr =
$indonesia->login($_SESSION['ADMIN'], $_POST['password']);
if ($errstr != "") {
print "<br><hr><b>Permission denied!</b><hr>\n";
} else {
$delete_count = 0;
$error_flag = 0;
$selected = 0;
foreach($_POST as $name => $pkey) {
if (
($name != "id") && ($name != "missed_entries") &&
($name != "password")) {
$pkey = trim($pkey);
$pkey = $web->tohtml($pkey);
$selected++;
$errstr =
$indonesia->delete_miss($pkey);
if ($errstr != "") {
print "<br><hr><b>${errstr}</b><hr>\n";
$error_flag = 1;
break;
} else {
$delete_count++;
}
}
}
if (!$selected) {
print
"<hr><b>You must select at least one " .
"missed entries to delete!</b><hr>\n";
} else {
$_SESSION['NODUP_MISSES'] = $_POST['id'];
if (!$error_flag) {
if ($delete_count > 1) {
print
"<hr><b>Successfully deleted " .
"${delete_count} " .
"missed search entries!</b><hr>\n";
} else if ($delete_count == 1) {
print
"<hr><b>Successfully deleted " .
"${delete_count} " .
"missed search entry!</b><hr>\n";
} else {
print
"<hr><b>No missed search " .
"entries deleted!" .
"</b><hr>\n";
}
}
}
}
} else if (
(isset($_POST['delete_all'])) &&
(isset($_POST['id'])) &&
(isset($_POST['password']))) {
if (
(!$_SESSION['NODUP_MISSES'] ||
(($_SESSION['NODUP_MISSES']) &&
($_SESSION['NODUP_MISSES'] != $_POST['id'])))) {
if ($_SESSION['NODUP_MISSES']) {
unset($_SESSION['NODUP_MISSES']);
}
$errstr =
$indonesia->login($_SESSION['ADMIN'], $_POST['password']);
if ($errstr != "") {
print "<br><hr><b>Permission denied!</b><hr>\n";
} else {
$errstr = $indonesia->delete_misses();
if ($errstr != "") {
print "<hr><b>${errstr}</b><hr>\n";
} else {
print
"<hr><b>All missed search entries " .
"successfully " .
"deleted!</b><hr>\n";
$_SESSION['NODUP_MISSES'] = $_POST['id'];
}
}
}
}
show_misses($web, $indonesia);
?>
</body>
</html>
<?
//////////////////////////////////////////////////////////////////////////////
function show_misses($web, $indonesia) {
$misses = array();
$id = uniqid(rand(), true);
$errstr = $indonesia->get_misses($misses);
if ($errstr != "") {
print "<br><hr><b>${errstr}</b><hr><br>\n";
} else {
$total_misses = count($misses);
print
"<hr><b>Found ${total_misses} missed search " .
"entries</b>\n" .
"<hr><br>\n";
if ($total_misses == 0) {
return;
}
if ($total_misses > 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" .
"</form><hr>\n";
}
print
"<form name=\"missed_entries\" method=\"post\" " .
"onSubmit='return verify()'>\n" .
"<table cellpadding=\"3\" cellspacing=\"3\" " .
"border=\"1\">\n";
for($i = 0; $i < $total_misses; $i++) {
if ($i == 0) {
print
"<tr>\n" .
"<th>PKEY</th>\n" .
"<th>Entry</th>\n" .
"<th>Language</th>\n" .
"<th>Count</th>\n" .
"<th>Created</th>\n" .
"<th>Modified</th>\n" .
"<th>Insert</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($misses[$i]["pkey"]);
$entry = $web->tohtml($misses[$i]["entry"]);
$language = $web->tohtml($misses[$i]["language"]);
$count = $web->tohtml($misses[$i]["count"]);
$created = $web->tohtml($misses[$i]["created"]);
$modified = $web->tohtml($misses[$i]["modified"]);
print
"<tr>\n" .
"<td>${pkey} </td>\n" .
"<td>${entry} </td>\n" .
"<td>${language} </td>\n" .
"<td>${count} </td>\n" .
"<td>${created} </td>\n" .
"<td>${modified} </td>\n" .
"<td>\n" .
"<input type=\"submit\" value=\"Insert!\" " .
"name=\"${pkey}\">\n" .
"</td>\n" .
"<td>Delete: \n" .
"<input type=\"checkbox\" name=\"${pkey}\" " .
"value=\"${pkey}\"></td>\n" .
"</tr>\n";
}
print
"</table>\n" .
"<input type=\"hidden\" name=\"id\" value=\"${id}\">\n" .
"<input type=\"hidden\" name=\"missed_entries\" " .
"value=\"1\">\n" .
"</form>\n";
}
return;
}
?>
@
1.11
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: October 17, 2003
d84 2
@
1.10
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: October 05, 2003
d83 3
a85 3
<title>
Bahasa Indonesia Dictionary: Missed Search Entries
</title>
d88 1
d92 1
a92 26
///////////////////////////////////////////////////////////////////////////////
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);
}
///////////////////////////////////////////////////////////////////////////////
d104 1
a104 1
///////////////////////////////////////////////////////////////////////////////
d121 1
a121 1
///////////////////////////////////////////////////////////////////////////////
d140 2
a141 2
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
@
1.9
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: September 30, 2003
d169 3
a171 1
<h2>Bahasa Indonesia Dictionary: Missed Search Entries</h2>
@
1.8
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: September 03, 2003
d45 1
a45 1
if (!session_is_registered("ADMIN")) {
d173 1
a173 1
(session_is_registered("NODUP_MISSES")) &&
d185 1
a185 1
if (session_is_registered("NODUP_MISSES")) {
d187 1
a187 1
session_unregister("NODUP_MISSES");
d243 1
a243 3
$NODUP_MISSES = $_POST['id'];
session_register("NODUP_MISSES");
d278 2
a279 2
(!session_is_registered("NODUP_MISSES") ||
((session_is_registered("NODUP_MISSES")) &&
d282 1
a282 1
if (session_is_registered("NODUP_MISSES")) {
d284 1
a284 1
session_unregister("NODUP_MISSES");
d309 1
a309 3
$NODUP_MISSES = $_POST['id'];
session_register("NODUP_MISSES");
@
1.7
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: September 01, 2003
a51 9
if (session_is_registered("NODUP_DELETE_MISS")) {
session_unregister("NODUP_DELETE_MISS");
$web->redirect("admin.php");
exit;
}
d185 5
d238 2
a239 2
"<br><hr><b>You must select at least one " .
"missed entries to delete!<br><hr><b>\n";
d252 1
a252 1
"<br><hr><b>Successfully deleted " .
d259 1
a259 1
"<br><hr><b>Successfully deleted " .
d266 1
a266 1
"<br><hr><b>No missed search " .
d284 5
d302 1
a302 1
print "<br><hr><b>${errstr}</b><hr><br>\n";
d307 2
a308 2
"<br><hr><b>All missed search entries " .
" successfully " .
d330 2
a333 2
$id = uniqid(rand(), true);
d352 21
a372 13
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" .
"</form><hr>\n";
@
1.6
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: August 30, 2003
d97 1
d164 1
a164 1
document.missed_entires.password.focus();
d287 1
d363 1
a363 1
"</form>\n";
d387 2
a388 2
"onClick='return verify_delete_selected()'" .
"><br>\n" .
d415 1
a415 1
"<td>\n" .
d417 1
a417 1
"value=\"${pkey}\">Delete!</td>\n" .
@
1.5
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: August 29, 2003
@
1.4
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: August 28, 2003
@
1.3
log
@*** empty log message ***
@
text
@d186 1
a186 1
//Do nothing...prevents refresh duplication of delete selected
@
1.2
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: August 19, 2003
d72 17
d95 80
d180 12
a191 1
if (isset($_POST['delete_entry'])) {
d194 1
a194 1
$indonesia->delete_miss($_POST['delete_entry']);
d198 1
a198 1
print "<br><hr><b>${errstr}</b><hr><br>\n";
d202 7
d210 3
a212 1
print "<br><hr><b>Successful deletion!</b><hr><br>\n";
d214 1
a214 1
$NODUP_DELETE_MISS = 1;
d216 59
a274 1
session_register("NODUP_DELETE_MISS");
d277 32
a308 1
} else {
d310 4
a313 1
show_misses($web, $indonesia);
d315 3
d329 2
d333 1
a333 1
print "<hr><br><b>${errstr}</b><hr><br>\n";
d339 4
a342 1
print "<h3>Found ${total_misses} misses</h3>\n";
d350 16
d367 1
a367 1
"border=\"1\" width=\"50%\">\n";
d382 9
a390 1
"<th>Delete</th>\n" .
d394 6
a399 6
$pkey = $web->tohtml($misses[$i]->pkey);
$entry = $web->tohtml($misses[$i]->entry);
$language = $web->tohtml($misses[$i]->language);
$count = $web->tohtml($misses[$i]->count);
$created = $web->tohtml($misses[$i]->created);
$modified = $web->tohtml($misses[$i]->modified);
d410 2
a411 6
"<form name=\"insert\" action=\"insert.php\" " .
"method=\"post\">\n" .
"<input type=\"submit\" value=\"Insert!\">\n" .
"<input type=\"hidden\" " .
"name=\"insert_missed_entry\" " .
"value=\"${pkey}\"></form>\n" .
d414 2
a415 4
"<form name=\"delete\" method=\"post\">\n" .
"<input type=\"submit\" value=\"Delete!\">\n" .
"<input type=\"hidden\" name=\"delete_entry\" " .
"value=\"${pkey}\"></form>\n" .
d419 6
a424 1
print "</table>\n";
@
1.1
log
@Initial revision
@
text
@d5 37
@
1.1.1.1
log
@Bahasa Indonesia Dictionary
@
text
@@