<?php 
include "../config.php";
if(isset($_POST['lr_no'])){
    $search = $_POST['lr_no'];
    $query = "SELECT * FROM lr_mst WHERE lr_no like '%$search%' AND lhc_status = 'N' AND company_id = '".$_SESSION['company_id']."' AND branch_id = '".$_SESSION['branch_id']."' GROUP BY lr_no";
    $result = mysqli_query($conn,$query);
    while($row = mysqli_fetch_assoc($result) ){
        $response[] = $row;
    }

    if(mysqli_num_rows($result) != 0) {
		$data = array('status' => 1);
	} else {
		$data = array('status' => 0);
	}

	echo json_encode($data);
	die();
}