Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $upto_date = '00-00-0000';
- function is_customer($kb){
- global $debit_total, $upto_date;
- $id = $kb['id'];
- $customer = mysql_query("SELECT * FROM customer WHERE id = '$id' ");
- if(mysql_num_rows($customer) ==1 ){
- $cu = mysql_fetch_assoc($customer);
- $temp = $cu['grand_total'];
- $str = str_replace(array('.', ','), '' , $temp);
- $debit_total = $debit_total + $str;
- $temp_date = strtotime($cu['date']);
- $temp_upto = strtotime($upto_date);
- echo "DATE: " . $temp_date . "UPTO: " . $upto_date;
- if($temp_date <= $temp_upto){
- echo "<tr id='highlight'>";
- }else{
- echo "<tr>";
- }
- ?>
- <?php
- function is_reciept($kb){
- global $credit_total, $discount_total, $gr_total;
- $id = $kb['id'];
- $reciept = mysql_query("SELECT * FROM receipt WHERE id = '$id' ");
- if(mysql_num_rows($reciept) ==1 ){
- $re = mysql_fetch_assoc($reciept);
- global $upto_date;
- if(empty($re['upto'])){
- $upto_date = '00-00-0000';
- }else{
- $upto_date = strtotime($re['upto']);
- }
- $temp = $re['received_amount'];
- $str = str_replace(array('.', ','), '' , $temp);
- $credit_total = $credit_total + $str;
- $temp = $re['discount_amount'];
- $str = str_replace(array('.', ','), '' , $temp);
- $discount_total = $discount_total + $temp;
- $temp = $re['gr_amount'];
- $str = str_replace(array('.', ','), '' , $temp);
- $gr_total = $gr_total + $temp;
- ?>
- //BOTH OF THESE FUNCTION ARE CALLED REPEATEDLY BECAUSE THEY ARE IN A LOOP.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement