Location: PHPKode > scripts > PHP Online Invoice System > php-online-invoice-system/edit_invoice.php
<?
/*
 * Exemplar Web hosting
 * http://www.exemplar.biz
 *
 * Title: PHP Online Invoice System
 * Version: 2.0
 * Author: Exemplar
 * Date: 01-01-2006
 *
*/

include('header.php');
$year = date (Y);
$mon = date (m);
$day = date (d);
$today = $year."-". $mon."-". $day;

?>

<SCRIPT language=JavaScript>

function taxable()
{
$tax1 = 0;
$tax2 = 0;
$tax3 = 0;
$tax4 = 0;
$tax5 = 0;
$tax6 = 0;
$tax7 = 0;
$tax8 = 0;
$tax9 = 0;
$tax10 = 0;

	if(form1.serv1tax.value=="yes")
	{
		$tax1 = Math.round(((eval(form1.serv1amt.value)*eval(<?=$taxrate?>))/100)*Math.pow(10,2))/Math.pow(10,2);
	}

	if(form1.serv2tax.value=="yes")
	{
		$tax2 = Math.round(((eval(form1.serv2amt.value)*eval(<?=$taxrate?>))/100)*Math.pow(10,2))/Math.pow(10,2);
	}

	if(form1.serv3tax.value=="yes")
	{
		$tax3 = Math.round(((eval(form1.serv3amt.value)*eval(<?=$taxrate?>))/100)*Math.pow(10,2))/Math.pow(10,2);
	}

	if(form1.serv4tax.value=="yes")
	{
		$tax4 = Math.round(((eval(form1.serv4amt.value)*eval(<?=$taxrate?>))/100)*Math.pow(10,2))/Math.pow(10,2);
	}

	if(form1.serv5tax.value=="yes")
	{
		$tax5 = Math.round(((eval(form1.serv5amt.value)*eval(<?=$taxrate?>))/100)*Math.pow(10,2))/Math.pow(10,2);
	}

	if(form1.serv6tax.value=="yes")
	{
		$tax6 = Math.round(((eval(form1.serv6amt.value)*eval(<?=$taxrate?>))/100)*Math.pow(10,2))/Math.pow(10,2);
	}

	if(form1.serv7tax.value=="yes")
	{
		$tax7 = Math.round(((eval(form1.serv7amt.value)*eval(<?=$taxrate?>))/100)*Math.pow(10,2))/Math.pow(10,2);
	}

	if(form1.serv8tax.value=="yes")
	{
		$tax8 = Math.round(((eval(form1.serv8amt.value)*eval(<?=$taxrate?>))/100)*Math.pow(10,2))/Math.pow(10,2);
	}

	if(form1.serv9tax.value=="yes")
	{
		$tax9 = Math.round(((eval(form1.serv9amt.value)*eval(<?=$taxrate?>))/100)*Math.pow(10,2))/Math.pow(10,2);
	}

	if(form1.serv10tax.value=="yes")
	{
		$tax10 = Math.round(((eval(form1.serv10amt.value)*eval(<?=$taxrate?>))/100)*Math.pow(10,2))/Math.pow(10,2);
	}

	form1.salestax.value=Math.round((eval($tax1) + eval($tax2) + eval($tax3) + eval($tax4) + eval($tax5) + eval($tax6) + eval($tax7) + eval($tax8) + eval($tax9) + eval($tax10))*Math.pow(10,2))/Math.pow(10,2);

}

function total()
{
	form1.total.value = Math.round((eval(form1.subtotal.value) + eval(form1.salestax.value) + eval(form1.shipping.value) + eval(form1.misc.value))*Math.pow(10,2))/Math.pow(10,2);
}

