prepare($query); $stmt->bind_param("ii" , $id,$_SESSION["glpiID"]); $stmt->execute(); $result = $stmt->get_result(); $res = array(); if ($result->num_rows > 0) { $res = $result->fetch_assoc(); } return $res; } function getfullnameResponsable($idResponsable){ global $DB; $query = "SELECT id , CONCAT(realname,' ', firstname) as fullname from glpi_users where id = ? "; $stmt = $DB->prepare($query); $stmt->bind_param("i" , $idResponsable); $stmt->execute(); $result = $stmt->get_result(); if ($result->num_rows > 0) { $Responsable = $result->fetch_assoc(); }else{ $Responsable['fullname'] = null; $Responsable['id'] = null; } return $Responsable; } function getInformationUser(){ global $DB; $query = "SELECT registration_number as matricule , realname as nom , firstname as prenom , users_id_supervisor as idResponsable from glpi_users where id ='".$_SESSION["glpiID"]."' "; $result = $DB->query($query); if ($result->num_rows > 0) { $InformationUser = $result->fetch_assoc(); // print_r( $InformationUser); } return $InformationUser; } function getFonction(){ global $DB; $query = "SELECT picklist.value as fonction from glpi_users , picklist where glpi_users.id_fonction = picklist.id and glpi_users.id ='".$_SESSION["glpiID"]."' "; $result = $DB->query($query); if ($result->num_rows > 0) { $fonction = $result->fetch_assoc(); } if(!empty($fonction['fonction'])){ return $fonction['fonction']; }else{ return $fonction = ""; } } function getStructure(){ global $DB; $query = "SELECT picklist.value as structure from glpi_users , picklist where glpi_users.id_structure = picklist.id and glpi_users.id ='".$_SESSION["glpiID"]."' "; $result = $DB->query($query); if ($result->num_rows > 0) { $structure = $result->fetch_assoc(); } if(!empty($structure['structure'])){ return $structure['structure']; }else{ return $structure =""; } } $InformationUser = getInformationUser(); $Responsable = getfullnameResponsable( $InformationUser['idResponsable'] ); $fonction = getFonction() ; $structure = getStructure(); if(isset($Responsable['id'])){ $_SESSION['idResponsable'] = $Responsable['id']; }else{ $_SESSION['idResponsable'] = null; } if(!isset($_GET['id'])){ echo "

"; echo""; echo"
Boite à idées ".date("Y-m-d")."
Matricule :
Responsable hiérarchique : *
Nom : * Prénom : *
Fonction : Structure :
Description "; Html::textarea([ 'name' => "description", 'enable_richtext' => true, 'required' => 1 ]); echo"
"; }elseif(isset($_GET['id'])){ if(!filter_var($_GET['id'], FILTER_VALIDATE_INT)) $_GET['id'] = 0; $res = getIdeeInformation($_GET['id']); if(sizeof($res) > 0){ echo "

"; echo"
Boite à idées ".$res['dateTime_creation']."
Matricule :
Responsable hiérarchique : *
Nom : * Prénom : *
Fonction : Structure :
Description "; Html::textarea([ 'name' => "description", 'enable_richtext' => true, 'value' => $res['description'], 'editor_id' => 'description12' ]); echo"
"; }else{ //Html::redirect($CFG_GLPI["root_doc"]."/front/drh.boiteIdeesListe.php"); $text = "


Attention

Vous n avez pas les droits requis pour réaliser cette action.
"; echo ''; } } if (Session::getCurrentInterface() == "helpdesk") { Html::helpFooter(); } else { Html::footer(); } $link=$CFG_GLPI["root_doc"]; $user = Session::getCurrentInterface(); ?>