|
|
|
แบ่งหน้าไม่ได้ค่ะ ลองแล้ว งงมากค่ะ ขอบคุณล่วงหน้าค่ะ |
|
|
|
|
|
|
|
ลองเอา Code คอม ข้างนอก ลูป รึยังครับ
|
|
|
|
|
Date :
2012-07-15 19:02:20 |
By :
gtblackhat |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ลองแล้วค่ะมันผิดอ่ะ ดูให้ทีค่ะ
Code
<?
include("mylib.inc");
CheckSession();
CheckAdmin();
?>
<?
if ($_GET["oid"] != "" && $_GET["pid"] != "") {
$con = mysql_connect("localhost", "root", "1234");
$db = mysql_select_db("pl", $con);
mysql_query("SET character_set_results=tis620");
mysql_query("SET character_set_client=tis620");
mysql_query("SET character_set_connection=tis620");
$sql = "delete from orders where oid='" . $_GET["oid"] . "' and pid='" . $_GET["pid"] . "'";
mysql_query($sql, $con);
mysql_close($con);
}
?>
<html>
<head>
<title>เพิ่มรัก</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<script language="javascript">
function userinfo(uid) {
var width = 300;
var height = 210;
var left = (screen.width - width) / 2;
var top = (screen.height - height) / 2;
window.open("userinfo.php?uid=" + uid, "userinfo", "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=" + width + ",height=" + height + ",left=" + left+ ",top=" + top);
}
</script>
<script type="text/JavaScript">
<!--
function MM_controlSound(x, _sndObj, sndFile) { //v3.0
var i, method = "", sndObj = eval(_sndObj);
if (sndObj != null) {
if (navigator.appName == 'Netscape') method = "play";
else {
if (window.MM_WMP == null) {
window.MM_WMP = false;
for(i in sndObj) if (i == "ActiveMovie") {
window.MM_WMP = true; break;
} }
if (window.MM_WMP) method = "play";
else if (sndObj.FileName) method = "run";
} }
if (method) eval(_sndObj+"."+method+"()");
else window.location = sndFile;
}
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_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_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 type="text/css">
<!--
.style6 {font-size: 12px; }
.style7 {font-size: 14px}
-->
</style>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('images/index_03_1.jpg' ,'images/index_04_1.jpg','images/index_05_1.jpg', 'images/index_06_1.jpg' ,'images/index_07_1.jpg','images/index_08_1.jpg','images/index_09_1.jpg','images/index_10_1.jpg' ,'images/index_11_1.jpg','images/index_12_1.jpg')">
<!-- ImageReady Slices (webhome copy.jpg) -->
<table align="center" id="Table_01" width="1024" height="769" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="13"><img src="images/index_01.jpg" width="1024" height="177" alt=""></td>
</tr>
<tr>
<td><img src="images/index_02.jpg" width="91" height="31" alt=""></td>
<td colspan="2"><img src="images/index_03.jpg" alt="" width="68" height="31" id="Image1" onMouseOver="MM_swapImage('Image1','','images/index_03_1.jpg',1)" onMouseOut="MM_swapImgRestore()"></td>
<td><img src="images/index_04.jpg" alt="" width="65" height="31" id="Image2" onMouseOver="MM_swapImage('Image2','','images/index_04_1.jpg',1)" onMouseOut="MM_swapImgRestore()"></td>
<td><img src="images/index_05.jpg" alt="" width="61" height="31" id="Image3" onMouseOver="MM_swapImage('Image3','','images/index_05_1.jpg',1)" onMouseOut="MM_swapImgRestore()"></td>
<td><img src="images/index_06.jpg" alt="" width="71" height="31" id="Image4" onMouseOver="MM_swapImage('Image4','','images/index_06_1.jpg',1)" onMouseOut="MM_swapImgRestore()"></td>
<td><img src="images/index_07.jpg" alt="" width="61" height="31" id="Image5" onMouseOver="MM_swapImage('Image5','','images/index_07_1.jpg',1)" onMouseOut="MM_swapImgRestore()"></td>
<td><img src="images/index_08.jpg" alt="" width="110" height="31" id="Image6" onMouseOver="MM_swapImage('Image6','','images/index_08_1.jpg',1)" onMouseOut="MM_swapImgRestore()"></td>
<td><img src="images/index_09.jpg" alt="" width="91" height="31" id="Image7" onMouseOver="MM_swapImage('Image7','','images/index_09_1.jpg',1)" onMouseOut="MM_swapImgRestore()"></td>
<td><img src="images/index_10.jpg" alt="" width="77" height="31" id="Image8" onMouseOver="MM_swapImage('Image8','','images/index_10_1.jpg',1)" onMouseOut="MM_swapImgRestore()"></td>
<td><img src="images/index_11.jpg" alt="" width="102" height="31" id="Image9" onMouseOver="MM_swapImage('Image9','','images/index_11_1.jpg',1)" onMouseOut="MM_swapImgRestore()"></td>
<td><img src="images/index_12.jpg" alt="" width="133" height="31" id="Image10" onMouseOver="MM_swapImage('Image10','','images/index_12_1.jpg',1)" onMouseOut="MM_swapImgRestore()"></td>
<td><img src="images/index_13.jpg" width="94" height="31" alt=""></td>
</tr>
<tr>
<td colspan="13"><img src="images/index_14_1.jpg" width="1024" height="24" alt=""></td>
</tr>
<tr>
<td colspan="2"><img src="images/index_15_1.jpg" width="136" height="493" alt=""></td>
<td colspan="10" ><table width="463" border="1" align="center">
<tr bgcolor="#FFECFF">
<td colspan="3"><div align="center">การจัดการระบบ <a href="logout.php">(ออกจากระบบ)</a></div></td>
</tr>
<tr bgcolor="#FFCCFF">
<td width="140" ><div align="center" class="style7">จัดการข่าวสาร</div></td>
<td width="154" ><div align="center" class="style7">จัดการบริการ</div></td>
<td width="147" ><div align="center" class="style7">จัดการโปรโมชั่น</div></td>
</tr>
<tr bgcolor="#FFE8FF">
<td><div align="center" class="style7">จัดการผลงาน</div></td>
<td><div align="center" class="style7">จัดการแพ็คเกต</div></td>
<td><div align="center" class="style7">จัดการสมาชิก</div></td>
</tr>
</table>
<p align="center"> </p>
<table width="720" border="0" align="center">
<tr>
<td><div align="center">รายการสั่งซื้อสินค้า</div></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<?
$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
$objDB = mysql_select_db("pl");
mysql_query("SET character_set_results=tis620");
mysql_query("SET character_set_client=tis620");
mysql_query("SET character_set_connection=tis620");
$sql = "select * from orders inner join products on orders.pid=products.pid " .
"order by orders.date,orders.time,orders.oid,orders.pid";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$Num_Rows = mysql_num_rows($objQuery);
$Per_Page = 5; // Per Page
$Page = $_GET["Page"];
if(!$_GET["Page"])
{
$Page=1;
}
$Prev_Page = $Page-1;
$Next_Page = $Page+1;
$Page_Start = (($Per_Page*$Page)-$Per_Page);
if($Num_Rows<=$Per_Page)
{
$Num_Pages =1;
}
else if(($Num_Rows % $Per_Page)==0)
{
$Num_Pages =($Num_Rows/$Per_Page) ;
}
else
{
$Num_Pages =($Num_Rows/$Per_Page)+1;
$Num_Pages = (int)$Num_Pages;
}
$strSQL .=" order by id ASC LIMIT $Page_Start , $Per_Page";
$objQuery = mysql_query($strSQL);
?>
<table width="724" border="1">
<tr>
<td class="style6">ลำดับ</td>
<td class="style6">รหัสสินค้า</td>
<td class="style6">จำนวน</td>
<td class="style6">ไอดี</td>
<td class="style6">ชื่อสินค้า</td>
<td class="style6">ราคา</td>
<td class="style6">วัน/เดือน/ปี</td>
<td class="style6">เวลา</td>
<td class="style6">สถานะ</td>
<td class="style6"> </td>
</tr>
<?
while($objResult = mysql_fetch_array($objQuery))
{
?>
<?
$con = mysql_connect("localhost", "root", "1234");
$db = mysql_select_db("pl", $con);
mysql_query("SET character_set_results=tis620");
mysql_query("SET character_set_client=tis620");
mysql_query("SET character_set_connection=tis620");
$sql = "select * from orders inner join products on orders.pid=products.pid " .
"order by orders.date,orders.time,orders.oid,orders.pid";
$table = mysql_query($sql, $con);
$n = 1;
while ($row = mysql_fetch_array($table)) {
print "<tr>";
print "<td><font size='2'>" . $n++ . "</font></td>";
print "<td><font size='2'>" . $row["oid"] . "</font></td>";
print "<td><font size='2'>" . $row["pid"] . "</font></td>";
print "<td><font size='2'><a href=# onclick=userinfo('" . $row["uid"] . "')>" . $row["uid"] ."</a></font></td>";
print "<td><font size='2'>" . $row["pname"] . "</font></td>";
print "<td><font size='2'>" . $row["price"] . "</font></td>";
print "<td><font size='2'>" . DisplayDate($row["date"]) . "</font></td>";
print "<td><font size='2'>" . DisplayTime($row["time"]) . "</font></td>";
print "<td><font size='2'>" . $row["status"] . "</font></td>";
print "<td><font size='2'><a href=admin.php?oid=" . $row["oid"] . "&pid=" . $row["pid"] . ">Delete</a></font></td>";
print "</tr>";
}
mysql_close($con);
?>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
<td><img src="images/index_19_1.jpg" width="94" height="493" alt=""></td>
</tr>
<tr>
<td width="1024" height="43" colspan="13" background="images/index_20_1.jpg" alt="" onfocus="MM_controlSound('play','document.CS1342254117937','canon.mp3')"> </td>
</tr>
<tr>
<td><img src="images/spacer.gif" width="91" height="1" alt=""></td>
<td><img src="images/spacer.gif" width="45" height="1" alt=""></td>
<td><img src="images/spacer.gif" width="23" height="1" alt=""></td>
<td><img src="images/spacer.gif" width="65" height="1" alt=""></td>
<td><img src="images/spacer.gif" width="61" height="1" alt=""></td>
<td><img src="images/spacer.gif" width="71" height="1" alt=""></td>
<td><img src="images/spacer.gif" width="61" height="1" alt=""></td>
<td><img src="images/spacer.gif" width="110" height="1" alt=""></td>
<td><img src="images/spacer.gif" width="91" height="1" alt=""></td>
<td><img src="images/spacer.gif" width="77" height="1" alt=""></td>
<td><img src="images/spacer.gif" width="102" height="1" alt=""></td>
<td><img src="images/spacer.gif" width="133" height="1" alt=""></td>
<td><img src="images/spacer.gif" width="94" height="1" alt=""></td>
</tr>
</table>
<div align="center"><br>
<font color="#FFFFFF">Total </font>
<font color="#FFFFFF"> <?= $Num_Rows;?> </font>
<font color="#FFFFFF"> Record : </font>
<font color="#FFFFFF"> <?=$Num_Pages;?> </font>
<font color="#FFFFFF"> Page :</font>
<?
if($Prev_Page)
{
echo " <font color='#FFFFFF'><a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page'><< Back</a></font> ";
}
for($i=1; $i<=$Num_Pages; $i++){
if($i != $Page)
{
echo "[ <font color='#FFFFFF'><a href='$_SERVER[SCRIPT_NAME]?Page=$i'>$i</a> </font>]";
}
else
{
echo "<font color='#FFFFFF'><b> $i </b></font>";
}
}
if($Page!=$Num_Pages)
{
echo " <font color='#FFFFFF'><a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page'>Next>></a> </font>";
}
mysql_close($objConnect);
?>
</body>
</html>
|
|
|
|
|
Date :
2012-07-15 19:36:19 |
By :
นู๋น้อย |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
แบ่งหน้าได้ แต่คลิกแล้วไม่เปลี่ยน หน้า รึป่าวครับ
|
|
|
|
|
Date :
2012-07-15 19:45:47 |
By :
gtblackhat |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
มันขึ้น Parse error: syntax error, unexpected $end in C:\AppServ\www\permluck\admin.php on line 278 ไอ้บรรทัดที่ 278 คือบรรทัดท้ายสุดเลยอ่ะ แล้วจะไปแก้ที่ไหนนี่ T-T
|
|
|
|
|
Date :
2012-07-15 20:42:09 |
By :
นู๋น้อย |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ไม่ได้อยู่ดีค่ะ แต่ก้ขอบคุณค่ะ
|
|
|
|
|
Date :
2012-07-16 16:10:04 |
By :
นู๋น้อย |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ลองไล่ดูดี ๆ ครับ
|
|
|
|
|
Date :
2012-07-16 17:00:03 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|