/**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $interviews = Candidate::where('status_record_id', 3)->get();
     $employees = Employee::all();
     $employall = array();
     $employall += array('0' => 'None');
     foreach ($employees as $key => $value) {
         $employall += array($value->id => $value->lastname . " " . $value->firstname);
     }
     $statusrecord = StatusRecord::lists('name', 'id');
     return view('employee.interview', compact('statusrecord', 'interviews', 'employall'));
 }
Пример #2
0
 public function dashboard(Request $request)
 {
     if ($request->session()->has('kandidat')) {
         $id = $request->session()->get('kandidat');
         $data = Candidate::where('id', $id)->first();
         $hak_akses = $data->hak_akses;
         $pribadika = Pribadi::where('nrp', $data->nrp_caka)->first();
         $pribadiwaka = Pribadi::where('nrp', $data->nrp_cawaka)->first();
         $cekcaka = Pribadi::where('nrp', $data->nrp_caka)->count();
         $cekcawaka = Pribadi::where('nrp', $data->nrp_cawaka)->count();
         return view('candidate.dashboard', compact('data', 'hak_akses', 'pribadika', 'pribadiwaka', 'cekcaka', 'cekcawaka', 'user'));
     } else {
         return redirect()->action('LoginCandidateController@getlogin');
     }
 }
 public function postlogin(Request $request)
 {
     $username = $request->input('username');
     $password = $request->input('password');
     $data_login = Candidate::where('username', $username)->first();
     if ($data_login->count() > 0) {
         if (Hash::check($password, $data_login->password)) {
             $request->session()->put('kandidat', $data_login->id);
             return redirect()->action('CandidateController@index');
         } else {
             return redirect()->action('LoginCandidateController@getlogin');
         }
     } else {
         return redirect()->action('LoginCandidateController@getlogin');
     }
 }