<?php
session_start();
require_once "../../../config.php";
require_once "../../../validation.php";
require_once "../../../Helper.php";

require_once '../../database1.php';
require_once "../../check_admin.php";

class addAjax extends database
{
   public function index($name)
    {
    	 $sql = " SELECT * FROM user WHERE (cl_name LIKE  '" . $name . "%' OR username LIKE  '" . $name . "%' OR email LIKE '" . $name . "%') AND cl_deleted_at IS NULL AND user_type='customer' LIMIT 0, 25";
        return $this->callQuery($sql);
    }
}


$obj = new addAjax();
if(!isset($_POST['name']))
{
	http_response_code(400);
	echo json_encode(array('No input found'));
	exit;
}

$name = $_POST['name'];


$users = $obj->index($name);


http_response_code(200);
echo json_encode($users);
exit;