• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Unique ticket number not so unique

Unique ticket number not so unique 11 years 1 month ago #26862

  • pim
  • pim's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
I'm designing an application form for a field trip that opens at 8pm sharp. There are limited seats available (50) so I added the next code (Script called after form has been processed):

global $database;
$database = JFactory::getDBO();
$submissionId = JRequest::getInt('submissionId');
$database->setQuery("SELECT COUNT(`SubmissionId`) FROM #__rsform_submissions WHERE `formId`='16'");
$database->query();
 
$totaal=$database->loadResult();
if(intval($database->loadResult()) > 50) {
  $thankYouMessage="List is full" .$totaal. "" ;
}

But when many people apply at the same time, the form closes after 50+. To check, I added a "ticket number" field. And what seems to happen: the people that applied for the exactly same time, they share the same ticket number. Is there any workaround to fix this?
The administrator has disabled public write access.

Unique ticket number not so unique 11 years 1 month ago #26864

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
You are verifying this after the form has processed the submitted information (saved to database, emails sent, etc). You should perform this validation within the Scripts called on form display area, or even within the Scripts called on form process.
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.
The following user(s) said Thank You: pim

Unique ticket number not so unique 11 years 1 month ago #26917

  • pim
  • pim's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
Thank you for the reply, that makes sense!

Should I change anything before I can use this script in the Scripts called field? I expect many people to load the form at once (before anyone submitted), so Call on show form doesn't seem the right field to me.

I found out that using

if ($submissions > $max) {
$invalid[] = RSFormProHelper::getComponentId(SubmissionId);

}


prevents the script from adding this record to the table. Next thing I would like to do is redirect the people (after the limit) to another page (back-up seats form). Can you help me out?
Last Edit: 11 years 1 month ago by pim.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!