예제 #1
0
파일: Filiere.php 프로젝트: dermoumi/saget
 public function __construct()
 {
     parent::__construct();
     $this->setup_name(FALSE, 'filière');
     $this->entry_attr(array('id_niveau' => 'filiere_niveau', 'code' => 'filiere_code', 'libelle' => 'filiere_libelle', 'description' => 'filiere_description', 'mode' => 'filiere_mode', 'assign' => 'filiere_assign'));
     check_context_secteur();
 }
예제 #2
0
 public function contexte_filiere()
 {
     $redirect_to = $this->input->get('redirect');
     check_context_secteur('admin/utilisateur/contexte_filiere' . ($redirect_to ? '?redirect=' . $redirect_to : ''));
     $this->load->helper('form');
     $this->load->helper('common');
     $this->load->model('filiere_model');
     $curr_secteur = context_get('secteur_id');
     $curr_etab_secteur = context_get('etab_secteur_id');
     if ($this->input->post('filiere')) {
         $filiere = $this->filiere_model->get($this->input->post('filiere'));
         $assignment = $filiere ? $this->filiere_model->assignment($filiere->id) : null;
         if ($assignment) {
             context_set('filiere_id', $filiere->id);
             context_set('filiere_libelle', $filiere->libelle);
             context_set('e_s_filiere_id', $assignment->id);
             $this->session->keep_flashdata('flash_msg');
             $this->session->set_flashdata('flash_msg', "Filière sélectionnée");
             redirect($this->input->post('redirect_route') ? $this->input->post('redirect_route') : 'admin');
         } else {
             $this->session->set_flashdata('flash_msg_fail', "Erreur lors de la sélection de filière");
         }
     }
     $data = array('filieres' => $this->filiere_model->list_context(), 'curr_filiere_id' => context_get('filiere_id'), 'redirect_route' => $redirect_to);
     $this->show('utilisateur/contexte_filiere', $data);
 }
예제 #3
0
 function check_context_filiere($redirect_to = NULL)
 {
     if (context_get('filiere_id') && context_get('filiere_libelle') && context_get('e_s_filiere_id')) {
         return true;
     }
     if ($redirect_to == NULL) {
         $ci =& get_instance();
         $redirect_to = 'admin/' . $ci->router->fetch_class();
     }
     if (check_context_secteur('admin/utilisateur/contexte_filiere?redirect=' . $redirect_to)) {
         redirect('admin/utilisateur/contexte_filiere?redirect=' . $redirect_to);
     }
     return false;
 }