コード例 #1
0
 /**
  * Show the form for editing the specified branch.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $eallw = EAllowances::find($id);
     $employees = Employee::all();
     $allowances = Allowance::all();
     return View::make('employee_allowances.edit', compact('eallw', 'allowances', 'employees'));
 }
コード例 #2
0
ファイル: routes.php プロジェクト: kenkode/umash
                $objValidation->setErrorTitle('Input error');
                $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');
});
/*
*allowance template
*
*/
Route::get('template/allowances', function () {
    $data = Allowance::all();
    $employees = Employee::all();
    Excel::create('Allowances', function ($excel) use($data, $employees) {
        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('allowances', function ($sheet) use($data, $employees) {
            $sheet->row(1, array('EMPLOYEE', 'ALLOWANCE 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->allowance_name;
            }
コード例 #3
0
 /**
  * Display a listing of branches
  *
  * @return Response
  */
 public function index()
 {
     $allowances = Allowance::all();
     return View::make('allowances.index', compact('allowances'));
 }
コード例 #4
0
 public function __construct()
 {
     $dept_id = Department::distinct()->lists('super_department_id');
     $this->departments = Department::whereNotIn('id', $dept_id)->where('name', 'NOT LIKE', '%HONORER%')->orderBy('name')->get();
     $this->allowances = Allowance::all();
 }