ok

Mini Shell

Direktori : /home2/selectio/www/vijay-gases/apis/
Upload File :
Current File : //home2/selectio/www/vijay-gases/apis/get-search-purchase-edit.php

<?php 
ob_start();
session_start();
include"../config/config.php";
$condition='';
$get_pro_id =$_POST['pro_id'];
if($get_pro_id!=""){
	$condition.=" and id=".$get_pro_id;
}
$id = $_REQUEST['id'];
// $pr_statement = $pdo->prepare("SELECT *
// FROM `tbl_product`
// LEFT JOIN `tbl_purchase_item`
// ON `tbl_product`.`id` = `tbl_purchase_item`.`product_id` ");
// $pr_statement->execute();
// $pr_result = $statement->fetchAll(PDO::FETCH_ASSOC);
  



// $sql="SELECT * FROM tbl_product where 1=1 $condition"; 
// $statement = $pdo->prepare("SELECT * FROM tbl_product where 1=1 $condition");
// $statement->execute();
// $emp_data = $statement->fetchAll(PDO::FETCH_ASSOC);
// $totalData = $statement->rowCount();
$sql="SELECT * FROM tbl_product where 1=1 $condition"; 
$statement = $pdo->prepare("SELECT
    `tbl_product`.*,
    `tbl_product`.`id` AS pdt_id,
    `tbl_purchase_item`.*
FROM
    `tbl_product`
LEFT JOIN
    `tbl_purchase_item`
ON
    `tbl_product`.`id` = `tbl_purchase_item`.`product_id` where `tbl_product`.`id`= $id");
$statement->execute();
$emp_data = $statement->fetchAll(PDO::FETCH_ASSOC);
$totalData = $statement->rowCount();
error_log($totalData);
                                            
    
    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]['sku'].'" readonly/><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="product_name[]" class="form-control tip" id="product_name"  required="required" value="'.$emp_data[0]['product_name'].'" readonly/></td>
                                                <td><input type="text" name="purchase_rate[]" class="form-control tip" id="purchase_rate"  required="required" value="'.$emp_data[0]['purchase_price'].'" readonly/></td>
                                                <td><input type="text" name="sell_rate[]" class="form-control tip sell_rate" id="sell_rate"  required="required" value="0"/></td>
                                                <td><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>';
      }
?>

<script>
      $(document).on('click', '.remove_refill_cylinder', function() {
         
        $(this).closest('.remove_refill_cylinder_row').remove();
    });
</script>

Zerion Mini Shell 1.0