|
|
|
ช่วยมาปรับโค๊ดให้ทีคับแนะนำด้วยคับ!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|
|
|
|
|
|
|
ผมมีหน้าโค๊ดด้วยคับ พี่ๆช่วยแนะนำหน่อยคับว่าแก้ไขตรงไหน หรือเพิ่มโค๊ดให้เก็บใน ฐานข้อมูล ตรงไหน
ชื่อtable foodlist วันเดือนเวลา = day จำนวนโต๊ะ = table
นี่โค๊ดคับ
Code (PHP)
<?
@session_start();
ob_start();
$usermem = $_SESSION["usermem"];
require_once "include/connectdb.php";
require_once "include/connect.php";
require_once "include/tdate.php";
if(empty($usermem))
{
$showmember = "
<table width=100% border=0 align=center cellpadding=1 cellspacing=1>
<form method=post action=SignIn.php><tr>
<td width=32% align=right><font size=2 color=#ffffff>ชื่อสมาชิก :</font></td>
<td width=68%><input name=usermem type=text size=15></td>
</tr>
<tr>
<td align=right><font size=2 color=#ffffff>รหัสผ่าน :</font></td>
<td><input name=passmem type=password size=15></td>
</tr>
<tr>
<td> </td>
<td><input name=submit type=submit class=submit value=เข้าสู่ระบบ!></td>
</tr>
<tr>
<td> </td>
<td><font size=2 color=#ffff00>!</font> <a href=ForgetPass.php><font size=2 color=#ffffff>ลืมรหัสผ่าน</font></a></td>
</tr></form>
</table>
";
}else{
$sql="select * from member where usermem='$usermem'";
$db_query=mysql_db_query($db,$sql);
$result=mysql_fetch_array($db_query);
$idxx=$result[id];
$usename=$result[name];
$user_mem=$result[usermem];
$pass_mem=$result[passmem];
$showmember = "
<div align=center><font size=2 color=#ffffff><img src=images/user.gif width=25 height=15>ยินดีต้อนรับ : <font color=#FFFF00>$usename</font>
<br><font size=2 color=#ffffff>[</font> <a href=CheckMyOrder.php><font size=2 color=#ffffff>ประวัติสั่งซื้อสินค้า</font></a> <font size=2 color=#ffffff>]
<br><font size=2 color=#ffffff>[</font> <a href=ChangePass.php><font size=2 color=#ffffff>เปลี่ยนรหัสผ่าน</font></a> <font size=2 color=#ffffff>]
<br><font size=2 color=#ffffff>[</font> <a href=Profiles.php><font size=2 color=#ffffff>ข้อมูลส่วนตัว</font></a> <font size=2 color=#ffffff>]
<br>[</font><a href=Logout.php><font size=2 color=#ffffff>ออกจากระบบ</font></a><font size=2 color=#ffffff>]</font>
</div>
";
$myorder = "<a href=CheckMyOrder.php><img src=images/myorder.gif border=0><a>";
}
?>
<html>
<head>
<title>:: <? echo "$headtxt_web"; ?> ::</title>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
<link href="css/instyle.css" rel="stylesheet" type="text/css">
<link href="css/style1.css" rel="stylesheet" type="text/css">
<link href="css/style.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
<script src="css/jquery-latest.pack.js" type="text/javascript"></script>
<script src="css/jquery.lightbox.js" type="text/javascript"></script>
<script>
$(document).ready(function(){
$(".lightbox").lightbox();
});
</script>
<LINK href="css/contentslider2.css" type=text/css rel=stylesheet>
<STYLE type=text/css>BODY {
MARGIN-TOP: 0px; MARGIN-LEFT: 0px
}
</STYLE>
<SCRIPT src="js/contentslider.js" type=text/javascript>
</SCRIPT>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<style>
.jc{
position:relative;
}
</style>
<script language="JavaScript1.2">
var ns6=document.getElementById&&!document.all
var ie=document.all
var customcollect=new Array()
var i=0
function jiggleit(num){
if ((!document.all&&!document.getElementById)) return;
customcollect[num].style.left=(parseInt(customcollect[num].style.left)==-1)? customcollect[num].style.left=1 : customcollect[num].style.left=-1
}
function init(){
if (ie){
while (eval("document.all.jiggle"+i)!=null){
customcollect[i]= eval("document.all.jiggle"+i)
i++
}
}
else if (ns6){
while (document.getElementById("jiggle"+i)!=null){
customcollect[i]= document.getElementById("jiggle"+i)
i++
}
}
if (customcollect.length==1)
setInterval("jiggleit(0)",80)
else if (customcollect.length>1)
for (y=0;y<customcollect.length;y++){
var tempvariable='setInterval("jiggleit('+y+')",'+'100)'
eval(tempvariable)
}
}
window.onload=init
</script>
</head>
<body bgcolor="#ffffff" background="images/vintage.jpg">
<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
<!-- fwtable fwsrc="Untitled" fwbase="home.jpg" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" -->
<tr>
<td><img src="images/spacer.gif" width="423" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="16" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="225" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="315" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="21" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td>
</tr>
<tr>
<td colspan="5" rowspan="2"><div align="center"><img src="images/banner.jpg" width="1000" height="512"></div> </td>
<td><img src="images/spacer.gif" width="1" height="20" border="0" alt=""></td>
</tr>
<tr>
<td><img src="images/spacer.gif" width="1" height="133" border="0" alt=""></td>
</tr>
<tr>
<td colspan="2"><img src="images/home_r3_c1.jpg" alt="" name="home_r3_c1" width="439" height="62" border="0" usemap="#home_r3_c1Map">
<map name="home_r3_c1Map">
<area shape="rect" coords="30,20,96,50" href="index.php">
<area shape="rect" coords="136,19,230,51" href="Member.php">
<area shape="rect" coords="259,17,356,49" href="Products.php">
<area shape="rect" coords="371,15,440,51" href="Cart.php">
</map></td>
<td colspan="3"><img src="images/home_r3_c3.jpg" alt="" name="home_r3_c3" width="561" height="62" border="0" usemap="#home_r3_c3Map">
<map name="home_r3_c3Map">
<area shape="rect" coords="52,17,146,53" href="Payment.php">
<area shape="rect" coords="197,15,309,52" href="ConfirmPayment.php">
<area shape="rect" coords="365,14,440,55" href="Webboard.php">
<area shape="rect" coords="482,13,557,51" href="Contact.php">
</map></td>
<td><img src="images/spacer.gif" width="1" height="62" border="0" alt=""></td>
</tr>
<tr>
<td colspan="5" bgcolor="#FFFFFF"><div align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
<td width="190"><table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td><img src="images/106104443.jpg" width="174" height="33"></td>
</tr>
<tr>
<td>
<?
$page = $_GET['page'];
$select_type="select * from productstype order by id asc";
$query_select=mysql_query($select_type);
$num_rows=mysql_num_rows($query_select);
if($num_rows<1){
echo "<br><br><center><font color=#666666 face=tahoma size=2><b>ยังไม่มีการเพิ่มข้อมูลค่ะ</b></font></center>";
}else{
$select="select * from productstype order by id asc";
$q_ry = mysql_query($select);
$num_rows=mysql_num_rows($q_ry);
$pagesize=20;
$rt=$num_rows%$pagesize;
if($rt!=0)
{
$totalpage=floor($num_rows/$pagesize)+1;
}
else
{
$totalpage=floor($num_rows/$pagesize);
$toppic_id=1;
}
if(empty($page))
{
$page=1;
}
mysql_free_result($q_ry);
$goto=($page-1)*$pagesize;
$sql_select_mem="Select * From productstype order by id asc limit $goto,$pagesize";
$fect=mysql_query($sql_select_mem);
if(!$fect)
{
("ติดต่อฐานข้อมูลไม่ได้".mysql_error());
exit;
}
$bgcount=0;
while($rows=mysql_fetch_array($fect))
{
$idx =$rows['id'];
$productstypecode =$rows['productstypecode'];
$productstypename = $rows['productstypename'];
$bgcount=$bgcount+1;
$bgmod=$bgcount%2;
if($bgmod==0){
$bgcolor="#E9E9E8";
}else{
$bgcolor="#FFFFFF";
}
$s_num="select * from products where productstypecode = '$productstypecode'";
$query_select_num=mysql_query($s_num);
$snum=mysql_num_rows($query_select_num);
?>
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td height="23"> <div align="left"></div>
<div align="left"></div>
<div align="center"> </div>
<div align="left"><img src="images/opened.gif" width="17" height="17"><font color="#993300" size="2">
<? echo "<a href=ProductList.php?PRD=$productstypecode>$productstypename</a> ($snum)"; ?></font></div></td>
</tr>
<tr>
<td height="5"><img src="images/inline.jpg" width="184" height="3"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><?
}
}
?></td>
</tr>
</table></td>
<td width="482"><table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td><img src="images/2313214141242.JPG" width="137" height="35"></td>
</tr>
<tr>
<td><font size="2"> <strong>หมวดหมู่ :</strong></font><strong>
<a href="ProductList.php?PRD=<? echo "$_GET[PRD]"; ?>">บริการ
<?
$sql1="select * from productstype where productstypecode='$_GET[PRD]'";
$result1=mysql_db_query($db,$sql1);
$rs1=mysql_fetch_array($result1);
echo "<font size=2>";
echo $rs1[productstypename];
echo "</font>";
?>
เลือกจองโต๊ะอาหารได้เลยค่ะ</a></strong></td>
</tr>
<tr>
<td><div align="center">
<table width="100%" border="0">
<?
$sql="select * from products where productstypecode='$_GET[PRD]' order by id desc limit 99";
$check=1;
$result=mysql_db_query($db,$sql);
while ($rs=mysql_fetch_array($result)) {
if ($check%3 ==1){
echo "<TR>";
}
?>
<td height="20" align="center" valign="middle" >
<p>
<?
if ($rs[productsphoto]==""){
echo "
<img src='Admin/IMG/no_pic.jpg' WIDTH=150 HEIGHT=150 BORDER=0>";
}else
{
$products_name = substr($rs[productsname],0,20);
if ($rs[status] == "")
{
$statusnow = "<font size=2 color=#003333>พร้อมให้เช่า</font>";
}else if ($rs[status] == "00000"){
$statusnow = "<font size=2 color=#0033FF>จองแล้ว</font> <a href=QProducts.php?PrdID=$rs[productscode]><font size=2>สอบถาม!</font></a>";
}else if ($rs[status] == "11111"){
$statusnow = "<font size=2 color=#FF0000>เช่าไปแล้ว!</font> <a href=QProducts.php?PrdID=$rs[productscode]><font size=2>สอบถาม!</font></a>";
}
echo "<a href=ShowProducts.php?PrdID=$rs[id] target=_blank><img src='Admin/IMG/$rs[productsphoto]' WIDTH=150 HEIGHT=150 BORDER=0></a><br><img src=images/zoom.gif> <a href=Admin/IMG/$rs[productsphoto] class=lightbox rel=flowers><font size=2>คลิกเพื่อขยาย</font></a>
<br><font size=2>$products_name..<br><font color=#ff0000>ราคา : $rs[productsprice] บาท</font>
<br><a href=Cart_Add.php?PrdID=$rs[id]><img src=images/addcart.png width=108 height=32 border=0></a>";
}
?>
</p>
<table width="470" border="0" cellspacing="1" cellpadding="1">
<form method="post" action="ok.php">
<tr bgcolor="#FFFFFF">
<td width="131"> </td>
<td width="332"><p>
<select name="dd1" class="input" id="dd1">
<option value="0">วัน</option>
<option value="01">1</option>
<option value="02">2</option>
<option value="03">3</option>
<option value="04">4</option>
<option value="05">5</option>
<option value="06">6</option>
<option value="07">7</option>
<option value="08">8</option>
<option value="09">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>
<select name="mm1" class="input" id="mm1">
<option>เดือน</option>
<option value="01">มกราคม</option>
<option value="02">กุมภาพันธ์</option>
<option value="03">มีนาคม</option>
<option value="04">เมษายน</option>
<option value="05">พฤษภาคม</option>
<option value="06">มิถุนายน</option>
<option value="07">กรกฎาคม</option>
<option value="08">สิงหาคม</option>
<option value="09">กันยายน</option>
<option value="10">ตุลาคม</option>
<option value="11">พฤศจิกายน</option>
<option value="12">ธันวาคม</option>
</select>
<select name="select" class="input" id="select">
<option>เลือกเวลา</option>
<option value="01">06:00 .น - 12:00 .น</option>
<option value="02">13:00 .น - 17:00 .น</option>
<option value="03">18:00 .น - 22:00 .น</option>
</select>
</p>
<p>
<label>จำนวน
<input name="table" type="text" value="" size="5" maxlength="2">
</label>
โต๊ะ</p></td>
</tr>
<tr bgcolor="#FFFFFF">
<td><font size="3"> </font></td>
<td><font size="3">
<input name="Submit" type="submit" class="submit" value="สั่งจอง" onClick="return confirm ('คุณต้องการตรวจสอบข้อมูล ใช่ หรือ ไม่? ') ">
</font></td>
</tr>
</form>
</table>
<p> </p></td>
<? if ($check % 3== 0) {
echo "</TR>";
$check=0;
}
$check++;
}
?>
</table>
</div></td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
<td width="244"><table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td><table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td><img src="images/hr1.jpg" width="197" height="23"></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td><font size="2"> <img src="images/arrow.gif" width="7" height="8">
<a href="ReviewProducts.php"><font color="#666666">สินค้าโปรโมชั่น</font></a>
<img src="images/gif_new.gif" width="26" height="12">
</font></td>
</tr>
<tr>
<td><font size="2"><img src="images/arrow.gif" width="7" height="8">
<font color="#666666">ค้นหาสินค้าที่ต้องการ</font>
</font></td>
</tr>
<tr>
<td> <script language="JavaScript">
function checksearch()
{
var s1 = document.webFormSearch.txtsearch.value;
if( s1.length ==0)
{
alert("กรุณาใส่คำที่ค้นหาด้วยค่ะ");
document.webFormSearch.txtsearch.focus();
return false;
}
else
return true;
}
</script> <table width="100%" border="0" cellspacing="1" cellpadding="1">
<form method="post" action="Search.php" name="webFormSearch" onSubmit="return checksearch()">
<tr>
<td width="87%"> <div align="right">
<input name="txtsearch" type="text" class="inputxx" id="txtsearch10" onClick="this.value='';" value="ค้นหาสินค้า" maxlength="15" />
</div></td>
<td width="13%"><input name="image" type=image src="images/icon_search.jpg" width="23" height="23" scr=images/icon_search.jpg></td>
</tr>
<tr>
<td><div align="right"> <font size="2">
<input name="typesearch" type="radio" value="productscode" checked>
รหัสสินค้า
<input type="radio" name="typesearch" value="productsname">
ชื่อสินค้า</font> </div></td>
<td> </td>
</tr>
</form>
</table></td>
</tr>
<tr>
<td><font size="2"><img src="images/arrow.gif" width="7" height="8">
<a href="ConfirmPayment.php"><font color="#666666">แจ้งการชำระเงินได้ที่นี่</font></a></font></td>
</tr>
</table></td>
</tr>
<tr>
<td><img src="images/hr2.jpg" width="197" height="23"></td>
</tr>
<tr>
<td><img src="images/arrow4.gif" width="4" height="9">
<font size="2">ท่านสามารถตรวจสอบรายการสั่งซื้อได้ที่นี่</font></td>
</tr>
<tr>
<td><script language="JavaScript">
function checkOrder()
{
var o1 = document.webFormOrder.orderid.value;
if( o1.length ==0)
{
alert("กรุณาใส่คำที่ค้นหาด้วยค่ะ");
document.webFormOrder.orderid.focus();
return false;
}
else
return true;
}
</script> <table width="100%" border="0" cellspacing="1" cellpadding="1">
<form method="post" action="CheckRefID.php" name="webFormOrder" onSubmit="return checkOrder()">
<tr>
<td><div align="center">
<input name="orderid" type="text" class="inputxx" id="orderid7" onClick="this.value='';" value="เลขใบสั่งซื้อสินค้า" maxlength="15" />
</div></td>
</tr>
<tr>
<td><div align="center">
<input name="image" type="image" src="images/checked.jpg">
</div></td>
</tr>
</form>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</div></td>
<td><img src="images/spacer.gif" width="1" height="25" border="0" alt=""></td>
</tr>
<tr>
<td colspan="2"><img src="images/home_r5_c1.jpg" alt="" name="home_r5_c1" width="439" height="39" border="0" usemap="#home_r5_c1Map">
<map name="home_r5_c1Map">
<area shape="rect" coords="19,8,93,36" href="index.php">
<area shape="rect" coords="143,2,234,49" href="Member.php">
<area shape="rect" coords="265,3,347,35" href="Products.php">
<area shape="rect" coords="376,1,439,42" href="Cart.php">
</map></td>
<td colspan="3"><img src="images/home_r5_c3.jpg" alt="" name="home_r5_c3" width="561" height="39" border="0" usemap="#home_r5_c3Map">
<map name="home_r5_c3Map">
<area shape="rect" coords="56,1,144,39" href="Payment.php">
<area shape="rect" coords="196,-1,304,41" href="ConfirmPayment.php">
<area shape="rect" coords="364,-1,434,37" href="Webboard.php">
<area shape="rect" coords="498,-10,554,38" href="Contact.php">
</map></td>
<td><img src="images/spacer.gif" width="1" height="39" border="0" alt=""></td>
</tr>
<tr>
<td colspan="5"><div align="center"><font color="#FFFFFF" size="2"><? echo "$buttomtxt_web"; ?></font></div></td>
<td><img src="images/spacer.gif" width="1" height="71" border="0" alt=""></td>
</tr>
</table>
<map name="home_r3_c1Map">
<area shape="rect" coords="13,20,79,50" href="index.php">
<area shape="rect" coords="99,20,193,52" href="Member.php">
<area shape="rect" coords="204,19,301,51" href="Products.php">
<area shape="rect" coords="326,17,425,51" href="Cart.php">
</map>
<map name="home_r3_c3Map">
<area shape="rect" coords="15,16,109,52" href="Payment.php">
<area shape="rect" coords="125,16,237,53" href="ConfirmPayment.php">
<area shape="rect" coords="257,16,373,53" href="CheckRef.php">
<area shape="rect" coords="383,14,458,55" href="Webboard.php">
<area shape="rect" coords="472,13,547,51" href="Contact.php">
</map>
<map name="home_r5_c1Map">
<area shape="rect" coords="10,5,84,33" href="index.php">
<area shape="rect" coords="98,2,189,49" href="Member.php">
<area shape="rect" coords="208,2,303,42" href="Products.php">
<area shape="rect" coords="324,2,423,44" href="Cart.php">
</map>
<map name="home_r5_c3Map">
<area shape="rect" coords="12,-2,100,36" href="Payment.php">
<area shape="rect" coords="127,-6,235,36" href="ConfirmPayment.php">
<area shape="rect" coords="383,-1,453,37" href="Webboard.php">
<area shape="rect" coords="477,-12,546,37" href="Contact.php">
<area shape="rect" coords="256,1,365,57" href="CheckRef.php">
</map>
</body>
</html>
ขอบคุณล่วงหน้าคับ มือใหม่คับขอโทดที่รบกวนคับ
Tag : PHP, MySQL
|
ประวัติการแก้ไข 2012-05-07 13:32:55 2012-05-07 13:42:06
|
|
|
|
|
Date :
2012-05-07 13:31:36 |
By :
kaweechai |
View :
1029 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
รู้สึกจะแนะนำกระทู้ก่อนหน้านี้ไปแล้วน่ะครับ
|
|
|
|
|
Date :
2012-05-07 15:21:54 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|