Beispiel #1
0
 public function editDocStatus($typeid, $docname, $docstatus)
 {
     if ($docstatus == 'on') {
         $doc = true;
     } else {
         $doc = false;
     }
     UploadMedia::where('typeid', '=', $typeid)->where('fullpath', 'LIKE', '%' . $docname . '%')->update(['document_status' => false]);
     //->save();
 }
Beispiel #2
0
 public function proactiveCommitUploadSave()
 {
     $file_id = Input::get('file_id');
     $files = Input::file($file_id);
     $upload_typeid = Input::get('type_id');
     $document_description = Input::get('doc_des');
     if (count($files) > 0) {
         foreach ($files as $key => $file) {
             $file->move($this->upload_path, $file->getClientOriginalName());
             $fullpath = $this->upload_path . $file->getClientOriginalName();
             $upload_media[] = array('typeid' => $upload_typeid, 'fullpath' => $fullpath, 'document_status' => true, 'description' => $document_description);
         }
     }
     UploadMedia::insert($upload_media);
     //save to media upload
     return Redirect::to('other/proactive/commitment/' . $upload_typeid)->with('success', 'อัพโหลดไฟล์สำเร็จ');
 }
Beispiel #3
0
 public function downloadFileDetail($id)
 {
     $all_attrachfile = UploadMedia::pathfile($id);
     foreach ($all_attrachfile as $key => $path) {
         $filename = substr(explode(',', basename($path))[0], 0, -1);
         $dw_path = '/pro' . explode("/pro", $path->fullpath)[1];
         $paths[] = array('path' => $dw_path, 'filename' => $filename, 'training_id' => $path->training_id);
     }
     return $paths;
 }