-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.php
71 lines (53 loc) · 2.36 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
<div class="header clearfix">
<nav>
<ul class="nav nav-pills pull-right">
<li id="index" role="presentation" ><a href="index.php">Home</a></li>
<li id="about" role="presentation" ><a href="About.php" >About</a></li>
<?php
if(isset($_SESSION["id"])){
echo '<li style="display:none" id="signin" role="presentation"><a href="#">Sign in</a></li>';
echo '<li id="account" role="presentation"><a href="account.php?userName='.$_SESSION["username"].'" >Account</a></li>';
echo '<li role="presentation"><a href="logout.php" >Logout</a></li>';
if($_SESSION["privileges"] == 1){//Admin
echo '<li id="backoffice" role="presentation"><a href="backoffice.php">BackOffice</a></li>';
}
}
else{
echo '<li style="display:block" id="signin" role="presentation"><a href="#">Sign in</a></li>';
echo '<li role="presentation">';
echo '<div id="signInForm" style="display:none">';
echo '<form id="account" action="account.php" method="post" enctype="multipart/form-data">';
echo '<div class="form-group">';
echo '<input type="text" class="form-control" name="name" placeholder="username" style="width:8em">';
echo '</div>';
echo '<div class="form-group">';
echo '<input type="password" class="form-control" name="password" placeholder="password" style="width:8em">';
echo '</div>';
echo '<input type="Submit" name="formSignIn" value="Submit" class="btn btn-lg btn-success" formmethod="post"/>';
echo '</form>';
echo '</div>';
echo '</li>';
echo '<li id="createaccount" role="presentation"><a href="createAccount.php">Sign up</a></li>';
}
echo '<li id="leaderboard" role="presentation"><a href="leaderboard.php" >Leaderboard</a></li>';
?>
</ul>
</nav>
<h3 class="text-muted">Rhoban Tagger</h3>
<h5 class="text-muted" style="margin-top:-0.8em ; color:red" >Beta</h5>
<script type="text/javascript">
var signInFormVisible = false;
$('#signin').click(function(){
if(signInFormVisible)
$('#signInForm').slideUp();
else
$('#signInForm').slideDown();
signInFormVisible = !signInFormVisible;
});
var pageName = location.pathname;
pageName = pageName.split("/");
pageName = pageName[2].split('.');
pageName = pageName[0].toLowerCase();
$("#"+pageName).addClass("active");
</script>
</div> <!-- header -->