|
|
|
ช่วยดูให้หน่อยครับ Page ไม่ตัด 50 page ครับ |
|
|
|
|
|
|
|
มีการกำหนด Limit ในคำสั่ง Query ไม๊ครับ???
|
|
|
|
|
Date :
2018-02-07 12:24:35 |
By :
arm8957 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ไม่มีครับ
|
|
|
|
|
Date :
2018-02-07 12:59:30 |
By :
owenback |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ถ้างั้น ต้องใส่ยังไงอ่ะครับ
|
|
|
|
|
Date :
2018-02-07 13:39:31 |
By :
owenback |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
คุณลองตัด code มาดีกว่าครับเฉพาะที่คุณต้องการเปลี่ยน
|
|
|
|
|
Date :
2018-02-07 14:13:48 |
By :
dudesaranyu |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ตรงนี้นะครับ แบ่งออกมา เป็น 5 พันกว่าเลยนะครับ
Code (PHP)
if(isset($vname)==NULL)
{
echo "<div style='height:400px;width:1350;border:1px solid #ccc;'>";
echo "<br><br><br><br><br><br><br><br><br><br><-- Go to search --></div>";
}
else
{
$page=$_GET['page'];
if($page==NULL) $page=1; //page 1
$start = (50*$page)-49; //start page
$end = 50*$page; //end page
$poonline="select c.* from (select DENSE_RANK() OVER (ORDER BY VCODE DESC ) as ROW, * from PUR_PO where VCODE is NOT NULL";
if($vcode!=NULL)
$poonline.=" and VCODE='".$vcode."'";
if($vname!=NULL)
$poonline.=" and VNAME LIKE '%".$vname."%' ";
if($podate!="--")
$poonline.=" and PODATE>='".$podate."'"; if($to!="--")
$poonline.=" and PODATE<= '".$to."'";
if($purgrp!=NULL)
$poonline.=" and PURGRP='".$purgrp."'";
if($mate!=NULL)
$poonline.=" and MATERIAL='".$mate."'";
if($draw!=NULL)
$poonline.=" and DRAWNO='".$draw."'";
if($newdate!="--")
$poonline.=" and NEWDUEDATE>='".$newdate."'";
if($tonewdate!="--")
$poonline.=" and NEWDUEDATE<= '".$tonewdate."'";
if($reporttype!=NULL)
$poonline.=" and ='".$reporttype."'";
if($status!=NULL)
$poonline.=" and STATUS='".$status."'";
if($vconfdate!="--")
$poonline.=" and VCONFDATE>='".$vconfdate."'";
if($tovconfdate!="--")
$poonline.=" and VCONFDATE<= '".$tovconfdate."'";
if($vaccnpodate!="--")
$poonline.=" and VACCNPODATE>='".$vaccnpodate."'";
if($tovaccnpodate!="--")
$poonline.=" and VACCNPODATE<= '".$tovaccnpodate."'";
if($vaccrpodate!="--")
$poonline.=" and VACCRPODATE>='".$vaccrpodate."'";
if($tovaccrpodate!="--")
$poonline.=" and VACCRPODATE>='".$tovaccrpodate."'";
$poonline.=" ) c where c.ROW>=$start and c.ROW<=$end ";
$querypoonline=sqlsrv_query($conn,$poonline);
$cut1=str_replace("where c.ROW>=$start and c.ROW<=$end","",$poonline); //ตัดออก
$querycount=sqlsrv_query($conn,$cut1, $params,$options);
$num_rows=sqlsrv_num_rows($querycount);
$all_page=ceil($num_rows/50);
?>
<div align='left' style='width:1350;'>
<?php
if($page%10==1 && $page!=1) $continue=$page; //case (11,21,31,...)
else
{
if($page%10==0) $continue=$page-9; /*case (10,20,30,...)*/ else $continue=($page-($page%10))+1; /*case (1,2,3,4,...)*/
}
$linkpage="index.php?vname&docdate=&to=&purgrp=&mate=&status=&draw=&newdate=&tonewdate=&reporttype=&status=&vconfdate=&tovconfdate=&vaccnpodate=&tovaccnpodate=&vaccrpodate=&tovaccrpodate=&page=";
echo "<font color='Black'>Page: </font>";
for($j = $continue; $j <= $all_page; $j++)
{
if($j>10 && $j==$continue)
{
$prev=$continue-1; echo "<mark style='background-color:#A4A4A4; color:Black;'><a href='$linkpage"."1"."'><u>1</u></a></mark>|<a href='$linkpage".$prev."'><u>....</u></a>|";
}
if($page == $j)
{
echo(" <font color='Black'>".$j."</font> ");
} else
{
echo"<mark style='background-color:#A4A4A4; color:Black;'><a href='$linkpage".$j."'>$j</a></mark>";
}
echo "<font color='Black'>|</font>";
if($j%10==0)
{
$next=$j+1;
if($next<=$all_page) echo "<a href='$linkpage".$next."'><u>....</u></a>|<mark style='background-color:#A4A4A4; color:Black;' ><a href='$linkpage".$all_page."'><u>$all_page</u></a></mark>";
break;
}
}
?>
|
ประวัติการแก้ไข 2018-02-07 14:51:06 2018-02-07 14:51:48 2018-02-07 14:52:50 2018-02-07 14:53:22 2018-02-07 14:54:09
|
|
|
|
Date :
2018-02-07 14:50:14 |
By :
owenback |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ผิดๆ นึกว่า mysql
|
ประวัติการแก้ไข 2018-02-08 21:21:27
|
|
|
|
Date :
2018-02-08 21:19:58 |
By :
Chaidhanan |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
รบกวนด้วยครับ ยังติดอยู่เลยครับ
|
|
|
|
|
Date :
2018-02-09 09:20:59 |
By :
owenback |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|