-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch.php
More file actions
16 lines (16 loc) · 736 Bytes
/
search.php
File metadata and controls
16 lines (16 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
require_once 'core/init.php';
require_once 'helpers.php';
/**
* @var PDO $con
* @var Array $categories
* @var bool is_auth
*/
$searchText = filter_input(INPUT_GET,'search',FILTER_SANITIZE_STRING);
$stmt = $con->prepare('SELECT l.*,c.title AS title FROM lots l JOIN categories c ON l.id_category = c.id WHERE MATCH(l.good_name, good_discription) AGAINST (:searchText)');
$stmt->execute(['searchText'=>$searchText]);
$searchLots= $stmt->fetchAll();
$searchContent = include_template('main-template.php',['is_auth'=>$is_auth, 'categories'=>$categories, 'goods'=>$searchLots]);
$page = include_template('layout.php',['is_auth'=>$is_auth,'content'=>$searchContent,'categories'=>$categories,'user_name'=>$user_name]);
echo $page
?>