|
|
|
รบกวนช่วยเอา code แบ่งหน้า Page ออกให้หน่อยครับพอดีเอาออกแล้วข้อมูลไม่แสดงเลย |
|
|
|
|
|
|
|
Code (PHP)
<?php
require("connect/connect.php");
require("connect/function.php");
?>
<!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" />
<title>Download System</title>
<link href="css/styles.css" rel="stylesheet" type="text/css" />
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="general.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
<script type="text/javascript" src="jquery.ui.touch-punch.min.js"></script>
<script type="text/javascript" src="facescroll.js">
</script>
<script type="text/javascript">
jQuery(function(){ // on page DOM load
$('#Download').alternateScroll();
$('#Download').alternateScroll({ 'vertical-bar-class': 'styled-v-bar', 'hide-bars': false });
})
</script>
<script type="text/javascript">
function popup(url,name,windowWidth,windowHeight){
myleft=(screen.width)?(screen.width-windowWidth)/2:100;
mytop=(screen.height)?(screen.height-windowHeight)/2:100;
properties = "width="+windowWidth+",height="+windowHeight;
properties +=",scrollbars=yes, top="+mytop+",left="+myleft;
window.open(url,name,properties);
}
</script>
</head>
<body>
TEST New System
<?
//============ เลือกว่าเป็นหมวดอะไร
$resultHeadPro=select("category","where 1=1 and CatID='".$_GET["CatID"]."' ");
if(!$resultHeadPro)
{
//header("location:index.php");
}
if($_GET["CatID"]!="")
{
}
else
{
}
?>
<div id="Download" style="width:100%; height:550px; overflow:scroll">
<?
//============ เลือกรายการสินค้าออกมาแสดง
$condition="";
if($_GET["CatID"] <> "")
{
$condition="and CatID='$_GET[CatID]' ";
}
$sql = "select * from product where 1=1 $condition";
/* ตั้งค่า แสดงผลต่อหน้า $Per_Page */
$Per_Page =100;
if(!$Page)
$Page=1;
//============ คำนวณจำนวนหน้า
$Prev_Page = $Page-1;
$Next_Page = $Page+1;
$result=mysql_query($sql);
$Page_start = ($Per_Page*$Page)-$Per_Page;
$Num_Rows = mysql_num_rows($result);
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;
if(($Page>$Num_Pages) || ($Page<0))
print "<center><b>จำนวน $Page มากกว่า $Num_Pages ยังไม่มีข้อความ<b></center>";
$sql .= " order by ProductID DESC LIMIT $Page_start , $Per_Page";
//ส่วนแสดงผล
$i=0;
$query = mysql_query($sql);
While($resutNewPro= mysql_fetch_array($query)){
$i++;
echo "<td>";
?>
<div class="fs-name" style="font-size:12px; font-weight:bold;"><?=$resutNewPro["fansub"];?>
</div>
<?
$strSQL = "SELECT * FROM upload_list WHERE ProductID = '".$resutNewPro["ProductID"]."' ORDER BY ep ASC";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
?><?
while($objResult = mysql_fetch_array($objQuery))
{
?>
<div class="File" style="width:100%;">
<div class="File-List">
<div class="icon"><span class="icon-th-large"></span></div>
<div class="file-name"><a href="<?=$objResult["url"];?>" target="_blank" rel="nofollow external"><span style="font-size:12px; margin-right:3px;"><?=$objResult["file"];?> </span></a>
<?php if ($objResult["watch"]=="Enable"){?><a href="javascript:popup('http://watch.mashiro-th.com/watch.php?file_id=<?=$objResult["file_id"];?>','',940,529)" ><span class="icon-facetime-video"></span></a> <?php
}
?>
</div>
<div class="footer"></div>
</div>
</div>
<?php
}
?>
<div style="height:10px;"></div>
<?
if(($i)%1==0)
{
echo"</tr>";
}
else
{
}
}
echo"</tr></table>";
if($i==0)
{
echo "<div style='width:500px; color:red;'><h3>There are no files in this Anime</h3></strong></div>";
}
?>
</p>
</div>
</body>
</html>
Tag : PHP
|
|
|
|
|
|
Date :
2013-03-09 15:18:59 |
By :
nukedonut1 |
View :
882 |
Reply :
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<?php
require("connect/connect.php");
require("connect/function.php");
?>
<!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" />
<title>Download System</title>
<link href="css/styles.css" rel="stylesheet" type="text/css" />
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="general.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
<script type="text/javascript" src="jquery.ui.touch-punch.min.js"></script>
<script type="text/javascript" src="facescroll.js">
</script>
<script type="text/javascript">
jQuery(function(){ // on page DOM load
$('#Download').alternateScroll();
$('#Download').alternateScroll({ 'vertical-bar-class': 'styled-v-bar', 'hide-bars': false });
})
</script>
<script type="text/javascript">
function popup(url,name,windowWidth,windowHeight){
myleft=(screen.width)?(screen.width-windowWidth)/2:100;
mytop=(screen.height)?(screen.height-windowHeight)/2:100;
properties = "width="+windowWidth+",height="+windowHeight;
properties +=",scrollbars=yes, top="+mytop+",left="+myleft;
window.open(url,name,properties);
}
</script>
</head>
<body>
TEST New System
<?
$sql = "select * from product where 1=1 $condition";
$sql .= " order by ProductID DESC";
$i=0;
$query = mysql_query($sql);
While($resutNewPro= mysql_fetch_array($query)){
$i++;
echo "<td>";
?>
<div class="fs-name" style="font-size:12px; font-weight:bold;"><?=$resutNewPro["fansub"];?>
</div>
<?
$strSQL = "SELECT * FROM upload_list WHERE ProductID = '".$resutNewPro["ProductID"]."' ORDER BY ep ASC";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
?><?
while($objResult = mysql_fetch_array($objQuery))
{
?>
<div class="File" style="width:100%;">
<div class="File-List">
<div class="icon"><span class="icon-th-large"></span></div>
<div class="file-name"><a href="<?=$objResult["url"];?>" target="_blank" rel="nofollow external"><span style="font-size:12px; margin-right:3px;"><?=$objResult["file"];?> </span></a>
<?php if ($objResult["watch"]=="Enable"){?><a href="javascript:popup('http://watch.mashiro-th.com/watch.php?file_id=<?=$objResult["file_id"];?>','',940,529)" ><span class="icon-facetime-video"></span></a> <?php
}
?>
</div>
<div class="footer"></div>
</div>
</div>
<?php
}
?>
</div>
</body>
</html>
|
ประวัติการแก้ไข 2013-03-09 15:23:54
|
|
|
|
Date :
2013-03-09 15:23:19 |
By :
Ex-[S]i[L]e[N]t |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ลองแก้ไขละคับมันดึงออกมาแสดงหมดเลยอ่ะคับ ที่แบ่งหมวดไว้มันไม่ได้ เช่น id=5 มันดึงออกมาแสดงทั้ง db เลย
|
|
|
|
|
Date :
2013-03-09 15:35:59 |
By :
nukedonut1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เขียน code WHERECode (PHP)
<body>
<?
//============ เลือกรายการสินค้าออกมาแสดง
$condition="";
if($_GET["CatID"] <> "")
{
$condition="and CatID='$_GET[CatID]' ";
}
$sql = "select * from product where 1=1 $condition";
/* ตั้งค่า แสดงผลต่อหน้า $Per_Page */
$sql .= " order by ProductID DESC";
//ส่วนแสดงผล
$i=0;
$query = mysql_query($sql);
While($resutNewPro= mysql_fetch_array($query)){
$i++;
echo "<td>";
?>
<div class="fs-name" style="font-size:12px; font-weight:bold;"><?=$resutNewPro["fansub"];?>
</div>
<?
$strSQL = "SELECT * FROM upload_list WHERE ProductID = '".$resutNewPro["ProductID"]."' ORDER BY ep ASC";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
?><?
while($objResult = mysql_fetch_array($objQuery))
{
?>
<div class="File" style="width:100%;">
<div class="File-List">
<div class="icon"><span class="icon-th-large"></span></div>
<div class="file-name"><a href="<?=$objResult["url"];?>" target="_blank" rel="nofollow external"><span style="font-size:12px; margin-right:3px;"><?=$objResult["file"];?> </span></a>
<?php if ($objResult["watch"]=="Enable"){?><a href="javascript:popup('http://watch.mashiro-th.com/watch.php?file_id=<?=$objResult["file_id"];?>','',940,529)" ><span class="icon-facetime-video"></span></a> <?php
}
?>
</div>
<div class="footer"></div>
</div>
</div>
<?php
}
?>
<div style="height:10px;"></div>
<?
if(($i)%1==0)
{
echo"</tr>";
}
else
{
}
}
echo"</tr></table>";
if($i==0)
{
echo "<div style='width:500px; color:red;'><h3>There are no files in this Anime</h3></strong></div>";
}
?>
</p>
</div>
</body>
|
|
|
|
|
Date :
2013-03-09 15:49:31 |
By :
Ex-[S]i[L]e[N]t |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ได้ละคับขอบคุณครับ
|
|
|
|
|
Date :
2013-03-09 15:56:22 |
By :
nukedonut1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|