-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshowpost.php
More file actions
192 lines (161 loc) · 5.96 KB
/
Copy pathshowpost.php
File metadata and controls
192 lines (161 loc) · 5.96 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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<?php session_start(); ?>
<html>
<?php include('server.php') ?>
<?php $sql="SELECT * FROM uniform WHERE ID='{$_GET['id']}'";
mysqli_query($objCon,"SET NAMES tis-620");
$query= mysqli_query($objCon,$sql);
$result = mysqli_fetch_assoc($query);
// Comment
$sql_c = "SELECT * FROM comment WHERE uniform_id='{$_GET['id']}'";
mysqli_query($objCon,"SET NAMES tis-620");
$query_c = mysqli_query($objCon, $sql_c);
$rows_c = mysqli_fetch_all($query_c, MYSQLI_ASSOC);
?>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=tis-620" />
<link rel="stylesheet" href="./css.css">
<link rel="stylesheet" href="./mix&match.css">
<link rel="stylesheet" href="./showpost.css">
</head>
<body>
<!-- ถ้ามี ตัวเต็ม -->
<?php if($result['fullID']!=""){
$full="SELECT image FROM full WHERE fullID = '".$result['fullID']."'";
$objQuery = mysqli_query($objCon,$full);
$objResult = mysqli_fetch_array($objQuery);
$fullPic=$objResult["image"];
?>
<div class="right">
<h1>User Comment :</h1>
<?php foreach($rows_c as $row): ?>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000"
style="margin-top:10px;">
<tr>
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<tr>
<td width="30%" style="text-align: right;"><strong>UserName : </strong></td>
<td width="70%">
<?php $sql= "SELECT * FROM member WHERE userID='{$row['userID']}'";
$objQuery = mysqli_query($objCon,$sql);
$result_userid = mysqli_fetch_array($objQuery);
echo $result_userid['Username']; ?></td>
<tr>
<td valign="top" style="text-align: right;"><strong>Comment : </strong></td>
<td><?php echo $row['comment']; ?></td>
</tr>
</tr>
</tr>
</table>
</td>
</tr>
</table>
<?php endforeach ?>
</div>
<div class="left">
<h1> SHOW POST ID: <?php echo $result['ID']; ?></h1>
<div>
<h2>คำอธิบาย : <?php echo $result['clothesDesc'];?></h2>
</div>
<?php echo '<img src="'.$fullPic.'" width="300" height="400">'; ?>
<h1>Comment: </h1>
<form id="add_comment" name="add_coment" method="post" action="save_comment.php">
<input type="text" name="detail" style="width:100%;height:100px;">
<input type="hidden" name="id" value="<?php echo $result['ID']; ?>">
<input type="hidden" name="userID" value="<?php echo $_SESSION["UserID"]; ?>">
<div class="box-comment-submit">
<div style="width:50%;">
<input class="button-comment" type="button" name="back" value="back"
onclick="window.location='seeAll.php';" />
</div>
<div style="width:50%;">
<input class="button-comment" type="submit" name="submit" value="submit" />
</div>
</div>
</form>
</div>
<!-- ******** -->
<?php
}
// ถ้าไม่มีรูปตัวเต็ม
else {?>
<div class="left">
<h1> SHOW POST ID: <?php echo $result['ID']; ?></h1>
<h2>คำอธิบาย : <?php echo $result['clothesDesc'];?></h2>
<div style="text-align: center;">
<h2>Shirt : </h2>
<div>
<?php
$shirt= "SELECT image FROM shirts WHERE shirtID ='".$result['shirtID']."'";
$objQuery = mysqli_query($objCon,$shirt);
$objResult = mysqli_fetch_array($objQuery);
$shirtPic=$objResult["image"];
echo '<img src="'.$shirtPic.'" width="150" height="150">';
// echo $post['shirtID'];?> </div>
<h2>Pant : </h2>
<div>
<?php
$pant= "SELECT image FROM pants WHERE pantID ='".$result['pantID']."'";
$objQuery = mysqli_query($objCon,$pant);
$objResult = mysqli_fetch_array($objQuery);
$pantPic=$objResult["image"];
echo '<img src="'.$pantPic.'" width="150" height="150">';
// echo $post['pantID'];?> </div>
<h2>Shoe : </h2>
<div>
<?php $shoe= "SELECT image FROM shoes WHERE shoeID ='".$result['shoeID']."'";
$objQuery = mysqli_query($objCon,$shoe);
$objResult = mysqli_fetch_array($objQuery);
$shoePic=$objResult["image"];
echo '<img src="'.$shoePic.'" width="150" height="150">';
// echo $post['shoeID'];
?></div>
</div>
<h1>Comment: </h1>
<form id="add_comment" name="add_coment" method="post" action="save_comment.php">
<input type="text" name="detail" style="width:100%;height:100px;">
<input type="hidden" name="id" value="<?php echo $result['ID']; ?>">
<input type="hidden" name="userID" value="<?php echo $_SESSION["UserID"]; ?>">
<div class="box-comment-submit">
<div style="width:50%;">
<input class="button-comment" type="button" name="back" value="back"
onclick="window.location='seeAll.php';" />
</div>
<div style="width:50%;">
<input class="button-comment" type="submit" name="submit" value="submit" />
</div>
</div>
</form>
</div>
<div class="right">
<h1>User Comment :</h1>
<?php foreach($rows_c as $row){ ?>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000"
style="margin-top:10px;">
<tr>
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<tr>
<td width="30%" style="text-align: right;"><strong>UserName : </strong></td>
<td width="70%">
<?php $sql= "SELECT * FROM member WHERE userID='{$row['userID']}'";
$objQuery = mysqli_query($objCon,$sql);
$result_userid = mysqli_fetch_array($objQuery);
echo $result_userid['Username']; ?></td>
<tr>
<td valign="top" style="text-align: right;"><strong>Comment : </strong></td>
<td><?php echo $row['comment']; ?></td>
</tr>
</tr>
</tr>
</table>
</td>
</tr>
</table>
<?php } ?>
</div>
<?php } ?>
</body>
</html>