[eluser]maria clara[/eluser]
@the prodigy,
hi, it doesn't add anything..i change this:
$item = $this->input->post("item");
$rows = $this->input->post("row0");
$data['item'] =
$this->Reports->save($dt,$item,$rows);
to this:
$item = $this->input->post("item");
$rows = $this->input->post("row0");
$data['item'] =
$this->Reports->save($fields,$item,$rows);
is there any effect in the model??
MODEL:
Code:
function save($data,$item,$details) {
if ($item == '') {
$data['link'] = "reports/view";
$this->db->trans_start();
$this->db->insert('sec_reports', $data);
$item = $this->db->insert_id();
$this->save_detail($item,$details);
$this->db->trans_complete();
if ($this->db->affected_rows() == '1')
{
return TRUE;
}
return FALSE;
}
else {
$this->db->trans_start();
$this->db->where('module_id', $item);
$this->db->update('sec_reports', $data);
$this->save_detail($item,$details);
$this->db->trans_complete();
}
return $item;
}