Forums

Registerform with limited subscription

croonhb 09 Sep, 2014
For worksshops I made some forms for different levels(managers,CEO etc) for each level there are different dates.
For each date there is a maximum of subscribers.
The forms are made and now I am faced with the problem of maximum the subscribers.
Attached is the code of the master form. If this is working I can copy.
With the code as it now the form will not show dispite the fact that the number of subscribers is below the maximum.
From testing I think that the problem the PHP code.
I include two file code 1 and code 2.
Code 2 is working. Code 1 does not show the form.
Can anyone assist me in this?
croonhb 09 Sep, 2014
Sorry I forgot to mention the website http://tao2success.com/nl/registratie/direkteur-10-oktober-2014

Huib Croon
croonhb 11 Sep, 2014
I realize that maybe it is easier to analize the problem if I include the backup of the form.
i hope that some one is able to help me in this.
GreyHead 11 Sep, 2014
Hi croonhb,

I'm afraid that the form backup isn't helpful as it needs he related database tables to run.

I don't see anything obviously wrong with the PHP in either txt file - though neither are they code that I would write or use.

I would probably use a simple Joomla! DB query here in Custom Code action:
<?php
$db =& JFactory::getDBO();
$query = "
    SELECT COUNT(*)
        FROM `#__chronoforms_data_Registratie` ;
";
$db->setQuery($query);
$count = $db->loadResult();
if ( $count >= 5 ) {
  // event full
  $app =& JFactory::getApplication();
  $app->redirect('some_suitable_url', 'Sorry, the course is already full');
}
?>

Bob
croonhb 12 Sep, 2014
1 Likes
Bob,
Thanks for this solution.

If you were a woman I could kiss you. But instead I buy you a coffee or would you like a beer.

Huib
This topic is locked and no more replies can be posted.