Advertisement
Guest User

Too few arguments error

a guest
Jan 21st, 2018
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.29 KB | None | 0 0
  1.   public function edit( $id )
  2.   {
  3.     $where = array( 'id' => $id );
  4.         $data['user'] = $this->Admin_model->get_single( 'users' , $where );
  5.         $password = $data['user']->password;
  6.  
  7.     if (!empty($_POST)) {
  8.  
  9.       if ($this->form_validation->run('admin_users_create') == true)
  10.       {
  11.         if (empty($_POST['password']))
  12.         {
  13.           $_POST['password']=$password;
  14.         }
  15.         $data = array(
  16.          'name '=> $this->input->post('name', true),
  17.          'email' => $this->input->post('email', true),
  18.          'password' => password_hash($this->input->post('password', true), PASSWORD_BCRYPT),
  19.        );
  20.  
  21.        $this->session->set_flashdata('alert','Użytkownik dodany poprawnie');
  22.        refresh();
  23.       }
  24.       else{
  25.         $this->session->set_flashdata('alert',validation_errors());
  26.         refresh();
  27.       }
  28.     }
  29.     $this->load->view('admin/users/edit');
  30.   }
  31.   public function unique_email_edit($email)
  32.   {
  33.     $id = $this->uri->segment(4);
  34.     $where = array( 'id' => $id );
  35.     $user = $this->Admin_model->get_single( 'users' , $where );
  36.  
  37.     if($user->email != $email && $user->id == $id)
  38.     {
  39.       return true;
  40.     }
  41.     else {
  42.       $this->form_validation->set_message('username_check', 'Inny użytkownik ma taki email');
  43.       return false;
  44.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement