Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function Adduser(){
- $data['akses']=$this->us->Get_akses('user','Akses');
- foreach($data as $key=>$r){
- }
- $data['isi']='opp/add_user';
- $this->load->view('template_ope',$data);
- }
- public function tambah_user(){
- $nik=$this->input->post('nik');
- $nama=$this->input->post('nama');
- $almt=$this->input->post('almt');
- $user=$this->input->post('user');
- $pass=$this->input->post('pass');
- $akses=$this->input->post('akses');
- $this->form_validation->set_rules('nik', 'Nik', 'required|alpha_dash|min_length[7]|max_length[7]|callback_username_check');
- $this->form_validation->set_rules('nama', 'nama', 'required');
- $this->form_validation->set_rules('almt', 'Alamat', 'required');
- $this->form_validation->set_rules('user', 'Username', 'required');
- $this->form_validation->set_rules('pass', 'Password', 'required');
- if ($this->form_validation->run() == FALSE)
- {
- $this->session->set_flashdata('msg', 'Periksa Kembali Semua Data !!!');
- redirect('operator/Adduser','refresh');".";
- }
- else
- {
- $data_user=$this->us->lihat_user($nik);
- if ($data_user['NIK']==$nik and $data_user['username']=$user) {
- $this->session->set_flashdata('msg', 'Duplikat NIK dan username!!!');
- redirect('operator/Adduser','refresh');".";
- }
- elseif($data_user['NIK']==$nik or $data_user['username']=$user){
- $this->session->set_flashdata('msg', 'Duplikat NIK atau username!!!');
- redirect('operator/Adduser','refresh');".";
- }
- $this->us->tambah( $nik,$nama,$almt,$user,$pass,$akses);
- $this->session->set_flashdata('msg', 'Data Berhasil Disimpan !!!');
- redirect('operator/user/','refresh');".";
- }
- }
Add Comment
Please, Sign In to add comment