Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------controller--------------
- function tambahbiodata() {
- if($this->session->userdata('sudah_login_pelamar')){
- $user=$this->session->userdata('username');
- $config['upload_path'] = './biodata_pelamar/';
- $config['allowed_types'] = 'jpg|pdf';
- $this->load->library('upload', $config);
- if ( ! $this->upload->do_upload()){
- $array = array( 'content' => $this->load->view('akun_pelamar/gagal','',true) );
- $this->load->view('akun_pelamar/menu', $array);
- }else{
- $this->load->model('pelamar_model');
- $this->pelamar_model->update($user);
- $reg['query'] = $this->pelamar_model->tambahbiodata();
- if($reg['query']) {
- $array = array( 'content' => $this->load->view('akun_pelamar/sukses','',true) );
- $this->load->view('akun_pelamar/menu', $array);
- }
- }
- }else {
- redirect('index/index');
- }
- }
- ----------------Model----------------------
- function tambahbiodata() {
- $no=$this->input->post('no_urut');
- $img = $this->upload->data();
- $file_name = "GE".$no."_".$img['file_name'];
- $data = array(
- 'no_urut'=>$no,
- 'noktp'=>$this->input->post('noktp'),
- 'nama_lengkap'=>$this->input->post('nama'),
- 'tempat_lahir'=>$this->input->post('tempat_lahir'),
- 'tgl_lahir'=>$this->input->post('tgl_lahir'),
- 'jk'=>$this->input->post('jk'),
- 'alamat'=>$this->input->post('alamat'),
- 'kota'=>$this->input->post('kota'),
- 'country'=>$this->input->post('country'),
- 'kodepos'=>$this->input->post('kodepos'),
- 'agama'=>$this->input->post('agama'),
- 'goldar'=>$this->input->post('goldar'),
- 'telp'=>$this->input->post('telp'),
- 'status'=>$this->input->post('status'),
- 'email'=>$this->input->post('email'),
- 'file'=>'biodata_pelamar/'.$file_name
- );
- $query = $this->db->insert('biodata_pelamar',$data);
- return $query;
- }
Advertisement
Add Comment
Please, Sign In to add comment