<?php
include('../config/dbcon.php');
if(isset($_POST['supplier_code'])){
	$supplier_code=$_POST['supplier_code'];
	$update = mysqli_query($connect,"update suppsegment_mst set supplier_code = '".$supplier_code."'") or die(mysqli_error());	
	$query = "SELECT * FROM supplier_mst WHERE Lower(supplier_code) = Lower('".$supplier_code."')";
    $result = mysqli_query($connect,$query);    
    while($row = mysqli_fetch_array($result) ){		
        $response[] = array("label"=>$row['supplier_name'],"value"=>$row['supplier_code'],"supplier_place"=>$row['supplier_place'],"tax_code"=>$row['tax_code'],"supplier_gstno"=>$row['supplier_gstno'],"transporter_name"=>$row['transporter_name'],"opening"=>$row['opening'],"debit"=>$row['debit'],"credit"=>$row['credit'],"clbalance"=>$row['clbalance'],"supplier_address_one"=>$row['supplier_address_one'],"supplier_address_two"=>$row['supplier_address_two'],"supplier_address_three"=>$row['supplier_address_three'],"supplier_pin_code"=>$row['supplier_pin_code'],"supplier_phone"=>$row['supplier_phone'],"supplier_mobile"=>$row['supplier_mobile'],"supplier_st_code"=>$row['supplier_st_code'],"supplier_pan_no"=>$row['supplier_pan_no'],"supplier_email"=>$row['supplier_email'],"supplier_aadhar_no"=>$row['supplier_aadhar_no'],"supplier_st_name"=>$row['supplier_st_name'],"due_days"=>$row['due_days']);		
    }
    echo json_encode($response);
}
exit;
?>