예제 #1
0
 function edit_user($user_id = '')
 {
     if (!common::update_permit()) {
         common::redirect();
     }
     if ($_POST['save']) {
         if ($this->form_validation->run('valid_user')) {
             $this->mod_user->update_user();
             //Don't Change
             $this->session->set_flashdata('msg', 'Content Updated Successfully!');
             redirect('user');
         }
     }
     $id = $user_id;
     if ($id == '') {
         redirect('user');
     }
     $data = sql::row("scic_user", "id={$id}");
     $this->session->set_userdata('edit_user_id', $data['id']);
     //Don't Change
     $data['nav_array'] = array(array('title' => 'Manage Users', 'url' => site_url('user')), array('title' => 'Add New User', 'url' => ''));
     $data['dir'] = 'user';
     $data['action'] = 'user/edit_user/' . $user_id;
     $data['page'] = 'user_form';
     //Don't Change
     $data['page_title'] = 'Edit User';
     $this->load->view('main', $data);
 }
예제 #2
0
 function evaluate_third($user_id = '')
 {
     if (!common::update_permit()) {
         common::redirect();
     }
     $id = $user_id;
     if ($_POST['save']) {
         if ($this->form_validation->run('valid_third')) {
             $this->mod_result->update_third_marks($id);
             //Don't Change
             $this->session->set_flashdata('msg', 'Third Part Evaluated Successfully!');
             $check = sql::row("scic_result", "user_id={$id}");
             if ($check['general'] != -1 && $check['third_part'] != -1 && $check['notification'] == 0) {
                 $this->mod_result->sendEmail($id);
             }
             redirect('result');
         }
     }
     if ($id == '') {
         redirect('result');
     }
     $data = sql::row("scic_result", "user_id={$id}");
     //$this->session->set_userdata('edit_user_id', $data['id']); //Don't Change
     $data['nav_array'] = array(array('title' => 'Manage Results', 'url' => site_url('result')), array('title' => 'Evaluate Third Part', 'url' => ''));
     $data['question'] = $this->mod_result->get_third();
     $data['answer'] = $this->mod_result->get_third_answer($id);
     $data['dir'] = 'result';
     $data['action'] = 'result/evaluate_third/' . $user_id;
     $data['page'] = 'third_form';
     //Don't Change
     $data['page_title'] = 'Evaluation';
     $this->load->view('main', $data);
 }
 function is_admin()
 {
     $CI =& get_instance();
     if ($CI->session->userdata('logged_in') && $CI->session->userdata('user_name') == 'admin') {
         return true;
     } else {
         common::redirect();
     }
 }
예제 #4
0
 function add_url()
 {
     if (!common::add_permit()) {
         common::redirect();
     }
     if ($_POST['save']) {
         if ($this->form_validation->run('add_url')) {
             if ($this->shorturl_model->add_url()) {
                 $this->session->set_flashdata('msg', 'Url Added Successfully!!!');
                 redirect('shorturl');
             }
         }
     }
     $data['msg'] = $this->session->flashdata('msg');
     $data['dir'] = 'shorturl';
     $data['page'] = 'add_url';
     $this->load->view('main', $data);
 }
예제 #5
0
 function new_question()
 {
     if (!common::add_permit()) {
         common::redirect();
     }
     if ($_POST['save']) {
         if ($this->form_validation->run('new_question')) {
             if ($this->question_model->add_question()) {
                 $this->session->set_flashdata('msg', 'Question Added Successfully!!!');
                 redirect('question');
             }
         }
     }
     $data['msg'] = $this->session->flashdata('msg');
     $data['action'] = 'question/new_question';
     $data['dir'] = 'shorturl';
     $data['page'] = 'add_url';
     $data['page_title'] = 'Add Questions';
     $this->load->view('main', $data);
 }