ok
Direktori : /home2/selectio/public_html/vijay-gases/apis/ |
Current File : /home2/selectio/public_html/vijay-gases/apis/get-search-purchase.php |
<?php ob_start(); session_start(); include"../config/config.php"; $condition=''; $pro_cylinder_no =$_POST['pro_cylinder_no']; $cylinder_type =$_POST['cylinder_type']; if($pro_cylinder_no!="" && $cylinder_type!=''){ $condition.=" and tbl_product.cylinder_no='".$pro_cylinder_no."' and tbl_product.product_name='".$cylinder_type."'"; } $sql="SELECT tbl_product.*,tbl_gas.gas_name,tbl_gas.hsn_code FROM tbl_product LEFT JOIN tbl_gas ON tbl_product.product_name=tbl_gas.id where 1=1 and tbl_product.product_type=3 $condition"; error_log("Product Append Query".$sql); $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 where 1=1 and tbl_product.product_type=3 $condition"); $statement->execute(); $emp_data = $statement->fetchAll(PDO::FETCH_ASSOC); $totalData = $statement->rowCount(); if($totalData>0){ echo'<tr class="remove_refill_cylinder_row"> <td><input type="text" name="sku_no[]" class="form-control tip" id="sku_no" required="required" value="'.$emp_data[0]['hsn_code'].'" /> <input type="hidden" name="product_id[]" class="form-control pro_ids tip" id="product_id" required="required" value="'.$emp_data[0]['id'].'" /></td> <td><input type="text" name="cylinder_no[]" class="form-control tip cylinder_no" id="cylinder_no" required="required" value="'.$emp_data[0]['cylinder_no'].'" readonly/></td> <td><input type="text" name="product_name[]" class="form-control tip" id="product_name" required="required" value="'.$emp_data[0]['gas_name'].'" readonly/></td> <td hidden><input type="text" name="quantity[]" class="form-control tip" id="quantity" value="1" required="required" readonly /></td> <td><center><span class="btn btn-danger btn-sm remove_refill_cylinder" style="width:100%;height:33px;"><i class="fa fa-trash-o" style="font-size:14px;"></i></span></center></td> </tr>'; } else{ echo'<script>alert("This Cylinder Number Product Is Not Found!!!!")</script>'; } ?> <script> $(document).on('click', '.remove_refill_cylinder', function() { $(this).closest('.remove_refill_cylinder_row').remove(); }); </script>