-
Notifications
You must be signed in to change notification settings - Fork 2
/
header.php
86 lines (73 loc) · 2.56 KB
/
header.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
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!--
File Name: header.php
Author's Name: Sukhdeep Singh, Nav Bhullar
Web Site Name: Tourney Bracket
File Description: This Page Contains the Consistent Nav Bar for the Site
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Tourney Brackets</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link href='http://fonts.googleapis.com/css?family=Quicksand' rel='stylesheet' type='text/css'>
<!-- Bootstrap CSS -->
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="../assets/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<nav class="navbar navbar-inverse" role="navigation">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Tourney Bracket</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li>
<a href="index.php">Home</a>
</li>
<li>
<a href="tournament.php">Tournaments</a>
</li>
<?php
//access current session
session_start();
if (empty($_SESSION['user_id'])) {
} else {
$conn = mysqli_connect('webdesign4', 'dbxxxxxxxxx', 'xxxxx', 'dbxxxxxxxxx') or die('Error connecting to MySQL server');
$query = "SELECT * FROM tourney_admins";
$userID = $_SESSION['user_id'];
$sql = "SELECT email,username FROM tourney_admins where id = $userID";
$result = mysqli_query($conn, $query);
$email = mysqli_query($conn, $sql);
while ($address = mysqli_fetch_array($email)) {
$emailAddress = $address['email'];
$user = $address['username'];
}
while ($row = mysqli_fetch_array($result)) {
if ($emailAddress == $row['email']) {
echo '<li>';
echo '<a href="user_home.php">' . $user . '</a>';
echo '</li>';
}
}
mysqli_close($conn);
}
?>
</ul>
</div><!--/.nav-collapse -->
</nav>
<div class="container">