This topic is locked

Changing the where clause for a list page

7/10/2006 1:47:54 PM
PHPRunner General questions
D
Dale author

I have a purchases list with all the add/edit/delete/view forms produced by PHPrunner.
I have copied and renamed the purchases_list.php to purchases_acct_list.php.
Is there a way to change the where clause that fetches the data from the database.

This list I want to check a field named done to see if the purchase is active.
I know you can make a table view of the same table, but that increases the created file set by 12 files just so I can check one additional field. Seems like a lot of overhead for just one change. I can easily take care of any changes needed to the new list manually.
Is there any way I can override or modify on the fly the $gstrSQL statement that resides in the purchases_variables.php
Any suggestions would be appreciated.

adamdidthis 7/10/2006

I have a purchases list with all the add/edit/delete/view forms produced by PHPrunner.

I have copied and renamed the purchases_list.php to purchases_acct_list.php.
Is there a way to change the where clause that fetches the data from the database.

This list I want to check a field named done to see if the purchase is active.
I know you can make a table view of the same table, but that increases the created file set by 12 files just so I can check one additional field. Seems like a lot of overhead for just one change. I can easily take care of any changes needed to the new list manually.
Is there any way I can override or modify on the fly the $gstrSQL statement that resides in the purchases_variables.php
Any suggestions would be appreciated.


Is the done field on the same table?
If so you can edit the list file manualy to make it show up, or just add it to the list through PHPRunner.

J
Jane 7/11/2006

Dale,
open ..._acct_list.php file, locate include("include/TableName_variables.php"); line and add your code with new query after it:

$gstrSQL = "select ... where ...";

D
Dale author 7/11/2006

Thankyou Jane and Adam.
It is a bit more difficult, or should I say "I have made it a bit more difficult".

My initial customer list page acutally directs a user to another list page with master details appended.
Confused. I believe making new ...variable.php files for the custom ...list.php files will be the answer.

I will do some testing with what you suggested Jane.
Again, thanks for the reply.

Support is great.

D
Dale author 7/11/2006

Thanks, this issue is solved.
I created customer_active_variables file and altered the sql statement there.
Then on the custom customer_active_list.php I changed the include statement to point to the new customer_active_list_php.
It was a nice way to create a new list without having the extra 11 files generated.
Thankyou for your suggestions.

kujox 7/12/2006

I had the same problem, here's what i did
in the initial customer list page I stored the customer id(cust_id) in a session variable, in the events before you just to the next page
in the next page I put the session variable in the edit sql query as WHERE cust_id='$_SESSION['cust_id']'
this will then list only transactions associated with that customer