-
Notifications
You must be signed in to change notification settings - Fork 0
/
search_results.php
87 lines (39 loc) · 1.61 KB
/
search_results.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
37
38
39
40
41
42
43
44
<?php
require_once $dir_requires_mobile.'header.php';
require_once $dir_requires_mobile.'navbar.php';
?>
<div data-role="content" data-theme="a">
<p><?php echo $keywords;?></p>
<?php
if ($search->total_results != 0) {
foreach ($results as $result){
$item = Item::find_by_id('id', $result->id);
$photo = Photograph::find_by_id('item_id', $item->id);
echo '<ul data-role="listview" data-inset="true" data-divider-theme="a">
<li data-role="list-divider">'.$item->title.'</li>
<li>
<a href="viewitem.php?title='.str_replace(' ', '_', trim($item->title)).'&item_id='.$result->id.'">
<img src="'.$photo->image_path_thumb().'" alt="'.$item->title.'" id="productBox">
<p>₹'.number($item->cost).'</p>
<p class="pull-right">'.$item->viewed.' reviews</p>
</a>
</li>
</ul>';
}
//pagination's navigation
echo '<div data-role="footer" data-theme="a">';
if(!empty($keywords)) {
if ($pagination->total_pages() > 1) {
if ($pagination->has_previous_page()) {
echo '<a rel="prev" href="search_results.php?keywords='.$keywords.'&page='.$pagination->previous_page().'" data-role="button" data-icon="arrow-l" data-iconpos="right">Previous</a>';
}
if ($pagination->has_next_page()) {
echo '<a rel="next" href="search_results.php?keywords='.$keywords.'&page='.$pagination->next_page().'" data-role="button" data-icon="arrow-r" data-iconpos="right">Next</a>';
}
}
}
echo '</div>';
}
?>
</div>
<?php require_once $dir_requires_mobile.'footer.php';?>