Example #1
0
    $info = array('employee_name' => $_GET['Employee_name'], 'start' => $_GET['Start'], 'end' => $_GET['End']);
    $response = $db->search_approval_details($info);
    echo json_encode($response);
} elseif (isset($_GET['search_product_details'])) {
    $db = new Database();
    $info = array('product_category_id' => $_GET['Product_category_id'], 'start' => $_GET['Start'], 'end' => $_GET['End']);
    $response = $db->search_product_stock($info);
    echo json_encode($response);
} elseif (isset($_GET['Generate_bill'])) {
    $db = new Database();
    $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->generate_bill($info);
} elseif (isset($_GET['Update_bill'])) {
    $db = new Database();
    $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);