Bienvenido, Invitado
Recordarme

TEMA:

Send multiple uploaded files to BF integrator 3 meses 2 semanas antes #273224

  • Avatar de monomgabriel Autor del tema
  • monomgabriel
  • Fuera de línea
  • Senior Breezer
  • Senior Breezer
  • Mensajes: 90
  • Gracias recibidas: 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

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Send multiple uploaded files to BF integrator 3 meses 2 semanas antes #273245

  • Avatar de Mirec
  • Mirec
  • Fuera de línea
  • Ultimate Breezer
  • Ultimate Breezer
  • Mensajes: 2942
  • Karma: 2
  • Gracias recibidas: 150
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

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Última Edición: Post by Mirec.

Send multiple uploaded files to BF integrator 3 meses 2 semanas antes #273276

  • Avatar de monomgabriel Autor del tema
  • monomgabriel
  • Fuera de línea
  • Senior Breezer
  • Senior Breezer
  • Mensajes: 90
  • Gracias recibidas: 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?

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Send multiple uploaded files to BF integrator 3 meses 2 semanas antes #273279

  • Avatar de Mirec
  • Mirec
  • Fuera de línea
  • Ultimate Breezer
  • Ultimate Breezer
  • Mensajes: 2942
  • Karma: 2
  • Gracias recibidas: 150
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

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Send multiple uploaded files to BF integrator 3 meses 2 semanas antes #273280

  • Avatar de Mirec
  • Mirec
  • Fuera de línea
  • Ultimate Breezer
  • Ultimate Breezer
  • Mensajes: 2942
  • Karma: 2
  • Gracias recibidas: 150
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

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Última Edición: Post by Mirec.
Moderadores: ForumSupport
Tiempo de carga de la página: 0.052 segundos