<?php
session_start ();
include ("dictionary_addset_con.php");
$palabra_encontrada = "";
$error = "";
$estado = "";
if (isset ($_REQUEST["adaptset"])) {
$estado = "adaptset";
if (isset($_REQUEST ["inputset"])) {
$ret = dictionary_addset_adaptset ();
if (! $ret) {
$error = errores_leer ();
}
}
} else if (isset ($_REQUEST["newwords"])) {
$estado = "newwords";
$ret = dictionary_addset_newwords ();
if (! $ret) {
$error = errores_leer ();
}
} else if (isset ($_REQUEST["addset"])) {
$estado = "newwords";
$ret = dictionary_addset_insert ();
if (! $ret) {
$error = errores_leer ();
} else {
$error = "Words added correctly. ";
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<title>readenglish: dictionary add sets</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 colspan="2" valign="top">Add sets of new words from words existing in the dictionary</td>
</tr>
<tr>
<td valign="top" class="cabecera">Original</td>
<td valign="top" class="cabecera">Adaptation</td>
</tr>
<tr>
<td valign="top"><p>
<textarea name="inputset" cols="50%" rows="20" class="texto" id="inputset"><?php
if (isset($_REQUEST["inputset"])) {
echo $_REQUEST["inputset"];
}
?></textarea>
</p>
<p>
<label>
<input type="radio" name="wordtype" value="un">
verbs, past participle and adjetives (un-)</label>
<br>
<label>
<input type="radio" name="wordtype" value="verb_able">
verbs or adjetives (-able)</label>
<br>
<label>
<input type="radio" name="wordtype" value="verb_er">
verbs, nouns or adjetives (-er)</label>
<br>
<label>
<input type="radio" name="wordtype" value="verb_edly">
regular verbs (-edly)</label>
<br>
<input name="adaptset" type="submit" id="adaptset2" value="Adapt words from existing ones">
</p>
</td>
<td rowspan="3" valign="top">
<?php if ($estado != "") { ?>
<input name="hidden_wordtype" type="hidden" value="<?php
if (isset ($_REQUEST["hidden_wordtype"])) {
if (isset ($_REQUEST["wordtype"])) {
echo $_REQUEST["wordtype"];
} else {
echo $_REQUEST["hidden_wordtype"];
}
} else if (isset ($_REQUEST["wordtype"])) {
echo $_REQUEST["wordtype"];
}?>">
<table border="0" cellspacing="5" cellpadding="0">
<tr>
<td class="cabecera">Up</td>
<td class="cabecera">Original</td>
<td class="cabecera">Adaptation</td>
</tr>
<?php
dictionary_addset_noun_plural_vis ();
?>
</table>
<p>
<input name="newwords" type="submit" id="newwords" value="New readenglish words">
</p>
<?php } ?>
</td>
</tr>
<tr>
<td valign="top">
<?php if ($estado == "newwords") { ?>
<table border="0" cellspacing="5" cellpadding="0">
<tr>
<td class="cabecera">Up</td>
<td class="cabecera">Original</td>
<td class="cabecera">Adaptation</td>
<td class="cabecera">readenglish</td>
</tr>
<?php
dictionary_addset_noun_plural_new_vis ();
?>
<tr>
<td colspan="4"><input name="addset" type="submit" id="addset" value="Add to the dicctionary"> </td>
</tr>
</table>
<?php } ?> </td>
</tr>
<?php if ($error != "") { ?>
<tr>
<td colspan="2"><span class="error"><?php echo $error; ?></span></td>
</tr>
<?php } ?>
</table>
</form></td>
</tr>
</table>
</body>
</html>