Hi All,
I have decided to make the move and use the latest Fabrik for an upcoming project I am working on. The idea of how this is supposed to work is that it will have rainfall and evaporation data entered and it will calculate the effective amount of moisture that is in the ground.
The formula is fairly easy and is basically the amount of rainfall that has been obtained - 5mm.
I have created the below script which would be something I would use in Joomla 1.5 but this doesn't exactly work for the new version.
Just wondering if someone can point me in the right direction.
I have decided to make the move and use the latest Fabrik for an upcoming project I am working on. The idea of how this is supposed to work is that it will have rainfall and evaporation data entered and it will calculate the effective amount of moisture that is in the ground.
The formula is fairly easy and is basically the amount of rainfall that has been obtained - 5mm.
I have created the below script which would be something I would use in Joomla 1.5 but this doesn't exactly work for the new version.
Just wondering if someone can point me in the right direction.
PHP:
$db = JFactory::getDBO();
$rainfall = $this->_data['data_global_irrigation___rainfall'];
if (trim($rainfall) < "5") {
$formModel->updateFormData('data_global_irrigation___effective_rainfall', 0);
$formModel->updateFormData('data_global_irrigation___effective_rainfall_raw', 0);
}
else {
$db->setQuery("UPDATE data_global_irrigation SET effective_rainfall = effective_rainfall - 5 WHERE id = $rowid");
$db->query();
}