-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathitemLoadBidHistory.php
33 lines (31 loc) · 1.06 KB
/
itemLoadBidHistory.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
<?php
if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'){
include 'function/db.php';
$item_id = $_GET['item_id'];
$queryBidHis = "SELECT * FROM bidHistory, user WHERE bidHistory.item_id = $item_id AND bidHistory.user_id =user.user_id ORDER BY bidHistory.bidhistory_id DESC";
$resultBidHis = mysql_query($queryBidHis) or die(mysql_error());
$emptyBidHis = (mysql_num_rows($resultBidHis) == 0? true:false);
}
?>
<table>
<caption><h1>Bidding History</h1></caption>
<tbody>
<?php
if($emptyBidHis){
echo "<tr>
<td style='border:none'><h3>No bidding history</h3></td>
<input type='hidden' name='user_id' id='user_id' value='0'>
</tr>";
}else{
echo "<tr><th>User</th><th>Biding value</th></tr>";
while($rowBidHis = mysql_fetch_array($resultBidHis))
{
echo "<tr>
<td>" . $rowBidHis['username'] . "</td><td>" . $rowBidHis['price'] . "</td>
<input type='hidden' name='user_id' id='user_id' value='".$rowBidHis['user_id']."'/>
</tr>";
}
}
?>
</tbody>
</table>