01.
<?
02.
include
](
"../Data/conn_shopping.php"
;
03.
$sql_select
=
"select * from product_item limit 0,4"
;
04.
$result1
= mysql_query(
$sql_select
,
$conn
);
05.
echo
"<table width='380' border=0 cellspacing=5 cellpadding=5 class=black style='border-right:1px dotted #C0C0C0;'>"
;
06.
echo
"<tr>"
;
07.
?>
08.
09.
<script type=
"text/javascript"
>
10.
function
conf(pdid) {
11.
if
(confirm(
"Do you want to buy item?"
) == true){
12.
location.href=
'#?id='
+pdid; ผมคิดว่าปัญหามาจาก ตรง ลิ้ง #
13.
14.
return
true;
15.
}
16.
return
false;
17.
}
18.
</script>
19.
20.
<?
21.
while
(
$result
= mysql_fetch_array(
$result1
))
22.
{
23.
if
(
$a
>2){
24.
echo
"</tr><tr>"
;
25.
$a
=0;
26.
}
27.
28.
echo
"<td valign=top align=center style='board-left: 1px solid #C0C0C0; border-bottom: 1px dotted #C0C0C0; border-bottom-width: 1'><a href='' class='osx' onclick='conf({$result[id]})'><img src='$result[picture]' border=0 width=45 height=50><br><span id='$result[id]'>$result[title]..<font1><br>(ราคา:$result[price]บาท)</a></font1></span><br></td>"
;
29.
$a
=
$a
+1;
30.
}
31.
?>
32.
33.
<div id=
"modal-content"
>
34.
<div id=
"modal-title"
>Item</div>
35.
<div
class
=
"close"
><a href=
"#"
class
=
"simplemodal-close"
>x</a></div>
36.
<div id=
"modal-data"
>
37.
38.
ภายใน popup หมายเลข 4 ครับ
39.
40.
<?php
41.
include
(
"../Data/conn_shopping.php"
);
42.
$sql
=
"select * from product_item where id='$_GET[id]'"
;
43.
$sqlquery
= mysql_db_query(
$dbname
,
$sql
);
44.
$array
= mysql_fetch_array(
$sqlquery
);
45.
46.
print
"<img src='$array[picture]' width=45 height=50><br>"
;
47.
print
"ID : "
.
$array
[
'id'
].
"<br>"
;
48.
print
"Name : "
.
$array
[
'title'
].
"<br>"
;
49.
print
"Price : "
.
$array
[
'price'
].
" Bath"
;
50.
51.
?>
52.
</div>
53.
</div>
54.
55.
<?
56.
echo
"</tr>"
;
57.
echo
"</table>"
;
58.
?>