/** * Sauvegarde les modifications d'un schéma */ public function save() { // Upload les fichiers $config['upload_path'] = realpath('www/schemas/'); $config['allowed_types'] = 'gif|jpg|png|zip'; $config['max_size'] = '1000000'; $config['max_width'] = '1024'; $config['max_height'] = '768'; $this->load->library('upload', $config); $uploadDataImage = null; if ($this->upload->do_upload('image')) { $uploadDataImage = $this->upload->data('image'); } $uploadDataSource = null; if ($this->upload->do_upload('source')) { $uploadDataSource = $this->upload->data('source'); } // Mise à jour des données en base $model = new Schema_model(); $model->schidsch = $this->input->post('schidsch'); $model->schlbtit = $this->input->post('title'); $model->schlbdes = $this->input->post('description'); $model->update($this->db, $config['upload_path'] . "/", $uploadDataImage, $uploadDataSource); redirect('listschemas/index'); }