0x1998 - MANAGER
Edit File: eig.php
<?php include "config/auth-config.php"; include "config/authcheck.php"; include "config/garde.php"; // VERIFICATION if (!verif_skill($_SESSION['user'],1) && !verif_skill($_SESSION['user'],7)) { $msg="Vos autorisations sont insuffisantes pour cette action"; echo "<meta http-equiv=\"refresh\" content=\"0;url=accueil.php?msg=$msg\"> "; die(); } // On cherche la skill concernée ! if (isset($_SESSION['skill'])) $skill=$_SESSION['skill']; else { $choix_skill=cherche_skill($_SESSION['user'],'dispo'); if ($choix_skill[0]==1) { $skill=$choix_skill[1][1]; $_SESSION['skill']=$skill;} else {$skill=''; $_SESSION['skill']='';} } $result=mysqli_query($link,"select list_skill_denom from list_skill where list_skill_id=".$skill); if($result) { $val=mysqli_fetch_array($result); $profil=$val['list_skill_denom']; mysqli_free_result($result); } else $profil=''; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <title>EIG</title> <?php entete(); ?> <link href="config/stylePage.css" rel="stylesheet" type="text/css" /> <meta http-equiv='Content-Type' content='text/html;' /> <meta charset="utf-8" /> <script type="text/javascript" src="js_fonction.js"></script> <script type="text/javascript"> $(document).ready(function() { if (document.calendrier.skill.value=='') { $("#myModalLabel").html("<center>Fonction</center>"); var loadurl='modal_skill.php'; var targ="#modal-body"; $.get(loadurl, function(data) { $(targ).html(data); $("#modal").modal('show'); }); } $("#skill").click(function(){ $("#myModalLabel").html("<center>Fonction</center>"); var loadurl='modal_skill.php'; var targ="#modal-body"; $.get(loadurl, function(data) { $(targ).html(data); $("#modal").modal('show'); }); }) // CHARGEMENT DU FORMULAIRE if (document.calendrier.skill.value!='') { load ('liste',''); } $(".bloc_affiche").show(); $(".bloc_modifie").hide(); }); // fin ready function nouveau() { load('eig',''); } function closeModal() { $("#modal").modal('hide'); } function envoiForm2() { $.ajaxSetup({async: false}); if (!validForm('skillz','0')) return false; $.post( "garde_do.php", $( "#skillz" ).serialize(), function(html) {$("#modal").modal('hide'); window.location.reload(); } ); return false; } function load(page,id) { $.ajaxSetup({ cache: false }); if (page=='eig') var loadurl='aj_formeig.php?id='+id; if (page=='liste') var loadurl='aj_listeeig.php'; var targ="#content"; $.get(loadurl, function(data) { $(targ).html(data); }); } function change_statut(id,statut) { don=document.ttt['email'].value; $.ajaxSetup({async: false}); $.post( "garde_do.php", {action:'changeStatut',don:don,id:id,type:statut}); if (statut==3) { $.post( "garde_do.php", $( "#ttt" ).serialize()); load('liste',''); } else {load('eig',id);} } function bloc_hide() { $(".bloc_affiche").hide() $(".bloc_modifie").show(); } function saveInfos() { $.ajaxSetup({async: false}); eig_public=document.getElementById("eig_public").value; eig_ph=document.getElementById("eig_ph").value; $.post( "garde_do.php", {action:'changeInfos',id:'eig_public',type:eig_public}); $.post( "garde_do.php", {action:'changeInfos',id:'eig_ph',type:eig_ph}); document.location.reload(); } </script> </head> <body> <form name="calendrier"> <input type="hidden" name="skill" value="<?php echo $_SESSION['skill']; ?>" /> </form> <div class="col-md-12 "> <div class="panel panel-primary"> <div class="panel-heading"> <h3><center>Signalement d'événement indésirable</center></h3> </div> <div class="panel-body"> <?php // DEBUT du FORMULAIRE echo " <div class=\"row\"> <div class=\"col-md-12\"><center> Bienvenue ".$_SESSION['realname']."- Profil : ".$profil; echo " <span class=\"glyphicon glyphicon-user\" aria-hidden=\"true\" title=\"cliquez pour changer de compétence\" id=\"skill\"></span>"; echo" </center></div> </div>"; // PANEL N°2-1 echo" <div class=\"col-md-9\"> <div class=\"panel panel-primary\"> <div class=\"panel-body\" id=\"content\"><center> </center></div> </div> </div>"; // DEBUT DU PANEL 2.2 echo" <div class=\"col-md-3\">"; include_notes('Infos','eig_public'); echo" </div>"; if (verif_autor($_SESSION['user'],3)) { echo" <div class=\"col-md-3\">"; include_notes('Infos PH','eig_ph'); echo" </div>"; } ?> <div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> <h4 class="modal-title" id="myModalLabel"></h4> </div> <div class="modal-body" id="modal-body"> </div> </div> </div> </div> <?php // ROW INF echo" <div class=\"row\"> <div class=\"col-md-12\"> <center><button class=\"btn btn-default\" onclick=\"location.href = 'accueil.php'\">Retour à l'accueil</button></center> </div></div>"; // FIN DU FORMULAIRE ET DE LA CELLULE ?> </div> </div> </div> </body> </html> <?php function include_notes($key,$value) // Key> Titre ; { global $link; $result=mysqli_query($link, "select * from tools where tools_code='".$value."'") or die(mysqli_error($link)); $a_row=mysqli_fetch_array($result); echo " <div class=\"panel panel-primary\"> <div class=\"panel-heading\"> <center>".$key; if (verif_autor($_SESSION['user'],3)) echo " <span class=\"glyphicon glyphicon-pencil\" title=\"Modifier les ".$key."\" onclick=\"bloc_hide()\"/>"; echo" </center> </div> <div class=\"panel-body\"> <div class=\"bloc_affiche\">". nl2br($a_row['tools_title'])."</p> </div>"; echo " <div class=\"bloc_modifie\"> <textarea class=\"form-control\" id=\"".$value."\" rows=\"3\">".$a_row['tools_title']."</textarea> <input type=\"hidden\" id=\"id\" value=\"".$value."\" /> <center><input type=\"button\" value=\"Enregistrer\" onclick=\"saveInfos()\" class=\"btn btn-primary\" /></center> </div>"; echo" </div> </div>"; } ?>