01.
<?
02.
$no
=0;
03.
include
"../connect.php"
;
04.
$sql
=
"select * from tb_photoupload order by id_photo"
;
05.
$result
=mysql_db_query(
$dbname
,
$sql
);
06.
$num
=mysql_num_rows(
$result
);
07.
if
(
$num
>0) {
08.
09.
echo
"
10.
11.
<center><TABLE BORDER=1 >
12.
<TR bgcolor=#EEEEEE>
13.
<TD><strong><center>ลำดับ</center></strong></TD>
14.
<TD><strong><center>ชื่อไฟล์รูปภาพ</center></strong></TD>
15.
<TD><strong><center>รายละเอียด</center></strong></TD>
16.
<TD><strong><center>ประเภท</center></strong></TD>
17.
<TD><strong><center>ชื่อลูกค้า</center></strong></TD>
18.
<TD><strong><center>บริษัท</center></strong></TD>
19.
<TD><strong><center>เบอร์ติดต่อ</center></strong></TD>
20.
<TD><strong><center>อีเมล์</center></strong></TD>
21.
<TD><strong><center>จำนวน</center></strong></TD>
22.
<TD><strong><center>บล็อก</center></strong></TD>
23.
<TD><strong><center>แก้ไข</center></strong></TD>
24.
<TD><strong><center>ลบ</center></strong></TD>
25.
</TR>";
26.
27.
while
(
$r
=mysql_fetch_array(
$result
)) {
28.
$id_photo
=
$r
[id_photo];
29.
$name_photo
=
$r
[name_photo];
30.
$detail_photo
=
$r
[detail_photo];
31.
$category
=
$r
[category];
32.
$name_cus
=
$r
[name_cus];
33.
$company
=
$r
[company];
34.
$tel
=
$r
[tel];
35.
$email
=
$r
[email];
36.
$amount
=
$r
[amount];
37.
$blog
=
$r
[blog];
38.
39.
$no
++;
40.
41.
echo
"
42.
<TR>
43.
<TD><center>
$no
</center></TD>
44.
<TD>
45.
<center><A HREF=
'images_large/$name_photo'
TARGET=
'_blank'
>
46.
<img src=
'images_small/$name_photo'
border=0></A></center>
47.
</TD>
48.
<TD>
$detail_photo
</TD>
49.
<TD>
$category
</TD>
50.
<TD>
$name_cus
</TD>
51.
<TD>
$company
</TD>
52.
<TD>
$tel
</TD>
53.
<TD>
$email
</TD>
54.
<TD>
$amount
</TD>
55.
<TD><center>
$blog
</center></TD>
56.
57.
<TD><a href=
'edit.php?id_edit=$id_photo'
><center><img src=\
"images/edit.png\"
border=0></center></a></TD>
58.
<TD><a href=
'delete.php?id_del=$id_photo&name_del=$name_photo'
59.
onclick=\
"return confirm('คุณแน่ใจที่จะลบรูป $name_photo ออกจากระบบ?')\"><center><img src=\"images/delete.png\"
border=0></center></a>
60.
</TD> </TR>";
61.
}
62.
}
63.
?>