<div id="approximateNotifier" class="alert alert-info"></div> <table class="table table-hover"> <thead> <tr> <th>Particulars</th> <th>Price</th> <th>QTY</th> <th>Discount</th> <th>Unpaid</th> <th>Total</th> <th></th> </tr> </thead> <tbody id="charges"> <?php foreach ($ro4->get_patient_charges_itemNo() as $itemNo) { ?> <?php if ($ro->selectNow("patientCharges", "status", "itemNo", $itemNo) == "UNPAID") { ?> <?php if ($ro->selectNow("patientCharges", "title", "itemNo", $itemNo) != "PROFESSIONAL FEE") { ?> <tr> <td><?php echo $ro->selectNow("patientCharges", "description", "itemNo", $itemNo); ?> </td> <td><?php $ro->selectNow("patientCharges", "sellingPrice", "itemNo", $itemNo) > 0 ? $x = number_format($ro->selectNow("patientCharges", "sellingPrice", "itemNo", $itemNo), 2) : ($x = 0);
<?php include "../../myDatabase4.php"; $registrationNo = $_GET['registrationNo']; $ro = new database4(); $ro->get_patient_charges($registrationNo); $itemNo = $ro->get_patient_charges_itemNo(); $itemNo_count = count($itemNo); $myData = []; for ($x = 0; $x < $itemNo_count; $x++) { array_push($myData, ["itemNo" => $itemNo[$x], "description" => $ro->get_patient_charges_description()[$x], "sellingPrice" => $ro->get_patient_charges_sellingPrice()[$x], "quantity" => $ro->get_patient_charges_qty()[$x], "total" => $ro->get_patient_charges_total()[$x], "cashUnpaid" => $ro->get_patient_charges_cashUnpaid()[$x], "company" => $ro->get_patient_charges_company()[$x], "phic" => $ro->get_patient_charges_phic()[$x], "chargeBy" => $ro->get_patient_charges_chargeBy()[$x], "dateCharge" => $ro->formatDate($ro->get_patient_charges_dateCharge()[$x]), "timeCharge" => $ro->get_patient_charges_timeCharge()[$x], "checked" => $ro->get_patient_charges_checked()[$x]]); } $myJSON = json_encode($myData); echo $myJSON;