Hi to all,
i need to develop a simple plugins in order to print values of form into pdf using FPDF, and i would like to know how to retrieve table connected name from chronoforms.
I'm in the onsubmit event and i've already generated the PDF and attached to email (if i can get it works fine i will post the code)
The Problem you'll know is: i don't have cf_id in Jrequest. From Autogenerated code i would do it with no problem, but i need get it done inside the plugin so is there's a shortcut or i need to check mysql for mysql_insert_id() function?
Second i would like to retrieve the name of the Table connected to $chronoforms, it should be automatic and not hardcoded in the plugin (in this case jos_chronoforms_pdfTest). Witch chronoobject collection hold the table name connected to form id?
i need to develop a simple plugins in order to print values of form into pdf using FPDF, and i would like to know how to retrieve table connected name from chronoforms.
I'm in the onsubmit event and i've already generated the PDF and attached to email (if i can get it works fine i will post the code)
if ($params->get('savetodb'))
{
// TODO salva nel DB */
$db =& JFactory::getDBO();
$updateRow = new JObject();
// THIS IS WHERE I NEED TO RETRIEVE TABLE ID AND NAME
$updateRow->cf_id = JRequest::getVar( "cf_id", 0, "post", "int", "" );
$messages[] = 'Valore del record: '. print_r($updateRow->cf_id ,true);
$updateRow->pdfpath = JPATH_SITE.DS. $params->get('dirserver').$params->get('pdfFileName');
$ret = $db->updateObject('jos_chronoforms_pdfTest', $updateRow,'cf_id');
$messages[] = 'Salvataggio del file in DB: '. print_r($ret,true);
}
if ($params->get('debugging'))
{
$helper->showPluginDebugMessages($messages);
}
The Problem you'll know is: i don't have cf_id in Jrequest. From Autogenerated code i would do it with no problem, but i need get it done inside the plugin so is there's a shortcut or i need to check mysql for mysql_insert_id() function?
Second i would like to retrieve the name of the Table connected to $chronoforms, it should be automatic and not hardcoded in the plugin (in this case jos_chronoforms_pdfTest). Witch chronoobject collection hold the table name connected to form id?