paulknox
New Member
I'm trying... unsucessfully to filter a calc element in my table. I have a par level and a stock level. The par level is manually entered and the stock level is a calc element
$db =& JFactory::getDBO();
$query1 = "SELECT COUNT(*) FROM `iol` WHERE `lens_model` = '{stock_levels___lens_model}' AND `used` <> 'Yes' AND `used` <> 'Expired' AND `department` ='BCH' AND `iol_power` = '{stock_levels___iol_power}' ";
$db->setQuery($query1);
$query1 = $db->loadResult();
$result= $query1;
return number_format($result, 2);
the code above is working and returning the correct numbers... however... I would like a pre-filter on the menu that would allow me to only display entries where the stock level is lower than the par level.
I've tried with a menu pre-filter and I'm wondering if its because the calc element is working on the fly? I've even tried url filetering without luck..
index.php?option=com_fabrik&view=list&listid=2&clearfilters=1&stock_levels___current_stock[value][]=>5
displays below and it should only be displying results greater or equal to 5
Thoughts would be appreciated!
$db =& JFactory::getDBO();
$query1 = "SELECT COUNT(*) FROM `iol` WHERE `lens_model` = '{stock_levels___lens_model}' AND `used` <> 'Yes' AND `used` <> 'Expired' AND `department` ='BCH' AND `iol_power` = '{stock_levels___iol_power}' ";
$db->setQuery($query1);
$query1 = $db->loadResult();
$result= $query1;
return number_format($result, 2);
the code above is working and returning the correct numbers... however... I would like a pre-filter on the menu that would allow me to only display entries where the stock level is lower than the par level.
I've tried with a menu pre-filter and I'm wondering if its because the calc element is working on the fly? I've even tried url filetering without luck..
index.php?option=com_fabrik&view=list&listid=2&clearfilters=1&stock_levels___current_stock[value][]=>5
displays below and it should only be displying results greater or equal to 5
Thoughts would be appreciated!