after find action and sql query
Archived from the Xataface Users forum.
PolderBoy — Sun Jul 29, 2012 2:16 pm
Hello All,
Is there an action After_find?
And is it possible to get the query from a find?
index.php?-action=list&-table=tblGegevens&-cursor=0&-skip=0&-limit=30&-mode=find&-edit=1&Dierenarts=%3D1&HuisdierGewicht=12
would give:
SELECT * FROM tblGegevens WHERE Dierenarts = 1 AND HuisdierGewicht = 12
I do not know the criteria the user will use for a find, could be between dates and Dierenarts (vet) table = VetID
All I know is that the lay-out has to be perfect and the user has to be automatically presented with the pdf for viewing or downloading.
Thanks in advance,
Brian
PS I just posted this a couple of minutes before but couldn’t see my post, so maybe I double posted. If so I am sorry.
shannah — Mon Jul 30, 2012 10:35 am
Since “finds” just pipe a Xataface request using URL conventions, you might want to just preprocess all requests coming in using the beforeHandleRequest() method of the application delegate class. You can always get the current query as an associative array using the Dataface_Application::getQuery() method.
e.g
- Code: Select all
- `function beforeHandleRequest(){
$app = Dataface_Application::getInstance();
$query =& $app->getQuery(); // we obtain reference so we can change it…
}`
-Steve
PolderBoy — Mon Jul 30, 2012 2:41 pm
Hello Steve,
Perfect that is what I was looking for.
Now I can make the pdf for downloading after a user did a search.
Regards,
Brian