Пример #1
0
Route::group(['before' => 'reject_application'], function () {
    Route::get('leaverejects', function () {
        $leaveapplications = Leaveapplication::all();
        return View::make('leaveapplications.rejected', compact('leaveapplications'));
    });
});
Route::group(['before' => 'manage_settings'], function () {
    Route::get('migrate', function () {
        return View::make('migration');
    });
});
/*
* Template routes and generators 
*/
Route::get('template/employees', function () {
    $bank_data = Bank::all();
    $bankbranch_data = BBranch::all();
    $branch_data = Branch::all();
    $department_data = Department::all();
    $employeetype_data = EType::all();
    $jobgroup_data = JGroup::all();
    Excel::create('Employees', function ($excel) use($bank_data, $bankbranch_data, $branch_data, $department_data, $employeetype_data, $jobgroup_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('employees', function ($sheet) use($bank_data, $bankbranch_data, $branch_data, $department_data, $employeetype_data, $jobgroup_data, $employees) {
            $sheet->row(1, array('PERSONAL FILE NUMBER', 'EMPLOYEE', 'FIRST NAME', 'LAST NAME', 'ID', 'KRA PIN', 'BASIC PAY', ''));
            $empdata = array();
            foreach ($employees as $d) {
                $empdata[] = $d->personal_file_number . ':' . $d->first_name . ' ' . $d->last_name . ' ' . $d->middle_name;
            }
            $emplist = implode(", ", $empdata);
Пример #2
0
 /**
  * Display a listing of branches
  *
  * @return Response
  */
 public function index()
 {
     $banks = Bank::all();
     return View::make('banks.index', compact('banks'));
 }
Пример #3
0
 /**
  * Show the form for editing the specified branch.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $employee = Employee::find($id);
     $branches = Branch::all();
     $departments = Department::all();
     $jgroups = JGroup::all();
     $etypes = EType::all();
     $banks = Bank::all();
     $bbranches = BBranch::all();
     return View::make('employees.edit', compact('branches', 'departments', 'etypes', 'jgroups', 'banks', 'bbranches', 'employee'));
 }
Пример #4
0
Route::get('leaveReports/selectLeaveType', 'ReportsController@leaveselect');
Route::post('leaveReports/Employeesonleave', 'ReportsController@employeesleave');
Route::get('leaveReports/selectEmployee', 'ReportsController@employeeselect');
Route::post('leaveReports/IndividualEmployeeLeave', 'ReportsController@individualleave');
Route::get('api/dropdown', function () {
    $id = Input::get('option');
    $bbranch = Bank::find($id)->bankbranch;
    return $bbranch->lists('bank_branch_name', 'id');
});
Route::get('empedit/{id}', function ($id) {
    $employee = Employee::find($id);
    $branches = Branch::all();
    $departments = Department::all();
    $jgroups = JGroup::all();
    $etypes = EType::all();
    $banks = Bank::all();
    $bbranches = BBranch::all();
    return View::make('employees.cssedit', compact('branches', 'departments', 'etypes', 'jgroups', 'banks', 'bbranches', 'employee'));
});
Route::get('css/payslips', function () {
    $employeeid = DB::table('employee')->where('personal_file_number', '=', Confide::user()->username)->pluck('id');
    $employee = Employee::findorfail($employeeid);
    return View::make('css.payslip', compact('employee'));
});
Route::get('css/leave', function () {
    $employeeid = DB::table('employee')->where('personal_file_number', '=', Confide::user()->username)->pluck('id');
    $employee = Employee::findorfail($employeeid);
    $leaveapplications = DB::table('leaveapplications')->where('employee_id', '=', $employee->id)->get();
    return View::make('css.leave', compact('employee', 'leaveapplications'));
});
Route::get('css/leaveapply', function () {