ok
Direktori : /home2/selectio/www/vijay-gases/apis/ |
Current File : /home2/selectio/www/vijay-gases/apis/customer_sale-search-api.php |
<?php ob_start(); session_start(); include"../config/config.php"; $cond='where 1=1 '; $search=""; $old_sales = $_REQUEST['old_sales']; if(isset($_REQUEST['search_text'])){ $search .=$_REQUEST['search_text']; } if($old_sales=="Old_Sales_Product_Type_Not_Equal_2"){ $cond .= "AND tbl_product.product_type!=2"; }else{ $cond .= "AND tbl_product.product_type=1"; } $cond .= " AND (tbl_gas.gas_name like '%" . $search . "%' OR tbl_product.cylinder_no like '%" . $search . "%' OR tbl_product.sku like '%" . $search . "%')"; error_log("SELECT tbl_product.*,tbl_gas.gas_name FROM tbl_product LEFT JOIN tbl_gas ON tbl_product.product_name=tbl_gas.id $cond and tbl_product.product_type=1"); $statement = $pdo->prepare("SELECT tbl_product.*,tbl_gas.gas_name FROM tbl_product LEFT JOIN tbl_gas ON tbl_product.product_name=tbl_gas.id $cond"); $statement->execute(); $emp_data = $statement->fetchAll(PDO::FETCH_ASSOC); $totalData = $statement->rowCount(); /*INR Symbolâ‚ą*/ if($totalData>0){ foreach($emp_data as $res){ echo '<div onclick="product_selections('.$res['id'].')"> Product Name : '.$res['gas_name'].' <br> Cylinder No : '.$res['cylinder_no'].' <br> </div>'; } }else{ echo '<div><center> No Data Found...</center><div>'; } ?>