-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu.php
More file actions
21 lines (20 loc) · 897 Bytes
/
menu.php
File metadata and controls
21 lines (20 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<div class="aside">
<ul>
<?
$result = mysqli_query($conn,"SELECT * FROM categories");
while($row = mysqli_fetch_array($result)): ?>
<li>
<a href="?category_id=<?= $row['id']; ?>&page=1" class="<? if(isset($_GET['category_id']) && $_GET['category_id'] == $row['id']) echo 'menu-highlight';?>"><?= $row['name']; ?></a>
</li>
<? endwhile; ?>
<? if(isset($_GET['category_id'])): ?>
<a href="?category_id=<?= $_GET['category_id']; ?>&page=<?= (($_GET['page']) % ($_SESSION['totalpage']+1) == 1) ? $_SESSION['totalpage'] : $_GET['page'] - 1; ?>"class="prev">
<img src="lightbox/images/prev.png">
</a>
<? endif; ?>
</ul>
<form action="search.php" method="GET" class="search-form" autocomplete="off">
<input type="text" name="search-term">
<input type="submit" value="Search">
</form>
</div>