• 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: Maximum of tickets

Maximum of tickets 6 months 2 weeks ago #43043

I have a form where people can order tickets.
A maximum of 300 tickets can be sold.
When I open the form, I would like to have a check on the database where a certain field of all records is summarised.
If that value exceeds 300, I want the form to display an error message or something like that.
Can someone point me in the right direction?
The administrator has disabled public write access.

Maximum of tickets 6 months 5 days ago #43050

  • andreic
  • andreic's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 722
  • Thank you received: 59
Hello,

You can use the following article as a starting point:
www.rsjoomla.com/support/documentation/r...for-submissions.html
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.

Maximum of tickets 6 months 3 days ago #43052

Thank you.
This problem is solved
I found te correct code in your help file

$max = 300;
// Get a database connection.
$db = JFactory::getDbo();
// Setup the query. Deze query sums het veld Aantal_kaarten van het huidige formulier
// $formId contains the ID of the current form.
$db->setQuery("SELECT SUM(`FieldValue`) FROM #__rsform_submission_values WHERE `FormId`='".(int) $formId."'"." AND `FieldName`='Aantal_kaarten'");
$inschrijvingen = $db->loadResult();
if ($inschrijvingen >= $max) {
$formLayout = 'Sorry, het maximum aantal inschrijvingen voor deze uitvoering is bereikt..';
}

After the sum reaches 300 the form gives the Sorry notification

Now I would like to get that value on the screen somewhere. But I have opened a separate topic for that.
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!