<?php
class Demande_Conge_Det  extends CI_Controller{
    function __construct() {
        parent::__construct();
        $this->Is_Connected();

      }



    public function Is_Connected()
       {
       if (empty($this->session->userdata('SOCAR_ID_USER')))
        {
         redirect(base_url('Login/'));
        }
       }
     

        


  
    public function detail($id)
    {

        $data['data']=$this->Model->getRequeteOne('SELECT ID_DEMANDE_CONGE,config_exercice.DESCRIPTION AS EXERCICE, conge_credit.ID_CREDIT, conge_credit.NB_JOURS_RESTANT, rh_employe.NOM, rh_employe.PRENOM, DATE_DEMANDE, conge_status_conge.DESCRIPTION AS STATUS_CONGE, organigramme_niveau.DESCRIPTION AS NIVEAU , NB_JOURS_DEMANDE, NB_JOURS_ACCORDE, config_type_conge.NOM_CONGE AS TYPE_CONGE, organigramme_direction.DESCRIPTION AS DIRECTION, organigramme_service.DESCRIPTION AS DEPARTEMENT, organigramme_section.DESCRIPTION AS SERVICE, conge_demande_conge.DATE_DERNIER_REPOSE, conge_demande_conge.DATE_DEBUT_CONGE_DEMANDE, conge_demande_conge.DATE_FIN_CONGE_DEMANDE,IP,NAVIGATEUR,OS, DATE_SYSTEME_DEMANDE FROM `conge_demande_conge` LEFT JOIN config_exercice ON config_exercice.ID_EXERCICE = conge_demande_conge.ID_EXERCICE LEFT JOIN conge_credit ON conge_credit.ID_CREDIT = conge_demande_conge.ID_CREDIT LEFT JOIN rh_employe ON rh_employe.ID_EMPLOYE = conge_demande_conge.ID_EMPLOYE LEFT JOIN conge_status_conge ON conge_status_conge.STATUS_CONGE = conge_demande_conge.STATUS_CONGE LEFT JOIN organigramme_niveau ON organigramme_niveau.ID_NIVEAUX_ORGANIGRAMME = conge_status_conge.ID_NIVEAUX LEFT JOIN config_type_conge ON config_type_conge.ID_TYPE_CONGE = conge_demande_conge.ID_TYPE_CONGE LEFT JOIN organigramme_direction ON organigramme_direction.ID_DIRECTION = conge_demande_conge.ID_DIRECTION LEFT JOIN organigramme_service ON organigramme_service.ID_SERVICE = conge_demande_conge.ID_DEMANDE_CONGE LEFT JOIN organigramme_section ON organigramme_section.ID_SECTION = conge_demande_conge.ID_SERVICE WHERE conge_demande_conge.ID_DEMANDE_CONGE = '.$id.' ');

      $data['historique']=$this->Model->getRequete('SELECT DATE_TRAITEMENT, organigramme_direction.DESCRIPTION AS DIRECTION, organigramme_service.DESCRIPTION AS DEPARTEMENT, organigramme_section.DESCRIPTION AS ID_SECTION, rh_employe.NOM, rh_employe.PRENOM, conge_status_conge.DESCRIPTION AS STATUS_CONGE, COMMENTAIRE, DATE_DEBUT_CONGE_ACCORDE, DATE_FIN_CONGE_ACCORDE, IP,NAVIGATEUR,OS FROM `conge_traitement_conge` LEFT JOIN organigramme_direction ON organigramme_direction.ID_DIRECTION = conge_traitement_conge.ID_DIRECTION LEFT JOIN organigramme_service ON organigramme_service.ID_SERVICE = conge_traitement_conge.ID_DEPARTEMENT LEFT JOIN organigramme_section ON organigramme_section.ID_SECTION = conge_traitement_conge.ID_SERVICE LEFT JOIN rh_employe ON rh_employe.ID_EMPLOYE = conge_traitement_conge.ID_EMPLOYE_TRAITANT JOIN conge_status_conge ON conge_status_conge.STATUS_CONGE = conge_traitement_conge.STATUS_CONGE WHERE 1 AND ID_DEMANDE_CONGE = '.$id.'');

      $data['title']='Demande de cong&eacute;';
      $this->load->view('Demande_Conge_Scan_View',$data);
      

    }




}