-
Notifications
You must be signed in to change notification settings - Fork 2
/
member-docs-lended.php
73 lines (66 loc) · 2.65 KB
/
member-docs-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
<!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>
</tr>
</thead>
<tbody>
<?php
// DB CONN
require_once "dbcon.php";
// SELL INFO QUERY
$id = $_SESSION['id'];
$docs_count = 0;
$product_query = "SELECT * FROM info_buy_list LEFT JOIN sell_info ON sell_info.id = info_buy_list.sell_info_id
WHERE info_buy_list.member_id='{$_SESSION['id']}' AND deleteDate IS NULL GROUP BY (info_buy_list.id)";
$result = mysqli_query($conn, $product_query);
// SHOW TABLE
if($result->num_rows == 0){
echo <<< ZERO_PRODUCT
<tr>
<td colspan = '5'><h4>구매하신 문서가 없습니다.</h4></td>
</tr>
ZERO_PRODUCT;
}else{
while($row = mysqli_fetch_array($result)){
$row['title']=htmlspecialchars($row['title']);
$row['detail']=htmlspecialchars($row['detail']);
$row['price']=htmlspecialchars($row['price']);
$docs_count += 1;
echo <<< VIEW_PRODUCT
<tr>
<td>$docs_count</td>
<td>{$row['title']}</td>
<td>{$row['detail']}</td>
<td>{$row['price']}</td>
<td>{$row['upload']}</td>
VIEW_PRODUCT;
}
}
// CLOSE DB CONNECTION
mysqli_close($conn);
?>
</tbody>
</table>
</div>
</section>
<!-- add default footer -->
<?php include_once "footer.html" ?>
</body>
</html>