THEMA:

Breezingform Kalender 5 Jahre 3 Monate her #217797

  • Autor
  • Design-Agent
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Registered
  • Beiträge: 27
  • Dank erhalten: 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.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Breezingform Kalender 5 Jahre 3 Monate her #217852

  • marinkosevos Avatar
  • marinkosevo
  • Offline
  • Benutzer ist gesperrt
  • Benutzer ist gesperrt
  • Registered
  • Beiträge: 747
  • Dank erhalten: 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

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Breezingform Kalender 5 Jahre 3 Monate her #217867

  • Autor
  • Design-Agent
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Registered
  • Beiträge: 27
  • Dank erhalten: 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.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Breezingform Kalender 5 Jahre 3 Monate her #217891

  • marinkosevos Avatar
  • marinkosevo
  • Offline
  • Benutzer ist gesperrt
  • Benutzer ist gesperrt
  • Registered
  • Beiträge: 747
  • Dank erhalten: 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

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Breezingform Kalender 5 Jahre 3 Monate her #217923

  • Autor
  • Design-Agent
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Registered
  • Beiträge: 27
  • Dank erhalten: 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?

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Breezingform Kalender 5 Jahre 3 Monate her #217932

  • marinkosevos Avatar
  • marinkosevo
  • Offline
  • Benutzer ist gesperrt
  • Benutzer ist gesperrt
  • Registered
  • Beiträge: 747
  • Dank erhalten: 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

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

  • Seite:
  • 1
Moderatoren: ForumSupport
Ladezeit der Seite: 0.065 Sekunden

Angebot

Sommer Special! Alle Mitgliedschaften zum Sonderpreis!

Prio Support, alle Extensions und alle Templates in einem Paket.

Hier geht's zur Bestellung

Crosstec hilft sparen!

Falls Sie neu bei Crosstec sind aber bereits einen Formulargenerator bei einem anderen Hersteller gekauft haben, dann bekommen sie von uns einen Rabatt von 25% auf unsere 1-Jahres und Pro-Mitgliedschaften

Wie Sie an den Rabatt kommen?

Schreiben Sie uns einfach eine kurze Email mit beigelegten Kaufbeleg (z.B. PayPal Quittung) an sales@crosstec.org.

Live Support Chat Opened!

Join our Discord chat here and enter the Crosstec channels to receive live support and talk directly to the team!

Wir unterstützen die Joomla Community

Crosstec unterstützt weltweit alle offiziellen Joomla! User Groups und Organisatoren von Joomla! Days die bei Joomla.org registriert sind.

Falls das auf dich zutrifft und du eines unserer Produkte brauchst, schreib uns eine kurze Email an info@crosstec.org und du bekommst eine Flatrate-Mitgliedschaft geschenkt!