TOPIC:

Datenbankeinträge einschränken 3 years 9 months ago #216957

  • Topic Author
  • plorenz
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 8
  • Thanks: 0
Ist es möglich, dass man nur 3 Datensätze pro Datum zulässt?
Zum Beispiel: Ein bestimmtes Datum wurde schon 3 mal gewählt (=das Formular mit diesem Datum 3 mal abgeschickt) und der nächste muss ein anderes Datum wählen, sonst bekommt er eine Fehlermeldung?

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

Datenbankeinträge einschränken 3 years 9 months ago #216970

  • 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 you can do that, it would be easiest to place this in validation of the element, selecting all the records with that date from database, and if there are already 3, the user would be informed. I hope this is good answer, if you need help implementing this, I will help you.

Best regards,
Marinko

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

Datenbankeinträge einschränken 3 years 9 months ago #216973

  • Topic Author
  • plorenz
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 8
  • Thanks: 0
Hi,
thank you! Yes, your extension is amazing and also your support!

Have you an example how to implement this or can you help me?

Kind regards
Paul

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

Datenbankeinträge einschränken 3 years 9 months ago #216974

  • marinkosevo's Avatar
  • marinkosevo
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 747
  • Karma: 27
  • Thanks: 92
Great, I am so happy that you like it! I will now create you an example and explain i to you, you can even give me your backend and hosting credentials to marinko.sevo@crosstec.org, and I can arrange it all for you.

Best regards,
Marinko

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

Datenbankeinträge einschränken 3 years 9 months ago #216975

  • Topic Author
  • plorenz
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 8
  • Thanks: 0
thank you, great. Backend is on the way to you!

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

Datenbankeinträge einschränken 3 years 9 months ago #217167

  • marinkosevo's Avatar
  • marinkosevo
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 747
  • Karma: 27
  • Thanks: 92
Hello, your problem is solved. I will leave the solution here, for the future reference. Used PHP and AJAX. First I created two empty fields named 'Ache' and 'Inn'. I made them hidden, and created two files in your www folder, named ache.php and inn.php. I have put the following code in them, the only difference was the value "Ache" and "Inn".
<?php
define( '_JEXEC', 1 );
define( 'JPATH_BASE', realpath(dirname(__FILE__).'/' )); 
require_once ( JPATH_BASE .'/includes/defines.php' );
require_once ( JPATH_BASE .'/includes/framework.php' );

$id = $_GET['date'];
$database = &JFactory::getDBO();
$sql = "SELECT count(*) FROM jos_facileforms_subrecords WHERE record in (select record from jos_facileforms_subrecords WHERE Value = '$id') and value = 'Ache'"; // Select data from DB
$database->setQuery( $sql );
$result=$database->loadResult();
header('Content-type: application/json');
header('Access-Control-Allow-Origin: *'); // CORS Settings
echo $result;
?>
This takes the entered date, and returns number of inputs for each combination of dates and "Reviere".
And in the radio button I have created the AJAX script that takes the data from this php file and sends it into these fields when it is clicked on some radio button:
function ff_revier_action(element, action)
{
    switch (action) {
        case 'click':
jQuery.ajax({
        type: 'GET',
        url: '../ache.php',
        data: 'date=' + jQuery("#ff_elem14").val(),
        success: function(data){
           jQuery("#ff_elem255").val(data);
      }
    });
jQuery.ajax({
        type: 'GET',
        url: '../inn.php',
        data: 'date=' + jQuery("#ff_elem14").val(),
        success: function(data){
           jQuery("#ff_elem276").val(data);
      }
    });
            break;
        default:;
    } // switch
} // ff_revier_action
And also I had to make a blur function for the calendar button, that is triggered when you select the date, this is in case someone first clicks on radio button, and after that selects date. You will see those two hidden fields, there is validation added on them so you need to change the message so it fits your needs. I hope you understand this and you're satisfied with the solution. If you need any help just contact us here.

Best regards,
Marinko

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

  • Page:
  • 1
  • 2
Moderators: ForumSupport
Time to create page: 0.039 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!