/
productView_old.php
144 lines (82 loc) · 4.93 KB
/
productView_old.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
<?php
$sqlstr = "SELECT * FROM ".product." WHERE status='true'
AND id = '".intval($_GET['id'])."' ";
$sqlstr=mysql_query($sqlstr);
mysql_query("UPDATE ".product." SET solan=solan+1 WHERE id='".intval($_GET['id'])."'");
if(mysql_num_rows($sqlstr)>0) {
$row=mysql_fetch_array($sqlstr);
?>
<title> <?=$row['title']?> , <?=$tde?> </title>
<meta name="keywords" content=" <?=$row['title']?> , <?=$key?>" />
<meta name="description" content="<?=$row['title']?>, <?=$mota?>" />
<table style="border-collapse: collapse;" width="99%" align="center" border="1" cellpadding="2" cellspacing="2" id="bochinh" >
<tr id="achitiet">
<td colspan="3" align="left" height="30" >
<span id="chitiet"><?=$row['title']?></span> </td>
</tr>
<tr >
<td colspan="3" align="center" >
<?php if($row['picture2']) {?>
<img src="images/product/goc/<?=$row['picture2']?>" border="0" >
<?php }?>
</td>
</tr>
<tr>
<td colspan="3" height="30"> <strong>Giá: </strong> <span id="gia"><?php if($row['price']) {?> <?=number_format($row['price']*$explode[0],0,",",".")?> <?=$explode[1]?> <?php } else {?>Call <?php }?> </td>
</tr>
<tr>
<td colspan="3" height="30"> <strong>Đặt mua: </strong> <a href="index.php?page=shoppingCart&action=add&viewParent=<?=$_GET['viewParent']?>&id=<?=$row['id']?>" id="tieude"><img src="images1/mua.gif" border="0" align="absmiddle" /></a> </td>
</tr>
<tr>
<td colspan="3"height="30"bgcolor="#EFEFEF"> <strong>Thông tin chi tiết</strong></td>
</tr>
<tr>
<td colspan="3" id="noidung" height="30"><?=textContent($row['tomtat'])?></td>
</tr>
</table>
<?php } ?>
<br />
<table width="99%" border="0" align="center" cellspacing="1" cellpadding="1" id="bochinh">
<tr id="asanpham">
<td colspan="3" ><span id="sanpham"> Các sản phẩm cùng loại khác </span></td>
</tr>
<tr >
<?php
$p=15;
$sqlstr = "SELECT * FROM ".product." WHERE status='true' AND category = '".intval($row['category'])."' AND id <> '".intval($_GET['id'])."' ";
$sqlstr .=" ORDER BY postdate DESC limit $p";
$sqlstr=mysql_query($sqlstr);
?>
<?php
if(mysql_num_rows($sqlstr)>0) { $i=0;
while($row=mysql_fetch_array($sqlstr)) { $i+=1;
?>
<td align="center" valign="top" width="33%" id="bosanpham" >
<table width="100%" border="0" cellspacing="3" cellpadding="3" >
<tr>
<tr>
<td valign="top" align="center" colspan="2" height="40"> <a href="productView_<?=$row['category']?>_<?=$row['subCategory']?>_<?=$row['id']?><?=$vip?>" id="tieude"><?=$row['title']?></a>
</td>
</tr>
<td valign="middle" align="center" colspan="2" height="160">
<a href="productView_<?=$row['category']?>_<?=$row['subCategory']?>_<?=$row['id']?><?=$vip?>" ><img src="images/product/thumbs/<?=$row['picture']?>" border="0" alt="<?=$row['title']?>" title="<?=$row['title']?>"/></a></td>
</tr>
<tr>
<td valign="bottom" align="center" colspan="2"> <strong>Giá: </strong> <span id="gia"><?php if($row['price']) {?> <?=number_format($row['price']*$explode[0],0,",",".")?> <?=$explode[1]?> <?php } else {?>Call <?php }?> </span>
</td>
</tr>
<tr>
<td valign="top" align="center"> <a href="productView_<?=$row['category']?>_<?=$row['subCategory']?>_<?=$row['id']?><?=$vip?>" id="tieude"><img src="images1/chitiet.gif" border="0" /></a>
</td>
<td valign="top" align="center"> <a href="index.php?page=shoppingCart&action=add&viewParent=<?=$_GET['viewParent']?>&id=<?=$row['id']?>" id="tieude"><img src="images1/mua.gif" border="0" /></a>
</td>
</tr>
</table>
</td>
<?php if($i%3==0) echo "</tr>";?>
<?php } }
else {
echo "<td style='color:#FF0000' >Chưa có tin nào</td> </tr> ";
}
?>
</table>