public function Image($id) { $upload = new TUpload(); $result = $upload->Save('image'); $url = str_replace('../upload/', UR_UPLOAD, $result['value']['path']); $this->model->Edit($id, array('topic_image' => $url)); GoBack(); }
public function Update($id) { if ($_FILES['image']) { $up = new TUpload(UPLOAD_BY_OTHER, 'category'); $up->Save('image', $id); } $this->model->Edit($id, $_POST, 'category_'); Redirect(UR_MP . 'Category/Edit/' . $id); }
public function UploadAttach($file_name, $destination, $type = REALTION_ATTACH) { $upload = new TUpload(); $result = $upload->Save($file_name); if ($result['success']) { $res = $this->model->AddAttach($result, $destination, $type); } else { $res = false; } GoBack(); }