<?php
include ("dictionary_con.php");
$palabra_encontrada = "";
$error = "";
$estado = "";
if (isset ($_REQUEST["find"])) {
$estado = "find";
if (isset($_REQUEST ["palabra"])|| isset($_REQUEST ["palabra_find"])) {
$palabra = "";
if (isset($_REQUEST ["palabra_find"])) {
$palabra = $_REQUEST ["palabra_find"];
}
if ($palabra == "") {
$palabra = $_REQUEST ["palabra"];
}
$ret = dictionary_encontrar ($palabra, $palabra_encontrada);
if (! $ret) {
$error = errores_leer ();
}
$_REQUEST ["palabra"] = $palabra;
$_REQUEST ["palabra_encontrada"] = $palabra_encontrada;
}
} else if (isset ($_REQUEST["replace"])) {
$estado = "";
$ret = dictionary_actualizar ();
if (! $ret) {
$estado = "find";
$error = errores_leer ();
} else {
$error = "Word added or modified correctly. ";
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link href="images/favicon.ico" rel="shortcut icon"/>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<title>readenglish: dictionary</title>
<link href="readenglish.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" border="0" cellpadding="5" cellspacing="0">
<?php include "header_vis.php"; ?>
<tr>
<td width="100" valign="top"> <?php include "menu_vis.php"; ?> </td>
<td valign="top" bgcolor="#FFFFFF">
<form name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td>Add or modify a word in English:
<input name="palabra_find" type="text" id="palabra_find" size="35" maxlength="35">
<input name="find" type="submit" id="find" value="Find"></td>
</tr>
<tr>
<td><a href="dictionary_addset.php">To add sets of new words from words existing in the dictionary click here</a> </td>
</tr>
<?php if ($estado == "find") {
?>
<tr>
<td>Define or modify the readenglish of the word (see the <a href="rules.php" target="_blank">rules</a> to get information): </td>
</tr>
<tr>
<td><table border="0" cellspacing="0" cellpadding="5">
<tr>
<td><div align="right" class="cabecera"><span class="cabecera">English</span>:</div></td>
<td class="borde_menu"><?php echo $palabra; ?></td>
<td><div align="right" class="cabecera">readenglish:</div></td>
<td class="borde_menu"><?php echo htmlentities ($palabra_encontrada); ?></td>
</tr>
</table></td>
</tr>
<?php
include ("dictionary_vis.php");
} ?>
<?php if ($error != "") { ?>
<tr>
<td><span class="error"><?php echo $error; ?></span></td>
</tr>
<?php } ?>
</table>
</form></td>
</tr>
</table>
</body>
</html>