Files
MYSOPHAL/front/drh.boiteIdeesListe.php
2025-08-07 13:15:31 +01:00

126 lines
3.5 KiB
PHP

<?php
use Glpi\Event;
include ('../inc/includes.php');
Session::checkLoginUser();
if (Session::getCurrentInterface() == "helpdesk") {
Html::helpHeader("DRH", '', $_SESSION["glpiname"]);
} else {
Html::header("DRH", '', "", "");
}
$List = getList();
echo "<div class='center'>
<table border='0' class='tab_cadrehov js-dynamitable'>
<thead>
<tr class='tab_bg_2'>
<th ><a href=''>Matricule </a></th>
<th class=''><a href=''>Rédacteur</a></th>
<th class=''><a href=''>Fonction </a></th>
<th class=''><a href=''>Structure</a></th>
<th class=''><a href=''>Date de Création</a></th>
</tr>
</thead>
<tbody>";
if(sizeof($List) > 0){
foreach ($List as $List) {
result($List , $CFG_GLPI["root_doc"]);
}
}else{
echo "<tr style=' text-align: center;'><td colspan='7'>Aucune donnée trouvée</td></tr>";
}
echo" </tbody>
<tfoot>
<tr class='tab_bg_2'>
<th ><a >Matricule </a></th>
<th class=''><a href=''>Rédacteur</a></th>
<th class=''><a href=''>Fonction </a></th>
<th class=''><a href=''>Structure</a></th>
<th class=''><a href=''>Date de Création</a></th>
</tr>
</tfoot>
</table>
</div>";
if (Session::getCurrentInterface() == "helpdesk") {
Html::helpFooter();
} else {
Html::footer();
}
function result($List , $root){
echo ' <tr class="tab_bg_1">
<td valign="top"><a href="'.$root.'/front/drh.boiteIdees.php?id='.$List['id'].'">'.$List['matricule'].'</a></td>
<td valign="top" style="font-weight:bold">'.$List['nom']." ".$List['prenom'].'</td>
<td valign="top" style="font-weight:bold">'.$List['fonction'].'</td>
<td valign="top" style="font-weight:bold">'.$List['structure'].'</td>
<td valign="top" style="font-weight:bold">'.$List['dateTime_creation'].'</td>
</tr>';
}
function getList(){
global $DB;
$query = "SELECT * from boite_idees where user_id = '".$_SESSION["glpiID"]."'";
$result = $DB->query($query);
$List = array();
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$List[] = $row;
}
}
return $List;
}
$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="'+link+'/front/drh.boiteIdeesListe.php" class="here" title="Boite à idées"><i class="far fa-sticky-note"></i>&nbsp;Boite à idées</a></li>'+
'<li class="icons_block"><span><a href="'+link+'/front/drh.boiteIdees.php" class="pointer" title="Ajouter"><i class="fa fa-plus"></i>'+
'<span class="sr-only">Ajouter</span></a>'+
'</li>'+
'</ul>');
});
</script>