Beispiel #1
0
 public function index()
 {
     $this->load->helper(array("birthdate", "countries"));
     $this->data['birth_date_year'] = buildYearDropdown('birth_date_year', $this->input->post('birth_date_year'));
     $this->data['birth_date_month'] = buildMonthDropdown('birth_date_month', $this->input->post('birth_date_month'));
     $this->data['birth_date_day'] = buildDayDropdown('birth_date_day', $this->input->post('birth_date_day'));
     $this->load->view('register', $this->data);
 }
Beispiel #2
0
 public function user_edit($id)
 {
     $this->load->library('form_validation');
     $this->form_validation->set_rules('password', 'პაროლი', 'trim|min_length[5]|md5', array('min_length' => 'პაროლის სიგრძე უნდა იყოს 5 სიმბოლოზე მეტი'));
     $this->form_validation->set_rules('conf_password', 'გაიმეორეთ პაროლი', 'trim|md5|matches[password]', array('matches' => 'პაროლები ერთმანეთს არ ემთხვევა'));
     $this->form_validation->set_rules('mobile', 'მობილური', 'trim|numeric|exact_length[9]', array('numeric' => '%s ველი უნდა შეიცავდეს მხოლოდ ნიფრებს ყოვლგვარი გამოტოვების და "-" გარეშე ', 'exact_length' => 'ტელეფონი უნდა იყოს 9 სიმბოლო'));
     $this->form_validation->set_rules('personal_id', 'პირადი ნომერი', 'trim|numeric|exact_length[11]', array('numeric' => '%s ველი უნდა შეიცავდეს მხოლოდ ნიფრებს ყოვლგვარი გამოტოვების და "-" გარეშე ', 'exact_length' => 'პირადი ნომერი უნდა იყოს 11 სიმბოლო'));
     if ($_SERVER['REQUEST_METHOD'] == 'POST' && !$this->form_validation->run() == FALSE) {
         $data = array('name_en' => $this->input->post('name_en'), 'name_ge' => $this->input->post('name_ge'), 'birthday' => $this->input->post('day') . '/' . $this->input->post('month') . '/' . $this->input->post('year'), 'balance' => $this->input->post('balance'), 'mobile' => $this->input->post('mobile'), 'personal_id' => $this->input->post('personal_id'), 'city' => $this->input->post('city'), 'address' => $this->input->post('address'), 'is_company' => $this->input->post('is_company'), 'company_id' => $this->input->post('company_id'), 'company_name' => $this->input->post('company_name'), 'username' => $this->input->post('username'), 'email' => $this->input->post('email'));
         if ($this->input->post('password') != '') {
             $data['password'] = $this->input->post('password');
         }
         $this->manager_model->update_obj('users', $id, $data);
         $_SESSION['message'] = 'ჩანაწერი დამატებულია';
         $this->session->mark_as_flash('message');
         $this->db->where('id', $id);
         $this->db->update('users', $data);
     }
     $this->load->helper('birthdate');
     $data['birth_date_year'] = buildYearDropdown();
     $data['birth_date_month'] = buildMonthDropdown();
     $data['birth_date_day'] = buildDayDropdown();
     $result = $this->manager_model->select_single_obj('users', $id);
     $birthday = explode('/', $result['birthday']);
     $data['birthday'] = $birthday;
     $this->load->view('manager/header');
     $data['admin_name'] = $this->session->userdata('logged');
     $this->load->view('manager/top-menu', $data);
     $this->load->view('manager/side-navigation');
     $data['user'] = $result;
     $this->load->view('manager/single_user', $data);
     $this->load->view('manager/footer');
 }