-
Notifications
You must be signed in to change notification settings - Fork 0
/
show_item_detail.php
197 lines (133 loc) · 4.92 KB
/
show_item_detail.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
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
193
194
195
196
197
<? include("header.php");?>
<!-- First, add jQuery (and jQuery UI if using custom easing or animation -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
<!-- Second, add the Timer and Easing plugins -->
<script type="text/javascript" src="GalleryView/js/jquery.timers-1.2.js"></script>
<script type="text/javascript" src="GalleryView/js/jquery.easing.1.3.js"></script>
<!-- Third, add the GalleryView Javascript and CSS files -->
<script type="text/javascript" src="GalleryView/js/jquery.galleryview-3.0-dev.js"></script>
<link type="text/css" rel="stylesheet" href="GalleryView/css/jquery.galleryview-3.0-dev.css" />
<!-- Lastly, call the galleryView() function on your unordered list(s) -->
<script type="text/javascript">
$(function(){
$('#myGallery').galleryView({
panel_width: 450,
panel_height: 250,
frame_width: 75,
frame_height: 40,
frame_gap: 0,
frame_scale:'fit',
panel_scale:'fit',
transition_speed: 500,
});
});
</script>
<div id="main">
<div class="row">
<?php
session_start();
//若無,則為加入興趣清單時未登入的回傳
if($_GET['id']!=NULL){
$id=$_GET['id'];}
include_once("mysql_info.php");
$sql = "select m.id, m.username, i.* from member m, item_forsell i where i.owner = m.id and i.id='$id'";
$result = mysqli_query($link,$sql); // 執行SQL查詢
$row = mysqli_fetch_array($result);
if($row['status']==2){
echo '<center><p style="color:red;font-weight:bold;font-size:24px;">該商品已下架</p></center>';
}
elseif($row['status']==3){
echo '<center><p style="color:red;font-weight:bold;font-size:24px;">該商品閒置中</p></center>';
}
?>
<div class="col-md-5 col-md-offset-1">
<table>
<tr>
<td>
<center>
<div style="margin-bottom:10px">
<ul id="myGallery">
<?php
$number=$row[img_count];
for($i=1;$i<=$number;$i++)
{
echo '<li><img src="Picture/'.$row[filename].'_'.$i.'.jpg" width=75/></li>';
}
?>
</ul>
</div>
</center>
</td>
</tr>
<tr>
<td>
<form action="send_message.php" method="post">
<input type="hidden" name="item_type" value="sell">
<input type="hidden" id="receiver" name="receiver" value="<?php echo $row[username];?>">
<input type="hidden" id="id" name="id" value="<?php echo $row[id];?>">
<input type="hidden" id="subject" name="subject" value="<?php echo $row[name];?>">
<input type="hidden" id="content" name="content" value="<?php echo "商品內容:".$row[name]."\n商品描述:".$row[detail]."\n商品價格:".$row[price]."\n交易方式:".$row[method]."\n聯絡email:".$row[contact_email]."\n手機:".$row[phone];?>">
<input type="submit" value="加到興趣清單" class="btn btn-success" formaction="add_interested.php" style="margin:0px 5px">
<input type="submit" value="丟私人訊息" class="btn btn-info" style="margin:0px 5px">
<input type="submit" value="回報已成交/閒置" formaction="report_idle.php" class="btn btn-warning" style="margin:0px 5px;">
<button class="fb-share-button btn btn-primary" style="width:100px;height:33px;margin:0px 5px;" data-href="http://collegebazaar.tw/show_item_detail.php?id=<?php echo $row[id];?>"></button>
</form>
</td>
</tr>
<tr>
<td>
<div class="fb-comments" style="margin-top:10px;padding-bottom:10px;"data-href="http://collegebazaar.tw/show_item_detail.php?id=<?php echo $row[id];?>" data-width="500" data-numposts="10" data-colorscheme="light">
</div>
</td>
</tr>
</table>
</div>
<div class="col-md-6">
<font color="#FF0000" size="5">
<?php echo $notice;?>
</font>
<table id="item_info_table" >
<tr>
<td style="width:30%">商品名稱</td>
<td style="width:70%"><?php echo $row[name];?></td>
</tr>
<tr>
<td>商品描述</td>
<td><?php echo nl2br($row[detail]);?></td>
</tr>
<tr>
<td>商品價格</td>
<td><?php echo '$'.$row[price];?></td>
</tr>
<tr>
<td>交易方式</td>
<td><?php if($row['status']==1){ echo $row[method];} ?></td>
</tr>
<tr>
<td>聯絡email</td>
<td><?php if($row['status']==1){ echo $row[contact_email];} ?></td>
</tr>
<tr>
<td>手機</td>
<td><?php if($row['status']==1){ echo $row[phone];} ?></td>
</tr>
<tr>
<td>私人訊息</td>
<td><?php
if($row[msg_welcome]==1)
{echo "歡迎私訊";}
if($row[msg_welcome]==2)
{echo "不常用,以其他聯絡方式為主";}?></td>
</tr>
<tr>
<td>上架日期</td>
<td><?php echo $row[date];?></td>
</tr>
</tr>
</table>
</div>
</div>
</div>
</div>
<? include("footer.php");?>