Hi all,
Just to say I've found a workaround solution. I use the callback_column :
$crud->callback_column('cumul_kms', array($this, '_cumul_kms_callback'));
function _cumul_kms_callback($value, $row)
{
// cumul kms des étapes de ce parcours <= n° ordre
$tot_kms = $this->Circuits_model->kms_cumul($row->id_circuit_parcours, $row->id_order);
return ($tot_kms);
}
in the model Circuits_model :
function kms_cumul($id_circuit_parcours, $id_order)
{
$sql="select sum(nb_kms) as total_kms
from parcours, distances
where id_dist_parcours = id_dist
and id_order <= $id_order
and id_circuit_parcours = $id_circuit_parcours";
$query = $this->db->query($sql);
$row = $query->row();
$total_kms = $row->total_kms;
return $total_kms;
}
Thanks for your help