mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-14 13:42:04 +00:00
propperly initialize $totalDocs in search()
This commit is contained in:
parent
0026f8c69c
commit
5641b5b067
|
@ -716,6 +716,7 @@ class SeedDMS_Core_DMS {
|
||||||
|
|
||||||
/*--------- Do it all over again for documents -------------*/
|
/*--------- Do it all over again for documents -------------*/
|
||||||
|
|
||||||
|
$totalDocs = 0;
|
||||||
if($mode & 0x1) {
|
if($mode & 0x1) {
|
||||||
$searchKey = "";
|
$searchKey = "";
|
||||||
$searchFields = array();
|
$searchFields = array();
|
||||||
|
@ -900,7 +901,6 @@ class SeedDMS_Core_DMS {
|
||||||
if($searchKey || $searchOwner || $searchCategories || $searchCreateDate || $searchExpirationDate || $searchAttributes || $status) {
|
if($searchKey || $searchOwner || $searchCategories || $searchCreateDate || $searchExpirationDate || $searchAttributes || $status) {
|
||||||
// Count the number of rows that the search will produce.
|
// Count the number of rows that the search will produce.
|
||||||
$resArr = $this->db->getResultArray("SELECT COUNT(*) AS num FROM (SELECT DISTINCT `tblDocuments`.id ".$searchQuery.") a");
|
$resArr = $this->db->getResultArray("SELECT COUNT(*) AS num FROM (SELECT DISTINCT `tblDocuments`.id ".$searchQuery.") a");
|
||||||
$totalDocs = 0;
|
|
||||||
if (is_numeric($resArr[0]["num"]) && $resArr[0]["num"]>0) {
|
if (is_numeric($resArr[0]["num"]) && $resArr[0]["num"]>0) {
|
||||||
$totalDocs = (integer)$resArr[0]["num"];
|
$totalDocs = (integer)$resArr[0]["num"];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user