001.
<? ob_start(); ?>
002.
<? session_start(); ?>
003.
<?
include_once
"Menu.php"
?>
004.
<?
005.
006.
$str1
= " select id_prd , name_prd , ref_id_type ,prd_grp, price_prd , price , photo_prd
007.
, cast(replace(cast(detail_prd
as
nvarchar(Max)),
'<br>'
,
''
)
as
text)
as
detail_prd1
008.
, cast((cast(detail_prd
as
nvarchar(Max)))
as
text)
as
detail_prd
009.
,ProductSize , PageCount
as
NumPage ,ProductExample
010.
from tb_product where status = 1";
011.
012.
if
(
$_GET
[
'id_pre'
] !=
''
){
013.
$id
=
$_GET
[
'id_pre'
];
014.
$str1
.=
" and id_prd = '$id' "
;
015.
016.
if
(
$_GET
[
'group_prd_grp'
] !=
''
){
017.
$group_prd_grp1
=
$_GET
[
'group_prd_grp'
];
018.
$str1
.=
" and prd_grp = '$group_prd_grp1' "
;
019.
}
020.
021.
022.
if
(
$_GET
[
'TypeID'
] !=
''
){
023.
$TypeID1
=
$_GET
[
'TypeID'
];
024.
$str1
.=
" and ref_id_type = '$TypeID1' "
;
025.
}
026.
027.
}
else
{
028.
if
(
$_GET
[
'TypeID'
] !=
''
){
029.
$TypeID1
=
$_GET
[
'TypeID'
];
030.
$str1
.=
" and ref_id_type = '$TypeID1' "
;
031.
032.
}
033.
034.
}
035.
$str1
.=
" order by id_prd DESC "
;
036.
037.
038.
$querystr
= mssql_query(
$str1
);
039.
040.
$resuft1
= mssql_fetch_array(
$querystr
);
041.
$name
=
$resuft1
[
'name_prd'
];
042.
$price
=
$resuft1
[
'price'
];
043.
$price_prd
=
$resuft1
[
'price_prd'
];
044.
$details
= trim(
$resuft1
[
'detail_prd'
]);
045.
$ProductSize
=
$resuft1
[
'ProductSize'
];
046.
$NumPage
=
$resuft1
[
'NumPage'
];
047.
$DocDownload
=
$resuft1
[
'ProductExample'
];
048.
$photo
=
$resuft1
[
'photo_prd'
];
049.
$id_prd
=
$resuft1
[
'id_prd'
];
050.
051.
$code
=sprintf(
"%05d"
,
$id_prd
);
052.
?>
053.
<html>
054.
<head>
055.
<style>
056.
.img2{
057.
058.
overflow:hidden;
059.
text-overflow:ellipsis;
060.
white-space: nowrap;
061.
height:20px;
062.
color: rgb(238, 119, 10);
063.
font-weight: bold;
064.
font-size: 16px;
065.
}
066.
.text1{
067.
font-size: 14px;
068.
overflow: hidden;
069.
overflow-y: hidden;
070.
text-overflow: ellipsis;
071.
height:60px;
072.
font-weight: bold;
073.
074.
}
075.
.img {
076.
overflow: hidden;
077.
height: 280px;
078.
width: 290px;
079.
080.
}
081.
.col-md-4:nth-child(3n+1){
082.
clear: left;
083.
}
084.
</style>
085.
</head>
086.
087.
<body>
088.
089.
<!--start-single-->
090.
<div
class
=
"single contact"
>
091.
<div
class
=
"container"
>
092.
<div
class
=
"single-main"
>
093.
<div
class
=
"col-md-9 single-main-left"
>
094.
<div
class
=
"sngl-top"
>
095.
<div
class
=
"col-md-4 single-top-left"
>
096.
<div
class
=
"flexslider"
>
097.
<ul
class
=
"slides"
>
098.
<li data-thumb=
"<? echo $photo;?>"
>
099.
<center>
100.
<img src=
"../Xa/photo/<?echo $photo;?>"
/>
101.
</center>
102.
</li>
103.
</ul>
104.
</div>
105.
<!-- FlexSlider -->
106.
<script defer src=
"js/jquery.flexslider.js"
></script>
107.
<link rel=
"stylesheet"
href=
"css/flexslider.css"
type=
"text/css"
media=
"screen"
/>
108.
<script>
109.
110.
$(window).load(
function
() {
111.
$(
'.flexslider'
).flexslider({
112.
animation:
"slide"
,
113.
controlNav:
"thumbnails"
114.
});
115.
});
116.
</script>
117.
</div>
118.
<div
class
=
"col-md-7 col-sm-7 single-top-right"
>
119.
<div
class
=
"details-left-info simpleCart_shelfItem"
style=
"color:rgb(1, 11, 4); font-size:20px; font-weight:bold;"
>
120.
<h3 style=
"overflow:visible;"
><?
echo
iconv(
'TIS-620'
,
'UTF-8'
,
$name
); ?></h3>
121.
<!-- <p
class
=
"availability"
>สถานะ:
122.
<span
class
=
"color"
>In stock</span></p>-->
123.
124.
<div
class
=
"price_single"
>
125.
<p
class
=
"quick_desc"
style=
"font-size:16px;"
> รหัสหนังสือ : <?
echo
$code
;?> </p>
126.
<p
class
=
"quick_desc"
style=
"font-size:16px;"
>
127.
<?
128.
if
(
$price
!=
$price_prd
){
129.
?>
130.
<span
class
=
"reducedfrom"
>ราคา <?
echo
$price
;?>.00 บาท</span>
131.
<?
132.
}
133.
?>
134.
<span
class
=
"actual item_price"
>ราคา <?
echo
$price_prd
;?>.00 บาท</span> </p>
135.
<!--<a href=
"#"
>click
for
offer</a>-->
136.
137.
</div>
138.
<h2
class
=
"quick"
style=
"font-size:20px; font-weight:bold;"
>รายละเอียด</h2>
139.
<div style=
"width:100%;"
style=
"font-size:20px;"
>
140.
<p
class
=
"quick_desc"
style=
" text-overflow: ellipsis-word;white-space: nowrap;overflow: scroll;"
>
141.
<?
142.
143.
echo
iconv(
'TIS-620'
,
'UTF-8'
,
$details
);
144.
?>
145.
</p>
146.
</div>
147.
<p
class
=
"quick_desc"
style=
"font-weight:bold;"
>ขนาด: <?
echo
iconv(
'TIS-620'
,
'UTF-8'
,
$ProductSize
);?></p>
148.
<p
class
=
"quick_desc"
style=
"font-weight:bold;"
>ปก / จำนวนหน้า : <?
echo
iconv(
'TIS-620'
,
'UTF-8'
,
$NumPage
);?></p>
149.
<?
150.
$myFile
=
"../Xa/photo/"
.
$DocDownload
;
151.
if
(
is_file
(
$myFile
)){
152.
?>
153.
<p
class
=
"quick_desc"
>ตัวอย่าง <a href=
"../Xa/photo/<?echo iconv("
TIS-620
", "
UTF-8
",$DocDownload);?>"
target=
"_blank"
> <img src=
"images/pdf-icon.png"
> </a>
154.
<?
155.
}
156.
?>
157.
<div
class
=
"single-but item_add"
> <a href=
"order.php?id_prd=<? echo $id_prd?>"
>
158.
<input type=
"button"
class
=
"btn btn-warning"
value=
"หยิบใส่ตะกร้า"
/>
159.
</a> </div>
160.
</p>
161.
<div
class
=
"clearfix"
> </div>
162.
</div>
163.
</div>
164.
<div
class
=
"clearfix visible-md"
></div>
165.
</div>
166.
<div
class
=
"row"
>
167.
<div
class
=
"latest products"
>
168.
<div
class
=
"product-one"
>
169.
<?
170.
171.
$str2
= "select id_prd , name_prd , price, price_prd , photo_prd ,ref_id_type,prd_grp
172.
from tb_product where status = 1 ";
173.
174.
175.
if
(
$_GET
[
'TypeID'
] !=
""
){
176.
$str2
.=
" and ref_id_type = "
.
$_GET
[
'TypeID'
].
" "
;
177.
178.
$str2
.=
" and prd_grp = "
.
$_GET
[
'group_prd_grp'
].
" "
;
179.
$str2
.=
" order by id_prd DESC "
;
180.
$query2
= mssql_query(
$str2
);
181.
}
182.
183.
while
(
$row
= mssql_fetch_array(
$query2
)){
184.
$photo_prd
=
$row
[
'photo_prd'
];
185.
$id
=
$row
[
'id_prd'
];
186.
?>
187.
<div
class
=
"col-xs-6 col-sm-4 col-md-4 product-left single-left "
>
188.
<div
class
=
"p-one simpleCart_shelfItem"
>
189.
<div
class
=
"hidden-xs hidden-sm img2"
>
190.
<?
echo
iconv(
'TIS-620'
,
'UTF-8'
,
$row
[
'name_prd'
]) ?>
191.
</div>
192.
<br>
193.
<a href=
"single.php?id_pre=<? echo $row['id_prd']?>&TypeID=<? echo $row['prd_grp']?>&TypeID=<? echo $row['ref_id_type']?>"
> <img src=
"../Xa/photo/<?echo $row['photo_prd'];?>"
alt=
""
/>
194.
<div
class
=
"mask mask1"
> <span>รายละเอียด</span> </div>
195.
</a>
196.
<p style=
"font-size: 16px;"
> <a
class
=
"item_add"
href=
"order.php?id_prd=<? echo $row['id_prd']?>"
><i></i> ราคา <?
echo
$row
[
'price'
] ?> บาท<span
class
=
" item_price"
> </span></a>
197.
<?
198.
echo
"<div class= 'text1' >"
;
199.
if
(
$row
[
'price'
] !=
$row
[
'price_prd'
]){
200.
echo
"<font style='color:rgb(236, 39, 5);'>ลดเหลือ "
;
201.
echo
$row
[
'price_prd'
];
202.
echo
" บาท</font><br>"
;
203.
}
204.
205.
$dis3
=
$row
[
'price'
] -
$row
[
'price_prd'
];
206.
if
(
$dis3
!=
$row
[
'price_prd'
]){
207.
if
(
$dis3
!= 0){
208.
209.
echo
"<u><font style='color:rgb(29, 119, 11);'> ประหยัด "
;
210.
echo
$dis3
;
211.
echo
" บาท </u> </font>"
;
212.
}
213.
}
else
{
214.
echo
'<p><a
class
=
"item_add"
href=
"#"
><i></i>
215.
<span
class
=
" item_price"
> :';
216.
echo
$row
[
'price_prd'
];
217.
echo
'</span></a></p>'
;
218.
}
219.
echo
"</div>"
;
220.
?>
221.
<?
echo
"หมวดวิชา"
?>
222.
<?PHP
echo
$row
[
'prd_grp'
] ?> </p>
223.
</div>
224.
</div>
225.
226.
<!--
227.
<div
class
=
"col-xs-6 col-md-4 col-sm-4 product-left single-left"
>
228.
<div
class
=
"p-one simpleCart_shelfItem"
>
229.
<div
class
=
"hidden-xs hidden-sm img2"
>
230.
<?
231.
</div>
232.
<br>
233.
<a href=
"single.php?id_pre=<? echo $row['id_prd']?>&TypeID=<? echo $row['ref_id_type']?>"
>
234.
<img src=
"../Xa/photo/<?echo $row['photo_prd'];?>"
alt=
""
/>
235.
<div
class
=
"mask mask1"
>
236.
<span>รายละเอียด</span>
237.
</div>
238.
</a>
239.
240.
241.
<!--
242.
<p style=
"font-size:14px;"
>
243.
<?
244.
245.
<p style=
"font-size:14px; text-align:center; color:rgb(236, 92, 11) "
>
246.
<a
class
=
"item_add"
href=
"order.php?id_prd=<? echo $row['id_prd']?>"
><i></i>
247.
<span
class
=
" item_price"
>$<?
248.
</p>-->
249.
<!--
250.
<p style=
"font-size:14px; text-align:center; color:rgb(236, 92, 11) "
>
251.
<a
class
=
"item_add"
href=
"order.php?id_prd=<? echo $id?>"
><i></i>
252.
ราคา
253.
<span
class
=
" item_price"
><?
echo
$row
[
'price'
] ?></span> บาท</a>
254.
255.
256.
<?
257.
258.
259.
260.
261.
262.
263.
264.
265.
266.
267.
268.
269.
270.
271.
272.
273.
274.
275.
276.
277.
278.
279.
280.
281.
282.
283.
284.
285.
286.
287.
288.
289.
290.
?>
291.
-->
292.
293.
<?
294.
}
295.
?>
296.
<div
class
=
"clearfix visible-md"
></div>
297.
</div>
298.
</div>
299.
</div>
300.
</div>
301.
</div>
302.
303.
<!--tabs-->
304.
<div
class
=
"col-md-3 col-sm-3 single-right"
>
305.
<center>
306.
<h3 style=
"color: #ff6a00;"
>สินค้า</h3>
307.
</center>
308.
<?
309.
$string
= "select ref_id_type ,
count
(id_prd)
as
amount
310.
,(select name_type from tb_type where tb_type.id_type = tb_product.ref_id_type )
as
name_type
311.
from tb_product where status = 1
312.
and
ref_id_type in (1,2,3,4,5)
313.
group by ref_id_type order by ref_id_type desc";
314.
$query
= mssql_query(
$string
);
315.
while
(
$resutf
= mssql_fetch_array(
$query
)){
316.
?>
317.
<ul
class
=
"product-categories"
>
318.
<li > <a href=
"single.php?TypeID=<?= $resutf['ref_id_type']?>"
style=
"color:rgb(231, 93, 5); font-weight:bold;"
> <?
echo
iconv(
'TIS-620'
,
'UTF-8'
,
$resutf
[
'name_type'
]) ?> </a>
319.
<?
320.
if
(
$resutf
[
'ref_id_type'
]==5){
321.
echo
"<img src='images/star.gif' class='hidden-xs hidden-sm' width='48' height='48'/>"
;
322.
}
323.
?>
324.
<span
class
=
"count"
style=
"color:rgb(14, 12, 112); font-weight:bold;"
>(<?
echo
$resutf
[
'amount'
]?>)</span> </li>
325.
</ul>
326.
<?
327.
}
328.
?>
329.
</div>
330.
<div
class
=
"clearfix"
> </div>
331.
</div>
332.
</div>
333.
</div>
334.
<!--
end
-single-->
335.
336.
<?
echo
include
(
"Footer.php"
) ?>
337.
</body>
338.
</html>