1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230
| <?php
session_start();
require "../../../connect.php";
require "../../../fonction.php";
$id_profil = $_SESSION['id_profil'];
$nom = $_SESSION['nom'];
$prenom = $_SESSION['prenom'];
$user_name = $_SESSION['user_name'];
$user_password = $_SESSION['user_password'];
$id_perimetre = $_SESSION['id_perimetre'];
$id_statut = $_SESSION['id_statut'];
$val_id_poste = $_SESSION['id_poste'];
$chemin = "../../";
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="../../Style.css">
<link rel="stylesheet" type="text/css" href="../../Style_page.css">
<title>ERGOPROD</title>
<!-- Moyen pour mettre les listes à jour -->
<script type='text/javascript'>
var xhr = null;
function getXhr(){
if(window.XMLHttpRequest){ // Firefox et autres
xhr = new XMLHttpRequest();
}
else if(window.ActiveXObject){ // Internet Explorer
try {
xhr = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
xhr = new ActiveXObject("Microsoft.XMLHTTP");
}
}
else { // XMLHttpRequest non supporté par le navigateur
alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
xhr = false;
}
}
/**
* Méthode qui sera appelée sur le click du bouton
*/
function cotation1(){
getXhr();
// On défini ce qu'on va faire quand on aura la réponse
xhr.onreadystatechange = function(){
//alert(xhr.readyState);
// On ne fait quelque chose que si on a tout reçu et que le serveur est ok
if(xhr.readyState == 4 && xhr.status == 200){
di = document.getElementById('val_id_cot3');
di.innerHTML = xhr.responseText;
}
}
// Ici on va voir comment faire du post
xhr.open("POST","cotation1.php",true);
// ne pas oublier ça pour le post
xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
// ne pas oublier de poster les arguments
// ici, l'id de l'auteur
donnee_id_analyse = document.getElementById('val_id_analyse').options[document.getElementById('val_id_analyse').selectedIndex].value;
//alert(idauteur);
xhr.send(donnee_id_analyse);
}
</script>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
<!-- insertion de données -->
<?php
$sql_id = "SELECT * FROM ergoprod_poste WHERE id_poste = $val_id__poste";
$result_id = mysql_query($sql_id);
while ($row_id = mysql_fetch_object($result_id))
{$poste = $row_id->poste;
$libelle = $row_id->val_libelle;
$liste = $row_id->val_liste;
$date_jour = $row_id->val_date_jour;
$active = $row_id->val_active;
$id_profil = $row_id->val_id_profil;
$id_perimetre = $row_id->val_id_perimetre;
$id_activite = $row_id->val_id_activite;
$charge = $row_id->val_charge;
$ph = $row_id->val_ph;}
$_SESSION['id_poste'] = $val_id_poste;
$id_poste = $_SESSION['id_poste'];
?>
<!-- titre -->
<div id="titre">
<? $titre="../../"; include "../../titre.php"; ?>
</div>
<!-- barre de menu -->
<div id="menu">
<?php
if ($id_statut == 1){
$a = "../../menu/";
include "../../menu/profil_1.php";}
if ($id_statut == 4){
$a = "../../menu/";
include "../../menu/profil_4.php";}
if ($id_statut == 15){
$a = "../../menu/";
include "../../menu/profil_15.php";}
if ($id_statut == 20){
$a = "../../menu/";
include "../../menu/profil_20.php";}
?>
</div>
<!-- page du texte -->
<div id="contenu">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#0000FF" colspan="3">
<p align="center" class="titre_22"><b>Cotation de postes</b>
</td>
</tr>
<tr>
<td width="49%" valign="top"><p align="center" class="titre_02">
<table border="1" width="100%" cellspacing="0" cellpadding="0">
<!-- zone pour la visualisation d'un poste existant -->
<tr height="100%">
<td width="50%" bgcolor="#6182E4"><p align="center" class="titre_02">Cotation du poste</p></td>
</tr>
<tr>
<td align="center" valign="middle" width="50%" height="200">
<?php
$sql_niveau4 = "SELECT ergoprod_cotation1.libelle, ergoprod_cotation2.nature, ergoprod_cotation3.niveau
FROM (ergoprod_cotation1 INNER JOIN ergoprod_cotation2 ON ergoprod_cotation1.id_cot1 = ergoprod_cotation2.id_cot1) INNER JOIN (ergoprod_poste_cotation INNER JOIN ergoprod_cotation3 ON ergoprod_poste_cotation.id_cot3 = ergoprod_cotation3.id_cot3) ON ergoprod_cotation2.id_cot2 = ergoprod_cotation3.id_cot2
WHERE (((ergoprod_poste_cotation.id_poste)=$id_poste) AND ((ergoprod_cotation3.evaluation)=4))";
echo "<div id=\"niveau4\">";
echo "<p align=\"left\" class=\"TITRE_20\">";
$result_niveau4=mysql_query($sql_niveau4);
while ($row_niveau4 = mysql_fetch_array($result_niveau4, MYSQL_ASSOC)) {
echo "<font face=\"Wingdings\">Ø</font> ".$row_niveau4["libelle"]." (".$row_niveau4["nature"].") <font face=\"Wingdings\">è</font> ".$row_niveau4["niveau"]."<br>";}
echo "</div>";
$sql_niveau3 = "SELECT ergoprod_cotation1.libelle, ergoprod_cotation2.nature, ergoprod_cotation3.niveau
FROM (ergoprod_cotation1 INNER JOIN ergoprod_cotation2 ON ergoprod_cotation1.id_cot1 = ergoprod_cotation2.id_cot1) INNER JOIN (ergoprod_poste_cotation INNER JOIN ergoprod_cotation3 ON ergoprod_poste_cotation.id_cot3 = ergoprod_cotation3.id_cot3) ON ergoprod_cotation2.id_cot2 = ergoprod_cotation3.id_cot2
WHERE (((ergoprod_poste_cotation.id_poste)=$id_poste) AND ((ergoprod_cotation3.evaluation)=3))";
echo "<div id=\"niveau3\">";
echo "<p align=\"left\" class=\"TITRE_20\">";
$result_niveau3=mysql_query($sql_niveau3);
while ($row_niveau3 = mysql_fetch_array($result_niveau3, MYSQL_ASSOC)) {
echo "<font face=\"Wingdings\">Ø</font> ".$row_niveau3["libelle"]." (".$row_niveau3["nature"].") <font face=\"Wingdings\">è</font> ".$row_niveau3["niveau"]."<br>";}
echo "</div>";
$sql_niveau2 = "SELECT ergoprod_cotation1.libelle, ergoprod_cotation2.nature, ergoprod_cotation3.niveau
FROM (ergoprod_cotation1 INNER JOIN ergoprod_cotation2 ON ergoprod_cotation1.id_cot1 = ergoprod_cotation2.id_cot1) INNER JOIN (ergoprod_poste_cotation INNER JOIN ergoprod_cotation3 ON ergoprod_poste_cotation.id_cot3 = ergoprod_cotation3.id_cot3) ON ergoprod_cotation2.id_cot2 = ergoprod_cotation3.id_cot2
WHERE (((ergoprod_poste_cotation.id_poste)=$id_poste) AND ((ergoprod_cotation3.evaluation)=2))";
echo "<div id=\"niveau2\">";
echo "<p align=\"left\" class=\"TITRE_20\">";
$result_niveau2=mysql_query($sql_niveau2);
while ($row_niveau2 = mysql_fetch_array($result_niveau2, MYSQL_ASSOC)) {
echo "<font face=\"Wingdings\">Ø</font> ".$row_niveau2["libelle"]." (".$row_niveau2["nature"].") <font face=\"Wingdings\">è</font> ".$row_niveau2["niveau"]."<br>";}
echo "</div>";
$sql_niveau1 = "SELECT ergoprod_cotation1.libelle, ergoprod_cotation2.nature, ergoprod_cotation3.niveau
FROM (ergoprod_cotation1 INNER JOIN ergoprod_cotation2 ON ergoprod_cotation1.id_cot1 = ergoprod_cotation2.id_cot1) INNER JOIN (ergoprod_poste_cotation INNER JOIN ergoprod_cotation3 ON ergoprod_poste_cotation.id_cot3 = ergoprod_cotation3.id_cot3) ON ergoprod_cotation2.id_cot2 = ergoprod_cotation3.id_cot2
WHERE (((ergoprod_poste_cotation.id_poste)=$id_poste) AND ((ergoprod_cotation3.evaluation)=1))";
echo "<div id=\"niveau1\">";
echo "<p align=\"left\" class=\"TITRE_20\">";
$result_niveau1=mysql_query($sql_niveau1);
while ($row_niveau1 = mysql_fetch_array($result_niveau1, MYSQL_ASSOC)) {
echo "<font face=\"Wingdings\">Ø</font> ".$row_niveau1["libelle"]." (".$row_niveau1["nature"].") <font face=\"Wingdings\">è</font> ".$row_niveau1["niveau"]."<br>";}
echo "</div>";
?>
</td>
</tr>
</table>
</td>
<td width="2%"> </td>
<td width="49%" valign="top"><p align="center" class="titre_02">
<?php
echo $val_id_poste;
?>
<table border="1" width="100%" cellspacing="0" cellpadding="0">
<!-- zone pour la visualisation d'un poste existant -->
<tr height="100%">
<td width="50%" bgcolor="#6182E4"><p align="center" class="titre_02">Modification</p></td>
</tr>
<tr>
<td align="center" valign="middle" width="50%" height="200">
<form>
<select name="val_id_analyse" class="TITRE_20" id="val_id_analyse" onchange="cotation1()">
<option class="TITRE_20">Aucun</option>
<?php
$sql = "SELECT ergoprod_poste_cotation.id_analyse, ergoprod_cotation1.libelle, ergoprod_cotation2.nature, ergoprod_cotation3.niveau
FROM (ergoprod_cotation1 INNER JOIN ergoprod_cotation2 ON ergoprod_cotation1.id_cot1 = ergoprod_cotation2.id_cot1) INNER JOIN (ergoprod_poste_cotation INNER JOIN ergoprod_cotation3 ON ergoprod_poste_cotation.id_cot3 = ergoprod_cotation3.id_cot3) ON ergoprod_cotation2.id_cot2 = ergoprod_cotation3.id_cot2
WHERE (ergoprod_poste_cotation.id_poste=$val_id_poste)";
$result=mysql_query($sql);
while ($row=mysql_fetch_object($result)) {
echo "<option value=\"$row->id_analyse\">$row->libelle ($row->niveau)</option>\n";
}
?>
</select>
<br> <br>
<div id="val_id_cot3" style="display:inline">
<select class="TITRE_20" name="val_id_cot3">
<option value="-1">Choisir le niveau à modifier</option>
</select>
</div>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</body>
</html> |
Partager