This topic is locked
[SOLVED]

 Need a one-page fill-in form

4/14/2016 12:36:05 PM
PHPRunner General questions
bbarker author

Need simple ONE-PAGE per person application.
I've been working on a small project to allow 8,000 people to log in and fill out a form to "volunteer" for an upcoming event.
The flow is:

If this is the first time they've clicked the link - it creates a BLANK form for them to fill out... and save.

If this is a subsequent time that they've clicked on the link - it directs them to the previously filled-in form so that they can edit it.
That's it. One page (form) per person.
My question: Is one of the other apps sufficient to do this? Or should I continue coding my own?
(Note: I did run into some issues with it allowing them to create a second, third, etc page. Don't want that. Only ONE per person.)

Sergey Kornilov admin 4/14/2016

This can be done and a bit of coding will be required.

  1. Turn on Login page
  2. Use Advanced Security mode 'Users can see and edit their own data' on Forms table
  3. In AfterSuccessfulLogin event you need to find if current user already has a record in Forms table. If yes, redirect them to the Edit page of this record. If not, redirect them to the Add page.

bbarker author 4/15/2016

Yep, that's exactly how I was working on it. Thanks. I'll let you know how it turns out.

bbarker author 4/25/2016

Having a problem with EDIT
After modifying a page, I click SUBMIT and get

ERROR

Unknown column 't4.id_vol' in "where clause'
Based upon my search, this might be a result of the setting:

"Owners can see and edit their own data only."
I just saved a copy to the DEMO area and posted a TICKET.
Thanks in advance.

Sergey Kornilov admin 4/26/2016

As far as I understand your SQL Query contains fields from multiple tables. You need to make sure none of fields from joined tables is making it to update SQL query.

You need to add the following to BeforeAdd/BeforeEdit events:

unset($values["id_vol"]);


More info:

http://xlinesoft.com/phprunner/docs/update_multiple_tables.htm

bbarker author 4/27/2016

The unknown column problem was solved by Alexey (THANKS!). I'll post it here for others who have a similar issue:

To get the Edit page issue fixed, remove the t4 alias from your SQL query.

The main table - the table that you update - must appear without an alias in the SQL query.

Otherwise PHPRunner doesn't know how to update your fields.
I.e instead of

LEFT OUTER JOIN volunteer AS t4 ON t1.idmember_met = t4.idmember_vol

you should have

LEFT OUTER JOIN volunteer ON t1.idmember_met = volunteer.idmember_vol