예제 #1
0
 /**
  * Show the form for editing the specified branch.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $rel = ERelief::find($id);
     $employees = Employee::all();
     $reliefs = Relief::all();
     return View::make('employee_relief.edit', compact('rel', 'employees', 'reliefs'));
 }
예제 #2
0
파일: routes.php 프로젝트: kenkode/umash
                $objValidation->setError('Value is not in list.');
                $objValidation->setPromptTitle('Pick from list');
                $objValidation->setPrompt('Please pick a value from the drop-down list.');
                $objValidation->setFormula1('"' . $emplist . '"');
                //note this!
            }
        });
    })->export('xls');
});
/*
*Relief template
*
*/
Route::get('template/reliefs', function () {
    $employees = Employee::all();
    $data = Relief::all();
    Excel::create('Reliefs', function ($excel) use($employees, $data) {
        require_once base_path() . "/vendor/phpoffice/phpexcel/Classes/PHPExcel/NamedRange.php";
        require_once base_path() . "/vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell/DataValidation.php";
        $excel->sheet('reliefs', function ($sheet) use($employees, $data) {
            $sheet->row(1, array('EMPLOYEE', 'RELIEF TYPE', 'AMOUNT'));
            $empdata = array();
            foreach ($employees as $d) {
                $empdata[] = $d->personal_file_number . ':' . $d->first_name . ' ' . $d->last_name . ' ' . $d->middle_name;
            }
            $emplist = implode(", ", $empdata);
            $listdata = array();
            foreach ($data as $d) {
                $listdata[] = $d->relief_name;
            }
            $list = implode(", ", $listdata);
예제 #3
0
 /**
  * Remove the specified branch from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Relief::destroy($id);
     return Redirect::route('reliefs.index');
 }