function subtotal()
{
	taxable();
	form1.subtotal.value = Math.round((eval(form1.serv1amt.value) + eval(form1.serv2amt.value) + eval(form1.serv3amt.value) + eval(form1.serv4amt.value) + eval(form1.serv5amt.value) + eval(form1.serv6amt.value) + eval(form1.serv7amt.value) + eval(form1.serv8amt.value) + eval(form1.serv9amt.value) + eval(form1.serv10amt.value))*Math.pow(10,2))/Math.pow(10,2);
	total();
}
function servtotal1()
{
	form1.serv1amt.value = Math.round((form1.serv1qty.value * form1.serv1rate.value)*Math.pow(10,2))/Math.pow(10,2);
	subtotal();
}
function servtotal2()
{
	form1.serv2amt.value = Math.round((form1.serv2qty.value * form1.serv2rate.value)*Math.pow(10,2))/Math.pow(10,2);
	subtotal();
}
function servtotal3()
{
	form1.serv3amt.value = Math.round((form1.serv3qty.value * form1.serv3rate.value)*Math.pow(10,2))/Math.pow(10,2);
	subtotal();
}
function servtotal4()
{
	form1.serv4amt.value = Math.round((form1.serv4qty.value * form1.serv4rate.value)*Math.pow(10,2))/Math.pow(10,2);
	subtotal();
}
function servtotal5()
{
	form1.serv5amt.value = Math.round((form1.serv5qty.value * form1.serv5rate.value)*Math.pow(10,2))/Math.pow(10,2);
	subtotal();
}
function servtotal6()
{
	form1.serv6amt.value = Math.round((form1.serv6qty.value * form1.serv6rate.value)*Math.pow(10,2))/Math.pow(10,2);
	subtotal();
}
function servtotal7()
{
	form1.serv7amt.value = Math.round((form1.serv7qty.value * form1.serv7rate.value)*Math.pow(10,2))/Math.pow(10,2);
	subtotal();
}
function servtotal8()
{
	form1.serv8amt.value = Math.round((form1.serv8qty.value * form1.serv8rate.value)*Math.pow(10,2))/Math.pow(10,2);
	subtotal();
}
function servtotal9()
{
	form1.serv9amt.value = Math.round((form1.serv9qty.value * form1.serv9rate.value)*Math.pow(10,2))/Math.pow(10,2);
	subtotal();
}
function servtotal10()
{
	form1.serv10amt.value = Math.round((form1.serv10qty.value * form1.serv10rate.value)*Math.pow(10,2))/Math.pow(10,2);
	subtotal();
}



</SCRIPT>

<?

 echo   "<h1>Edit invoice</h1>";


