Location: PHPKode > projects > Pet Grooming Management System > pet/charge5.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>PMGS charge6</title>
<?php
$amount = $_POST['amount'];
$operator = $_COOKIE['user'];
$date = $_POST['date'];
$pet = $_POST['pet'];
$serNum = $_POST['sernum'];
$discount = $_POST['discount'];
require_once ('name.inc');
require_once ('dateout.inc');
require_once ('info.inc');
mysql_connect('localhost',$r,$p) or die("Could not connect to Host.");
mysql_select_db($d) or die("Could not select database.");
$query = "select *
          from services_scheduled
          where sid = '$serNum'";
$result = mysql_query($query) or die("Could not run query.");
$numrows = mysql_num_rows($result);
$numberServices = $numrows;
for($i=0;$i<$numberServices;$i++)
 {
 $row = mysql_fetch_array($result);
 $serv[$i] = $row['service_number'];
 $type[$i] = $row['type'];
 $paid[$i] = $row['paid'];
 $how[$i] = $row['how'];
 }
?>
</head>
<body onLoad = "window.print()">
<?php

echo'<center>';
require ('header.inc');
echo'<h2>Charges for '.$pet.'</h2>';
echo'<form action="" method="post">';
echo'<table border="0" cellpadding="1" cellspacing="1" summary="">';
for ($i=0; $i<$numberServices; $i++) {
     echo'<tr><td>'.$serv[$i].'</td><td>'.$type[$i].'</td><td>$'.number_format($paid[$i],2).'</td></tr>';
     $chargeTotal = $chargeTotal + $paid[$i];
		 }
echo'<tr><td colspan = "2">Services Total</td><td align = "right">$'.number_format($chargeTotal,2).'</td></tr>';
echo'<tr><td colspan = "2">Coupon</td><td style="text-align: right">$'.number_format($discount,2).'</td></tr>';
$newTotal = $chargeTotal - $discount;
echo'<tr><td colspan ="2"><b>Total</td><td>$'.number_format($newTotal,2).'</td></tr>';
echo'<tr><td colspan = "2">Amount Tendered</td><td>$'.number_format($amount,2).'</td></tr>';
$change = $amount - $newTotal;
echo'<tr><td colspan = "2">Change Due</td><td>$'.number_format($change,2).'</td></tr>';
echo'</table>';
echo'</form>';
require ('footer.inc');
echo'</center>';
?>
</body>
</html>
Return current item: Pet Grooming Management System