-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin_home.php
160 lines (137 loc) · 6.51 KB
/
admin_home.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<?php
session_start();
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
require_once('connection_pdo.php');
if (!isset($_SESSION['username_admin'])) {
header("location:admin_login.php");
exit();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Homepage</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-4bw+/aepP/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9" crossorigin="anonymous">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-icons/1.10.5/font/bootstrap-icons.min.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<!-- navbar section -->
<header class="navbar-section">
<nav class="navbar navbar-expand-lg">
<div class="container-fluid">
<a class="navbar-brand" href="#"></i> Debating Tool</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link" href="new_speaker.php">new speaker</a>
</li>
<li class="nav-item">
<a class="nav-link" href="new_team.php">new team</a>
</li>
<li class="nav-item">
<a class="nav-link" href="zert.php">certificates</a>
</li>
<li class="nav-item">
<a class="nav-link" href="postlogin.php">admintool</a>
</li>
<li class="nav-item">
<a class="nav-link" href="signup.php">Signup</a>
</li>
<li class="nav-item">
<div class="dropdown">
<a class='nav-link dropdown-toggle' href='edit.php?id=$res_id' id='dropdownMenuLink'
data-bs-toggle='dropdown' aria-expanded='false'>
<i class='bi bi-person'></i>
</a>
<ul class="dropdown-menu mt-2 mr-0" aria-labelledby="dropdownMenuLink">
<li>
<?php
// Fetch user information using $connection_pdo
$id = $_SESSION['id_admin'];
$stmt = $connection_pdo->prepare("SELECT * FROM users_admin WHERE id = :id");
$stmt->execute([':id' => $id]);
$result = $stmt->fetch(PDO::FETCH_ASSOC);
if ($result) {
//undefinded ??
//$res_username = $result['username_admin'];
//$res_email = $result['email'];
$res_id = $result['id'];
echo "<a class='dropdown-item' href='admin_edit.php?id=$res_id'>Change Profile</a>";
}
?>
</li>
<li><a class="dropdown-item" href="logout.php">Logout</a></li>
</ul>
</div>
</li>
</ul>
</div>
</div>
</nav>
</header>
<section>
<h2>Results SR</h2>
<div class="row">
<div class="col-md-6">
<iframe src="chart_playermaxpointsSR.php" width="100%" height="300px"></iframe>
</div>
<div class="col-md-6">
<iframe src="chart_teampointsSR.php" width="100%" height="300px"></iframe>
</div>
</div>
</section>
<section>
<h2>Results JR:</h2>
<div class="row">
<div class="col-md-6">
<iframe src="chart_playermaxpointsJR.php" width="100%" height="300px"></iframe>
</div>
<div class="col-md-6">
<iframe src="chart_teampointsJR.php" width="100%" height="300px"></iframe>
</div>
</div>
</section>
<!-- footer section -->
<footer>
<div class="container">
<div class="row">
<div class="col-lg-4 col-md-12 col-sm-12">
<p class="logo"></i> Debating Tool</p>
</div>
<div class="col-lg-5 col-md-12 col-sm-12">
<ul class="d-flex">
<li><a href="resultsJR.php">results jr.</a></li>
<li><a href="resultsSR.php">results sr.</a></li>
<li><a href="team_results.php">Team Results</a></li>
</ul>
</div>
<div class="col-lg-2 col-md-12 col-sm-12">
<p>©
<a href="https://github.com/Cybersky4" target="_blank" style="color: inherit; text-decoration: underline;">2024_Cyber</a>,
<a href="https://github.com/silverhadch" target="_blank" style="color: inherit; text-decoration: underline;">Hadi</a>
</p>
</div>
<div class="col-lg-1 col-md-12 col-sm-12">
<!-- back to top -->
<a href="#" class="back-to-top d-flex align-items-center justify-content-center"><i
class="bi bi-arrow-up-short"></i></a>
</div>
</div>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-HwwvtgBNo3bZJJLYd8oVXjrBZt8cqVSpeBNS5n7C8IVInixGAoxmnlMuBnhbgrkm"
crossorigin="anonymous"></script>
</body>
</html>