Example #1
0
 function manage_admins()
 {
     $user_service = new User_service();
     //        $user_model = new User_model();
     $data['heading'] = "Manage Admins";
     $data['results'] = $user_service->get_admin_details();
     $parials = array('content' => 'users/manage_admin_view');
     $this->template->load('template/main_template', $parials, $data);
 }
Example #2
0
 function update_password()
 {
     $user_service = new User_service();
     $reg_user_list = $user_service->get_admin_details();
     $input_username = trim($this->input->post('username', TRUE));
     foreach ($reg_user_list as $user) {
         if (strcmp($user->user_name, $input_username) == 0) {
             $user_model = new User_model();
             $user_model->set_id($user->id);
             $user_model->set_password(md5($this->input->post('password', TRUE)));
             $result = $user_service->update_password($user_model);
             if ($result == '1') {
                 echo "1";
                 die;
             } else {
                 echo "2";
                 die;
             }
         }
     }
     echo '0';
 }