forked from Zualemo-xo/Online-Voting-Management-System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vote.php
280 lines (255 loc) · 9.09 KB
/
vote.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
274
275
276
277
278
279
280
<?php include ('head.php');?>
<?php include ('sess.php');?>
<body>
<body>
<head>
<link rel="stylesheet" type="text/css" href="css/login_mahel.css">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src='https://kit.fontawesome.com/a076d05399.js'></script>
<!-- Add icon library -->
<img src="https://seeklogo.com/images/E/election-commission-of-india-logo-324FF87C0E-seeklogo.com.png" alt="Vote" style="float:left;;width:160px;height:150px">
<img src="https://www.myindiamyvote.com/wp-content/uploads/2018/08/myindiamyvotelogo.png" alt="Vote" style="float:left;width:160px;height:150px">
<!-- <img src="https://knowindia.gov.in/assets/images/National-Emblem.png" alt="Vote" style="background: auto;float:right; width:400px;height:300px"> -->
<style>
body {
background-image: url('https://knowindia.gov.in/assets/images/National-Emblem.png');
background-repeat: repeat;
background-position:bottom;
background-attachment:inherit;
background-size:auto;
}
</style>
</body>
<!-- actual size:300px 200 px 100px 200 px -->
</head>
<!-- </body> -->
<!-- <header> -->
<div class="panel">
<h1 align="center"><b>Welcome Responsible Citizen of India</b></h1>
<center><b><h1><font color="darkblue">Online Voting Sytem - Ballot Window</font></h1></b></center>
<!-- <marquee bgcolor="lightgreen" behavior="scroll" direction="left">Election portal opens at 5:00 AM and closes at 12:00 AM.Please use your chance within these hours.</marquee> -->
</div>
<!-- </header> -->
<center>
<div id="wrapper">
<?php include ('side_bar.php');?>
</div>
<form method = "POST" action = "vote_result.php">
<div class="col-lg-6">
<div class="panel panel-primary">
<div class="panel-heading"><center>
PRESIDENT</center>
</div>
<div class="panel-body" style = "background-color:;">
<?php
$query = $conn->query("SELECT * FROM `candidate` WHERE `position` = 'President'") or die(mysqli_errno());
while($fetch = $query->fetch_array())
{
?>
<div id = "position">
<img src = "admin/<?php echo $fetch['img']?>" style ="border-radius:6px;" height = "150px" width = "150px" class = "img">
<center><button type="button" class="btn btn-primary btn-xs" style = "border-radius:60px;margin-top:4px;"><?php echo $fetch['firstname']." ".$fetch['lastname']?></button></center>
<center><input type = "checkbox" value = "<?php echo $fetch['candidate_id'] ?>" name = "pres_id" class = "president"></center>
</div>
<?php
}
?>
</div>
</div>
</div>
<div class="col-lg-6">
<div class="panel panel-primary">
<div class="panel-heading"><center>
VICE PRESIDENT</center>
</div>
<div class="panel-body" style = "background-color:;">
<?php
$query = $conn->query("SELECT * FROM `candidate` WHERE `position` = 'Vice President'") or die(mysqli_errno());
while($fetch = $query->fetch_array()){
?>
<div id = "position">
<img class = "image-rounded" src = "admin/<?php echo $fetch['img']?>"style ="border-radius:6px;" height = "150px" width = "150px">
<center><button type="button" class="btn btn-primary btn-xs" style = "border-radius:60px;margin-top:4px;"><?php echo $fetch['firstname']." ".$fetch['lastname']?></button></center>
<center><input type = "checkbox" value = "<?php echo $fetch['candidate_id'] ?>" name = "vpinternal_id" class = "vpinternal"></center>
</div>
<?php
}
?>
</div>
</div>
</div>
<div class="col-lg-6">
<div class="panel panel-primary">
<div class="panel-heading">
<center>PRIME MINISTER</center>
</div>
<div class="panel-body" style = "background-color:;">
<?php
$query = $conn->query("SELECT * FROM `candidate` WHERE `position` = 'Prime Minister'") or die(mysqli_errno());
while($fetch = $query->fetch_array())
{
?>
<div id = "position">
<img src = "admin/<?php echo $fetch['img']?>" style ="border-radius:6px;" height = "150px" width = "150px" class = "img">
<center><button type="button" class="btn btn-primary btn-xs" style = "border-radius:60px;margin-top:4px;"><?php echo $fetch['firstname']." ".$fetch['lastname']?></button></center>
<center><input type = "checkbox" value = "<?php echo $fetch['candidate_id'] ?>" name = "vpexternal_id" class = "vpexternal"></center>
</div>
<?php
}
?>
</div>
</div>
</div>
<div class="col-lg-6">
<div class="panel panel-primary">
<div class="panel-heading">
<center>CHIEF MINISTER</center>
</div>
<div class="panel-body" style = "background-color:;">
<?php
$query = $conn->query("SELECT * FROM `candidate` WHERE `position` = 'Chief Minister'") or die(mysqli_errno());
while($fetch = $query->fetch_array())
{
?>
<div id = "position">
<img src = "admin/<?php echo $fetch['img']?>" style ="border-radius:6px;" height = "150px" width = "150px" class = "img">
<center><button type="button" class="btn btn-primary btn-xs" style = "border-radius:60px;margin-top:4px;"><?php echo $fetch['firstname']." ".$fetch['lastname']?></button></center>
<center><input type = "checkbox" value = "<?php echo $fetch['candidate_id'] ?>" name = "secretary_id" class = "secretary"></center>
</div>
<?php
}
?>
</div>
</div>
</div>
<center><button class = "btn btn-success ballot" type = "submit" name = "submit">Submit Ballot</button></center>
</form>
</body>
<?php include ('script.php')?>
<script type = "text/javascript">
$(document).ready(function(){
$(".president").on("change", function(){
if($(".president:checked").length == 1)
{
$(".president").attr("disabled", "disabled");
$(".president:checked").removeAttr("disabled");
}
else
{
$(".president").removeAttr("disabled");
}
});
$(".vpinternal").on("change", function(){
if($(".vpinternal:checked").length == 1)
{
$(".vpinternal").attr("disabled", "disabled");
$(".vpinternal:checked").removeAttr("disabled");
}
else
{
$(".vpinternal").removeAttr("disabled");
}
});
$(".vpexternal").on("change", function(){
if($(".vpexternal:checked").length == 1)
{
$(".vpexternal").attr("disabled", "disabled");
$(".vpexternal:checked").removeAttr("disabled");
}
else
{
$(".vpexternal").removeAttr("disabled");
}
});
$(".secretary").on("change", function(){
if($(".secretary:checked").length == 1)
{
$(".secretary").attr("disabled", "disabled");
$(".secretary:checked").removeAttr("disabled");
}
else
{
$(".secretary").removeAttr("disabled");
}
});
$(".auditor").on("change", function(){
if($(".auditor:checked").length == 1)
{
$(".auditor").attr("disabled", "disabled");
$(".auditor:checked").removeAttr("disabled");
}
else
{
$(".auditor").removeAttr("disabled");
}
});
$(".treasurer").on("change", function(){
if($(".treasurer:checked").length == 1)
{
$(".treasurer").attr("disabled", "disabled");
$(".treasurer:checked").removeAttr("disabled");
}
else
{
$(".treasurer").removeAttr("disabled");
}
});
$(".pio").on("change", function(){
if($(".pio:checked").length == 1)
{
$(".pio").attr("disabled", "disabled");
$(".pio:checked").removeAttr("disabled");
}
else
{
$(".pio").removeAttr("disabled");
}
});
$(".busman").on("change", function(){
if($(".busman:checked").length == 1)
{
$(".busman").attr("disabled", "disabled");
$(".busman:checked").removeAttr("disabled");
}
else
{
$(".busman").removeAttr("disabled");
}
});
$(".sgtarm").on("change", function(){
if($(".sgtarm:checked").length == 1)
{
$(".sgtarm").attr("disabled", "disabled");
$(".sgtarm:checked").removeAttr("disabled");
}
else
{
$(".sgtarm").removeAttr("disabled");
}
});
$(".muse").on("change", function(){
if($(".muse:checked").length == 1)
{
$(".muse").attr("disabled", "disabled");
$(".muse:checked").removeAttr("disabled");
}
else
{
$(".muse").removeAttr("disabled");
}
});
$(".escort").on("change", function(){
if($(".escort:checked").length == 1)
{
$(".escort").attr("disabled", "disabled");
$(".escort:checked").removeAttr("disabled");
}
else
{
$(".escort").removeAttr("disabled");
}
});
});
</script>
</html>