I have a listing by date range that works fine when no range is input. The complete set of records is displayed and pagination works as expected.
When inputting a date range it also works fine if there is no limit to the page.
If a page limit is set the first page is displayed correctly but on picking a different page from the paginator the date range check is lost and the full listing appears.
The code for the date range is in the Header:
The code to select the records is in the Conditions box for the model:
Is this a bug or am I missing some code? Help much appreciated.
Wallyhowe
When inputting a date range it also works fine if there is no limit to the page.
If a page limit is set the first page is displayed correctly but on picking a different page from the paginator the date range check is lost and the full listing appears.
The code for the date range is in the Header:
<p>To select range of dates enter the dates in the format: yyyy-mm-dd. End date can be left empty for today's date.</p> <p> <b> Search: </b><input type="text" name="srch" /> <b> Start Date: </b><input type="text" name="datemin" /> <b> End Date: </b><input type="text" name="datemax" /> <br /> </p> <p> <input type="submit" name="submit" value="Go" /> <br /> </p>
The code to select the records is in the Conditions box for the model:
<?php $start=\GCore\Libs\Request::data("datemin"); $b=strtotime("$start"); $end= \GCore\Libs\Request::data("datemax"); $c=strtotime("$end"); $t=time(); if(empty($end)){$c=$t;} if(\GCore\Libs\Request::data("datemin")){ return array("txn.date >=" => "$b", "txn.date <=" => "$c"); } ?>
Is this a bug or am I missing some code? Help much appreciated.
Wallyhowe