public function save()
 {
     $data = Request::input('data');
     Candidate::find($data['id'])->update(['status_record_id' => $data['status_record_id'], 'time_interview' => $data['time_interview'], 'time' => $data['time']]);
     if ($data['employee_id'] != '') {
         Candidate::find($data['id'])->employees()->sync($data['employee_id']);
     }
     if ($data['status_record_id'] == 2) {
         $candidate = Candidate::find($data['id']);
         Employee::create(['firstname' => $candidate->first_name, 'lastname' => $candidate->last_name, 'phone' => $candidate->phone, 'email' => $candidate->email, 'position_id' => $data['position'], 'date_of_birth' => $candidate->date_of_birth]);
     }
 }
Пример #2
0
 public function upload(Request $request)
 {
     $file = Input::file('data');
     $filename = $file->getClientOriginalName();
     $destinationPath = 'berkas_kandidat/';
     $file->move($destinationPath, $filename);
     $id = $request->session()->get('kandidat');
     $update = Candidate::find($id);
     $update->status_upload = 1;
     $update->save();
     return redirect()->action('CandidateController@dashboard');
 }
 /**
  * Delete candidate
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $candidate = Candidate::find($id);
     $files = File::where('candidate_id', '=', $candidate->id)->delete();
     $candidate->delete();
     return redirect()->route('candidates.index')->with('messageDelete', 'Delete candidate successfully!');
 }
 public function destroy($id)
 {
     $candidate = Candidate::find($id);
     $candidate->delete();
     return Redirect::to('/dashboard/candidate')->with('message', 'Candidate deleted Successfully.');
 }