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
/
request.php,v
< prev
next >
Wrap
Text File
|
2003-10-26
|
12KB
|
662 lines
head 1.10;
access;
symbols
Initial:1.1.1.1 bule:1.1.1;
locks; strict;
comment @# @;
1.10
date 2003.10.26.01.53.10; author bule; state Exp;
branches;
next 1.9;
1.9
date 2003.10.20.00.21.46; author bule; state Exp;
branches;
next 1.8;
1.8
date 2003.10.18.00.33.42; author bule; state Exp;
branches;
next 1.7;
1.7
date 2003.10.17.00.39.36; author bule; state Exp;
branches;
next 1.6;
1.6
date 2003.10.06.00.39.27; author bule; state Exp;
branches;
next 1.5;
1.5
date 2003.10.01.06.51.29; author bule; state Exp;
branches;
next 1.4;
1.4
date 2003.09.11.05.28.22; author bule; state Exp;
branches;
next 1.3;
1.3
date 2003.09.04.07.27.00; author bule; state Exp;
branches;
next 1.2;
1.2
date 2003.08.19.19.24.21; 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.10
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: request.php
// Author(s): John L. Whiteman
// Created: June 23, 2003
// Modified: October 20, 2003
// Description: The purpose of this unrestricted access PHP web
// client page is to allow the client to request a
// new entry be placed in the dictionary.
//
// 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();
$indonesia = new Indonesia();
$status = $indonesia->get_dictionary_status();
if (
($status["status"] == 1) ||
($status["status"] == 2) ||
($status["status"] == 3)) {
$web->redirect("offline.php");
exit;
}
?>
<html>
<head>
<title>Bahasa Indonesia Dictionary: Request a New Word</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() {
english = document.request.english.value;
english = trim(english);
if (english.length > 255) {
alert(
"The English value must be 255 characters or less!");
document.request.english.focus();
return(false);
}
indonesian = document.request.indonesian.value;
indonesian = trim(indonesian);
if (indonesian.length > 255) {
alert(
"The Indonesian value must be 255 characters or less!");
document.request.indonesian.focus();
return(false);
}
if ((english == "") && (indonesian =="")) {
alert(
"You must specify at least an English or Indonesian " +
"value!");
document.request.english.focus();
return(false);
}
return(true);
}
//////////////////////////////////////////////////////////////////////////////
// -->
</script>
</head>
<body>
<?
$web->show_logo("Request a New Word");
?>
<a class="menu" href="search.php">Search Dictionary</a>
|
<a class="menu" href="reference.php">Reference</a>
|
<a class="menu" href="email.php">Send Us E-mail</a>
|
<a class="menu" href="admin.php">Administration</a>
<hr>
<b>
If you didn't find a word or phrase that you were looking for in the
dictionary,<br>
then use this form to submit a request for it to be added.
Terima Kasih!
</b>
<hr>
<?
if (
($_SESSION['NODUP_REQUESTS']) &&
(isset($_POST['id'])) &&
($_SESSION['NODUP_REQUESTS'] == $_POST['id'])) {
//Do nothing...prevents refresh duplication of last action
} else if (
(isset($_POST['english'])) &&
(isset($_POST['indonesian'])) &&
(isset($_POST['spelling_flag'])) &&
(isset($_POST['id'])) &&
(isset($_POST['part_of_speech'])) &&
(isset($_POST['comments']))) {
if ($_SESSION['NODUP_REQUESTS']) {
unset($_SESSION['NODUP_REQUESTS']);
}
$errstr =
$indonesia->insert_request(
$_POST['english'], $_POST['indonesian'],
$_POST['spelling_flag'], $_POST['part_of_speech'],
$_POST['comments']);
if ($errstr != "") {
print "<hr><b>${errstr}</b><hr><br>\n";
} else {
print
"<hr><b>Your request has been submitted!" .
"</b><hr>";
$_SESSION['NODUP_REQUESTS'] = $_POST['id'];
}
}
show_request_form($web, $indonesia);
$web->show_footer();
?>
</body>
</html>
<?
//////////////////////////////////////////////////////////////////////////////
function show_request_form($web, $indonesia) {
$pos = array();
$id = uniqid(rand(), true);
$pos_select =
"<select name=\"part_of_speech\">\n";
$errstr = $indonesia->get_parts_of_speech($pos);
$pos_help =
"<table cellpadding=\"3\" cellspacing=\"3\" border=\"1\">\n" .
"<tr>\n" .
"<th>Part of Speech</th>\n" .
"<th>Description</th>\n" .
"</tr>\n";
$total_pos = count($pos);
for($i = 0; $i < $total_pos; $i++) {
$part_of_speech =
$web->tohtml($pos[$i]["part_of_speech"]);
$description =
$web->tohtml($pos[$i]["description"]);
$pkey =
$web->tohtml($pos[$i]["pkey"]);
if ($part_of_speech != "unknown") {
$pos_select .=
"<option value=\"${pkey}\">${part_of_speech}\n";
} else {
$pos_select .=
"<option value=\"${pkey}\" selected>" .
"${part_of_speech}\n";
}
$pos_help .=
"<tr>\n" .
"<td>${part_of_speech}:</td>\n" .
"<td>${description}</td>\n" .
"</tr>\n";
}
$pos_select .= "</select>\n";
$pos_help .= "</table>\n";
print <<<EOFSSF
<form name="request" method="post" onSubmit='return verify()'>
<table cellpadding="3" cellspacing="3" border="0">
<tr>
<td>English (1 to 255 characters):</td>
</tr><tr>
<td>
<input type="text" name="english"
maxlength="255" size="50">
</td>
</tr><tr>
<td><hr></td>
</tr><tr>
<td>Indonesian (1 to 255 characters):</td>
</tr><tr>
<td>
<input type="text" name="indonesian"
maxlength="255" size="50">
</td>
</tr><tr>
<td><hr></td>
</tr><tr>
<td>Spelling Convention:</td>
</tr><tr>
<td>
<input type="radio" name="spelling_flag" value="1">Before 1972
<input type="radio" name="spelling_flag" value="0" checked>Modern
</td>
</tr><tr>
<td><hr></td>
</tr><tr>
<td>Part of Speech: <a href="request.php#pos">Help</a></td>
</tr><tr>
<td>
$pos_select
</td>
</tr><tr>
<td><hr></td>
</tr><tr>
<td>Comments:</td>
</tr><tr>
<td>
<textarea name="comments" wrap="soft" rows="5" cols="55"></textarea>
</td>
</tr><tr>
<td><hr></td>
</tr><tr>
<td align="right">
<input type="reset" value="Clear Form">
<input type="submit" value="Send Request!">
</td>
</tr>
</table>
<input type="hidden" name="id" value="${id}">
</form>
<script language="Javascript" type="text/javascript">
document.request.english.focus();
</script>
<hr>
<a name="pos"><h3>Parts of Speech Definitions</h3>
<hr>
$pos_help
<hr>
EOFSSF;
return;
}
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
?>
@
1.9
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: October 19, 2003
d118 1
a118 1
<a href="search.php">Search Dictionary</a>
d120 1
a120 1
<a href="reference.php">Reference</a>
d122 1
a122 1
<a href="email.php">Send Us E-mail</a>
d124 1
a124 1
<a href="admin.php">Administration</a>
@
1.8
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: October 17, 2003
d58 2
@
1.7
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: October 15, 2003
d57 1
a57 6
<title>
Bahasa Indonesia Dictionary: Request a New Word
</title>
<script language="Javascript" type="text/javascript">
//////////////////////////////////////////////////////////////////////////////
function is_email(token) {
d59 1
a59 1
var regexp = /^\w+([\.-]?\w+)*@@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
d61 2
a62 29
if (regexp.test(token)) return(true);
return(false);
}
//////////////////////////////////////////////////////////////////////////////
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);
}
d108 1
@
1.6
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: October 05, 2003
d206 1
@
1.5
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: September 30, 2003
d143 3
a145 2
<h2>Bahasa Indonesia Dictionary: Request a New Word</h2>
@
1.4
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: September 05, 2003
d163 1
a163 1
(session_is_registered("NODUP_REQUESTS")) &&
d177 1
a177 1
if (session_is_registered("NODUP_REQUESTS")) {
d179 1
a179 1
session_unregister("NODUP_REQUESTS");
d199 1
a199 3
$NODUP_REQUESTS = $_POST['id'];
session_register("NODUP_REQUESTS");
@
1.3
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: September 03, 2003
d58 1
a58 1
Bahasa Indonesia Dictionary: Request a New Entry
d126 11
d144 1
a144 1
<h2>Bahasa Indonesia Dictionary: Request a New Entry</h2>
d147 14
a160 1
@
1.2
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: August 19, 2003
a39 7
if (session_is_registered("NODUP_REQUEST_ENTRY")) {
session_unregister("NODUP_REQUEST_ENTRY");
$web->redirect("search.php");
}
d135 1
a135 1
<a href="search.php">Search</a>
d139 7
d149 2
a150 1
(isset($_POST['pos'])) &&
d153 5
d161 1
a161 1
$_POST['spelling_flag'], $_POST['pos'],
d166 1
a166 1
print "<br><hr><b>${errstr}</b><hr><br>\n";
d172 2
a173 2
"<br><hr><b>Your entry has been submitted " .
"and will be reviewed!</b><hr><br>";
d175 1
a175 1
$NODUP_REQUEST_ENTRY = 1;
d177 1
a177 1
session_register("NODUP_REQUEST_ENTRY");
d179 1
d181 1
a181 1
} else {
a182 2
show_request_form($web, $indonesia);
}
d192 2
d195 1
a195 1
"<select name=\"pos\">\n";
d206 14
a219 1
foreach($pos as $p) {
d221 2
a222 1
$part_of_speech = $web->tohtml($p->part_of_speech);
d224 1
a224 1
$description = $web->tohtml($p->description);
d226 4
a229 2
$pos_select .=
"<option value=\"$p->pkey\">${part_of_speech}\n";
d247 1
a247 1
<td>English (255 characters maximum):</td>
d250 2
a251 1
<textarea name="english" wrap="soft" rows="2" cols="55"></textarea>
d258 1
a258 1
<td>Indonesian (255 characters maximum):</td>
d261 2
a262 1
<textarea name="indonesian" wrap="soft" rows="2" cols="55"></textarea>
d309 1
@
1.1
log
@Initial revision
@
text
@d5 33
a37 1
a301 2
@
1.1.1.1
log
@Bahasa Indonesia Dictionary
@
text
@@