-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadmin.php
273 lines (240 loc) · 6.87 KB
/
admin.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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
<?php
$s_name = "localhost";
$username = "root";
$password = "";
$connection = mysqli_connect($s_name,$username,$password,"e_voting");
if(!$connection)
{
echo "not connected";
}
else{
?>
<!DOCTYPE html>
<html>
<body>
<script>
alert("you are logged in successfully");
</script>
</body>
</html>
<?php
}
?>
<html>
<head>
<style>
body {
margin: 0;
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
width: 25%;
background-color: #f1f1f1;
position: fixed;
height: 50%;
overflow: auto;
}
li a {
display: block;
color: #000;
padding: 8px 0 8px 16px;
text-decoration: none;
}
li a.active {
background-color: #4CAF50;
color: white;
}
li a:hover:not(.active) {
background-color: #555;
color: white;
}
#admin {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
height: 25px;
background-color: black;
color: white
}
#constituency,#approve,#contestor,#result,#id01,#id02,#id03{
display: none;
}
.divs{
margin-left:25%;
padding:1px 16px;
height:50%;
background-color: #555;
}
#logout{
position: right;
}
</style>
</head>
<body>
<div>
<?php
session_start();
$ad_id = $_POST["ad_id"];
$_SESSION["ad_id"]=$ad_id;
echo $ad_id;
?>
</div>
<ul>
<li><a onclick="disp1()">Constituency</a></li>
<li><a onclick="disp2()">Approve Nominations</a></li>
<li><a onclick="disp3()">Contestors List</a></li>
<li><a onclick="disp4()">Result</a></li>
<li><a onclick="disp5()">Display Details</a></li>
<li><a href="index.html">Logout</a></li>
</ul>
<div id="constituency" class="divs">
<h1>hELLO</hELLO>
<?php
echo "gaja";
$ad_id = $_POST["ad_id"];
$pwd = $_POST["pwd"];
$query = "select con_id,con_name
from constituency where ad_id = '$ad_id' ";
$qr = mysqli_query($connection,$query);
?>
<html><body><table><tr>
<th>Constituency ID</th>
<th>Constituency Name</th>
</tr>
<?php
while($row = mysqli_fetch_array($qr))
{
?><tr>
<td><?php echo $row[0]; ?></td>
<td><?php echo $row[1];?></td>
</tr>
<?php
}?>
</table>
</body>
</html>
<?php
// $query = "select ad_id,ad_pwd from admn";
// $qr = mysqli_query($connection,$query);
// while($row = mysqli_fetch_array($qr))
// {
// if($row[0]==$ad_id && $row[1]==$pwd)
// {
// session_start();
// $_SESSION["ad_id"]=$ad_id;
// $_SESSION["pwd"]=$pwd;
// // include 'adminpage1.php';
// // header("location:./adminpage1");
// }
// }
?>
</div>
<div id="approve" class="divs" >
<label for="con_id"><b>Constituecny ID</b></label></br>
<form action="nominee.php" method="POST">
<input type="text" placeholder="Enter Constituency ID" name="con_id">
<input type="submit" />
</form>
<!-- <button type="button" onclick="document.getElementById('id01').style.display='block'" >Get Nominations</button> -->
<!-- <div id="id01">
<h3>Nominees List</h3><br/>
<form action="nominee.php" method="POST">
<input type="checkbox" name="color[]" id="color" value="red"> 1 <br/>
<input type="checkbox" name="color[]" id="color" value="red"> 2 <br/>
<input type="checkbox" name="color[]" id="color" value="red"> 3 <br/>
<input type="checkbox" name="color[]" id="color" value="red"> 4 <br/>
<input type="checkbox" name="color[]" id="color" value="red"> 5 <br/>
<button type="button" onclick="document.getElementById('id01').style.display='none'">Approve</button>
</form>
</div>
-->
</div>
<div id="contestor" class="divs" >
<label for="con_id"><b>Constituecny ID</b></label></br>
<?php
// session_start();
$_SESSION["ad_id"]=$ad_id;
?>
<form method="post" action="displaycontestor.php">
<input type="text" placeholder="Enter Constituency ID" name="con_id"></br>
<input type="submit" name="submit" value="Submit Form"><br>
</form>
</div>
<!-- <button type="button" onclick="document.getElementById('id02').style.display='block'" >Get Constestors List</button> -->
<div id="result" class="divs" >
<label for="con_id"><b>Constituecny ID</b></label></br>
<input type="text" placeholder="Enter Constituency ID" name="con_id">
<button type="button" onclick="document.getElementById('id03').style.display='block'" >Get Results</button>
<div id="id03">
<h3>Results</h3>
<form action="" method="POST">
<table>
<tr><td>Contestor ID</td><td>Number of votes</td></tr>
<tr><td><?php echo"coming soon"?></td><td><?php echo"coming soon"?></td></tr>
<tr><td><?php echo"coming soon"?></td><td><?php echo"coming soon"?></td></tr>
<tr><td><?php echo"coming soon"?></td><td><?php echo"coming soon"?></td></tr>
</table>
<button type="button" onclick="document.getElementById('id03').style.display='none'">Update to website</button>
</form>
</div>
</div>
<div id="display" class="divs" >
$_SESSION["ad_id"]=$ad_id;
<label for="v_id"><b>Voter ID</b></label></br>
<form method="post" action="displayvoterinfo.php">
<input type="text" placeholder="Enter Voter Id" name="v_id"></br>
<input type="submit" name="submit" value="Submit Form"><br>
</form>
<script>
var a=document.getElementById("constituency");
var b=document.getElementById("approve");
var c=document.getElementById("contestor");
var d=document.getElementById("result");
var e=document.getElementById("display");
function disp1()
{
// console.log("gaja");
a.style.display="block";
b.style.display="none";
c.style.display="none";
d.style.display="none";
e.style.display="none";
}
function disp2()
{
a.style.display="none";
b.style.display="block";
c.style.display="none";
d.style.display="none";
e.style.display="none";
}
function disp3()
{
a.style.display="none";
b.style.display="none";
c.style.display="block";
d.style.display="none";
e.style.display="none";
}
function disp4()
{
a.style.display="none";
b.style.display="none";
c.style.display="none";
d.style.display="block";
e.style.display="none";
}
function disp5()
{
a.style.display="none";
b.style.display="none";
c.style.display="none";
d.style.display="none";
e.style.display="block";
}
</script>
</body>
</html>