-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdashboard.php
92 lines (92 loc) · 5.36 KB
/
dashboard.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
87
88
89
90
91
92
<?php
// Comme la page controler.php n'a pas encore été incluse via le fichier nav-bar.php on start la session pour vérifier si l'user est connecté
session_start();
if ($_SESSION['connected']) {
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="assets/css/style.css">
<link href="https://fonts.googleapis.com/css?family=Exo+2&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="assets/js/app.js"></script>
<title>FA Automobile | Dashboard</title>
</head>
<body>
<?php include('assets/inc/nav-bar.php'); ?>
<main>
<div class="dashboard-nav">
<ul>
<li class="active nav-account">Mon compte</li>
<?php
if ($_SESSION['admin']) {
?>
<li class="nav-admin">Admin</li>
<?php
}
?>
<li class="nav-activity">Mon activité</li>
</ul>
</div>
<section class="account">
<span>Nom: <?php echo $_SESSION['first_name']; ?></span>
<span>Prénom: <?php echo $_SESSION['second_name']; ?></span>
<span>Adresse mail: <?php echo $_SESSION['mail']; ?></span>
<?php
if ($_SESSION['admin']) {
?>
<span>Vous êtes admin !</span>
<?php
}
?>
<div class="btn-group-action">
<a href="modify-account.php">
<button class="btn btn-warning">Modifier mes informations</button>
</a>
<a href="controler.php?action=delete">
<button class="btn btn-danger">Supprimer mon compte</button>
</a>
</div>
</section>
<?php
if ($_SESSION['admin']) {
?>
<section class="admin hidden">
<h2>Ajouter une marque</h2>
<form action="controler.php" method="POST">
<input type="text" class="form-control" name="mark" placeholder="Marque du véhicule" required>
<input type="submit" class="btn btn-success" name="submit-mark" value="Ajouter">
</form>
<h2>Ajouter un véhicule</h2>
<form action="controler.php" method="POST" enctype="multipart/form-data">
<select name="mark-select" class="form-control">
<option value="0">Marque du véhicule</option>
<?= $v_marks ?>
</select>
<input type="text" class="form-control" name="model" placeholder="Modèle" required>
<textarea name="description" class="form-control" placeholder="Description" required></textarea>
<input type="number" class="form-control" name="price" placeholder="Prix" required>
<input type="number" class="form-control" name="year" placeholder="Année" required>
<input type="file" class="form-control" name="picture" accept="image/png, image/jpeg, image/jpg" required>
<input type="submit" class="btn btn-success" name="submit-vehicle" value="Ajouter">
</form>
</section>
<?php
}
?>
<section class="activity hidden">
<?= $historic ?>
</section>
</main>
<?php include('assets/inc/footer.php'); ?>
</body>
</html>
<?php
} else {
header('Location: login.php');
}
?>