-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.php
executable file
·33 lines (30 loc) · 1.11 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
<!DOCTYPE html>
<html lang="en">
<head>
<title> Drinkathon </title>
<link rel="stylesheet" type="text/css" href="/css/style.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css" integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
</head>
<body>
<nav class="main-nav">
<ul>
<li><a href="/"> Home </a></li>
<li><a href="/about"> About </a></li>
<li><a href="/questions"> Questions </a></li>
<?php
if( !isset($_SESSION['loggedin']) || !$_SESSION['loggedin']){ ?>
<li><a href="/register"> Register </a></li>
<li><a href="/login"> Login </a></li>
<?php } else {
$sql='select * from teams where id='.$_SESSION['team_id'];
if($res = $db->query($sql)){
$username = $res->fetch_assoc()['name'];
}
?>
<li><a href="/team"> Team </a></li>
<li><a href="/choose_question"> Submit</a></li>
<li><a href="/logout"> Logout: <?php echo $_SESSION['team_name']; ?> </a></li>
<?php } ?>
</ul>
</nav>