Exemplo n.º 1
0
 /**
  * import the xls sheet values to the db.
  *
  * @param  int  $id
  * @return Response*/
 public function storeorderimport(DistrictRequest $request, $camp_id)
 {
     $camp = Camp::findOrFail($camp_id);
     $file = 'fileimport';
     if ($request->hasFile($file)) {
         $destinationPath = base_path() . "/uploads/import/";
         $filename = $request->file($file)->getClientOriginalName();
         $request->file($file)->getRealPath();
         $request->file($file)->getClientOriginalExtension();
         $request->file($file)->move($destinationPath, $destinationPath . $filename, 0777);
         chmod($destinationPath . $filename, 0777);
         $pathname = $destinationPath . $filename;
         static::orderimport_xls($pathname, $camp_id, $this->camp_id, $this->description, $this->object_id, $this->object_type, $this->status);
     }
     return Redirect::route('ruban.cards.view', array($camp->card_id));
 }
Exemplo n.º 2
0
 /**
  * import the xls sheet values to the db.
  *
  * @param  int  $id
  * @return Response*/
 public function storeimport(DistrictRequest $request)
 {
     $file = 'fileimport';
     if ($request->hasFile($file)) {
         $destinationPath = base_path() . "/uploads/import/";
         $filename = $request->file($file)->getClientOriginalName();
         $request->file($file)->getRealPath();
         $request->file($file)->getClientOriginalExtension();
         $request->file($file)->move($destinationPath, $destinationPath . $filename, 0777);
         chmod($destinationPath . $filename, 0777);
         $pathname = $destinationPath . $filename;
         static::import_xls($pathname, $this->state_id);
     }
     return Redirect::route('ruban.districts.import');
 }