-
Notifications
You must be signed in to change notification settings - Fork 14
/
validation_3.php
73 lines (57 loc) · 1.9 KB
/
validation_3.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
<?php
include("dbConnect.php");
$sql = "SELECT candidate,count(*) as result from `users_3rd` group by candidate";
$stmt = $pdo->prepare($sql);
$stmt->execute();
$rs = $stmt->fetchAll();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<style>
.card-5{
border: 2px black solid;
padding: 30px;
margin-top:5%;
width:70%;
margin-left:auto;
margin-right:auto;
}
#footersection{
margin-top:18%;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="card-5">
<h2><strong>Result</strong></h2>
<hr>
<?php foreach($rs as $row){
echo "<strong>".$row['candidate']." = ".$row['result']." </strong><br>";
echo "
<div class='progress'>
<div class='progress-bar progress-bar-striped bg-success progress-bar-animated' role='progressbar' aria-valuenow=".$row['candidate']." aria-valuemin=\"0\" aria-valuemax=\"1000\" style='width: ".$row['result']."%'>
</div>
</div>
";
}
?>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
</body>
</html>
<?php
include("footer.html");
?>