361 lines
11 KiB
PHP
361 lines
11 KiB
PHP
<?php
|
|
|
|
|
|
|
|
|
|
|
|
use Glpi\Event;
|
|
|
|
include ('../inc/includes.php');
|
|
|
|
Session::checkLoginUser();
|
|
|
|
require_once '../functionsophalglpi.php';
|
|
|
|
|
|
|
|
|
|
|
|
if (Session::getCurrentInterface() == "helpdesk") {
|
|
|
|
Html::helpHeader("DRH", '', $_SESSION["glpiname"]);
|
|
|
|
} else {
|
|
|
|
Html::header("DRH", '', "", "");
|
|
|
|
}
|
|
|
|
$currentDate = date("Y-m-d");
|
|
|
|
/*
|
|
|
|
function callWebService($matricule , $operation){
|
|
|
|
|
|
|
|
$url = "http://si.sophal.net/controller/Webservices.php";
|
|
|
|
$accessKey = 'D*G-KaNdRgUkXp2s5v8y/B?E(H+MbQeS'; //CSRF ATTACK
|
|
|
|
|
|
|
|
$data = array(
|
|
|
|
'accessKey' => $accessKey ,
|
|
|
|
'matricule' => $matricule,
|
|
|
|
'operation' => $operation
|
|
|
|
);
|
|
|
|
|
|
|
|
$resource = curl_init();
|
|
|
|
curl_setopt($resource, CURLOPT_URL, $url);
|
|
|
|
curl_setopt($resource, CURLOPT_HTTPHEADER, array('Content-Type:multipart/form-data'));
|
|
|
|
curl_setopt($resource, CURLOPT_POST, 1);
|
|
|
|
curl_setopt($resource, CURLOPT_RETURNTRANSFER, 1);
|
|
|
|
curl_setopt($resource, CURLOPT_POSTFIELDS, $data);
|
|
|
|
|
|
|
|
$response = curl_exec($resource);
|
|
|
|
|
|
|
|
curl_close($resource);
|
|
|
|
|
|
|
|
if ($response !== false) {
|
|
|
|
return $response;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function getMatricule(){
|
|
|
|
|
|
|
|
global $DB;
|
|
|
|
|
|
|
|
$query = "SELECT registration_number as matricule from glpi_users
|
|
|
|
where glpi_users.id ='".$_SESSION["glpiID"]."' ";
|
|
|
|
$result = $DB->query($query);
|
|
|
|
|
|
|
|
if ($result->num_rows > 0) {
|
|
|
|
$res = $result->fetch_assoc();
|
|
|
|
return $res['matricule'];
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
$mat = getMatricule();
|
|
|
|
//echo"<div id='loadingslide'><div class='loadingindicator'>Chargement...</div></div>";
|
|
|
|
if(!empty($mat)){
|
|
|
|
|
|
|
|
$response =callWebService($mat , 'get_MonDossierRH');
|
|
|
|
|
|
|
|
echo "<div id='tabs1216654411' class='center vertical ui-tabs ui-corner-all ui-widget ui-widget-content ui-tabs-vertical ui-helper-clearfix ui-corner-left'>
|
|
|
|
<div id='ui-id-3' style='padding:0px;' aria-live='polite' aria-labelledby='ui-id-2' role='tabpanel' class='ui-tabs-panel ui-corner-bottom ui-widget-content' aria-hidden='false'>
|
|
|
|
|
|
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<div class='spaced' id='tabsbody'>
|
|
|
|
<table class='tab_cadre_fixe' id='mainformtable'>
|
|
|
|
<tbody>
|
|
|
|
<tr class='headerRow'>
|
|
|
|
<th colspan='2' class=''>Mon Dossier</th>
|
|
|
|
<th colspan='2' class=''></th>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr class=''>
|
|
|
|
<td width='20%'>Nom & Prenom :</td>
|
|
|
|
<td width='30%'>
|
|
|
|
<input id='fullname' size='40' type='text' name='fullname' value='' readonly>
|
|
|
|
</td>
|
|
|
|
<td colspan='2' rowspan='7' ><center><img style='width: 150px;' id='photo' src='' /></center></td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr class=''>
|
|
|
|
<td width='20%'>Département :</td>
|
|
|
|
<td colspan='3'>
|
|
|
|
<input size='40' id='Departement' type='text' name='Departement' value='' readonly>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr class=''>
|
|
|
|
<td width='20%'>Fonction :</td>
|
|
|
|
<td width='30%'>
|
|
|
|
<input id='Fonction' size='40' type='text' name='Fonction' value='' readonly>
|
|
|
|
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr class=''>
|
|
|
|
<td width='20%'>Periode :</td>
|
|
|
|
<td width='30%'>
|
|
|
|
<input id='Periode' size='40' type='text' name='Periode' value='' readonly>
|
|
|
|
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr class=''>
|
|
|
|
<td width='20%'>Téléphone :</td>
|
|
|
|
<td width='30%'>
|
|
|
|
<input id='tele' size='40' type='text' name='tele' value='' readonly>
|
|
|
|
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr class=''>
|
|
|
|
<td width='20%'>Matricule :</td>
|
|
|
|
<td width='30%'>
|
|
|
|
<input id='Matricule' size='40' type='text' name='Matricule' value='' readonly>
|
|
|
|
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr class=''>
|
|
|
|
<td width='20%'>Service :</td>
|
|
|
|
<td width='30%'>
|
|
|
|
<input id='Service' size='40' type='text' name='Service' value='' readonly>
|
|
|
|
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr class=''>
|
|
|
|
<td width='20%'>Date recrutement :</td>
|
|
|
|
<td width='30%' id='Date_recrutement'></td>
|
|
|
|
</tr>
|
|
|
|
<tr class=''>
|
|
|
|
<td width='20%'>au :</td>
|
|
|
|
<td width='30%' id='au'> </td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
</tr>";
|
|
|
|
|
|
|
|
echo" </tbody>
|
|
|
|
</table>
|
|
|
|
</div>";
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
echo"<table class='tab_cadre_fixehov'>
|
|
|
|
<tr>
|
|
|
|
<th class=''>Num Contrat</th>
|
|
|
|
<th class=''>Date Début</th>
|
|
|
|
<th class=''>Date Fin</th>
|
|
|
|
<th class=''>Modèle</th>
|
|
|
|
</tr>
|
|
|
|
<tbody id='Contrats'></tbody>
|
|
|
|
</table>
|
|
|
|
<br><br>";
|
|
|
|
*/
|
|
|
|
|
|
|
|
echo"<table class='tab_cadre_fixehov'>
|
|
|
|
<tr>
|
|
|
|
<th class=''>Sanction</th>
|
|
|
|
<th class=''>Date Début</th>
|
|
|
|
<th class=''>Motif</th>
|
|
|
|
<th class=''>Degré</th>
|
|
|
|
</tr>
|
|
|
|
<tbody id='sanctions'></tbody>
|
|
|
|
</table>
|
|
|
|
<br><br>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo"<table class='tab_cadre_fixehov'>
|
|
|
|
<tbody><tr>
|
|
|
|
<th class=''>Absence</th>
|
|
|
|
<th class=''>Heure</th>
|
|
|
|
</tr>
|
|
|
|
<tr class='tab_bg_1'>
|
|
|
|
<td><b>ABSENCES AUTORISES</b></td>
|
|
|
|
<td id='1' width='25%'></td>
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
<tr class='tab_bg_1'>
|
|
|
|
<td><b>ABSENCES CONGE</b></td>
|
|
|
|
<td id='2' width='25%'></td>
|
|
|
|
</tr>
|
|
|
|
<tr class='tab_bg_1'>
|
|
|
|
<td><b>ABSENCE IRREGULIERE</b></td>
|
|
|
|
<td id='3' width='25%'></td>
|
|
|
|
</tr>
|
|
|
|
<tr class='tab_bg_1'>
|
|
|
|
<td><b>ABSENCE MALADIE</b></td>
|
|
|
|
<td id='4' width='25%'></td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table><br><br>";
|
|
|
|
|
|
|
|
echo"<table class='tab_cadre_fixehov'>
|
|
|
|
<tr>
|
|
|
|
<th class=''>Les différentes poste occupés</th>
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
<tbody id='poste'></tbody>
|
|
|
|
</table>
|
|
|
|
<br><br>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>";
|
|
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
echo "<div id='tabs1216654411' class='center vertical ui-tabs ui-corner-all ui-widget ui-widget-content ui-tabs-vertical ui-helper-clearfix ui-corner-left'>
|
|
|
|
<div id='ui-id-3' style='padding:0px;' aria-live='polite' aria-labelledby='ui-id-2' role='tabpanel' class='ui-tabs-panel ui-corner-bottom ui-widget-content' aria-hidden='false'>
|
|
|
|
<center>aucune donnée trouvée</center>
|
|
|
|
</div>
|
|
|
|
</div>";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (Session::getCurrentInterface() == "helpdesk") {
|
|
|
|
Html::helpFooter();
|
|
|
|
} else {
|
|
|
|
Html::footer();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$link = $CFG_GLPI["root_doc"];
|
|
|
|
$user = Session::getCurrentInterface();
|
|
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
var link = <?php echo json_encode($link); ?>;
|
|
|
|
var user = <?php echo json_encode($user); ?>;
|
|
|
|
var userlink;
|
|
|
|
if(user == "helpdesk"){
|
|
|
|
userlink ='<li class="breadcrumb_item"><a href="'+link+'/front/helpdesk.public.php" title="Accueil">Accueil</a></li>';
|
|
|
|
}else{
|
|
|
|
userlink = '<li class="breadcrumb_item"><a href="'+link+'/front/central.php" title="Accueil">Accueil</a></li>';
|
|
|
|
}
|
|
|
|
|
|
|
|
$(document).ready(function(){
|
|
|
|
|
|
|
|
|
|
|
|
$("#c_ssmenu2").html('<ul>'+
|
|
|
|
userlink+
|
|
|
|
'<li class="breadcrumb_item"><a href="" title="">Ressources Humaines</a></li>'+
|
|
|
|
'<li class="breadcrumb_item"><a href="" class="here" title="Mon Dossier"><i class="far fa-sticky-note"></i> Mon Dossier </a></li>'+
|
|
|
|
|
|
|
|
'</li>'+
|
|
|
|
'</ul>');
|
|
|
|
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
<script>
|
|
|
|
|
|
|
|
|
|
|
|
var MATRICULE = <?php echo json_encode($mat); ?>;
|
|
|
|
var data = <?php echo $response; ?>;
|
|
|
|
|
|
|
|
function get_sanctions(){
|
|
|
|
|
|
|
|
|
|
|
|
if (data.sanctions !== null && data.sanctions.length > 0) {
|
|
|
|
for(var i = 0; i < data.length; i++) {
|
|
|
|
var row ="<tr class='tab_bg_1'>"+
|
|
|
|
"<td><b>"+data.sanctions[i].LIBELLE+"</b></td>"+
|
|
|
|
"<td id='col_label_1_514157212' width='25%'>"+data.sanctions[i].DateDebut+"</td>"+
|
|
|
|
"<td id='col_label_5_514157212' width='25%'>"+data.sanctions[i].Motif+"</td>"+
|
|
|
|
"<td id='col_label_6_514157212' width='25%'>"+data.sanctions[i].DEGRE+"</td>"+
|
|
|
|
"</tr>";
|
|
|
|
$('#sanctions').append(row);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function get_absences(matricule,departement){
|
|
|
|
|
|
|
|
|
|
|
|
if (data.absences !== null && data.absences.length > 0) {
|
|
|
|
$('#1').text(data.absences[0]);
|
|
|
|
$('#2').text(data.absences[1]);
|
|
|
|
$('#3').text(data.absences[2]);
|
|
|
|
$('#4').text(data.absences[3]);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function get_photo(){
|
|
|
|
|
|
|
|
if (data.photo.length > 0) {
|
|
|
|
$("#photo").attr("src",data.photo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function get_contrats(){
|
|
|
|
var currentDate = <?php echo json_encode($currentDate); ?>;
|
|
|
|
if (data.contrats.length > 0) {
|
|
|
|
for(var k = 0; k < data.contrats.length; k++) {
|
|
|
|
|
|
|
|
var date = data.contrats[k].DateDebContrat.split(" ");
|
|
|
|
var date = new Date(date[0]);
|
|
|
|
var currentDate = new Date(currentDate);
|
|
|
|
if(currentDate > date){
|
|
|
|
var row ="<tr class='tab_bg_1'>"+
|
|
|
|
"<td><b>"+data.contrats[k].NumContrat+"</b></td>"+
|
|
|
|
"<td id='col_label_1_514157212' width='25%'>"+data.contrats[k].DateDebContrat+"</td>"+
|
|
|
|
"<td id='col_label_5_514157212' width='25%'>"+data.contrats[k].DateFinContrat+"</td>"+
|
|
|
|
"<td id='col_label_6_514157212' width='25%'>"+data.contrats[k].Libelle+"</td>"+
|
|
|
|
"</tr>";
|
|
|
|
$('#Contrats').append(row);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function get_historique_poste(){
|
|
|
|
|
|
|
|
if (data.postes.length > 0) {
|
|
|
|
for(var k = 0; k < data.postes.length; k++) {
|
|
|
|
var row ="<tr class='tab_bg_1'>"+
|
|
|
|
"<td><b>"+data.postes[k].poste+"</b></td>"+
|
|
|
|
"</tr>";
|
|
|
|
$('#poste').append(row);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (MATRICULE.length > 0) {
|
|
|
|
|
|
|
|
if (data.employe !== null && Object.keys(data.employe).length > 0) {
|
|
|
|
$('#fullname').val(data.employe.employe_name);
|
|
|
|
$('#Departement').val(data.employe.DEPARTEMENT);
|
|
|
|
$('#Fonction').val(data.employe.Libelle);
|
|
|
|
$('#Periode').val(data.employe.DATEDEBCONTRAT);
|
|
|
|
$('#tele').val(data.employe.NUMTELEPHONE);
|
|
|
|
$('#Matricule').val(data.employe.MATRICULE);
|
|
|
|
$('#Service').val(data.employe.SERVICE);
|
|
|
|
$('#Date_recrutement').text(data.employe.DateRecrutement);
|
|
|
|
$('#au').text(data.employe.DATEFINCONTRAT);
|
|
|
|
|
|
|
|
get_sanctions();
|
|
|
|
get_absences();
|
|
|
|
//get_contrats();
|
|
|
|
get_photo();
|
|
|
|
get_historique_poste();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|