$info = array('bill_no' => $_GET['Bill_no'], 'name' => $_GET['Name'], 'payment_mode' => $_GET['Payment_mode'], 'barcode' => $_GET['Barcode'], 'available' => $_GET['Available'], 'qty' => $_GET['Qty'], 'rate' => $_GET['Rate'], 'total' => $_GET['Total'], 'grand_total' => $_GET['Grand_total']); $response = $db->update_bill($info); } elseif (isset($_GET['For_approval'])) { $db = new Database(); $info = array('bill_no' => $_GET['Bill_no'], 'name' => $_GET['Name'], 'contact_no' => $_GET['Contact_no'], 'barcode' => $_GET['Barcode'], 'available' => $_GET['Available'], 'qty' => $_GET['Qty'], 'rate' => $_GET['Rate'], 'total' => $_GET['Total'], 'grand_total' => $_GET['Grand_total']); $response = $db->generate_bill_for_approval($info); } elseif (isset($_GET['Search_barcode'])) { $db = new Database(); $barcode = $_GET['Barcode']; $search_barcode_values = $db->barcode_search($barcode); echo json_encode($search_barcode_values); } elseif (isset($_GET['Bill_search'])) { $db = new Database(); $search_bill_no = $_GET['Search_bill_no']; $search_name = $_GET['Search_name']; $response = $db->search_bill($search_bill_no, $search_name); echo json_encode($response); } elseif (isset($_GET['pay_amount'])) { $db = new Database(); $bill_no = $_GET['bill_no']; $name = $_GET['name']; $amount = $_GET['amount']; $response = $db->updateCreditInfo($bill_no, $name, $amount); echo json_encode($response); } elseif (isset($_GET['pay_commision'])) { $db = new Database(); $name = $_GET['name']; $commision = $_GET['commision']; $response = $db->updateCommision($name, $commision); echo json_encode($response); } elseif (isset($_GET['credit_bill_search'])) {