TOPIC:

Customize Reservation Calendar 2 weeks 6 days ago #259891

  • sciencemkt's Avatar Topic Author
  • sciencemkt
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Science applied to marketing
  • Posts: 233
  • Thanks: 0
Hi Tihana:
They send but it does not block the time.

Thank you and best regards.
Alejandro Cobo
Neuromarketing Company

==============================================
Blog: www.alejandrocobo.com
==============================================
Facebook: @AlejandroCobo.Neuromarketing
==============================================
Instagram: @alejandrocobo
==============================================

Please Log in or Create an account to join the conversation.

Customize Reservation Calendar 2 weeks 6 days ago #259894

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6113
  • Karma: 3
  • Thanks: 432
Hi,

could you please try it like:
$user = JFactory::getUser();
$db = JFactory::getDbo();
$db->setQuery('SELECT COUNT(id) FROM #__facileforms_subrecords WHERE name = "elementname" AND value="14"');
$db->loadResult();
if($db->loadResult() > 20){
  header("Location: index.php"); // replace index.php with the url to an article explaining that the max. amount has been reached
  exit;
}
If there is >20 people on same time then user will be redirect to your wantend url, and this records will not be stored in database.

Hope this helps

Regards,
Tihana

Please Log in or Create an account to join the conversation.

Customize Reservation Calendar 2 weeks 6 days ago #259897

  • sciencemkt's Avatar Topic Author
  • sciencemkt
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Science applied to marketing
  • Posts: 233
  • Thanks: 0
Hi Tihana:

It works fine. but it crashes the whole form when selecting the set time when super the set amount.

Is it possible for you to disable only the selected time and you can select another available time?

Thanks!
Alejandro Cobo
Neuromarketing Company

==============================================
Blog: www.alejandrocobo.com
==============================================
Facebook: @AlejandroCobo.Neuromarketing
==============================================
Instagram: @alejandrocobo
==============================================

Please Log in or Create an account to join the conversation.

Customize Reservation Calendar 2 weeks 6 days ago #259899

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6113
  • Karma: 3
  • Thanks: 432
Hi,

maybe like this, I am not 100% sure that this will work:
$user = JFactory::getUser();
$db = JFactory::getDbo();
$db->setQuery('SELECT COUNT(id) FROM #__facileforms_subrecords WHERE name = "elementname" AND value="14"');
$db->loadResult();
if($db->loadResult() > 20){
  echo '
<script>
JQuery("#ff_elem1247 option[value=\"14\"]").attr('disabled', true);
</script>
';
}
-#ff_elem1247 is ID of your select list (right click to your browser->Inspect->find ID of select list in Console).
-14 is value of select list (replace it with your value)

Let me know the result

Regards,
Tihana

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Time to create page: 0.089 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!