if($update)
{

$sql = "UPDATE invoices SET clientid='$clientid',due_date='$due_date',purchaseorder='$purchaseorder',
shipping='$shipping',total='$total',status='$status',
serv1amt='$serv1amt',serv1desc='$serv1desc',serv1qty='$serv1qty',serv1rate='$serv1rate'
,serv2amt='$serv2amt',serv2desc='$serv2desc',serv2qty='$serv2qty',serv2rate='$serv2rate',
serv3amt='$serv3amt',serv3desc='$serv3desc',serv3qty='$serv3qty',serv3rate='$serv3rate'
,serv4amt='$serv4amt',serv4desc='$serv4desc',serv4qty='$serv4qty',serv4rate='$serv4rate',
serv5amt='$serv5amt',serv5desc='$serv5desc',serv5qty='$serv5qty',serv5rate='$serv5rate'
,serv6amt='$serv6amt',serv6desc='$serv6desc',serv6qty='$serv6qty',serv6rate='$serv6rate',
serv7amt='$serv7amt',serv7desc='$serv7desc',serv7qty='$serv7qty',serv7rate='$serv7rate'
,serv8amt='$serv8amt',serv8desc='$serv8desc',serv8qty='$serv8qty',serv8rate='$serv8rate',
serv9amt='$serv9amt',serv9desc='$serv9desc',serv9qty='$serv9qty',serv9rate='$serv9rate'
,serv10amt='$serv10amt',serv10desc='$serv10desc',serv10qty='$serv10qty',serv10rate='$serv10rate',serv1tax='$serv1tax'
,serv2tax='$serv2tax',serv3tax='$serv3tax',serv4tax='$serv4tax',serv5tax='$serv5tax',serv6tax='$serv6tax',serv7tax='$serv7tax'
,serv8tax='$serv8tax',serv9tax='$serv9tax',serv10tax='$serv10tax',
subtotal='$subtotal',salestax='$salestax',note='$note',misc='$misc'

WHERE id=$id";
$result = mysql_query($sql);
echo ("<script language=javascript>document.location.href = 'edit_invoice.php?id=$id&message=Invoice $id has been Updated!'</script>");

}
else if($id)
{

$result = mysql_query("SELECT * FROM invoices WHERE id=$id",$db);
$row = mysql_fetch_array($result);
$clientid = $row["clientid"];
$status = $row["status"];
$shipping = $row["shipping"];
$sql = mysql_query("Select * From clients Where clientid = '$clientid'");
$clrow = mysql_fetch_array($sql);
$cname = $clrow["name"];
$first_name = $clrow["first_name"];
$last_name = $clrow["last_name"];
$company = $clrow["company"];
$address = $clrow["address"];
$city = $clrow["city"];
$state = $clrow["state"];
$zip = $clrow["zip"];
$date = $row["date"];
$bill_date = $row["bill_date"];
$due_date = $row["due_date"];
$paid_date = $row["paid_date"];
$purchaseorder=$row["purchaseorder"];
$shiptoname = $clrow["shiptoname"];
$shiptoaddr = $clrow["shiptoaddr"];
$shiptocity = $clrow["shiptocity"];
$shiptostate = $clrow["shiptostate"];
$shiptozip = $clrow["shiptozip"];
$taxid = $clrow["taxid"];
?>
<br><font color=red size=4><?php if (isset($_GET['message'])) { echo ' - '.$_GET['message']; } ?></font><BR>
<form name="form1" method="post" action="<?php echo $PHP_SELF?>">
<input type="hidden" name="clientid" value="<?=$clientid?>">
<br>
<FONT face="Arial, Helvetica, sans-serif" color=#800000 size=2>Editing Invoice # <?=$id?> for user <?=$cname?></font>
  <br><br>
<?
//-------------NEXT PREVIOUS----------------------------------------------------------------------

$sql ="SELECT * FROM invoices WHERE id < '$id' ORDER by id DESC LIMIT 1";

$resultp = mysql_query($sql);
$previousrows = mysql_num_rows($resultp);
while ($prerow = mysql_fetch_array($resultp)) {
$prev=$prerow['id'];
}


$sql2 ="SELECT id FROM invoices WHERE id > '$id' ORDER by id ASC LIMIT 1";

$resultn = mysql_query($sql2);
$nextrows = mysql_num_rows($resultn);
while ($nextrow = mysql_fetch_array($resultn)) {
$next=$nextrow['id'];
}

if ($previousrows == "") {
echo "";
}else{
echo "<B><a href=$PHP_SELF?id=$prev>$prev <- Prev</a> | ";
}
echo "<font size=6><B>$id</B></font>";
if ($nextrows == "") {
echo "";
}else{
echo "<b> | <a href=$PHP_SELF?id=$next > Next -> $next</a></b>";
}
?><br><br>
<? //---------------------add new edit fields------------------------------------------------------- ?>
<TABLE cellSpacing=1 cellPadding=2 width=605 border=0>
        <TBODY>
        <TR align=middle bgColor=#800000>
          <TD vAlign=top width=86 NOWRAP><FONT face="Arial, Helvetica, sans-serif" color=#ffffff size=2>Created Date</FONT></TD>
          <TD vAlign=top width=170><FONT face="Arial, Helvetica, sans-serif" color=#ffffff size=2>Invoice #</FONT></TD>
          <TD vAlign=top width=170><FONT face="Arial, Helvetica, sans-serif" color=#ffffff size=2>Purchase Order #</FONT></TD>
          <TD vAlign=top width=150><FONT face="Arial, Helvetica, sans-serif" color=#ffffff size=2>Tax ID</FONT></TD>
          <TD vAlign=top width=178><FONT face="Arial, Helvetica, sans-serif" color=#ffffff size=2>Due Date</FONT></TD>
          </TR>
        <TR vAlign=center align=middle bgColor=#cccccc>
          <TD NOWRAP><FONT face="Arial, Helvetica, sans-serif" color=#800000 size=2><?=$date?>
          </FONT></TD>
          <TD><FONT face="Arial, Helvetica, sans-serif" color=#800000 size=2><?=$id?>
          <INPUT type=hidden value="<?=$id?>" name="id">
          </FONT></TD>
          <TD><FONT face="Arial, Helvetica, sans-serif" color=#800000 size=2>
          <INPUT type="text" name="purchaseorder" id="purchaseorder" size="15" value="<?=$purchaseorder?>"></FONT></TD>
          <TD><FONT face="Arial, Helvetica, sans-serif" color=#800000 size=2>
          <INPUT type="text" name="taxid" id="taxid" size="15" value="<?=$taxid?>"></FONT></TD>
          <TD NOWRAP><FONT face="Arial, Helvetica, sans-serif" color=#800000 size=2>
<? //-----------calendar------------------------------?>
<input type="text" name="due_date" id="due_date" value="<?=$due_date?>">
<img src="img.gif" id="f_trigger_c"
     style="cursor: pointer; border: 1px solid red;"
     title="Date selector"
     onmouseover="this.style.background='red';"
     onmouseout="this.style.background=''" />
<script type="text/javascript">
    Calendar.setup({
        inputField     :    "due_date",
        ifFormat       :    "%Y-%m-%d",
        button         :    "f_trigger_c",
        align          :    "Tl",
        singleClick    :    true
    });
</script>
<? //----------- end calendar------------------------------?>
</TD>

     </TR>
     <FONT face=arial color=#006699 size=2>
     </TBODY></TABLE><BR>
      <TABLE cellSpacing=1 cellPadding=2 width=604 border=0>
        <TBODY>
        <TR bgColor=#800000>
          <TD vAlign=top width="50%"><FONT face="Arial, Helvetica, sans-serif" color=#ffffff size=2>Bill To </FONT></TD>
          <TD vAlign=top width="50%"><FONT face="Arial, Helvetica, sans-serif" color=#ffffff size=2>Ship To</FONT></TD>
          </TR>
          <FONT face=arial color=#006699 size=2>
        <TR vAlign=top bgColor=#cccccc>
          <TD width="50%">
<?=$first_name?>
<?=$last_name?><br>
<?=$company?><br>
<?=$address?><br>
<?=$city?>,
<?=$state?>
 <?=$zip?>

          </td>
          <TD width="50%">
          <FONT face="Arial, Helvetica, sans-serif" color=#800000 size=2>
<?=$shiptoname?><br>
<?=$shiptoaddr?><br>
<?=$shiptocity?>,
 <?=$shiptostate?>
 <?=$shiptozip?>
            </FONT>
        </TD>
        </TR></TBODY></TABLE><BR>

      <TABLE cellSpacing=1 cellPadding=2 width=604 border=0>
        <TBODY>
        <TR bgColor=#800000>
          <TD width=331><FONT face="Arial, Helvetica, sans-serif" color=#ffffff size=2>Service Description </FONT></TD>
          <TD width=59><FONT face="Arial, Helvetica, sans-serif" color=#ffffff size=2>Taxable</FONT></TD>
          <TD width=51><FONT face="Arial, Helvetica, sans-serif" color=#ffffff size=2>Qty/Hrs</FONT></TD>
          <TD width=70><FONT face="Arial, Helvetica, sans-serif" color=#ffffff size=2>Rate</FONT></TD>
          <TD width=67><FONT face="Arial, Helvetica, sans-serif" color=#ffffff size=2>Amount</FONT></TD>
          </TR>
        <TR bgColor=#cccccc>
          <TD><FONT face="Arial, Helvetica, sans-serif" size=2>
          <TEXTAREA id=serv1desc rows=2 cols=35 name=serv1desc><? echo $row["serv1desc"]; ?></TEXTAREA> </FONT></TD>
          <TD align=middle>
       <SELECT id=serv1tax onchange=servtotal1(); name=serv1tax>
       <OPTION><? echo $row["serv1tax"]; ?></OPTION>
           <OPTION value=no>no</OPTION>
           <OPTION value=yes>yes</OPTION>
       </SELECT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=2>
          <INPUT id=serv1qty onchange=servtotal1(); size=5 value="<? echo $row["serv1qty"]; ?>" name="serv1qty" > </FONT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=1><?=$currency?>
            <INPUT id=serv1rate onchange=servtotal1(); size=5 value="<? echo $row["serv1rate"]; ?>" name=serv1rate> </FONT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=1><?=$currency?>
            <INPUT id=serv1amt onchange=servtotal1(); size=5 value="<? echo $row["serv1amt"]; ?>" name=serv1amt>
            </FONT></TD></TR>
        <TR bgColor=#cccccc>
          <TD><FONT face="Arial, Helvetica, sans-serif" size=2>
          <TEXTAREA id=serv2desc rows=2 cols=35 name=serv2desc><? echo $row["serv2desc"]; ?></TEXTAREA> </FONT></TD>
          <TD align=middle>
       <SELECT id=serv2tax onchange=servtotal2(); name=serv2tax>
       <OPTION><? echo $row["serv2tax"]; ?></OPTION>
           <OPTION value=no>no</OPTION>
           <OPTION value=yes>yes</OPTION>
       </SELECT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=2>
          <INPUT id=serv2qty onchange=servtotal2(); size=5 value="<? echo $row["serv2qty"]; ?>" name=serv2qty> </FONT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=1><?=$currency?>
            <INPUT id=serv2rate onchange=servtotal2(); size=5 value="<? echo $row["serv2rate"]; ?>" name=serv2rate> </FONT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=1><?=$currency?>
            <INPUT id=serv2amt onchange=servtotal2(); size=5 value="<? echo $row["serv2amt"]; ?>" name=serv2amt>
            </FONT></TD></TR>
        <TR bgColor=#cccccc>
          <TD><FONT face="Arial, Helvetica, sans-serif" size=2>
          <TEXTAREA id=serv3desc rows=2 cols=35 name=serv3desc><? echo $row["serv3desc"]; ?></TEXTAREA> </FONT></TD>
          <TD align=middle>
        <SELECT id=serv3tax onchange=servtotal3(); name=serv3tax>
        <OPTION><? echo $row["serv3tax"]; ?></OPTION>
           <OPTION value=no>no</OPTION>
           <OPTION value=yes>yes</OPTION>
        </SELECT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=2>
          <INPUT id=serv3qty onchange=servtotal3(); size=5 value="<? echo $row["serv3qty"]; ?>" name=serv3qty> </FONT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=1><?=$currency?>
            <INPUT id=serv3rate onchange=servtotal3(); size=5 value="<? echo $row["serv3rate"]; ?>" name=serv3rate> </FONT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=1><?=$currency?>
            <INPUT id=serv3amt onchange=servtotal3(); size=5 value="<? echo $row["serv3amt"]; ?>" name=serv3amt>
            </FONT></TD></TR>
        <TR bgColor=#cccccc>
          <TD><FONT face="Arial, Helvetica, sans-serif" size=2>
          <TEXTAREA id=serv4desc rows=2 cols=35 name=serv4desc><? echo $row["serv4desc"]; ?></TEXTAREA> </FONT></TD>
          <TD align=middle>
        <SELECT id=serv4tax onchange=servtotal4(); name=serv4tax>
        <OPTION><? echo $row["serv4tax"]; ?></OPTION>
           <OPTION value=no>no</OPTION>
           <OPTION value=yes>yes</OPTION>
        </SELECT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=2>
          <INPUT id=serv4qty onchange=servtotal4(); size=5 value="<? echo $row["serv4qty"]; ?>" name=serv4qty> </FONT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=1><?=$currency?>
            <INPUT id=serv4rate onchange=servtotal4(); size=5 value="<? echo $row["serv4rate"]; ?>" name=serv4rate> </FONT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=1><?=$currency?>
            <INPUT id=serv4amt onchange=servtotal4(); size=5 value="<? echo $row["serv4amt"]; ?>" name=serv4amt>
            </FONT></TD></TR>
        <TR bgColor=#cccccc>
          <TD><FONT face="Arial, Helvetica, sans-serif" size=2>
          <TEXTAREA id=serv5desc rows=2 cols=35 name=serv5desc><? echo $row["serv5desc"]; ?></TEXTAREA> </FONT></TD>
          <TD align=middle>
        <SELECT id=serv5tax onchange=servtotal5(); name=serv5tax>
        <OPTION><? echo $row["serv5tax"]; ?></OPTION>
           <OPTION value=no>no</OPTION>
           <OPTION value=yes>yes</OPTION>
        </SELECT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=2>
          <INPUT id=serv5qty onchange=servtotal5(); size=5 value="<? echo $row["serv5qty"]; ?>" name=serv5qty> </FONT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=1><?=$currency?>
            <INPUT id=serv5rate onchange=servtotal5(); size=5 value="<? echo $row["serv5rate"]; ?>" name=serv5rate> </FONT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=1><?=$currency?>
            <INPUT id=serv5amt onchange=servtotal5(); size=5 value="<? echo $row["serv5amt"]; ?>" name=serv5amt>
            </FONT></TD></TR>
        <TR bgColor=#cccccc>
          <TD><FONT face="Arial, Helvetica, sans-serif" size=2>
         <TEXTAREA id=serv6desc rows=2 cols=35 name=serv6desc><? echo $row["serv6desc"]; ?></TEXTAREA> </FONT></TD>
          <TD align=middle>
        <SELECT id=serv6tax onchange=servtotal6(); name=serv6tax>
        <OPTION><? echo $row["serv6tax"]; ?></OPTION>
           <OPTION value=no>no</OPTION>
           <OPTION value=yes>yes</OPTION>
        </SELECT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=2>
          <INPUT id=serv6qty onchange=servtotal6(); size=5 value="<? echo $row["serv6qty"]; ?>" name=serv6qty> </FONT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=1><?=$currency?>
            <INPUT id=serv6rate onchange=servtotal6(); size=5 value="<? echo $row["serv6rate"]; ?>" name=serv6rate> </FONT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=1><?=$currency?>
            <INPUT id=serv6amt onchange=servtotal6(); size=5 value="<? echo $row["serv6amt"]; ?>" name=serv6amt>
            </FONT></TD></TR>
        <TR bgColor=#cccccc>
          <TD><FONT face="Arial, Helvetica, sans-serif" size=2>
          <TEXTAREA id=serv7desc rows=2 cols=35 name=serv7desc><? echo $row["serv7desc"]; ?></TEXTAREA> </FONT></TD>
          <TD align=middle>
        <SELECT id=serv7tax onchange=servtotal7(); name=serv7tax>
        <OPTION><? echo $row["serv7tax"]; ?></OPTION>
           <OPTION value=no>no</OPTION>
           <OPTION value=yes>yes</OPTION>
         </SELECT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=2>
          <INPUT id=serv7qty onchange=servtotal7(); size=5 value="<? echo $row["serv7qty"]; ?>" name=serv7qty> </FONT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=1><?=$currency?>
            <INPUT id=serv7rate onchange=servtotal7(); size=5 value="<? echo $row["serv7rate"]; ?>" name=serv7rate> </FONT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=1><?=$currency?>
            <INPUT id=serv7amt onchange=servtotal7(); size=5 value="<? echo $row["serv7amt"]; ?>" name=serv7amt>
            </FONT></TD></TR>
        <TR bgColor=#cccccc>
          <TD><FONT face="Arial, Helvetica, sans-serif" size=2>
          <TEXTAREA id=serv8desc rows=2 cols=35 name=serv8desc><? echo $row["serv8desc"]; ?></TEXTAREA> </FONT></TD>
          <TD align=middle>
        <SELECT id=serv8tax onchange=servtotal8(); name=serv8tax>
        <OPTION><? echo $row["serv8tax"]; ?></OPTION>
           <OPTION value=no>no</OPTION>
           <OPTION value=yes>yes</OPTION>
        </SELECT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=2>
          <INPUT id=serv8qty onchange=servtotal8(); size=5 value="<? echo $row["serv8qty"]; ?>"  name=serv8qty> </FONT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=1><?=$currency?>
            <INPUT id=serv8rate onchange=servtotal8(); size=5 value="<? echo $row["serv8rate"]; ?>" name=serv8rate> </FONT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=1><?=$currency?>
            <INPUT id=serv8amt onchange=servtotal8(); size=5 value="<? echo $row["serv8amt"]; ?>" name=serv8amt>
            </FONT></TD></TR>
        <TR bgColor=#cccccc>
          <TD><FONT face="Arial, Helvetica, sans-serif" size=2>
          <TEXTAREA id=serv9desc rows=2 cols=35 name=serv9desc><? echo $row["serv9desc"]; ?></TEXTAREA> </FONT></TD>
          <TD align=middle>
        <SELECT id=serv9tax onchange=servtotal9(); name=serv9tax>
        <OPTION><? echo $row["serv9tax"]; ?></OPTION>
           <OPTION value=no>no</OPTION>
           <OPTION value=yes>yes</OPTION>
        </SELECT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=2>
          <INPUT id=serv9qty onchange=servtotal9(); size=5 value="<? echo $row["serv9qty"]; ?>" name=serv9qty> </FONT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=1><?=$currency?>
            <INPUT id=serv9rate onchange=servtotal9(); size=5 value="<? echo $row["serv9rate"]; ?>" name=serv9rate> </FONT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=1><?=$currency?>
            <INPUT id=serv9amt onchange=servtotal9(); size=5 value="<? echo $row["serv9amt"]; ?>" name=serv9amt>
            </FONT></TD></TR>
        <TR bgColor=#cccccc>
          <TD><FONT face="Arial, Helvetica, sans-serif" size=2>
          <TEXTAREA id=serv10desc rows=2 cols=35 name=serv10desc><? echo $row["serv10desc"]; ?></TEXTAREA> </FONT></TD>
          <TD align=middle>
        <SELECT id=serv10tax onchange=servtotal10(); name=serv10tax>
        <OPTION><? echo $row["serv10tax"]; ?></OPTION>
           <OPTION value=no>no</OPTION>
           <OPTION value=yes>yes</OPTION>
        </SELECT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=2>
          <INPUT id=serv10qty onchange=servtotal10(); size=5 value="<? echo $row["serv10qty"]; ?>" name=serv10qty> </FONT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=1><?=$currency?>
            <INPUT id=serv10rate onchange=servtotal10(); size=5 value="<? echo $row["serv10rate"]; ?>" name=serv10rate> </FONT></TD>
          <TD align=middle><FONT face="Arial, Helvetica, sans-serif" size=1><?=$currency?>
            <INPUT id=serv10amt onchange=servtotal10(); size=5 value="<? echo $row["serv10amt"]; ?>" name=serv10amt> </FONT></TD></TR>
        <TR align=left bgColor=#cccccc>
          <TD colSpan=5><FONT face="Arial, Helvetica, sans-serif" size=2>Note:</FONT>
          <TEXTAREA id=note rows=2 cols=55 name=note> <? echo $row["note"]; ?> </TEXTAREA></TD></TR>
        <TR bgColor=#cccccc>
          <TD align=middle>&nbsp; </TD>
          <TD align=middle>&nbsp; </TD>
          <TD align=middle>&nbsp; </TD>
          <TD align=middle>&nbsp; </TD>
          <TD align=middle>&nbsp; </TD></TR>
        <TR bgColor=#cccccc>
          <TD rowSpan=2>&nbsp;
          <FONT face="Arial, Helvetica, sans-serif" color=#ff0000 size=3>**** If you change any<B> taxable </B>be sure to check or reselect taxable for Items marked
          Yes for tax.****
          </TD>
          <TD align=middle bgColor=#800000 colSpan=2><STRONG>
          <FONT face="Arial, Helvetica, sans-serif" color=#ffffff size=3>Sub total
            </FONT></STRONG></TD>
          <TD align=middle bgColor=#800000 colSpan=2>
          <FONT face="Arial, Helvetica, sans-serif" color=#ffffff size=2><?=$currency?>
          <INPUT id=subtotal onchange=servtotal1(); size=12 value=<? echo $row["subtotal"]; ?> name=subtotal>
            </FONT></TD>
          </TR>
        <TR bgColor=#cccccc>
          <TD align=middle bgColor=#800000 colSpan=2><STRONG>
          <FONT face="Arial, Helvetica, sans-serif" color=#ffffff size=3>Sales Tax</FONT></STRONG></TD>
          <TD align=middle bgColor=#800000 colSpan=2>
          <FONT face="Arial, Helvetica, sans-serif" color=#ffffff size=2><?=$currency?>
          <INPUT id=salestax onchange=servtotal1(); size=12 value=<? echo $row["salestax"]; ?> name=salestax>
            </FONT></TD>
          </TR>
        <TR bgColor=#cccccc>
          <TD rowSpan=3>
          <FONT face="Arial, Helvetica, sans-serif" size=1><BR>
            </FONT><FONT face="Arial, Helvetica, sans-serif" size=2>&nbsp;</FONT></TD>
          <TD align=middle bgColor=#800000 colSpan=2><STRONG>
          <FONT face="Arial, Helvetica, sans-serif" color=#ffffff size=3>Shipping
            </FONT></STRONG></TD>
          <TD align=middle bgColor=#800000 colSpan=2>
          <FONT face="Arial, Helvetica, sans-serif" color=#ffffff size=2><?=$currency?>
          <INPUT id=shipping onchange=servtotal1(); size=12 value=<? echo $row["shipping"]; ?> name=shipping>
            </FONT></TD></TR>
        <TR bgColor=#cccccc>
          <TD align=middle bgColor=#800000 colSpan=2><STRONG>
          <FONT face="Arial, Helvetica, sans-serif" color=#ffffff size=3>Miscellaneous</FONT></STRONG></TD>
          <TD align=middle bgColor=#800000 colSpan=2>
          <FONT face="Arial, Helvetica, sans-serif" color=#ffffff size=2><?=$currency?>
          <INPUT id=misc onchange=servtotal1(); size=12 value=<? echo $row["misc"]; ?> name=misc>
        </FONT></TD>
        </TR>
        <TR bgColor=#cccccc>
          <TD align=middle bgColor=#800000 colSpan=2><STRONG>
          <FONT face="Arial, Helvetica, sans-serif" color=#ffffff size=3>Total
            </FONT></STRONG></TD>
          <TD align=middle bgColor=#800000 colSpan=2>
          <FONT face="Arial, Helvetica, sans-serif" color=#ffffff size=2><?=$currency?>
          <INPUT id=total onchange=servtotal1(); size=12 value=<? echo $row["total"]; ?> name=total>
        </FONT></TD></TR>
        <TR align=middle bgColor=#cccccc>
          <TD colSpan=5><FONT face="Arial, Helvetica, sans-serif" size=2>

            </FONT></TD></TR></TBODY></TABLE></FONT></FONT></FONT></FONT>
<? //--------------------end new edit fields---------------------------------------------------------  ?>
<br>
  Status:<br>
  <select name="status">
    <option value="<? echo $status ?>" selected><? echo $status ?></option>
    <option value="pending">pending</option>
    <option value="paid">paid</option>
  </select>
  <br>
  <br>
<input type="Submit" name="update" value="Update information"></form>
</blockquote>
<?

}
else
{

exit;
}
include "footer.php";
?>
Return current item: PHP Online Invoice System