Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
File Manager
/
panel
/
ajax
:
getProductPrice.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php session_start(); include('../../config/database.php'); $orderInvoice = array(); $barcode = $_GET['barcode']; if(!empty($barcode)) { $sqlProduct = mysqli_query($cn,"select `id`,`distributor_price`,`image` from `tbl_product` where `barcode`='$barcode' and `status`=1"); if(mysqli_num_rows($sqlProduct)>0) { $sqlProductData = mysqli_fetch_array($sqlProduct); $sqlOrder = mysqli_query($cn,"select sum(qty) from `tbl_order` where `product_id`='".$sqlProductData['id']."'"); $sqlOrderData = mysqli_fetch_array($sqlOrder); $sqlProductStock = mysqli_query($cn,"select * from `tbl_barcode` where `barcode`='$barcode'"); $stock = mysqli_num_rows($sqlProductStock) - $sqlOrderData['sum(qty)']; $imgAll = explode('$',$sqlProductData['image']); $arr = array("status"=>1, 'distributorPrice'=>$sqlProductData['distributor_price'], 'img'=>$imgAll[0],'stockQty'=>$stock); echo json_encode($arr); } else { $arr = array("status"=>2, 'Msg'=>"Barocde Not Found."); echo json_encode($arr); } } else { $arr = array("status"=>2, 'Msg'=>"Enter correct barcode."); echo json_encode($arr); } ?>