Пример #1
0
 public function postBulkUpload()
 {
     $org_data = Auth::org()->get();
     $rules = array('file' => 'required', 'description' => 'required');
     $v = Validator::make(Input::all(), $rules);
     if ($v->fails()) {
         return Redirect::back()->withInput(Input::all())->withErrors($v);
     }
     $file = Input::file('file');
     $filename = str_random(15) . '.' . $file->getClientOriginalExtension();
     $file->move('front/images/upload/', $filename);
     $insert_array = array('org_id' => $org_data->id, 'file' => 'front/images/upload/' . $filename, 'description' => Input::get('description'));
     BulkUpload::create($insert_array);
     return Redirect::back()->with('success', 'Data Successfully Submitted');
 }
Пример #2
0
 public function postDeleteBulkReport()
 {
     BulkUpload::destroy(Input::get('id'));
     Session::flash('success', 'Report Deleted Successfully');
 }