blue-mouse
Member
Hi,
I have Joomla 2.5.28 and fabrik 3.0.9
I try to capture cascading dropdown variable from filter and use them in a calculation element.
I don't know what syntax to use to capture a data that is cascadingdropdown. (I could try it also for data field if this would be simpler)
I found on forum thread:
http://fabrikar.com/forums/index.php?threads/get-filter-data-dates-php.22273/
where is something - code for filter data - and i try use it to my example.
It is new function for me and i have no idea how to modify this code,
I try this:
I get an error:
Fatal error: Call to a member function setId() on a non-object in /var/www/cc.joomla/components/com_fabrik/views/list/tmpl/default-2015-09-11-table-kp5/default.php on line 160
can i get any tip how to code my variable for field: '`ccjom_cc_kk_karta_rejestr`.`zamow_symbol`' that is cascading dropdown or any simpler code for field : '`ccjom_cc_kk_karta_rejestr`.`testfied1`' that can be type "field". ?
I have Joomla 2.5.28 and fabrik 3.0.9
I try to capture cascading dropdown variable from filter and use them in a calculation element.
I don't know what syntax to use to capture a data that is cascadingdropdown. (I could try it also for data field if this would be simpler)
I found on forum thread:
http://fabrikar.com/forums/index.php?threads/get-filter-data-dates-php.22273/
where is something - code for filter data - and i try use it to my example.
It is new function for me and i have no idea how to modify this code,
I try this:
PHP:
echo "----- Test 1 --- Sum pakietow AA: <br/>";
$db =& JFactory::getDBO();
$table =& JModel::getInstance( 'Table', 'FabrikModel' );
$table->setId(331); //replace 1 with your table id
$filters = $table->getRequestData();
$keys = JArrayHelper::getValue( $filters, 'key', array() );
$vals = JArrayHelper::getValue( $filters, 'value', array() );
//echo "<pre>";print_r($keys);echo '</pre>';
for ($i = 0; $i < count($filters); $i++) {
if (JArrayHelper::getValue( $keys, $i, '') === '`ccjom_cc_kk_karta_rejestr`.`zamow_symbol`') {
$var_keg = $vals[$i];
$order1 = $var_keg[0];
}
}
echo " Nr zam ---- $order1";
$query = "SELECT `is_pak_xxxx` FROM `ccjom_cc_kk_karta_rejestr` WHERE (`rodzaj_karty_np_wzorzec`='2' AND `zamow_symbol`=".$order1.") ORDER BY `id`";
$db->setQuery($query);
$result = $db->loadResult();
$resaa = mysql_query($query);
$rrraa=array();
$n=0;
while($row = mysql_fetch_array($resaa))
{
$rrraa[$n]= $row['is_pak_xxxx'];
$n++;
}
$newrrraa = array_count_values($rrraa);
foreach ($newrrraa as $key => $value) {
$query = "SELECT `is_pak_wejsc_analog_aa` FROM `ccjom_cc_kk_is_aa` WHERE `id`=$key ";
$db->setQuery($query);
$result1 = $db->loadResult();
echo "$result1 ------ <strong>$value</strong> <br />"; }
echo "<br/>";
I get an error:
Fatal error: Call to a member function setId() on a non-object in /var/www/cc.joomla/components/com_fabrik/views/list/tmpl/default-2015-09-11-table-kp5/default.php on line 160
can i get any tip how to code my variable for field: '`ccjom_cc_kk_karta_rejestr`.`zamow_symbol`' that is cascading dropdown or any simpler code for field : '`ccjom_cc_kk_karta_rejestr`.`testfied1`' that can be type "field". ?