- no more sql error if the whole result set is to be shown

This commit is contained in:
steinm 2011-04-08 16:09:50 +00:00
parent 308005e1ac
commit 1dbf8bab6c

View File

@ -177,13 +177,13 @@ $startdate = array();
$stopdate = array();
if (isset($_GET["creationdate"]) && $_GET["creationdate"]!=null) {
$startdate = array('year'=>$_GET["createstartyear"], 'month'=>$_GET["createstartmonth"], 'day'=>$_GET["createstartday"]);
if (!checkdate($startdate['month'], $startdate['year'], $startdate['day'])) {
if (!checkdate($startdate['month'], $startdate['day'], $startdate['year'])) {
UI::contentContainer(getMLText("invalid_create_date_start"));
UI::htmlEndPage();
exit;
}
$stopdate = array('year'=>$_GET["createendyear"], 'month'=>$_GET["createendmonth"], 'day'=>$_GET["createendday"]);
if (!checkdate($stopdate['month'], $stopdate['year'], $stopdate['day'])) {
if (!checkdate($stopdate['month'], $stopdate['day'], $stopdate['year'])) {
UI::contentContainer(getMLText("invalid_create_date_end"));
UI::htmlEndPage();
exit;
@ -228,19 +228,20 @@ if(isset($_GET['categoryids']) && $_GET['categoryids']) {
//
// Default page to display is always one.
$pageNumber=1;
$limit = 25;
if (isset($_GET["pg"])) {
if (is_numeric($_GET["pg"]) && $_GET["pg"]>0) {
$pageNumber = (integer)$_GET["pg"];
$pageNumber = (int) $_GET["pg"];
}
else if (!strcasecmp($_GET["pg"], "all")) {
$pageNumber = "all";
elseif (!strcasecmp($_GET["pg"], "all")) {
$limit = 0;
}
}
// ------------------------------------- Suche starten --------------------------------------------
$startTime = getTime();
$resArr = $dms->search($query, 25, ($pageNumber-1)*25, $mode, $searchin, $startFolder, $owner, $status, $startdate, $stopdate, $categories);
$resArr = $dms->search($query, $limit, ($pageNumber-1)*$limit, $mode, $searchin, $startFolder, $owner, $status, $startdate, $stopdate, $categories);
$searchTime = getTime() - $startTime;
$searchTime = round($searchTime, 2);
// ---------------------------------- Ausgabe der Ergebnisse --------------------------------------