-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathadmin.php
More file actions
137 lines (99 loc) · 3.6 KB
/
Copy pathadmin.php
File metadata and controls
137 lines (99 loc) · 3.6 KB
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
<!DOCTYPE html>
<html>
<head>
<title>admin|panel</title>
<!-- include external files -->
<?php include 'header.php';?>
<link rel="icon" href="src/images/logo.jpeg" type="image/x-icon">
<style type="text/css">
.button{
margin: 0;
}
</style>
<?php
include 'backend/sqlConnect.php';
$connOk = connectDB(); // db connection
// SQL
$sqlNumOfContestants = "SELECT COUNT(*) AS totalContestants FROM contestant;";
$sqlNumOfusers = "SELECT COUNT(*) AS totalUsers FROM registered_user;";
// counting contestants number
$result1 = $connOk->query($sqlNumOfContestants); // getting total count of contestants
// fetching results
$totalCountsGot = $result1->fetch_assoc();
$allCon = $totalCountsGot['totalContestants'];
// counting user number
$result2 = $connOk->query($sqlNumOfusers); // getting total count of users
// fetching results
$totalUserssGot = $result2->fetch_assoc();
$allUsers = $totalUserssGot['totalUsers'];
//fetching vote session status
//sql
$sql2 ="SELECT * FROM session;";
//execute
$result2=$connOk->query($sql2);
//fetching results
$sStatus =$result2->fetch_assoc();
$status=$sStatus['status'];
?>
</head>
<body>
<!-- main section 1-->
<div class="row admin-bg" style="padding-left: 0;width: 100%;">
<!-- first column from left -->
<div class="col-3 " style="background-color:#2B2024;height: 100vh;color: white;padding-top: 5%;">
<h1 class="display-1" style="text-align: center;color:#FD0054;font-size: 3rem;">Admin Panel</h1><br><br>
<!-- logout butn -->
<a href="index.php" class="button" style="margin: 0;margin-left: 40%;">Log Out</a>
</div>
<!-- first column end -->
<!-- second column -->
<div class="col-3 ">
<center>
<!-- handle contestants -->
<div class="container-admin">
<h2 class="display-2"> Handle contestants</h2>
<br><br>
<a href="forms/addcontestants.php" class="button">Add contestant</a><br><br>
<a href="adminFunctions/seeContestants.php" class="button">see contestants</a>
</div>
<!-- contestant details -->
<div class="container-admin" style="height: 400px;">
<h2 class="display-2"> Contestants</h2>
<br><br>
<h1 class="display-2" style="color: #84626e;">Number of Contestants :</h1>
<h1 class="display-2" style="color: #FD0054;"><?php echo $allCon;?></h1>
<br><br>
<h1 class="display-2" style="color: #84626e;">Number of users :</h1>
<h1 class="display-2" style="color: #FD0054;"><?php echo $allUsers;?></h1>
</div>
</center>
</div>
<!-- second column ends -->
<div class="col-3 ">
<center>
<!-- handling vots -->
<div class="container-admin" >
<h2 class="display-2"> Handle votes</h2>
<br><br>
<a href="adminFunctions/checkVotes.php" class="button">votes</a><br><br>
<a href="adminFunctions/createVoteSession.php" class="button">Voting Sessions</a>
<a href="adminFunctions/seeVoteSession.php" class="button">session history</a>
</div>
<!-- vote session details -->
<div class="container-admin" >
<h2 class="display-2"> Vote session</h2>
<br><br>
<h1 class="display-2" style="color: #84626e;">Session is :</h1>
<h1 class="display-2" style="color: #FD0054;"><?php echo $status;?></h1>
</div>
</center>
</div>
<!-- second column end -->
<!-- third column -->
<div class="col-3" style="background-color:#f4f0f2">
</div>
<!-- third column end -->
</div>
<!-- main section 1 ends -->
</body>
</html>