This topic is locked

Select date interval and pass input to list page

1/10/2009 3:36:50 PM
PHPRunner General questions
hichem author

I have read a couple of related posts and they were quite useful however I am getting stuck here. Would appreciate some help <img src='' class='bbc_emoticon' alt=':)' />


Before executing a complex query on 1 table, I need to prompt the users to select a date fied, in fact they need to provide date BETWEEN 2 values as the query requires 2 dates. Once they do their date selection these params will be passed to the SQL to feed the view list.

As described by Jane, I have added my table to the project, ticked the box no records in first page and added event

List Page: BeforeProcessList


//my table name is transactions
then added the event on Search Page


// write search options

// my column name is CFG_DATE


$options.="<OPTION VALUE=\"Between\" selected>"."Between"."</option>";

$searchtype = "<SELECT ID=\"SearchOption\" NAME=\"asearchopt_CFG_DATE\" SIZE=1 onChange=\"return ShowHideControls();\">";

$searchtype .= $options;

$searchtype .= "</SELECT>";

When I build my project it complains about undefined smarty variable?
I need to pass the 2 date values to my SQL query which has joints and is quite long. What's the best way to do this?

I need to post date1 and date2 to use these in my query. Anyone has an example please?
many thanks in advance

Jane 1/12/2009

this code is for PHPRunner 4.2.

Here is the correct code for PHPRunner 5.0:

// write search options


$options.="<OPTION VALUE=\"Between\" selected>BETWEEN</option>";

$searchtype = "<SELECT ID=\"SearchOption\" NAME=\"asearchopt_FieldName\" SIZE=1 onChange=\"return ShowHideControls();\">";

$searchtype .= $options;

$searchtype .= "</SELECT>";