-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvotes2.php
68 lines (63 loc) · 1.52 KB
/
votes2.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
<?php
include("connection.php");
?>
<html>
<head>
<?php
include("script.php");
?>
<style>
.error {color: #FF0000;}
</style>
</head>
<body>
<div class='container-fluid'>
<?php
include("nav.php");
include("head.php");
echo"<br>
<div class='row'>
<div class='col-md-12'>
<div class='panel panel-primary min_h'>
<div class=well well-sm><h2>configuration of Categories for Elections</h2></div>
<div class=row><div class='col-md-1'></div>";
if(isset($_REQUEST['act']))
{
$act=$_REQUEST['act'];
$cname=$_REQUEST['name'];
echo"<div class='col-md-3'>";
$sql = "SHOW TABLES FROM $cname";
$result = mysqli_query($con,$sql);
if (!$result) {
echo "DB Error, could not list tables\n\n";
echo 'MySQL Error: ' . mysqli_error($con);
exit;
}
while ($row = mysqli_fetch_row($result))
{
echo "<div class='col-md-6'><a href='$row[0].php?class=$row[0]&&name=$cname' class='btn btn-primary'>$row[0]</a></div><br>";
}
$ss="SELECT * FROM $cname.tpr_voter_login";
$arr=mysqli_query($con,$ss);
$numm=mysqli_num_rows($arr);
$qw="select Max_votes from tprinfo where catname='$cname'";
$qww=mysqli_query($con,$qw);
$arow=mysqli_fetch_row($qww);
if($numm>($arow[0]-10))
{
echo "<br><br><br><br><div class='row'><div class='col-md-1'></div><div class='col-md-5'><a href='tpr_result.php?class=results&&name=$cname' class='btn btn-primary'>Results</a></div></div>";
}
}
echo"</div><br>
</div><br>
</div>
</div>
</div>
<hr>";
include("footer.php");
echo "</div>";
?>
</div>
<script>
</body>
</html>