Current File : /home/inlingua/www/icentex/pg/customer_ledger.php
<?php
session_start();
ob_start(); 
// Include the database connection details
require('../dbConnection.php');

// Include common functions
require('../commonFunc.php');

// Include common functions
require('../globalVars.php');

// Include the table handler class
require('../dbHandler.class.php');
$dbObject = new dbHandler();
$dbObject->connect();

$id=$_REQUEST['cid'];

/*$qurey ="SELECT main.student_id,SUM( main.amount ) AS mainamt, SUM( final_amount ) AS Finalamt, SUM( pay.amount ) AS Payamt FROM ingl_invoice_main main   INNER JOIN ingl_invoice_payment pay ON main.recNo = pay.invice_no group by main.student_id having main.student_id = '$id' ";*/
$qurey="SELECT d.course_id, p.bill_details, d.Discount, d.amount, d.remarks,cat.bill_category,d.quantity FROM ingl_invoice_main a INNER JOIN ingl_invoice_detail d ON a.invoice_no = d.invoice_no INNER JOIN ingl_billing_main p ON d.product_id = p.recNo INNER JOIN ingl_billing_cat cat ON d.category_id = cat.recNo Where a.student_id = '$id'";		
//echo $qurey;//exit;
$result=mysqli_query($conn,$qurey);



$resultshow=" <table align=\"right\" style=\"border:solid 2px !important;\" width=\"100%\" border=\"2\" >
<tr valign=\"top\">
<th width=\"60\">Category</th>
<th width=\"60\">Product</th>
<th width=\"60\">Reg. ID</th>
<th width=\"60\">Quantity</th>
<th width=\"60\">Discount(%)</th>
<th width=\"60\"> Amount</th>
<th width=\"60\">Remarks</th>
</tr>";

while($num=mysqli_fetch_assoc($result))
{
//echo "<pre>";
//print_r("".$num['5']."|".$num['6']."|".$num['7']."|".$num['8']."|".$num['9']."|".$num['10']."");

$resultshow.="<tr>
<td>".$num['bill_category'] ."</td>
<td>".$num['bill_details']." </td>
<td>".$num['course_id']."</td>
<td>".$num['quantity']."</td>
<td>".$num['Discount']." </td>
<td>".$num['amount']."</td>
<td>".$num['remarks']."</td>
</tr>";


}
$resultshow.="</table>";
echo $resultshow;
?>