PaulT
Member
I have a calc plugin element with this calculation:
$fields = array('geh_time_sheet_18_repeat___monday_total_hours','geh_time_sheet_11_repeat___tuesday_total_hours','geh_time_sheet_12_repeat___wednesday_total_hours','geh_time_sheet_13_repeat___thursday_total_hours','geh_time_sheet_14_repeat___friday_total_hours','geh_time_sheet_15_repeat___saturday_total_hours','geh_time_sheet_16_repeat___sunday_total_hours');
$total = 0;
foreach ($fields as $field)
{
$value = JArrayHelper::getValue($data, $field . '_raw', array());
$thisSum = array_sum($value);
$total += $thisSum;
}
return $total;
This shows the total hours for the week on a timesheet once the form is saved. I was wondering if there is a way get the form to send this result to the database after it has processed the calculation?
$fields = array('geh_time_sheet_18_repeat___monday_total_hours','geh_time_sheet_11_repeat___tuesday_total_hours','geh_time_sheet_12_repeat___wednesday_total_hours','geh_time_sheet_13_repeat___thursday_total_hours','geh_time_sheet_14_repeat___friday_total_hours','geh_time_sheet_15_repeat___saturday_total_hours','geh_time_sheet_16_repeat___sunday_total_hours');
$total = 0;
foreach ($fields as $field)
{
$value = JArrayHelper::getValue($data, $field . '_raw', array());
$thisSum = array_sum($value);
$total += $thisSum;
}
return $total;
This shows the total hours for the week on a timesheet once the form is saved. I was wondering if there is a way get the form to send this result to the database after it has processed the calculation?