This topic is locked

Chose data before run list_page

12/31/2008 1:30:40 AM
PHPRunner General questions
M
maxcolo author

Hi,

Goog 2009 at all,

I have this query for my list_page.php:

[codebox]SELECT
tavoli_cena.id_tavolo_cena,

tavoli_cena.zona,

tavoli_cena.numero_tavolo,

tavoli_cena.posti_max,

tavoli_cena.foto_tavolo,

prenotazioni_cena.id_pre_cena,

prenotazioni_cena.id_tavolo,

prenotazioni_cena.`data`,

prenotazioni_cena.id_utente,

prenotazioni_cena.posti_prenotati,

prenotazioni_cena.ora_arrivo,

prenotazioni_cena.durata_stimata,

prenotazioni_cena.note

FROM

tavoli_cena

Left Join prenotazioni_cena ON prenotazioni_cena.id_tavolo = tavoli_cena.id_tavolo_cena

WHERE

prenotazioni_cena.`data` <> '2008-12-21' OR

prenotazioni_cena.posti_prenotati IS NULL [/codebox]
Would I want to replace the date, a variable that can be select from the consumer from a calendar before the page performs the query as I can resolve?

T
thesofa 1/3/2009

set the first page to have no records, redirect user to search page where he can select date from calendar for the date field

hichem 1/3/2009

set the first page to have no records, redirect user to search page where he can select date from calendar for the date field


How do you set the page to have no records?

This is not all as selecting the date wouldn't automatically insert it into your query, unless I missed something here?

I am dealing with a similar issue. You need to use the event BeforSQLQuery and get the date using $_POST. I yet have to test my example.

may be someone else has a better idea?

M
maxcolo author 1/4/2009

Hi, the problem is to do just so that the consumer can choose the date before the execution of the query, and then to pass her as variable to the same query.

I understand Hich, but I don't succeed in understanding the explanation of Thesofa.

Does someone better of me have some other best solution?

T
thesofa 1/4/2009

OK, In Version 5, on the miscellaneous page, there is a tick box No records on First page.

Tick this and then use the page redirect event to send the user to the advanced search page to get them to chose the date
You may wish to read this about searching before data shown

It is quite long and involved, but I had to filter data before showing it, like you need to, and the syatem in the thread works fine, on first selecting the list, user is redirected to the advanced search page to pick the data required then the list page is shown, but you need to read and follow the code samples shown.

Good luck

M
maxcolo author 1/4/2009

Grazie,

for this solution, I make a verification as you you recommend and I make you know. I thank you for your attention.

Thanks