public static function sendReset($candidate_id) { // Generate activation code $code = str_random(25); $c = Candidate::find($candidate_id); $c->password_reset_code = $code; $c->save(); $data = []; $data['candidate'] = $c; // Send activation email - Just in case they missed it when registering Mail::send('emails.candidate.reset', $data, function ($message) use($c) { $message->to($c->email, $c->name . ' ' . $c->surname)->subject('KDC - Reset your password'); }); }
if (is_array($cadidates_checked)) { $account_id = Session::get('account_id', '這是預設值,沒設定過就用這個囉!!'); //echo $account_id; //dd('5'); $account = Account::find($account_id); $vote = Vote::find($account->vote_id); if (count($cadidates_checked) > $vote->can_select) { $can_select = $vote->can_select; $candidates = Candidate::where('vote_id', '=', $account->vote_id)->get(); $account_id = Session::get('account_id', '這是預設值,沒設定過就用這個囉!!'); $err_msg = '超過可選數目'; return View::make('tasks.candidate_select', compact('candidates', 'account_id', 'err_msg', 'can_select')); } else { echo "投票完成!<br>您選擇的是:<br>"; foreach ($cadidates_checked as $candidate_id) { $candidate = Candidate::find($candidate_id); echo $candidate->cname; echo "<br>"; $candidate->accounts()->save($account); $candidate->total_count++; $candidate->save(); } } //echo $account_id; } // return our view and Vote information // return View::make('tasks.candidate_select_result',compact('candidates')); })); Route::get('/account_data_show/{id}', array('as' => 'account_data_show', function ($id) { $accounts = Account::where('vote_id', '=', $id)->get(); $votes = Vote::where('id', '=', $id)->get();
public function jobAlertsPost() { // dd(Input::all()); if (!is_null(Session::get('candidate'))) { $candidate = Candidate::find(Session::get('candidate')->id); $input = Input::all(); // Check if there is an alert already $jobAlert = JobAlerts::where('candidate_id', $candidate->id)->first(); if (is_null($jobAlert)) { $alert = new JobAlerts(); } else { $alert = $jobAlert; } if (isset($input['active'])) { $active = 1; } else { $active = 0; } $alert->candidate_id = $candidate->id; $alert->job_type = $input['job_type_id']; $alert->sector_id = $input['sector_id']; $alert->location_id = $input['location_id']; $alert->salary_expectations = $input['salary']; $alert->keywords = $input['job_keywords']; $alert->skill_keywords = $input['skill_keywords']; $alert->active = $active; $alert->save(); return Redirect::back()->withInfo('Your alert settings have been saved'); } else { return Redirect::to('become-a-candidate')->with('info', 'Please login / register to view this page'); } }
public function postSavecandidatenotes() { $candidate = Candidate::find(Input::get('id')); if (!$candidate) { return Response::json(array('result' => 0, 'error' => 'Candidate not found')); } $candidate->notes = Input::get('notes'); $candidate->save(); return Response::json(array('result' => 1)); }
if (!is_null(Session::get('candidate'))) { $candidate = Candidate::find(Session::get('candidate')->id); $candidate->password = Hash::make(Input::get('password')); $candidate->save(); return Redirect::to('candidate')->withInfo('Your password has been updated.'); } else { return Redirect::to('become-a-candidate')->with('info', 'Please login / register to view this page'); } }); Route::get('candidate/login', array('as' => 'candidate.login', function () { return 'Candidate Login Page'; })); Route::get('candidate/applications', array('as' => 'candidate.applications', 'uses' => 'CandidateController@getJobApplications')); Route::get('candidate/cv-tips', array('as' => 'candidate.cv-tips', function () { if (!is_null(Session::get('candidate'))) { $candidate = Candidate::find(Session::get('candidate')->id); return View::make('candidate.cvtips')->with(compact('candidate')); } else { return Redirect::to('become-a-candidate')->with('info', 'Please login / register to view this page'); } })); Route::get('candidate/job-alerts', array('uses' => 'CandidateController@jobAlerts')); Route::post('candidate/job-alerts', array('as' => 'post.candidate.job-alerts', 'uses' => 'CandidateController@jobAlertsPost')); Route::group(array('before' => 'auth'), function () { Route::get('dashboard', array('as' => 'dashboard', 'uses' => 'AdminController@dashboard')); Route::get('dashboard/home', array('as' => 'home', 'uses' => 'AdminController@home')); Route::get('dashboard/sectors', array('as' => 'sectors', 'uses' => 'AdminController@sectors')); Route::get('dashboard/news', array('as' => 'news', 'uses' => 'AdminController@news')); Route::post('dashboard/news', array('uses' => 'AdminController@saveNews')); Route::get('dashboard/news/arquive', array('as' => 'newsarquive', 'uses' => 'AdminController@newsarquive')); Route::get('dashboard/news/edit/{id}', array('as' => 'newsedit', 'uses' => 'AdminController@newsedit'));