|
|
|
search แบ่งหน้าทำไงคะ คือทำ search แล้วพอแบ่งหน้า หน้าที่ 2ไม่แสดงผล มันบอกว่า |
|
|
|
|
|
|
|
คือทำ search แล้วพอแบ่งหน้า หน้าที่ 2ไม่แสดงผล มันบอกว่า ให้เลือกเงื่อนไขที่ต้องการค้นหา ทำยังไงคะต้องการด่วนมากเลย
<?
session_start();
$name=$_SESSION[sess_username];
include "connect.php";
$sql="select * from employee where UserID = '$name'";
$result=mysql_db_query($dbname,$sql);
$rs=mysql_fetch_array($result);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="style.css" rel="stylesheet" type="text/css" />
<title>ระบบจัดการร้านแว่นตา</title>
<style type="text/css">
<!--
#apDiv1 {
position:absolute;
left:157px;
top:256px;
width:221px;
height:107px;
z-index:1;
}
a:link {
color: #0000FF;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #0000FF;
}
a:hover {
text-decoration: none;
color: #FF0066;
}
a:active {
text-decoration: none;
color: #FF0033;
}
.style6 {
font-size: 36px;
font-family: AngsanaUPC;
color: #FF0066;
}
.style7 {color: #FF0066}
.style8 {
color: #FFFFFF;
font-size: 16px;
}
.style9 {
font-size: 16px
}
-->
</style>
<script type="text/javascript" language="JavaScript1.2" src="stmenu.js"></script>
</head>
<body>
<p> </p>
<table width="942" height="820" border="0" align="center" bordercolor="#FF9900" cellPadding=0 cellSpacing=0 >
<tr bordercolor="#FF9900">
<td height="155" colspan="2" scope="col"><img src="Image/head.jpg" width="942" height="158" /></td>
</tr>
<tr bordercolor="#FF9900">
<td width="209" valign="top" bgcolor="#FFFFFF"><table width="209" height="15" border="0">
<tr>
<td width="230">
<center>
<p class="style7"> </p>
<p class="style7"><img src="Image/welcome.jpg" width="198" height="33" /></p>
<p> </p>
<p><font face="MS Sans Serif" size="3" color="#ff0066"><? echo "$rs[EmpName] $rs[EmpSName]"; ?><br /><br /><a href="logout.php"><img src="Image/star.gif" width="18" height="18" border="0"/> Logout</a> </font><img src="Image/star.gif" width="18" height="18" /> </p>
<p> </p>
<p><img src="Image/menu.jpg" width="198" height="33" /></p>
<p> </p>
</center>
<center>
<script type="text/javascript" language="JavaScript1.2">
<!--
stm_bm(["menu7677",730,"","blank.gif",0,"", "",0,0,250,0,1000,1,0,0,"","",0,0,1,2,"hand","hand",""],this);
stm_bp("p0",[1,4,0,0,1,2,20,7,100, "progid:DXImageTransform.Microsoft.Fade(overlap=.5, enabled=0,Duration=0.40)",-2,"",-2,70,0,0,"#7F7F7F", "#F2F2F2","",3,0,0,"#666666"]);
stm_ai("p0i0",[0,"หน้าหลัก","","",-1,-1,0,"./logmem.php","_self","","","47d0e9e9ede47.gif", "47d0e9e9ede47.gif",20,20,0,"","",0,0,0,0,1,"#FFFFFF",0,"#FFFFFF", 0,"","",0,0,0,0,"#F4A838","#666666","#FF0066","#0000FF","11pt 'Arial','Verdana'","11pt 'Arial','Verdana'",0,0],200,30);
stm_ai("p0i1",[6,1,"#FF0066","",-1,-1,0]);
stm_aix("p0i2","p0i0",[0,"ลูกค้า","","",-1,-1,0,"","_self","","","47d0e9e9ede47.gif", "47d0e9e9ede47.gif",20,20,0,"arrow_r.gif", "arrow_r.gif",7,7],200,30);
stm_bp("p1",[1,2,-80,0, 1,1,20,0,100,"stEffect(\"slip\")",-2,"stEffect(\"slip\")",-2,80,0,0,"#7F7F7F","#F2F2F2", "",3,0,0,"#FF0066"]);
stm_aix("p1i0","p0i0",[0,"เพิ่มลูกค้า","","",-1,-1,0,"./formregis.php"],120,30);
stm_aix("p1i1","p0i1",[]);
stm_aix("p1i2","p0i0",[0,"รายชื่อลูกค้า","","",-1,-1,0,"./showcust.php"],120,30);
stm_aix("p1i3","p0i1",[]);
stm_ep();
stm_aix("p0i3","p0i1",[]);
stm_aix("p0i4","p0i2",[0,"พนักงาน"],200,30);
stm_bpx("p2","p1",[]);
stm_aix("p2i0","p0i0",[0,"เพิ่มพนักงาน","","",-1,-1,0,"./formemp.php"],120,30);
stm_aix("p2i1","p0i1",[]);
stm_aix("p2i2","p0i0",[0,"รายชื่อพนักงาน","","",-1,-1,0,"./showemp.php"],120,30);
stm_aix("p2i3","p0i1",[]);
stm_ep();
stm_aix("p0i5","p0i1",[]);
stm_aix("p0i6","p0i2",[0,"สินค้า"],200,30);
stm_bpx("p3","p1",[]);
stm_aix("p3i0","p0i0",[0,"กรอบแว่น","","",-1,-1,0,"./showgl.php"],120,30);
stm_aix("p3i1","p0i1",[]);
stm_aix("p3i2","p0i0",[0,"เลนส์","","",-1,-1,0,"./showlens.php"],120,30);
stm_aix("p3i3","p0i1",[]);
stm_ep();
stm_aix("p0i7","p0i1",[]);
stm_aix("p0i8","p0i0",[0,"ยืนยันการรับสินค้า","","",-1,-1,0,"./state_or.php"],200,30);
stm_aix("p0i9","p0i1",[]);
stm_aix("p0i10","p0i0",[0,"รายการใบสั่งซื้อ","","",-1,-1,0,"./report.php"],200,30);
stm_aix("p0i11","p0i1",[]);
stm_aix("p0i12","p0i2",[0,"รายงานการซื้อขาย","","",-1,-1,0,"./report.php"],200,30);
stm_bpx("p4","p1",[1,2,-80,0,1,1,20,7]);
stm_aix("p4i0","p0i0",[0,"รายรับ","","",-1,-1,0,"./revenue.php"],140,30);
stm_aix("p4i1","p0i1",[]);
stm_aix("p4i2","p0i0",[0,"สินค้าขายดี","","",-1,-1,0,"./amount_max.php"],140,30);
stm_aix("p4i3","p0i1",[]);
stm_aix("p4i4","p0i2",[0,"จำนวนสินค้า"],140,30);
stm_bpx("p5","p1",[]);
stm_aix("p5i0","p0i0",[0,"กรอบแว่น","","",-1,-1,0,"./showgl_am.php"],120,30);
stm_aix("p5i1","p0i1",[]);
stm_aix("p5i2","p0i0",[0,"เลนส์","","",-1,-1,0,"./showlens_am.php"],120,30);
stm_aix("p5i3","p0i1",[]);
stm_ep();
stm_aix("p4i5","p0i1",[]);
stm_ep();
stm_aix("p0i13","p0i1",[]);
stm_aix("p0i14","p0i2",[0,"เพิ่มสินค้าใหม่"],200,30);
stm_bpx("p6","p1",[]);
stm_aix("p6i0","p0i0",[0,"กรอบแว่น","","",-1,-1,0,"./add_gl.php"],120,30);
stm_aix("p6i1","p0i1",[]);
stm_aix("p6i2","p0i0",[0,"เลนส์","","",-1,-1,0,"./add_lens.php"],120,30);
stm_aix("p6i3","p0i1",[]);
stm_ep();
stm_aix("p0i15","p0i1",[]);
stm_ep();
stm_em();
//-->
</script></center></td>
</tr>
</table>
<p align="center"> </p>
<p align="center"><img src="Image/calendar.jpg" /></p>
<center>
<p> <br />
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var now = new Date();
var month_array = new Array("มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม");
document.write("<form name=date_list><table bgcolor=#FFCCFF><tr><td>");
document.write("<select name=month onchange=change_month(this.options.selectedIndex)>");
for(i=0;i<month_array.length;i++)
{
if (now.getMonth() != i)
{document.write ("<option value="+i+">"+month_array[i]);}
else
{document.write ("<option value="+i+" selected>"+month_array[i]);}
}
document.write("</select>");
document.write("</td><td>");
document.write ("<select name=year onchange=change_year(this.options[this.options.selectedIndex])>");
for(i=1950;i<3000;i++)
{
if (now.getYear() != i)
{document.write("<option value="+i+">"+i);}
else
{document.write("<option value="+i+" selected>"+i);}
}
document.write("</select></td></tr><tr><td colspan=2><center>");
document.write("<table bgcolor=white border=0 cellspacing = 0 cellpading = 0 width=100%><tr bgcolor=#FFCCFF align=center>");
document.write("<td><font color=black>จ</font></td><td><font color=black>อ</td><td><font color=black>พ</td><td><font color=black>พฤ</td><td><font color=black>ศ</td><td ><font color=black>ส</td><td ><font color=black>อ</td>");
document.write("</tr><tr>");
for(j=0;j<6;j++)
{
for(i=0;i<7;i++)
{
document.write("<td align=center id=d"+i+"r"+j+"></td>")
}
document.write("</tr>");
}
document.write("</table>");
document.write("</center></form></td></tr></table>");
var show_date = new Date();
function set_cal(show_date)
{
begin_day = new Date (show_date.getYear(),show_date.getMonth(),1);
begin_day_date = begin_day.getDay();
end_day = new Date (show_date.getYear(),show_date.getMonth()+1,1);
count_day = (end_day - begin_day)/1000/60/60/24;
input_table(begin_day_date,count_day);
}
set_cal(show_date);
function input_table(begin,count)
{
init();
j=0;
if (begin!=0){i=begin-1;}else{i=6}
for (c=1;c<count+1;c++)
{
colum_name = eval("d"+i+"r"+j);
if ((now.getDate() == c)&&(show_date.getMonth() == now.getMonth())&&(show_date.getYear() == now.getYear())) {colum_name.style.backgroundColor = "FFCCFF";colum_name.style.color = "FF0066";};
colum_name.innerText = c;
i++;
if (i==7){i=0;j++;}
}
}
function init()
{
for(j=0;j<6;j++)
{
for(i=0;i<7;i++)
{
colum_name = eval("d"+i+"r"+j);
colum_name.innerText = "-";
colum_name.style.backgroundColor ="";
colum_name.style.color ="";
}
}
}
function change_month(sel_month)
{
show_date = new Date(show_date.getYear(),sel_month,1);
set_cal(show_date);
}
function change_year(sel_year)
{
sel_year = sel_year.value;
show_date = new Date(sel_year,show_date.getMonth(),1);
set_cal(show_date);
}
// End -->
</script>
</p>
</p>
<p> </p>
</center></p></td>
<th width="733" height="660" valign="top" bordercolor="#FF0066" bgcolor="#FFFFFF" scope="col">
<br /><table width="733" border="0">
<tr>
<td><form name="search" method="post" action="search.php">
<div align="right">
<select name="search" id="select">
<option><-- ค้นหาจาก --></option>
<option value="1">ชื่อลูกค้า</option>
<option value="2">ราคากรอบแว่น</option>
<option value="3">เลขที่ใบสั่งสินค้า</option>
</select>
<input name="keyword" type="text" size="10" maxlength="10">
<input type="submit" value="ค้นหา">
</label>
</div>
</form></td>
</tr>
</table>
<p align="center"> </p>
<p align="center">
<?
include "connect.php";
$search= $_POST['search'];
$keyword= $_POST['keyword'];
//echo " = $search";
//echo " = $keyword";
if ($search=="" and $keyword==""){
echo "กรุณากรอกและเลือกรายการที่ต้องการค้นหา";
}else if($search=="1")
{
$sql="select * from customer where CustName like '%$keyword%' ";
$result=mysql_db_query($dbname,$sql);
$num=mysql_num_rows($result);
if($num==0) {
echo "<font color='red'>ไม่พบชื่อลูกค้าที่ต้องการค้นหา</font>" ;
}else {
echo "รายชื่อลูกค้าที่พบ<br><br>";
echo "<table width=600 height = '20' border=1 bordercolor='#0000FF' cellPadding=0 cellSpacing=0>";
echo "<tr bgcolor = ccffff>";
echo "<td align = center>ชื่อ</td>";
echo "<td align = center>นามสกุล</td>";
echo "<td align = center> ข้อมูลส่วนตัว </td>";
echo "<td align = center> แก้ไข </td>";
echo "<td align = center> ลบ </td>";
echo "<td align = center> สั่งสินค้า </td>";
echo "</tr>";
while($recode = mysql_fetch_array($result)) {
$CustID = $recode['CustID'] ;
$CustName = $recode['CustName'] ;
$CustSurName = $recode['CustSurName'] ;
echo "<tr height ='30' bgcolor =FFFFFF>";
echo "<td align='left'> $CustName </td>";
echo "<td align='left'> $CustSurName </td>";
echo "<td><a href = \"./showcustID.php?CustID=$CustID\"> <img src='./Image/open.gif' border=0></a></td>";
echo "<td><a href = \"./editcust.php?CustID=$CustID\"><img src='./Image/edit.gif' border=0></a></td>";
echo "<td><a href = \"./delete.php?CustID=$CustID\" onclick=\"return confirm(' ต้องการลบข้อมูลหรือไม่ ')\"><img src='./Image/delete.gif' border=0</a></td>";
echo "<td><a href = \"./showgl.php?CustID=$CustID\"><img src='./Image/order.gif' border=0></a></td>";
echo "</tr>";
}
echo "</table>";
}
}else if($search=="2"){
//echo "$keyword";
$sql="select * from product where (Price between '0' and '$keyword%') AND (PrdID like 'A%') ORDER BY PrdID DESC limit 10";
$result=mysql_db_query($dbname,$sql);
$num=mysql_num_rows($result);
if($num==0) {
echo "<font size='2' color='red'>ไม่พบราคาที่ต้องการ</font>" ;
}else {
$c=0;
echo "ราคากรอบแว่นที่พบ<br><br>";
while($recode = mysql_fetch_array($result)) {
$PrdID = $recode[PrdID];
$PrdName = $recode[PrdName];
$PrdDesign = $recode[PrdDesign];
$PrdColor = $recode[PrdColor];
$PrdDetail =$recode[PrdDetail];
$Amount = $recode[Amount];
$P = $recode[Price];
echo "<table>";
echo "
<tr><td rowspan=5><img src='./Image/product/$PrdID' height=150 width=140> </td>
</tr>
<tr>
<td height=22 width=157 align=right><font size=2 color=#000099>ชื่อสินค้า ::</font></td>
<td width=168 align=left><font size=2 color=#000099>$PrdName</font></td>
</tr>
<tr>
<td height=26 width=157 align=right><font size=2 color=#000099>รุ่น ::</font></td>
<td width=168 align=left><font size=2 color=#000099>$PrdDesign</font></td>
</tr>
<tr>
<td width=157 align=right><font size=2 color=red> ราคา ::</font></td>
<td align=left><font size=2 color=red> $P บาืท</font></td>
</tr>
<tr>
<td colspan=2><center><font color=0000ff>[<a href=proview.php?PrdID=$PrdID&CustID=$CustID><font size=2>รายละเอียด</font></a>]</font>
<font color=0000ff>[<a href=basket_add.php?PrdID=$PrdID&CustID=$CustID><img src=./Image/cart.gif border=0></a> $Amount ชิ้น]</font></center></td>
</tr>";
echo "</table>";
$c++;
}//while
}//else
}else if($search == "3"){
//echo "<br>$keyword ==";
$sql="select customer.CustName, customer.CustSurName, customer.CustTel, order.id_order, order.total_price, order.DateOrder, order.Status FROM `customer` INNER JOIN `order` ON customer.CustID = order.CustID where id_order like '$keyword%' ";
$result=mysql_db_query($dbname,$sql);
$num=mysql_num_rows($result);
if($num == 0) {
//echo"++ $num //";
echo "<font color='red'>ไม่พบเลขที่ใบสั่งที่่ต้องการค้นหา</font>";
}else {
echo "รายการใบสั่งซื้อที่พบ";
echo "<br><br>";
//echo"-- $num //";
echo "<center><table>
<TABLE BORDER=0 width = 600 height=30>
<TR BGCOLOR=#98F5FF>
<TD><CENTER><B><font size=3>ใบสั่งสินค้า</font></B></CENTER></TD>
<TD><CENTER><B><font size=3>ชื่อ - สกล</font></B></CENTER></TD>
<TD><CENTER><B><font size=3>เบอร์ติดต่อ</font></B></CENTER></TD>
<TD><CENTER><B><font size=3>ราคารวม</font></B></CENTER></TD>
<TD><CENTER><B><font size=3>วันที่</font></B></CENTER></TD>
<TD><CENTER><B><font size=3>รับสินค้า</font></B></CENTER></TD>
<TD><CENTER><B><font size=3>[ลบ]</font></B></CENTER></TD>
</TR> ";
$no=1;
while($record=mysql_fetch_array($result)) {
$id_order=$record[id_order];
$code_order=sprintf("%05d",$id_order);
$CustName=$record[CustName];
$CustSurName=$record[CustSurName];
$CustTel=$record[CustTel];
$total_price=$record[total_price];
$DateOrder=$record[DateOrder];
$Status=$record[Status];
//$tim = $rs[tim];
echo "
<TR BGCOLOR=#E0FFFF>
<TD><A HREF=\"cust_or.php?id_order=$id_order\">$code_order</A></TD>
<TD align=left><font size=2><left>$CustName $CustSurName</left></font></TD>
<TD align=left><font size=2>$CustTel</font></TD>
<TD align=center><font size=2>$total_price</font></TD>
<TD><font size=2>$DateOrder</font></TD>";
if($Status == '0'){
echo "<td align=right><font size=2>ไม่้ยืนยัน<img src=./Image/no.gif></font></td>";
}else{
echo "<td align=right><font size=2>ยืนยันแล้ว<img src=./Image/confirm.gif></font></td>";
}
echo "<TD><A HREF=\"order_delete.php?id_order=$id_order\"
onclick=\"return confirm('ยืนยันลบใบสั่งซื้อสินค้า $id_order ออกจากระบบ')\"><font size=2>[ลบ]</font></A></TD>
</TR>
</TR>";
$no++;
}//while
echo "</TABLE></center>";
}//else
}
?>
</p>
<p align="center"><br>
</p>
<p align="center"> </p></th>
</tr>
</table>
<p align="center" class="style9"> </p>
<p align="center"><span class="style8">Copyright ? 2009 (Your Site). All Rights Reserved. Design by AraBelle</span></p>
<p align="center"> </p>
<p align="center"> </p>
</body>
</html>
Tag : - - - -
|
|
|
|
|
|
Date :
2009-05-25 14:48:26 |
By :
belle |
View :
1303 |
Reply :
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ช่วยแบ่งหน้าการแสดงผลโดยที่หน้าถัดมาแสดงได้เหมือนกับหน้าที่1ด้วยนะคะ
ขอบคุณค่ะ
|
|
|
|
|
Date :
2009-05-25 14:51:10 |
By :
belle |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ส่งตังแปร $_GET['keuword'] ไปด้วย
|
|
|
|
|
Date :
2009-05-25 18:24:20 |
By :
danya |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|