Hi sir.pls help me on this.
this code only showing one customer report on one page.but i want to get all the customer details like wise on one report page.so pls help me on this…
<?php
$rview = $_POST['rview'];
$q = mysql_query("SELECT cus_name FROM cus WHERE cus_id = '$cus_id'");
$r = mysql_fetch_assoc($q);
$cus_name = $r['cus_name'];
echo "
Customer: {$cus_name}
";
if($rview == "products"){
?>
Code |
Description |
Unit |
Qty |
Gross Value |
<?php
$total_qty = 0;
$total_gross = 0;
$q = mysql_query("SELECT itm_code, itm_des, itm_unit, SUM(ini_qty), SUM(ini_qty * ini_price) AS gross
FROM itm, inv, inv_itm
WHERE itm_id = ini_itm AND inv_id = ini_trn AND inv_cus = '$cus_id' AND inv_date BETWEEN '$from' AND '$to' GROUP BY ini_itm");
while($r = mysql_fetch_assoc($q)){
$itm_code = $r['itm_code'];
$itm_des = $r['itm_des'];
$itm_unit = $r['itm_unit'];
$itm_qty = $r['SUM(ini_qty)'];
$gross_val = $r['gross'];
echo "
{$itm_code} |
{$itm_des} |
{$itm_unit} |
".number_format($itm_qty,2,".",",")." |
".number_format($gross_val,2,".",",")." |
\n";
$total_qty += $itm_qty;
$total_gross += $gross_val;
}
?>
|
|
|
<?php echo number_format($total_qty,2,".",","); ?> |
<?php echo number_format($total_gross,2,".",","); ?> |
<?php