This topic is locked

date search variable set like $_SESSION['variable']

1/16/2012 6:19:40 AM
PHPRunner General questions
T
technoserv author

Hi everybody.
I'm using Phprunner 5.3.
I had make two bottons previous and next page that meke me see previous and next day.
With great help of Cristian I put corect code in Before SQL query" event (see topic [SOLVED] Button previuos and next by day variable).
the buttons work fine and the search with the advanced panel make me se all record filter by a field that i want.
The problem is when I put in search field of panel search, a date (for example 20/01/2012). It make me see records filter by that date but the buttons there are not. I think the $_SESSION variable is still set on the old value.
How can i set the field date value in search box edited = to the S_SESSION variable that work correctly with next and previous buttons?

C
cgphp 1/16/2012
if( ! isset($_SESSION['step_date']))

{

$_SESSION['step_date'] = date('Y-m-d',strtotime("+1 day",time()));

}
if(isset($_GET['ctlSearchFor']))

{

$_SESSION['step_date'] = date('Y-m-d',strtotime($_GET['ctlSearchFor']));

}
$strWhereClause = whereAdd("giorno_app ='".$_SESSION['step_date']."'",$strWhereClause);
T
technoserv author 1/16/2012

Hi Cristian-

Im happy to see you.
It does not work!
only to recapitulate.
The first entrance to the list page works fine, It goese to list by day that begin from tomorrow.


If I click to next button and previous one it works fine.


If I put in date search field a value and submit it goes at list of the value that i put but the previous and next buttons have disappeared and the value of $_SESSION['step_date'] remain old one and do not get the value of field search.

T
technoserv author 1/17/2012

How can I set a $_SESSION variable = field in date search panel?

C
cgphp 1/17/2012
if( ! isset($_SESSION['step_date']))

{

$_SESSION['step_date'] = date('Y-m-d',strtotime("+1 day",time()));

}
if(isset($_GET['value11']))

{

$_SESSION['step_date'] = date('Y-m-d',strtotime($_GET['value11']));

}
$strWhereClause = whereAdd("giorno_app ='".$_SESSION['step_date']."'",$strWhereClause);


value11 holds the date value of the search panel.