-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.php
68 lines (61 loc) · 2.79 KB
/
index.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
<?php require_once 'bootstrap.php'; ?>
<!DOCTYPE html>
<html>
<head>
<title>Invoice Database</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="style.css">
<link rel="icon" type="image/ico" href="favicon.ico"/>
</head>
<body>
<div id="header">
<h1>Linguagens e Tecnologias Web</h1>
<h2>Invoice database</h2>
</div>
<div id="menu">
<ul id="menuList">
<li><a href="index.php">Home</a></li>
<?php
if(isset($_SESSION['permissions']) && isset($_SESSION['username']) && $_SESSION['permissions']['read'] == '1') {
echo '<li><a href="invoices.php">Invoices</a></li>';
echo '<li><a href="customers.php">Customers</a></li>';
echo '<li><a href="products.php">Products</a></li>';
}
if(isset($_SESSION['permissions']) && isset($_SESSION['username']) && $_SESSION['permissions']['promote'] == '1') {
echo '<li><a href="users.php">Users</a></li>';
}
if(isset($_SESSION['permissions']) && isset($_SESSION['username']) && $_SESSION['permissions']['write'] == '1') {
echo '<li><a href="importAndExport.php">Import and Export</a></li>';
}
?>
</ul>
<div class="login">
<?php
$sessionEmpty = empty($_SESSION["username"]);
if($sessionEmpty) {
echo '<form method="post" action="login.php">';
echo '<ul id="loginMenu">';
echo '<li><input type="text" name="login" pattern="^[A-Za-z][A-Za-z0-9]{4,29}$" value="" placeholder="Username or Email"></li>';
echo '<li><input type="password" name="password" value="" placeholder="Password"></li>';
echo '<li class="submit"><input type="submit" name="commit" value="Login"></li>';
echo '<li class="loginHelp"> <a href="register.html">Register</a></li>';
echo '</ul>';
echo '</form>';
}
else {
echo 'Welcome back, <strong>' . $_SESSION["username"] . '</strong>!';
echo ' <a href="logout.php">Logout</a>';
}
?>
</div>
</div>
<div id="content">
<h2>Mestrado Integrado em Engenharia Informática e Computação<br>2013 / 2014</h2>
<h2>Group:</h2>
Diogo Ribeiro Gomes dos Santos <br><strong> [email protected]</strong> <br><br>
João Fernando de Sousa Almeida <br><strong> [email protected]</strong> <br><br>
Pedro Ricardo Oliveira Fernandes <br><strong> [email protected]</strong> <br><br>
Sara Filipa Mendes da Silva <br><strong> [email protected]</strong> <br><br>
</div>
</body>
</html>