ok
Direktori : /proc/thread-self/root/home2/selectio/www/vijay-gases/apis/ |
Current File : //proc/thread-self/root/home2/selectio/www/vijay-gases/apis/balance-amount-supplier.php |
<?php ob_start(); session_start(); include "../config/config.php"; $session_id = $_SESSION['vijay_gases']['id']; if(isset($_POST['supplier_id']) && $_POST['supplier_id']!='' && $_POST['supplier_id']!='all' && $_POST['supplier_id']!='0'){ $statement = $pdo->prepare("SELECT supplier ,SUM(total_amount)as sup_total_amount,SUM(paid_amount)as sup_paid_amount FROM `tbl_purchase` WHERE supplier=?"); $statement->execute(array($_POST['supplier_id'])); $totals = $statement->rowCount(); $result = $statement->fetchAll(PDO::FETCH_ASSOC); if($totals) { foreach($result as $balance_data){ if($balance_data['sup_total_amount']>$balance_data['sup_paid_amount']){ echo '<span>RS . '.$balance_data['sup_total_amount'].'</span>'; } } } } ?>