-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest
More file actions
130 lines (110 loc) · 4.41 KB
/
Copy pathtest
File metadata and controls
130 lines (110 loc) · 4.41 KB
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
<?php
include'connection.php';
include 'include.php';
session_set();
error_reporting(0);
if(empty($_GET['id'])){
header('Location: dashboard.php');
}
else {
$id = mysqli_real_escape_string($conn,$_GET['id']);
$auction_sql = "SELECT * FROM auction_table WHERE auction_id = '$id'";
$auction_query = mysqli_query($conn,$auction_sql);
$auction_product = mysqli_fetch_array($auction_query);
$username = $_SESSION['username'];
$user_sql = "SELECT * FROM users where username='$username'";
$user_query = mysqli_query($conn,$user_sql);
$user_data = mysqli_fetch_array($user_query);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Rajasthan E-Auction Bidding Portal</title>
<!-- Bootstrap core CSS -->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/modern-business.css" rel="stylesheet">
</head>
<style>
.timer{
font-size: 4em;
text-align: center;
margin:100px 0px;
}
.countdown{
margin:50px 0px;
}
</style>
<script>
var timeleft = 15;
var downloadTimer = setInterval(function(){
document.getElementById("progressBar").value = 15 - --timeleft;
if(timeleft <= 0)
clearInterval(downloadTimer);
},1500);
</script>
<body>
<!-- Navigation -->
<?php
include 'nav.php';
?>
<!-- Page Content -->
<div class="container">
<!-- Page Heading/Breadcrumbs -->
<h1 class="mt-4 mb-3" style="text-align: center;">
Portal for <?php echo $auction_product['product_name']; ?> Bidding
</h1>
<div id="countdown" class="countdown col-md-4 col-md-offset-4"></div>
<br/>
<?php
if($auction_product['expired'] == 0){
echo '<progress value="0" max="10" id="progressBar"></progress>';
}else{
}
?>
<p>For details about Product <a href="auction.php?id=<?php echo $id; ?>">Click Here</a></p>
</div>
<!-- /.container -->
<!-- Footer -->
<footer class="py-5 bg-dark" style="position:absolute;bottom:0;width:100%;height:60px;">
<div class="container">
<p class="m-0 text-center text-white">Copyright © Rajasthan Governement</p>
</div>
<!-- /.container -->
</footer>
<!-- Bootstrap core JavaScript -->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script>
// Set the date we're counting down to
var countDownDate = new Date("<?php echo date('m-d-Y H:i:s',strtotime($auction_product['bid_date'])); ?>").getTime();
// Update the count down every 1 second
var x = setInterval(function() {
// Get todays date and time
var now = new Date().getTime();
// Find the distance between now an the count down date
var distance = countDownDate - 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);
// Output the result in an element with id="demo"
document.getElementById("countdown").innerHTML = "<div class='timer'>"+ days + "d " + hours + "h "
+ minutes + "m " + seconds + "s </div>";
// If the count down is over, write some text
if (distance < 0) {
clearInterval(x);
document.getElementById("countdown").innerHTML = "<form method='POST' name='bid'>Enter Bid Amount(Should be Higher then Minimum Bid & Last Maximum Bid)<br/><br/><div class='form-group'><input type='number' class='form-control' name='Enter Bid Amount'></div><button name='bid' class='btn btn-lg btn-success btn-block'>Bid</button></form>";
}
}, 1000);
</script>
</body>
</html>
<?php
}
?>