|
From: <dai...@us...> - 2014-06-01 08:16:29
|
Revision: 6741
http://sourceforge.net/p/web-erp/reponame/6741
Author: daintree
Date: 2014-06-01 08:16:22 +0000 (Sun, 01 Jun 2014)
Log Message:
-----------
fix POItems.php paging
Modified Paths:
--------------
trunk/PO_Items.php
trunk/doc/Change.log
Modified: trunk/PO_Items.php
===================================================================
--- trunk/PO_Items.php 2014-05-31 01:41:40 UTC (rev 6740)
+++ trunk/PO_Items.php 2014-06-01 08:16:22 UTC (rev 6741)
@@ -1074,16 +1074,18 @@
}
}
- $sqlcount = substr($sql,strpos($sql, "FROM"));
- $sqlcount = substr($sqlcount,0, strpos($sqlcount, "ORDER"));
- $sqlcount = 'SELECT COUNT(*) '.$sqlcount;
- $SearchResult = DB_query($sqlcount,$db,$ErrMsg,$DbgMsg);
+ $SQLCount = substr($sql,strpos($sql, "FROM"));
+ $SQLCount = substr($SQLCount,0, strpos($SQLCount, "ORDER"));
+ $SQLCount = 'SELECT COUNT(*) '.$SQLCount;
+ $SearchResult = DB_query($SQLCount,$db,$ErrMsg,$DbgMsg);
$myrow=DB_fetch_array($SearchResult);
DB_free_result($SearchResult);
unset($SearchResult);
$ListCount = $myrow[0];
$ListPageMax = ceil($ListCount / $_SESSION['DisplayRecordsMax'])-1;
-
+ if ($ListPageMax < 0) {
+ $ListPageMax = 0;
+ }
if (isset($_POST['Next'])) {
$Offset = $_POST['currpage']+1;
}
@@ -1091,10 +1093,14 @@
$Offset = $_POST['currpage']-1;
}
if (!isset($Offset)) {
- $Offset=0;
+ $Offset = 0;
}
- if($Offset<0)$Offset=0;
- if($Offset>$ListPageMax)$Offset=$ListPageMax;
+ if($Offset < 0){
+ $Offset = 0;
+ }
+ if($Offset > $ListPageMax) {
+ $Offset = $ListPageMax;
+ }
$sql = $sql . "LIMIT " . $_SESSION['DisplayRecordsMax']." OFFSET " . strval($_SESSION['DisplayRecordsMax']*$Offset);
Modified: trunk/doc/Change.log
===================================================================
--- trunk/doc/Change.log 2014-05-31 01:41:40 UTC (rev 6740)
+++ trunk/doc/Change.log 2014-06-01 08:16:22 UTC (rev 6741)
@@ -1,4 +1,5 @@
webERP Change Log
+1/6/14 Phil: Fixed bug in POItems.php that resulted in an SQL error when the number of items from the search was zero after previous searches had returned records
27/05/14 RChacon: Add page title text and icon to import scripts. Page title text = menu option.
27/05/14 RChacon: Regroups the import scripts in the utility menu.
27/05/14 Exson: Add Sales man login control for PDFOrderStatus.php
|