Welcome Guest, Not a member yet? Register   Sign In
failed to upload image file and save data
#25

[eluser]cestaz18[/eluser]
CONTINUATION OF MODEL

Code:
function save_detail($id,$rows) //Query for saving the company details
    {
        $this->db->where('report_id', $id);
        $this->db->delete('sec_reports_parameters');
        
        foreach ($rows as $row)
        {
            $rdata = explode('|', $row);
            
            $data['report_id'] = $id;
            $data['parameter_label'] = $rdata[1];        
            $data['parameter_name'] = $rdata[2];    
            $data['parameter_type'] = $rdata[3];        
            
            $this->db->insert('sec_reports_parameters', $data);
        }
    }

  /*  function save($file_name,$data,$item,$details) {
        if ($item == '') {
            $data['link'] = "reports/view";
            $this->db->trans_start();
            $this->db->insert('sec_reports', $data);
            $this->db->insert('sec_reports', $file_name);
            $item = $this->db->insert_id();
            $this->save_detail($item,$details);            
            $this->db->trans_complete();
        
        }*/
        
        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();
            }
        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;
    }

    function delete($data)
    {
        $deleted_row = $data['module_id'];

        $this->db->where('module_id', $data['module_id']);
        $this->db->delete('sec_reports', $data);

        return $deleted_row;
    }
}

?>


Messages In This Thread
failed to upload image file and save data - by El Forum - 01-18-2010, 09:41 PM
failed to upload image file and save data - by El Forum - 01-18-2010, 09:53 PM
failed to upload image file and save data - by El Forum - 01-18-2010, 09:57 PM
failed to upload image file and save data - by El Forum - 01-18-2010, 10:05 PM
failed to upload image file and save data - by El Forum - 01-18-2010, 10:10 PM
failed to upload image file and save data - by El Forum - 01-18-2010, 11:23 PM
failed to upload image file and save data - by El Forum - 01-18-2010, 11:30 PM
failed to upload image file and save data - by El Forum - 01-18-2010, 11:35 PM
failed to upload image file and save data - by El Forum - 01-19-2010, 12:09 AM
failed to upload image file and save data - by El Forum - 01-19-2010, 12:22 AM
failed to upload image file and save data - by El Forum - 01-19-2010, 03:34 AM
failed to upload image file and save data - by El Forum - 01-19-2010, 06:50 PM
failed to upload image file and save data - by El Forum - 01-19-2010, 07:23 PM
failed to upload image file and save data - by El Forum - 01-19-2010, 07:39 PM
failed to upload image file and save data - by El Forum - 01-19-2010, 07:43 PM
failed to upload image file and save data - by El Forum - 01-19-2010, 08:08 PM
failed to upload image file and save data - by El Forum - 01-19-2010, 08:17 PM
failed to upload image file and save data - by El Forum - 01-19-2010, 08:22 PM
failed to upload image file and save data - by El Forum - 01-19-2010, 08:33 PM
failed to upload image file and save data - by El Forum - 01-19-2010, 08:37 PM
failed to upload image file and save data - by El Forum - 01-19-2010, 08:43 PM
failed to upload image file and save data - by El Forum - 01-19-2010, 08:46 PM
failed to upload image file and save data - by El Forum - 01-19-2010, 08:48 PM
failed to upload image file and save data - by El Forum - 01-19-2010, 08:50 PM
failed to upload image file and save data - by El Forum - 01-19-2010, 08:51 PM
failed to upload image file and save data - by El Forum - 01-19-2010, 08:56 PM
failed to upload image file and save data - by El Forum - 01-19-2010, 10:40 PM
failed to upload image file and save data - by El Forum - 01-19-2010, 11:04 PM
failed to upload image file and save data - by El Forum - 01-19-2010, 11:06 PM
failed to upload image file and save data - by El Forum - 01-19-2010, 11:07 PM
failed to upload image file and save data - by El Forum - 01-19-2010, 11:11 PM
failed to upload image file and save data - by El Forum - 01-19-2010, 11:18 PM
failed to upload image file and save data - by El Forum - 01-19-2010, 11:26 PM
failed to upload image file and save data - by El Forum - 01-19-2010, 11:38 PM
failed to upload image file and save data - by El Forum - 01-19-2010, 11:56 PM
failed to upload image file and save data - by El Forum - 01-20-2010, 12:01 AM
failed to upload image file and save data - by El Forum - 01-20-2010, 12:09 AM
failed to upload image file and save data - by El Forum - 01-20-2010, 12:17 AM
failed to upload image file and save data - by El Forum - 01-20-2010, 12:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB