-
Notifications
You must be signed in to change notification settings - Fork 2
/
search.php
37 lines (24 loc) · 890 Bytes
/
search.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/**
* @author James Baster <[email protected]>
* @copyright City of Edinburgh Council & James Baster
* @license Open Source under the 3-clause BSD License
* @url https://github.com/City-Outdoors/City-Outdoors-Web
*/
/**if (!isset($_GET['search']) || !trim($_GET['search'])) {
header("Location: /");
die();
}**/
require 'includes/src/global.php';
$currentUser = getCurrentUser();
$tpl = getSmarty($currentUser);
$collectionSearch = new CollectionSearch();
$tpl->assign('collections', $collectionSearch->getAllResultsIndexed());
$page = isset($_GET['page']) ? max(intval($_GET['page']),1) : 1;
$itemSearch = new ItemSearch();
$itemSearch->setPaging($page, 10);
$itemSearch->freeTextSearch($_GET['search']);
$itemSearch->includeChildCollections();
$tpl->assign('itemSearch',$itemSearch);
$tpl->assign('searchTerm',$_GET['search']);
$tpl->display('search.htm');