TOPIC:

Send multiple uploaded files to BF integrator 7 months 6 days ago #273224

  • monomgabriel's Avatar Topic Author
  • monomgabriel
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 90
  • Thanks: 1
Ok I understand.
Now, how can I get the record ID in the integrator?
That way I'll be able to find the right subrecord files from my table

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

Send multiple uploaded files to BF integrator 7 months 4 days ago #273245

  • Mirec's Avatar
  • Mirec
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 3265
  • Karma: 2
  • Thanks: 160
Hi,

we can get the record ID in the database and then recorded it in the hidden element and then you can use it in the integrator and save him in the table that you created.

create a new hidden input element with the name 'recordid'


please copy this code into the Before Form Piece under 'form's advanced tab > more options > Form Pieces':
$this->execPieceByName('ff_InitLib');
$db =& JFactory::getDBO();

$result = null;
$query = "SELECT id
FROM #__facileforms_records
WHERE id = (SELECT MAX(id) FROM #__facileforms_records)";
$db->setQuery($query);
$result = $db->loadObject()+1;

foreach($result as $a){
ff_setValue('recordid', $a);
}

In this way you will get record ID of the current FORM

Let me know whether works for this

If you have more questions, feel free to ask!

Regards,
Mirko

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

Last edit: Post by Mirec.

Send multiple uploaded files to BF integrator 7 months 4 days ago #273276

  • monomgabriel's Avatar Topic Author
  • monomgabriel
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 90
  • Thanks: 1
Hello Mirko thank you again that's a nice way of doing it.
Is this method safe if many users open and submit the form in the same time?

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

Send multiple uploaded files to BF integrator 7 months 4 days ago #273279

  • Mirec's Avatar
  • Mirec
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 3265
  • Karma: 2
  • Thanks: 160
Hi,

Is this method safe if many users open and submit the form in the same time?


No, you are good notice it, I will find another solution, and I will let you know

if you have more questions, feel free to ask!

Regards,
Mirko

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

Send multiple uploaded files to BF integrator 7 months 4 days ago #273280

  • Mirec's Avatar
  • Mirec
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 3265
  • Karma: 2
  • Thanks: 160
Hi,

oke, here is the solution!

create one PHP file into your Joomla root and give him the name 'recordID' and insert this code:
<?php

define('_JEXEC', 1);
if (file_exists(__DIR__ . '/defines.php'))
{
    include_once _DIR_ . '/defines.php';
}
if (!defined('_JDEFINES'))
{
    define('JPATH_BASE', __DIR__);
    require_once JPATH_BASE . '/includes/defines.php';
}
require_once JPATH_BASE . '/includes/framework.php';


$db = JFactory::getDBO(); 

//$code=$_POST['code']; // the value posted from the AJAX request above


$db = JFactory::getDBO();

$db->setQuery("SELECT id
FROM #__facileforms_records
WHERE id = (SELECT MAX(id) FROM #__facileforms_records)");

$recordid =$db->loadResult()+1;


	echo ($recordid );


?>


then in your FORM GO to Advanced->More options -> Scripts->Init script and put this code:
function ff_mirkoExmaple111_init()
{
setInterval('test()',500):
} // ff_mirkoExmaple111_init


function test (){


 jQuery.ajax({
                type: "POST",
                
                url: "<?php return JURI::root(true ); ?>/recordID.php",
                data: test,    
                success: function(data) {
ff_getElementByName('hiddenElement').value=data;

}

});

}


-function ff_mirkoExmaple111_init() - instead 'mirkoExmaple111' insert name of your FORM
-ff_getElementByName('hiddenElement').value=data;
instead 'hiddenElement' insert name of hidden element.

it is all, please test this and let me know whether works!

If you have more questions, feel free to ask!

Regards,
Mirko

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

Last edit: Post by Mirec.
Moderators: ForumSupport
Time to create page: 0.044 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!