I've fought this for days - can someone help?
<?php
mysql_connect(localhost,root,"");
mysql_select_db(oob) or die( "Unable to select database");
$query = "
INSERT INTO oocust (payrec,invnum,date,time,name,name,street,state,zip,terms,fob,ordernum,dateord,datecomp,datepaid,charges,paidamt,tax,amtdue)
VALUES('$payrec','$invnum','$date','$time','$name','$street','$state','$zip','$terms','$fob','$ordernum','$dateord','$datepaid','$charges','$paidamt','$tax','$amtdue')";
echo "data inserted</font><br /><br />";
$stat = mysql_query($query) or die('Query failed: ' . mysql_error());
if (isset( $_POST['payrec']) )
{
$payrec=$_POST['payrec'];
$invnum=$_POST['invnum'];
$date=$_POST['date'];
$time=$_POST['time'];
$name=$_POST['name'];
$street=$_POST['street'];
$state=$_POST['state'];
$zip=$_POST['zip'];
$terms=$_POST['terms'];
$fob=$_POST['fob'];
$ordernum=$_POST['ordernum'];
$dateord=$_POST['dateord'];
$datecomp=$_POST['datecomp'];
$datepaid=$_POST['datepaid'];
$charged=$_POST['charged'];
$paidamt=$_POST['paidamt'];
$tax=$_POST['tax'];
$amtdue=$_POST['amtdue'];
// charges x tax(.06) + shipamt = amtdue
mysql_connect(localhost,root,"");
mysql_select_db(numbersdb) or die( "Unable to select database");
if(!empty($_POST["submit"]))
{
$invnum = $_POST['invnum'];
}
mysql_query("UPDATE numbdata SET invnum=invnum+1");
$result=mysql_query("select number from numbdata") or die ("Error - could not retrieve receipt number from database");
$data=mysql_fetch_assoc($result);
echo ".Invoice number ".$data['invnum'];
mysql_close();
?>
<HTML><HEAD>
<SCRIPT>
changed = 0;
function change(field)
{
for (var node = 0; node < field.attributes.length; node++)
{
if (field.attributes[node].nodeName == 'class')
{
if (field.defaultValue == field.value)
{
if (field.attributes[node].nodeValue != 'bgwhite')
{
field.attributes[node].nodeValue = 'bgwhite';
changed--;
}
}
else
{
if (field.attributes[node].nodeValue != 'bgyellow')
{
field.attributes[node].nodeValue = 'bgyellow';
changed++;
}
}
field.Form.reset.disabled = ! changed;
break;
}
}
}
function changeall(Form)
{
Form.reset.disabled = true;
changed = 0;
for (var el = 0; el < Form.elements.length; el++)
{
if (Form.elements[el].name != 'reset') /* Some way needed of knowing which to reset. */
{
for (var node = 0; node < Form.elements[el].attributes.length; node++)
{
if (Form.elements[el].attributes[node].nodeName == 'class')
{
Form.elements[el].attributes[node].nodeValue = 'bgwhite';
break;
}
}
}
}
}
</SCRIPT>
<STYLE type=text/css>.highlight {
BACKGROUND: #ff6699
}
.text {
COLOR: #ffffff
}
.both {
BACKGROUND: black; COLOR: white
}
</STYLE>
<STYLE>INPUT.bgyellow {
BACKGROUND-COLOR: yellow
}
</STYLE>
<script type="text/javascript">
var today = new Date();
var date = today.getMonth() + " / " + today.getDate() + " / " + today.getFullYear();
</script>
<!--increment date to create due date-->
</head>
<body>
<script type="text/javascript">document.write(date);
</script>
<center>
<B><font size=+2>Work Order Input Form</font></b></center>
<P><FORM name="Form">
AR/AP: <SELECT name=payrec>
<OPTION class=highlight value=ar selected>R
<OPTION class=highlight value=ap>P
</OPTION></SELECT>
Order No: <INPUT TYPE="text" size=5 name="ordernum">
Invoice No: <INPUT TYPE="text" size=5 name="invnum" MAXLENGTH=5
onKeyUp="if(this.value.length==this.size)document.form.date.focus();">
Date: <INPUT TYPE="text" size=10 name="date" MAXLENGTH=10
onKeyUp="if(this.value.length==this.size)document.form.name.focus();"><p>
<b>Bill</b> - Name: <INPUT TYPE="text" name=bname>
Street: <INPUT TYPE="text" name=bstreet>
State: <SELECT name=bstate>
<OPTION class=highlight value=fl selected>Florida
<OPTION class=highlight value=ga>Georgia
<OPTION class=highlight value=al>Alabama
<OPTION class=highlight value=la>Louisiana
<OPTION class=highlight value=sc>South Carolina
</OPTION></SELECT>
Zip: <INPUT TYPE="text" name="bzip" MAXLENGTH=5
onKeyUp="if(this.value.length==this.size)document.form.contact.focus();"><br>
<b>Contact: </b><INPUT TYPE="text" name=contact><BR>
<b>Ship</b> - Name:
<INPUT TYPE="text" name=sname>
Street <INPUT TYPE="text" name=sstreet>
State <SELECT name=sstate>
<OPTION class=highlight value=fl selected>Florida
<OPTION class=highlight value=ga>Georgia
<OPTION class=highlight value=al>Alabama
<OPTION class=highlight value=la>Louisiana
<OPTION class=highlight value=sc>South Carolina
</OPTION></SELECT>
Zip: <INPUT TYPE="text" name="szip" MAXLENGTH=5
onKeyUp="if(this.value.length==this.size)document.form.terms.focus();"><p>
Terms: <SELECT name=terms>
<OPTION class=highlight value=net 10 selected>Net 10
<OPTION class=highlight value=1_10_30ga>1 10 Net 30
<OPTION class=highlight value=2_10_30>2 10 Net 30
<OPTION class=highlight value=cash>Cash
</OPTION></SELECT>
FOB: <SELECT name=fob>
<OPTION class=highlight value=Destination selected>Destination
<OPTION class=highlight value=Origin>Origin
</OPTION></SELECT><p>
<b>Dates</b> - Ordered:
<INPUT TYPE="text" size=10 name="dateord" MAXLENGTH=10
onKeyUp="if(this.value.length==this.size)document.form.datecomp.focus();">
Completed: <INPUT TYPE="text" size=10 name="datecomp" MAXLENGTH=10
onKeyUp="if(this.value.length==this.size)document.form.duedate.focus();">
Due($): <INPUT TYPE="text" size=10 name="duedate" MAXLENGTH=10
onKeyUp="if(this.value.length==this.size)document.form.charges.focus();"><p>
Charges: <INPUT TYPE="text" name=charges>
Tax: <INPUT TYPE="text" name tax>
Shipping: <INPUT TYPE="text" name shipamt>
Amount Due: <INPUT TYPE="text" name=amtdue><p>
<INPUT type="submit" value="submit data" />
</p></form></body></html>
<input type=text value="Old Orchard Plumbing"><br>
<input type=text value="2210 E. Hogan Hollow Road"><br>
<input type=text value="Margate, Fl 33063"><br>
<img src="dave pic.jpg">
<center>
<B><font size=+2>Work Order Input Form</font></b></center>
<P><FORM name="Form">
AR/AP = <SELECT name=payrec>
<OPTION class=highlight value=ar selected>R
<OPTION class=highlight value=ap>P
</OPTION></SELECT><BR>
<INPUT TYPE="text" size=5 name="ordernum">Order No<br>
<INPUT TYPE="text" size=5 name="invnum" MAXLENGTH=5
onKeyUp="if(this.value.length==this.size)document.form.date.focus();">Invoice No.<br />
<INPUT TYPE="text" size=10 name="date" MAXLENGTH=10
onKeyUp="if(this.value.length==this.size)document.form.name.focus();">Date<br />
<INPUT TYPE="text" name=name>Name<BR>
<INPUT TYPE="text" name=street>Street<BR>
state = <SELECT name=state>
<OPTION class=highlight value=fl selected>Florida
<OPTION class=highlight value=ga>Georgia
<OPTION class=highlight value=al>Alabama
<OPTION class=highlight value=la>Louisiana
<OPTION class=highlight value=sc>South Carolina
</OPTION></SELECT><BR>
<INPUT TYPE="text" size=5 name="zip" MAXLENGTH=5
onKeyUp="if(this.value.length==this.size)document.form.contact.focus();">Zip Code<br />
<INPUT TYPE="text" name=contact>Contact<BR>
Terms = <SELECT name=terms>
<OPTION class=highlight value=net 10 selected>Net 10
<OPTION class=highlight value=1_10_30ga>1 10 Net 30
<OPTION class=highlight value=2_10_30>2 10 Net 30
<OPTION class=highlight value=cash>Cash
</OPTION></SELECT><BR>
FOB = <SELECT name=fob>
<OPTION class=highlight value=Destination selected>Destination
<OPTION class=highlight value=Origin>Origin
</OPTION></SELECT><BR>
<INPUT TYPE="text" size=10 name="dateord" MAXLENGTH=10
onKeyUp="if(this.value.length==this.size)document.form.datecomp.focus();">Date Ordered<br />
<INPUT TYPE="text" size=10 name="datecomp" MAXLENGTH=10
onKeyUp="if(this.value.length==this.size)document.form.datepaid.focus();">Date Completed<br />
<INPUT TYPE="text" size=10 name="datepaid" MAXLENGTH=10
onKeyUp="if(this.value.length==this.size)document.form.charges.focus();">Date Paid<br />
<INPUT TYPE="text" name=charges>Charges<BR>
<INPUT TYPE="text" name=paidamt>Amount Paid<BR>
<INPUT TYPE="text" name tax>tax<BR>
<INPUT type="submit" value="submit data">
</p></form></body></html>