-
Notifications
You must be signed in to change notification settings - Fork 2
/
member-product-lended.php
76 lines (71 loc) · 3.13 KB
/
member-product-lended.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
<!DOCTYPE html>
<html lang="en">
<!--ADD HEADER-->
<?php include_once "header.html"; ?>
<!--CHECK SESSION-->
<?php include_once "check-session.php"?>
<body>
<!-- add default profile -->
<?php include_once "member-profile.php" ?>
<!-- begin product info section -->
<section>
<div>
<table class="myproduct-table">
<thead>
<tr>
<th>No</th> <!-- id -->
<th>상품이미지</th>
<th>기종 및 형식명</th>
<th>제조사</th>
<th>농기구 종류</th>
<th>제조년식</th>
<th>임대 시작일</th>
<th>임대 종료일</th>
<th>대여장소</th>
<th>등록일</th>
<th>가격</th>
</tr>
</thead>
<tbody>
<?php
require_once "dbcon.php";
$id = $_SESSION['id'];
//$product_query = "SELECT * FROM product WHERE member_id = '$id'";
$product_query = "SELECT * FROM product LEFT JOIN file ON product.id= file.p_id WHERE member_id='{$_SESSION['id']}' AND close=1 AND deleteDate IS NULL GROUP BY (id)";
$result = mysqli_query($conn, $product_query);
if($result->num_rows == 0){
echo <<< ZERO_PRODUCT
<tr>
<td colspan = '11'><h4>임대하신 제품이 없습니다.</h4></td>
</tr>
ZERO_PRODUCT;
}while($row = mysqli_fetch_array($result)){
$row['model']=htmlspecialchars($row['model']);
$row['price']=htmlspecialchars($row['price']);
$row['place']=htmlspecialchars($row['place']);
$row['primakerce']=htmlspecialchars($row['maker']);
echo <<< VIEW_PRODUCT
<tr>
<td>{$row['id']}</td>
<td><img class="product-img" src="{$row['link']}"></td>
<td>{$row['model']}</td>
<td>{$row['maker']}</td>
<td>{$row['category']}</td>
<td>{$row['make_year']}</td>
<td>{$row['start_date']}</td>
<td>{$row['end_date']}</td>
<td>{$row['place']}</td>
<td>{$row['upload']}</td>
<td>{$row['price']}</td>
VIEW_PRODUCT;
}
mysqli_close($conn);
?>
</tbody>
</table>
</div>
</section>
<!-- add default footer -->
<?php include_once "footer.html" ?>
</body>
</html>