0byt3m1n1
Path:
/
home
/
k74ns2xygros
/
www
/
globetech
/
cms
/
letter
/
[
Home
]
File: getVendor.php
<?php session_start(); error_reporting(0); include "../assets/config.php"; $user = new User(); $admin_cid = $_SESSION['admin_cid']; $company_id = $_SESSION['company_id']; $search = $_POST['searchTerm']; $ep_entity_type = $_POST['ep_entity_type']; try { if (!isset($search)) { $emp_sql = "SELECT * FROM vendor_details WHERE company_id='$company_id' AND status IN ('ACTIVE') AND ep_entity_type='$ep_entity_type' ORDER BY ep_name ASC LIMIT 100"; } else { $emp_sql = "SELECT * FROM vendor_details WHERE company_id='$company_id' AND status IN ('ACTIVE') AND (ep_name LIKE '%" . $search . "%' or ep_contact_no LIKE '%" . $search . "%') AND ep_entity_type='$ep_entity_type' ORDER BY ep_name ASC LIMIT 100"; } echo$emp_sql; $emp_qu_sq = mysqli_query($user->conn, $emp_sql); $data = array(); while ($row = mysqli_fetch_array($emp_qu_sq)) { // $empDet = $row['ep_name'] . ", Mobile : " . $row['ep_contact_no'] . ", Working Place : " . $row['electrycity_zone']; $empDet = $row['ep_name'] . ", Mobile : " . $row['ep_contact_no']; $data[] = array("id" => $row['ep_id'], "text" => $empDet); } echo json_encode($data); } catch (PDOException $e) { echo json_encode(array("error" => $e->getMessage())); } ?>