/** * Execute the job. * * @return void */ public function handle() { $data = data_employment::create(['id_recruitment' => $this->req['id_recruitment'], 'nm_depan' => $this->req['nm_depan'], 'nm_belakang' => $this->req['nm_belakang'], 'mobile' => $this->req['telp'], 'email' => $this->req['email'], 'sex' => $this->req['gender'], 'tempat_lahir' => $this->req['tempat_lahir'], 'tgl_lahir' => date('Y-m-d', strtotime($this->req['tgl_lahir'])), 'alamat' => $this->req['alamat'], 'agama' => $this->req['agama'], 'pendidikan' => $this->req['pendidikan'], 'id_status' => 1]); $id = $data->id; if (isset($this->req['company_name']) && count($this->req['company_name']) > 0) { foreach ($this->req['company_name'] as $i => $value) { data_employment_portfolio::create(['id_employment' => $id, 'company_name' => $this->req['company_name'][$i], 'title' => $this->req['title'][$i], 'location' => $this->req['location'][$i], 'date_start' => date('Y-m-d', strtotime($this->req['date_start'][$i])), 'date_end' => date('Y-m-d', strtotime($this->req['date_end'][$i])), 'description' => $this->req['description'][$i]]); } } }
/** * Execute the job. * * @return void */ public function handle() { $rec = data_employment::find($this->req['id']); data_employment::find($this->req['id'])->update(['id_status' => $this->req['id_status']]); if ($this->req['id_status'] == 2) { data_karyawan::create(['nm_depan' => $rec->nm_depan, 'nm_belakang' => $rec->nm_belakang, 'email' => $rec->email, 'sex' => $rec->sex, 'hp' => $rec->mobile, 'tempat_lahir' => $rec->tempat_lahir, 'tgl_lahir' => date('Y-m-d', strtotime($rec->tgl_lahir)), 'jabatan' => 1, 'alamat' => $rec->alamat, 'agama' => $rec->agama, 'pendidikan' => $rec->pendidikan, 'id_status' => 15, 'tgl_bergabung' => date('Y-m-d')]); } else { } return $this->req; }
public function postDestroy(Request $req) { data_employment::find($req->id)->update(['id_status' => 0]); return json_encode(['result' => true]); }