Hi I have a scheduled script that runs everyday in the morning and it save the information in the table Internal_way_outstanding;So i wnat to make sure thta my form update/saves timestamp now () in the Date_Invoice_Received
All i need to do is to allow users to update Date_Invoice_Received to current date Now()
Kindly assist me with this please
+---------------+--------------+-----------------------+---------------+
| WaybillNumber | Waybill_Date | Date_Invoice_Received | Admin_Checked |
+---------------+--------------+-----------------------+---------------+
| 22519009 | 2009-03-09 | 2009-03-09 | 0 |
| XA0070785 | 2009-03-09 | 1900-01-01 | 0 |
| XA0082814 | 2009-03-09 | 1900-01-01 | 0 |
| XA0094198 | 2009-03-09 | 1900-01-01 | 0 |
and a form that will update The Date Invoiced Received to Timestamp Now()
<html>
<head>
<title><?php echo $pageTitle; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="keywords" content="<?php echo $keywords;?>" />
<meta name="description" content="<?php echo $description;?>" />
<link href="styles/main.css" rel="stylesheet" type="text/css" />
</head>
<?php
if (isset($additionalStyles))
{
foreach ($additionalStyles as $style)
{
?>
<link rel="stylesheet" href="styles/<?php echo $style; ?>" type="text/css">
<?php
}
}
?>
<?php
if (isset($additionalScripts))
{
foreach ($additionalScripts as $script)
{
?>
<script src="/scripts/<?php echo $script; ?>"></script>
<?php
}
}
?>
<body>
<div align="center">
<div align="center" class="inner">
<h2>Nikita Document Control</h2>
<p>Please Enter Waybill Number , then press the "Update" button to update the Date Invoice Recieved.</p>
<vlsummary form="docproc" class="defaultErr" headertext="Please correct the following errors" showsummary="true" messagebox="true" displaymode="bulletlist">
<form name="docproc" method="post" action="docproc_update.php" runat="vdaemon" clientvalidate="true">
<table>
<tr>
<td align="right">
<font class="normaltext">Waybill Number:</font>
</td>
<td align="left">
<input type="text" class="normaltext" name="waybillNum">
<vlvalidator name="waybillNumReq" type="required" control="waybillNum" errmsg="Waybill Number is required to update Invoice Date Received." minlength="2" maxlength="15">
</td>
</tr>
<tr>
<td align="center" colspan="2">
<input type="submit" value="Update">
</td>
</tr>
</table>
</form>
</div>
</div>
</body>
</html>
<?php if(isset($additionalScripts))
{
if ($additionalScripts[0] == 'vdaemon.js')
{
VDEnd();
}
}
?>
This is my docproc_update.php
<?php
//This is a controller file. It will include a template file and also a class
require ('paths.php');
define('VDAEMON', false);
require(REPOSITORY.'vdaemon/vdaemon.php');
//strip out anything malicious
submissionClean($_POST);
//require (CONNECTIONS.'db_connect.php');
include("db_connect.php");
//populates waybillnumber to update the date
$waybill= $_GET['waybill'];
// Retrieve data from database
$sel="SELECT * FROM Internal_way_outstanding";
$res=mysql_query($sel);
$rows=mysql_fetch_array($res);
$waybill= $_POST['waybill'];
$waybilldate= $_POST['waybilldate'];
$dateinvrec= $_POST['dateinvrec'];
$adminc= $_POST['adminc'];
// update data in mysql database
$sql="UPDATE Internal_way_outstanding SET Date_Invoice_Received=NOW() WHERE WaybillNumber='$waybill'";
$result=mysql_query($sql) or die("cannot update nformation");
// if successfully updated.
if($result){
echo "<BR>";
echo "<BR>";
echo "Date Invoice Received Successfully Updated";
echo "<BR>";
}
else {
echo "ERROR";
}
?>