|
 |
|
ช่วยดู ต่อให้หน่อยครับ (มือใหม่หัดเขียน) คือผมทโปรแกรมตะกร้าสินค้านะครับ...นี้คือหน้าแรก หน้าต่อไป |
|
 |
|
|
 |
 |
|
คือผมทโปรแกรมตะกร้าสินค้านะครับ...นี้คือหน้าแรก หน้าต่อไป ผม นึกไม่ออกครับ ว่าจะทำไงต่อ ผมได้ดึงข้อมูลมาจากฐานข้อมูลมาโชว์ แล้ว กดปุ่มสั่งซื้อ .ตรงนี้ ละ ครับที่ติดปัญหา.......ยังไง ก็ ช่วย แนะนำ ผม หน่อย นะ ครับ
Code (PHP)
<html>
<head>
<title>My Shop - หน้าแสดงรายการสินค้า</title>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
<script language="javascript">
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}
</script>
<style>
BODY {
FONT-FAMILY: Arial, Helvetica, sans-serif
}
</style>
</head>
<body>
<center><b><u><font size="5">หน้าแสดงรายการสินค้า</font></u></b></center><br><br>
<center>[ <a href="cart.php" onClick="NewWindow(this.href,'name','600','400','yes');return false">ตะกร้าสินค้า</a> ] [ <a href="manageorder.php">แสดงรายการคำสั่งซื้อ</a> ]</center>
<br><br>
<center></center>
<br><br>
<center>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="60%" id="AutoNumber1" height="149">
<tr>
<td width="35%" bgcolor="#CCCCFF" align="center" height="20"><b>
<font color="#000080">ภาพสินค้า</font></b></td>
<td width="51%" bgcolor="#CCCCFF" align="center" height="20"><b>
<font color="#000080">รายละเอียดสินค้า</font></b></td>
<td width="14%" bgcolor="#CCCCFF" align="center" height="20"><b>
<font color="#000080">สั่งซื้อ</font></b></td>
</tr>
<?php
include("config.inc.php");
// คำสั่ง SQL ที่ใช้ในการเลือกข้อมูลที่อยู่ในฐานข้อมูลกลับมา (เรียงตามลำดับ ID)
$strSQL="SELECT * FROM product";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
/* ในลูปด้านล่าง เทียบได้กับการดึงข้อมูลมาทีละ 1 Record เพื่อนำมาแสดงผลทางหน้าจอ */
while($objResult = mysql_fetch_array($objQuery))
{
?>
<tr>
<td width="35%" align="center" height="128">
<a href="photo/<?=$objResult["FilesName"];?>">
<img src="photo/<?=$objResult["Thumbnails"];?>" border="0"></a></center></td> </td>
<td width="51%" align="center" height="128">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" >
<tr>
<tr>
<td width="27%" align="right">
<p align="right"><font size="2" color="#800000">
รหัสสินค้า :</font></td>
<td width="3%"> </td>
<td width="70%"><font size="2" color="#000080"><?php echo $objResult['id'] ; ?></font></td>
</tr>
<tr>
<td width="27%" align="right">
<p align="right"><font size="2" color="#800000">
ชื่อสินค้า :</font></td>
<td width="3%"> </td>
<td width="70%"><font size="2" color="#000080"><?php echo $objResult['name'] ; ?></font></td>
</tr>
<tr>
<td width="27%" align="right">
<font size="2" color="#800000">
ประเภทสินค้า :</font></td>
<td width="3%"> </td>
<td width="70%"><font size="2" color="#000080"><?php echo $objResult['type'] ; ?></font></td>
</tr>
<tr>
<td width="27%" align="right">
<font size="2" color="#800000">
ราคา :</font></td>
<td width="3%"> </td>
<td width="70%"><font size="2" color="#000080"><?php echo $objResult['price'] ; ?></font><font size="2" color="#000080"> บาท/ตัว</td>
</tr>
<tr>
<td width="27%" align="right">
<font size="2" color="#800000">รุ่น
:</font></td>
<td width="3%"> </td>
<td width="70%"><font size="2" color="#000080"><?php echo $objResult['model'] ; ?></font></td>
</tr>
<tr>
<td width="27%" align="right">
<font size="2" color="#800000">
คงเหลือ :</font></td>
<td width="3%"> </td>
<td width="70%"><font size="2" color="#000080"><?php echo $objResult['amount'] ; ?></font>
<font size="2" color="#000080"> ตัว</td>
</tr>
<tr>
<td width="27%" align="right">
<font size="2" color="#800000">
สี :</font></td>
<td width="3%"> </td>
<td width="70%"><font size="2" color="#000080"><?php echo $objResult['color'] ; ?></font></td>
</tr>
</table>
</td>
<td width="14%" align="center" height="128"><b>
<font color="#000080"><a href="order.php?product_id=5" onClick="NewWindow(this.href,'name','600','400','yes');return false">[สั่งซื้อ]</a></font></b></td>
<?php
}
?>
</tr>
</table>
</center>
<br><br>
</body>
</html>
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2009-09-29 04:31:55 |
By :
kittioof |
View :
951 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
|
|

|
Load balance : Server 05
|