Exemple #1
0
});
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);
            $listdata = array();
            foreach ($data as $d) {
                $listdata[] = $d->allowance_name;
            }
            $list = implode(", ", $listdata);
 /**
  * Remove the specified branch from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     JGroup::destroy($id);
     return Redirect::route('job_group.index');
 }
 /**
  * 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'));
 }
Exemple #4
0
Route::get('leaveReports/selectLeave', 'ReportsController@balanceselect');
Route::post('leaveReports/leaveBalances', 'ReportsController@leavebalances');
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'));