TOPIC:

Breezingform Kalender 2 years 8 months ago #217797

  • Topic Author
  • Design-Agent
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 27
  • Thanks: 0
Guten Abend,

ich hoffe, dass diese Frage nicht schon einmal gestellt wurde, jedenfalls konnte ich nichts Passendes in der Suche finden. Weshalb ich es einfach mal probiere. ;)

Grundsituation: Ich möchte für einen Cateringdienst ein Formular erstellen welches dem Kunden es erlaubt seinen Wunschtermin im Kalender einzutragen.

Funktion 1: wäre das der Kunde frühstens in 3 Tage wählen kann. Sodass kein Catering zum folge Tag möglich ist.

Funktion 2: Eine Datenbank abfrage, die überprüft, ob am gewähltem Tag bereits Caterings vorhanden sind, mit einer Ausgabe wie: An dem gewähltem Tag sind wir leider bereits ausgebucht... .

Vielen Dank im Voraus.

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

Breezingform Kalender 2 years 7 months ago #217852

  • marinkosevo's Avatar
  • marinkosevo
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 747
  • Karma: 27
  • Thanks: 92
Hello,
Could we please continue this topic in English, as we are a little short on German speaking staff. Yes, this can be done with breezingforms.
Function 1: setting custom validation in calendar element, making it check if the current date is at least 3 days before selected date, if it is than validations is okay, and if not then you get message that you have to select at least 3 days earlier
Function 2: Creating PHP file and AJAX function, in PHP file you should have query that checks if there are caterings selected for that day, and you send that data trough AJAX to your form, and if there is you get also validation error.
You can take a look at this topic for reference crosstec.org/en/forums/46-breezingforms/...%A4nken.html?start=6
If you need help, you can send me your backend credentials to marinko.sevo@crosstec.org, so I could take a look and set it up for you.

Best regards,
Marinko

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

Breezingform Kalender 2 years 7 months ago #217867

  • Topic Author
  • Design-Agent
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 27
  • Thanks: 0
Hello,

The link seems to be what I need.
But I do not understand the instructions with the radio buttons. Is it possible that only the responsive calendar does the data query.

So I mean: first step in the form is the date query, only then it goes on.

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

Breezingform Kalender 2 years 7 months ago #217891

  • marinkosevo's Avatar
  • marinkosevo
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 747
  • Karma: 27
  • Thanks: 92
Hello,
in the kalendar validation you should have following:
function ff_Kalender_validation(element, message)
{
     if ([size=5][i]your condition[/i][/size]) {
        if (message=='') message = element.name+" faild in my test.\n"
        ff_validationFocus(element.name);
        return message;
    } // if
    return '';
} // ff_Kalender_validation
Instead of your condition, you input your javascript condition that will check if entered value is less than 3 days away from now. Now when the value is okay, it will submit, if it is not okay then it will show message.

And for php file and AJAX for checking is there catering booked on that day, it should be something like this:

catering.php file created in root folder, with content:
<?php
define( '_JEXEC', 1 );
define( 'JPATH_BASE', realpath(dirname(__FILE__).'/' )); 
require_once ( JPATH_BASE .'/includes/defines.php' );
require_once ( JPATH_BASE .'/includes/framework.php' );

$date= $_GET['date'];
$database = &JFactory::getDBO();
$sql = "SELECT count(*) FROM jos_facileforms_subrecords WHERE date = $date";
$database->setQuery( $sql );
$result=$database->loadResult();
header('Content-type: application/json');
header('Access-Control-Allow-Origin: *'); // CORS Settings
echo $result;
?>

And AJAX code should be in initialization script, that on change of the calendar value, user gets alerted that date already has catering reserved, it should look something like this:
var url = document.location.origin + '/catering.php';
jQuery("#ff_elem7").change(function(){
jQuery.ajax({
        type: 'GET',
        url: url1,
        data: 'date=' + jQuery("#ff_elem7").val(),
        success: function(data){
           //Code that should execute when you get if there is catering on that day or no
example: if(data!=0){
           alert('There is already...');
}
      }
    });
});
I hope you can implement this. If not I will assist you.

Best regards,
Marinko

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

Breezingform Kalender 2 years 7 months ago #217923

  • Topic Author
  • Design-Agent
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 27
  • Thanks: 0
Hello and thank you for your effort.

I have inserted the scripts and created a php file. When I use the calendar script, not a single field works in the form.

If I do not use the calendar script, all buttons work again but the query whether the date is "busy" does not work either.

What am I doing wrong?

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

Breezingform Kalender 2 years 7 months ago #217932

  • marinkosevo's Avatar
  • marinkosevo
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 747
  • Karma: 27
  • Thanks: 92
Could you send me your FTP and joomla credentials to marinko.sevo@crosstec.org, with this topic name as subject, and I will take a closer look.

Best regards,
Marinko

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

  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.050 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

Summer Sale!

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!