Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
 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();
 }