|
 |
|
พี่ๆค่ะ ช่วยอีกนิดนึงนะค่ะ หาไม่เจออีกแล้วอ่ะ แงๆ ช่วยหน่อยนะ |
|
 |
|
|
 |
 |
|
Code (PHP)
<?
session_start();
if ($sess_adminid<>session_id()) {
header ( "Location: admin.php"); exit();
}
include "connect.php";
$sql="select * from tb_product order by id_prd desc";
$result=mysql_db_query($dbname,$sql);
$number=mysql_num_rows($result);
$no=1;
?>
<html>
<head></title>ร้านค้าออนไลน์สำหรับผู้ดูแลระบบ</title></head>
<body>
<?
include "admin_menu.php";
if ($number<>0) {
echo "
<p><strong>แสดงสินค้า</strong></p>
<table border=1>
<tr bgcolor=#e8e8e8>
<td><center><b>รหัสสินค้า</b></center></td>
<td><center><b>สินค้า</b></center></td>
<td><center><b>ประเภทสินค้า</b></center></td>
<td><center><b>ราคา</b></center></td>
<td><center><b>[แก้ไข]</b></center></td>
<td><center><b>[ลบ]</b></center></td>
</tr>";
while ($rs=mysql_fetch_array($result)) {
$id_prd=$rs[id_prd];
$code_prd=sprintf("%05d",$id_prd);
$name_prd=$rs[name_prd];
$ref_id_type=$rs[ref_id_type];
$price_prd=$rs[price_prd];
$photo_prd=$rs[photo_prd];
$sql2="select name_type from tb_type where id_type = '$ref_id_type' ";
$result2=mysql_db_query($dbname,$sql2);
$rs2=mysql_fetch_array($result2);
$name_type=$rs2[name_type];
echo "
<tr>
<td>$code_prd</td>
<td>$name_prd</td>
<td>$name_type</td>
<td>$price_prd</td>
<td><a href =\"admin_product_edit.php?id_edit=$id_prd\">[แก้ไข]</a></td>
<td><a href =\"admin_product_delete.php?id_del=$id_prd&Photo_del=$Photo_prd\
"onclick=\"return confirm('ยืนยันการลบประเภทสินค้า $name_prd ออกจากระบบ')\">[ลบ]</a></td>
</tr>
</tr>";
$no++;
}
echo "</table>";
mysql_close();
}
?>
</body>
</html>
|
 |
 |
 |
 |
Date :
2010-12-21 21:05:17 |
By :
ppanchai |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
บรรทัดที่ 49 กับ 50 ทำไมปิด tag </tr> 2 ครั้งล่ะครับ
|
 |
 |
 |
 |
Date :
2010-12-21 21:08:43 |
By :
ppanchai |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ค่ะๆ งง
|
 |
 |
 |
 |
Date :
2010-12-21 21:38:13 |
By :
yokuchan |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองดูแบบนี้ครับ น่าจะง่ายกว่า
Code (PHP)
<?
session_start();
if ($sess_adminid<>session_id()) {
header ( "Location: admin.php"); exit();
}
include "connect.php";
$sql="select * from tb_product order by id_prd desc";
$result=mysql_db_query($dbname,$sql);
$number=mysql_num_rows($result);
$no=1;
?>
<html>
<head></title>ร้านค้าออนไลน์สำหรับผู้ดูแลระบบ</title></head>
<body>
<?
include "admin_menu.php";
if ($number<>0) {
?>
<p><strong>แสดงสินค้า</strong></p>
<table border=1>
<tr bgcolor=#e8e8e8>
<td><center><b>รหัสสินค้า</b></center></td>
<td><center><b>สินค้า</b></center></td>
<td><center><b>ประเภทสินค้า</b></center></td>
<td><center><b>ราคา</b></center></td>
<td><center><b>[แก้ไข]</b></center></td>
<td><center><b>[ลบ]</b></center></td>
</tr>
<?
while ($rs=mysql_fetch_array($result)) {
$id_prd=$rs[id_prd];
$code_prd=sprintf("%05d",$id_prd);
$name_prd=$rs[name_prd];
$ref_id_type=$rs[ref_id_type];
$price_prd=$rs[price_prd];
$photo_prd=$rs[photo_prd];
$sql2="select name_type from tb_type where id_type = '$ref_id_type' ";
$result2=mysql_db_query($dbname,$sql2);
$rs2=mysql_fetch_array($result2);
$name_type=$rs2[name_type];
?>
<tr>
<td><?=$code_prd;?></td>
<td><?=$name_prd;?></td>
<td><?=$name_type;?></td>
<td><?=$price_prd;?></td>
<td><a href ="admin_product_edit.php?id_edit=<?=$id_prd;?>">[แก้ไข]</a></td>
<td><a href ="admin_product_delete.php?id_del=$id_prd&Photo_del=$Photo_prd "onclick="return confirm('ยืนยันการลบประเภทสินค้า <?=$name_prd;?> ออกจากระบบ')">[ลบ]</a></td>
<?
$no++;
}
?>
</tr>
</table>
<?
mysql_close();
}
?>
</body>
</html>
|
ประวัติการแก้ไข 2010-12-21 23:43:32 2010-12-21 23:44:57 2010-12-22 02:25:27
 |
 |
 |
 |
Date :
2010-12-21 23:39:10 |
By :
thnvaza |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|