Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header("Cache-Control: no-store, no-cache, must-revalidate");
- header("Cache-Control: post-check=0, pre-check=0", false);
- require_once '../../../../conf.php';
- require_once $_root_dir . 'db.php';
- require_once $_root_dir . 'includes/functions.php';
- require_once $_root_dir . 'includes/template.php';
- //print_r($_POST);
- if (!isset($_SESSION['status']) || $_SESSION['status'] != "login" || $_SESSION['ip'] != $_ip)
- return -1;
- $folder = $_POST['folder'];
- $page = $_POST['page'];
- $query = (isset($_POST['query']) ? addslashes($_POST['query']) : '');
- $contacts = NULL;
- $sql = "select * from contacts " .
- "where name like '%{$query}%' or surename like '%{$query}%' or company like '%{$query}%' or phone1 like '%{$query}%' limit 10";
- if (($result = $db->sql_query($sql)) && $db->sql_numrows($result) > 0) {
- $contacts = $db->sql_fetchrowset($result);
- }
- $params = array(
- 'contacts' => $contacts
- );
- echo json_encode($params);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement