'.$setting[desc][$_GET[lang]].' |
'.$setting[qty][$_GET[lang]].' |
'.$setting[unit_price][$_GET[lang]].' |
'.$setting[dis][$_GET[lang]].' |
'.$setting[total][$_GET[lang]].' |
';*/
$query = " SELECT MAX(row)
FROM `bill_detail`
WHERE bill_number = '$number' AND (item <> '' OR description <> '' OR qty >0 OR unit_price >0)";
$rows= mysql_query($query) ;
$temp = mysql_fetch_row($rows);
$max_row = $temp[0];
$query = " SELECT description , qty ,units, unit_price ,dis , item ,row
FROM `bill_detail`
WHERE bill_number = '$number'
ORDER By row";
$rows= mysql_query($query) ;//echo $query;
$page =1;
while($temp = mysql_fetch_row($rows))
{
$i++;
if($temp[4] > 0 ){$temp[total] = $temp[1] * $temp[3] *($temp[4] /100) ;$temp[4] .= '%';}
else{$temp[total] = $temp[1] * $temp[3];}
$sum += $temp[total];
if($temp[3] == 0 ){$temp[3] ='';}else{$temp[3] = '$ '.number_format($temp[3], 1);}
if($temp[1] == 0 ){$temp[1] ='';}
if($temp[total] == 0 ){$temp[total] ='';}else{$temp[total] = '$ '.number_format($temp[total], 1);}
$row[$page] .= '