<?php
include("upalheader.inc");
$table = "RecType";
?>
<! -- *****************************************
start web page content
*****************************************-->
<table width='500' border="0" bgcolor="ffffff">
<tr>
<td align='center' valign='middle' nowrap>
<table cellpadding='10' cellspacing='2' border='0' style='border:1px solid #345487' class='row2'>
<tr>
<td width="253" valign="middle">
<div align="justify"><font color="#666666" size="2" face="Arial">
<b>Add Option Form</b></font></div></td>
</tr>
</table>
<br>
<?php
if ($Submit) {
$resultdupe = mysql_query("
SELECT *
FROM $table
WHERE rt_type='". $rt_type ."'
",$db);
$row = mysql_fetch_row($resultdupe);
if ($rt_type==$row[1]){
echo "Option \"$row[1]\" is already in use. Please try another.";
}
else {
$defaultrt_type=$rt_type;
// process form
$formdate =date("Y-m-d H:i:s");
$sql = "INSERT INTO RecType (
rt_type
)
VALUES (
'$rt_type'
)";
$result = mysql_query($sql);
echo "<br><br>";
echo "<br><br><font color='#666666' size='2' face='Arial'>";
echo "$formdate";
echo "<br><br>";
echo " $rt_type has sucessfully been added.\n";
echo "<br><br>";
$rt_type = Null;
// $password = Null;
// $userlevel = Null;
// echo "$rt_type";
echo "<form name=\"formaf\" method=\"post\" action=\"editrectype_input.php\"><div align=\"center\">
<input type=\"Submit\" name=\"Submit2\" value=\"Add New Option\">
</div></form>";
}
}
if (!$Submit || $error) {
echo $error;
// display form
?>
<table width='500' border="0" bgcolor="ffffff">
<tr>
<td align='center' valign='middle' nowrap>
<form name="formaf" method="post" action="editrectype_input.php">
<table cols="2" cellpadding='10' cellspacing='2' border='0' style='border:1px solid #345487' class='row2'>
<!-- <tr>
<td colspan="2" valign="middle">
<div align="justify"><font color="#666666" size="2" face="Arial">
<strong>*</strong>Required fields</font></div></td>
</tr> -->
<tr>
<td width="90"><strong><font color="#666666" size="2" face="Arial">
Add New Option</font><font color="#666666" size="2" face="Arial">:
</font></strong></td>
<td width="350"><strong><font color="#666666" size="2" face="Arial">
<input name="rt_type" type="text" id="rt_type"
value="<?php
echo $defaultrt_type;
?>"
size="35" maxlength="35"></font>
<font color=#ff0000>
<?php
echo $errorrt_type;
?>
</font></strong></td>
</tr>
</table>
<br>
<table width="69%" border="0" align="left">
<tr>
<td><div align="center">
<input type="submit" name="Submit" value="Submit">
</div></td>
<td><div align="center">
<input type="reset" name="Submit2" value="Reset">
</div></td>
</tr>
</table>
</form></td>
</tr>
</table>
<?php
} // end if
?>
<! -- *****************************************
end the web page content
*****************************************-->
<?php
include("cmifooter.inc");
?>