-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbids.php
More file actions
176 lines (120 loc) · 6.55 KB
/
bids.php
File metadata and controls
176 lines (120 loc) · 6.55 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
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
<?php session_start(); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="robots" content="all,follow">
<meta name="googlebot" content="index,follow,snippet,archive">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Obaju e-commerce template">
<meta name="author" content="Ondrej Svestka | ondrejsvestka.cz">
<meta name="keywords" content="">
<title>
Online Auction System
</title>
<meta name="keywords" content="">
<link href='http://fonts.googleapis.com/css?family=Roboto:400,500,700,300,100' rel='stylesheet' type='text/css'>
<!-- styles -->
<link href="css/font-awesome.css" rel="stylesheet">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/animate.min.css" rel="stylesheet">
<link href="css/owl.carousel.css" rel="stylesheet">
<link href="css/owl.theme.css" rel="stylesheet">
<!-- theme stylesheet -->
<link href="css/style.default.css" rel="stylesheet" id="theme-stylesheet">
<!-- your stylesheet with modifications -->
<link href="css/custom.css" rel="stylesheet">
<script src="js/respond.min.js"></script>
<link rel="shortcut icon" href="favicon.png">
</head>
<body>
<?php
include 'conn.php';
$query1 = "SELECT * FROM category ";
$result1 = mysqli_query($db, $query1);
$categories = mysqli_fetch_array($result1);
include 'header.php';
// if(isset($_POST['keyword'])){ $keyword=$_POST['keyword'];}else{$CategoryID=null;}
$userid = $_SESSION['userid'];
$query2 = "SELECT DISTINCT bids.ItemID, item.itemID, item.PhotosID, item.ItemName, item.CurrentPrice, bids.BidderID, user.UserID, user.alias FROM item
INNER JOIN bids INNER JOIN user WHERE item.itemID = bids.itemID AND bids.BidderID = user.UserID AND user.UserID = $userid";
$result2 = mysqli_query($db, $query2);
$searchResults = mysqli_fetch_array($result2);
?>
<div id="all">
<div id="content">
<div class="container">
<div class="col-md-12">
<ul class="breadcrumb">
<li><a href="index.php">Home</a>
</li>
<li>Bidding</li>
</ul>
<!-- <div class="box"> -->
<!-- <h1>Search Results for '<?php echo $keyword ?>'</h1> -->
<!-- </div> -->
<?php
$userid = $_SESSION['userid'];
while($searchResults) {
$itemid = $searchResults['ItemID'];
$query2 = "SELECT max(BidAmount) as BidAmount FROM `bids` WHERE BidderID = $userid AND ItemID = $itemid";
$result = mysqli_query($db, $query2);
$row2= mysqli_fetch_array($result);
?>
<div class="col-md-3 col-sm-6">
<div class="product same-height">
<div class="flip-container">
<div class="flipper">
<div class="front">
<a href="detail.php?ItemNo=<?php echo $searchResults['ItemID'] ?>">
<img src="img/<?php echo $searchResults['PhotosID'];?>" alt="" class="img-responsive">
</a>
</div>
<div class="back">
<a href="detail.php?ItemNo=<?php echo $searchResults['ItemID'] ?>">
<img src="<?php echo $searchResults['PhotosID'];?>" alt="" class="img-responsive">
</a>
</div>
</div>
</div>
<a href="detail.php?ItemNo=<?php echo $searchResults['ItemID'] ?>" class="invisible">
<img src="img/product2.jpg" alt="" class="img-responsive">
</a>
<div class="text">
<a href="detail.php?ItemNo=<?php echo $searchResults['ItemID'] ?>"><h3><?php echo $searchResults['ItemName'] ?></h3></a>
<p class="price"><b>Seller ID:</b> <?php echo $searchResults['alias'] ;?></p>
<!-- <p class="price"><b>Reference Number:</b> <?php echo $searchResults['CurrentPrice']; ?></p> -->
<p class="price"><b>Your Bid ZWL$</b> <?php echo number_format($row2['BidAmount'],2);?></p>
<p class="price"><b>Current Bid ZWL$</b> <?php echo number_format($searchResults['CurrentPrice'],2);?></p>
</div>
</div>
<!-- /.product -->
</div>
<?php $searchResults = $result2->fetch_assoc();} ?>
<?php if(mysqli_num_rows($result2) == 0) { ?>
<div class="box">
<h1>You currently have no bids placed.</br></br>
Search for items and place your bids.</h1>
</div>
<?php } ?>
</div>
<!-- /.col-md-9 -->
</div>
<!-- /.container -->
</div>
<!-- /#content -->
<?php include 'footer.php';?>
</div>
<!-- /#all -->
<!-- *** SCRIPTS TO INCLUDE ***
_________________________________________________________ -->
<script src="js/jquery-1.11.0.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.cookie.js"></script>
<script src="js/waypoints.min.js"></script>
<script src="js/modernizr.js"></script>
<script src="js/bootstrap-hover-dropdown.js"></script>
<script src="js/owl.carousel.min.js"></script>
<script src="js/front.js"></script>
</body>
</html>