forked from Zualemo-xo/Online-Voting-Management-System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
checktimeresult.php
115 lines (101 loc) · 3.95 KB
/
checktimeresult.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
<html>
<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://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: no-repeat; */
/*background-color: red;*/
background-color: rgb(201,76,76);
background-position:center;
background-repeat:no-repeat;
background-attachment:inherit;
background-size:auto;
}
</style>
</body>
<h1 align="center" style="font-family:Georgia"><i><b>Election Commission Of India</b></i></h1>
<!-- actual size:300px 200 px 100px 200 px -->
<!-- </head>
<div class="panel">
<center><b><h1><font color="darkblue" size="30">Election Commission Of India</font></h1></b></center>
</div>
</figure> -->
<!-- </html> -->
<!-- <script> -->
<!DOCTYPE HTML>
<!-- <html> -->
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
p {
text-align:center;
/* padding-bottom: 100px; */
position:100px absolute;
font-family: Courier;
font-size: 30px;
margin-top:-50px;
}
</style>
</head>
<body>
</html>
<p id="demo"></p>
<script>
var StartcountDownDate = new Date("June 1, 2020 15:27:25").getTime();
var EndcountDownDate=new Date("June 3, 2020 1:04:25").getTime();
// Update the count down every 1 second
var x = setInterval(function() {
// Get today's date and time
var now = new Date().getTime();
// Find the distance between now and the count down date
var distance = StartcountDownDate - now;
// Time calculations for days, hours, minutes and seconds
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
// Display the result in the element with id="demo"
// document.write('Time left for election to begin');
document.getElementById("demo").innerHTML = '<br><b>Time left for election to begin:'+days + "d " + hours + "h "
+ minutes + "m " +"<br>You are being redirected";
setTimeout(function(){
window.location = "http://localhost/NEWDBMSPROJ/index.html";
},5000);
// </body>
if (distance < 0) {
clearInterval(x);
// document.getElementById("demo").innerHTML = "EXPIRED";
// header('Location: http://localhost/NEWDBMSPROJ/indexx.php');
// Display message
var delay=5000;
// var x = setInterval(function() {
// Get today's date and time
var now = new Date().getTime();
var left=EndcountDownDate-now;
var days = Math.floor(left/ (1000 * 60 * 60 * 24));
var hours = Math.floor((left % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((left % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((left % (1000 * 60)) / 1000);
document.getElementById("demo").innerHTML = "<br><b>Please wait!Elections have begun.Results will be visible once elections come to an end.<br>Elections will end by:"+days + "d " + hours + "h "
+ minutes + "m ";
setTimeout(function(){
window.location = "http://localhost/NEWDBMSPROJ/index.html";
},delay);
if(left<0)
{
document.getElementById("demo").innerHTML = "<br><br><br><b>Redirecting to the results page.";
setTimeout(function(){
window.location = "http://localhost/NEWDBMSPROJ/displaychart.php";
},delay);
}
}
}, 1000);
</script>