| Current Path : /var/www/cesa.co.za/echasl23/annualdec/ |
| Current File : /var/www/cesa.co.za/echasl23/annualdec/ADeditDone.php |
<html>
<head>
<title>SAACE: Annual Declaration</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<?php
include("inc/log_query.php");
// All the database constants
$scriptname = "ADeditDone.php";
include( 'inc/database.inc' );
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#CCCCCC">
<?php include( 'inc/menu.inc' ); ?>
</td>
</tr>
<tr>
<td>
<h3><font face="sans-serif" color="#666666">Edit Records:</font><font face="sans-serif">
ADec_Done </font></h3>
<p>
<?php
if ($action == "update")
{
// Connect to the databse and update the date
$dbc = mysql_connect($server,$user,$pass);
mysql_select_db($db,$dbc);
$sql = "UPDATE ADec_Done SET RefID = '$form[refid]' ,RefType = '$form[reftype]' ,RefDoc = '$form[refdoc]', ADecDate = '$form[adecdate]' WHERE ADecID = '$form[adecid]'";
$result = mysql_query($sql);
log_query($sql);
echo "The update was completed";
}
else
{
// Connect to the databse and show the data
$dbc = mysql_connect($server,$user,$pass);
mysql_select_db($db,$dbc);
$sql = "SELECT * FROM ADec_Done WHERE ADecID = $ADecID";
$result = mysql_query($sql);
$result_rows = mysql_num_rows($result);
$row = mysql_fetch_array($result);
?>
<FORM ACTION="<?php echo $scriptname; ?>?action=update" METHOD="POST">
<?php $form[chaser] = ""; ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="15%"><b><font face="Comic Sans MS" size="2">ADecID</font></b></td>
<td width="85%"><font face="Comic Sans MS" size="2"><b>
<?php
echo $row["ADecID"] ;
$form[adecid] = $row["ADecID"];?>
</b></font></td>
</tr>
<tr>
<td width="15%" height="26"><b><font face="Comic Sans MS" size="2">RefID</font></b></td>
<td width="85%" height="26"> <font face="Comic Sans MS" size="2">
<input type="text" name="form[refid]" size="50" value="<?php echo $row["RefID"] ; ?>">
</font></td>
</tr>
<tr>
<td width="15%"><b><font face="Comic Sans MS" size="2">RefType</font></b></td>
<td width="85%"> <font face="Comic Sans MS" size="2">
<input type="text" name="form[reftype]" size="50" value="<?php echo $row["RefType"] ; ?>">
</font></td>
</tr>
<tr>
<td width="15%" height="33"><b><font face="Comic Sans MS" size="2">RefDoc</font></b></td>
<td width="85%" height="33"> <font face="Comic Sans MS" size="2">
<input type="text" name="form[refdoc]" size="50" value="<?php echo $row["RefDoc"]; ?>">
</font></td>
</tr>
<tr>
<td width="15%" height="30"><b><font face="Comic Sans MS" size="2">ADecDate</font></b></td>
<td width="85%" height="30"> <font face="Comic Sans MS" size="2">
<input type="text" name="form[adecdate]" size="50" value="<?php echo $row["ADecDate"] ; ?>">
</font></td>
</tr>
<tr>
<td width="15%"> </td>
<td width="85%">
<input type="submit" name="Submit" value="Update">
<input type="reset" name="Submit2" value="Clear">
</td>
</tr>
</table>
<INPUT TYPE="HIDDEN" NAME="form[adecid]" VALUE="<?php echo $row["ADecID"] ;?>">
</form>
<?php } ?>
</td>
</tr>
<tr>
<td bgcolor="#CCCCCC">
<?php include( 'inc/footer.inc' ); ?>
</td>
</tr>
</table>
</body>
</html>