-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu.php
More file actions
72 lines (60 loc) · 1.77 KB
/
menu.php
File metadata and controls
72 lines (60 loc) · 1.77 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
/**
*
*/
class Menu
{
public function menu_generator()
{
include("site_dim.php");
include('db-config.php');
include_once("authenticate.php");
echo '<div class="site-menu">'.
'<div class="menu-logo"><a href="index.html">'.$site_subheader_1.' <span class="yellow">|</span> <b>'.$site_subheader_2.'</b></a></div>'.
'<div class="menu-nav">'.
'<ul>';
$query = "SELECT * FROM `$menu_table`";
$result = mysqli_query($dbc, $query)
or die("Failed to execute query!");
while($row = mysqli_fetch_array($result, MYSQLI_NUM))
{
if($row[1])
{
echo '<li><a href='.$row[1].'>'.$row[2].'</a></li>'.PHP_EOL;
}
}
if(logged_in())
{
echo '<li><a href="logout.php">LOGOUT</a></li>'.PHP_EOL;
}
else
{
echo '<li><a href="login.php">LOGIN<a></li>'.PHP_EOL;
}
echo '</ul>'.
'</div>'.
'<div class="menu-search">'.
'<form>'.
'<input name="search" type="text" placeholder="SEARCH">'.
'<button type="submit" class="search-btn"><i class="fa fa-search"></i></button>'.
'</form>'.
'</div>'.
'<div class="menu-footer">'.
'<ul class="social-icons nav-default clearfix">';
$query = "SELECT * FROM `$social_table`";
$result = mysqli_query($dbc, $query)
or die("Failed to execute query!");
while($row = mysqli_fetch_array($result, MYSQLI_NUM))
{
if($row[1])
{
echo '<li><a href='.$row[1].'><i class="'.$row[2].'"></i></a></li>'.PHP_EOL;
}
}
echo '</ul>'.
'<p>© '.$site_subheader_1.' | Architects Design Studio</p>'.
'</div>'.
'</div>';
}
}
?>