mogy74
Member
Hi to everyone ,
i'm realy new in fabrik and i found this joomla component and forum very cool , so i try to set up my frist app using fabrik and reading this forum i think i did a nice job , i'm not a programmer so now i found my frist very hard problem , i wish someone can help with ideas or solution , the question is:
i have two list "list-one" and "list-two" in list-one i have set the update_col plug in and it working well , now i have to make new record in list two and it must be dome when the colum update with the plug in are done.
so my idea was put some php code in the php eval on the same plug in and it also workin well ,
the problem is i can't find the way to get data from list-one and replace in list-two's new record.
the php code i use is:
//recuperiamo i dati
$mese = $formModel->getElementData('compila_cedolino___mese');
$importo = $formModel->getElementData('compila_cedolino___totale_avere');
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
// Insert columns.
$columns = array('data_operazione','descrizione_operazione','ragione_sociale' ,'documento','tipo_pagamento','importo','sede','mese', 'anno');
// Insert values.
$values = array('1', '2', '3','4','5',"$importo",'7',"$mese",'9');
// Prepare the insert query.
$query
->insert($db->quoteName('banche_out'))
->columns($db->quoteName($columns))
->values(implode(',', $db->quote($values)));
// Reset the query using our newly populated query object.
$db->setQuery($query);
try {
// Execute the query
$result = $db->execute();
//use $db->query() in Joomla2.5
}
catch (Exception $e) {
// catch any database errors.
}
$newid = (int)$db->insertid(); //get new record id
in $values array if i set a fix number or letter it work well , but i need to have data from this row , set them as some $var and put in the $values array.
someone can help in this?
Thanks to all for read me.
i'm realy new in fabrik and i found this joomla component and forum very cool , so i try to set up my frist app using fabrik and reading this forum i think i did a nice job , i'm not a programmer so now i found my frist very hard problem , i wish someone can help with ideas or solution , the question is:
i have two list "list-one" and "list-two" in list-one i have set the update_col plug in and it working well , now i have to make new record in list two and it must be dome when the colum update with the plug in are done.
so my idea was put some php code in the php eval on the same plug in and it also workin well ,
the problem is i can't find the way to get data from list-one and replace in list-two's new record.
the php code i use is:
//recuperiamo i dati
$mese = $formModel->getElementData('compila_cedolino___mese');
$importo = $formModel->getElementData('compila_cedolino___totale_avere');
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
// Insert columns.
$columns = array('data_operazione','descrizione_operazione','ragione_sociale' ,'documento','tipo_pagamento','importo','sede','mese', 'anno');
// Insert values.
$values = array('1', '2', '3','4','5',"$importo",'7',"$mese",'9');
// Prepare the insert query.
$query
->insert($db->quoteName('banche_out'))
->columns($db->quoteName($columns))
->values(implode(',', $db->quote($values)));
// Reset the query using our newly populated query object.
$db->setQuery($query);
try {
// Execute the query
$result = $db->execute();
//use $db->query() in Joomla2.5
}
catch (Exception $e) {
// catch any database errors.
}
$newid = (int)$db->insertid(); //get new record id
in $values array if i set a fix number or letter it work well , but i need to have data from this row , set them as some $var and put in the $values array.
someone can help in this?
Thanks to all for read me.