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
|
<?php
session_start();
$idsession=session_id();
?>
<head>
<LINK rel="stylesheet" type="text/css" href="styles.css"/>
<script>
var n = 5;
function init(numero){
var html = '';
for (i=0; i<n; i++){
id = i+1;
html += '<a href="#"><img src="starOut.png" ';
html += 'id="star" value="off" ';
html += 'onMouseOver="over('+id+','+numero+');" ';
html += 'onMouseOut="out('+id+','+numero+');" ';
html += 'onClick="on('+id+','+numero+')"/></a>'
}
textNum = "classement"+numero;
document.getElementById(textNum).innerHTML = html;
}
function over(nb, numero){
textNum = "classement"+numero;
elemClassement = document.getElementById(textNum);
tabImg = elemClassement.getElementsByTagName("img");
if (nb > 0)
for (i=0; i<nb; i++)
tabImg[i].src="starOver.png";
for (i=nb; i<n; i++)
tabImg[i].src="starOut.png";
}
function out(nb, numero){
textNum = "classement"+numero;
elemClassement = document.getElementById(textNum);
tabImg = elemClassement.getElementsByTagName("img");
for (i=0; i<nb; i++)
tabImg[i].src="starOut.png";
for (i=0; i<n; i++){
if (tabImg[i].value == "on")
tabImg[i].src="starOn.png";
}
}
function on(nb, numero){
textNum = "classement"+numero;
elemClassement = document.getElementById(textNum);
tabImg = elemClassement.getElementsByTagName("img");
for (i=0; i<nb; i++){
tabImg[i].src="starOn.png";
tabImg[i].value="on";
}
for (i=nb; i<n; i++){
tabImg[i].src="starOut.png";
tabImg[i].value="off";
}
textNum = "commentaire"+numero;
elemComment = document.getElementById(textNum);
switch(nb){
case 1: text="Médiocre"; break;
case 2: text="Mauvais"; break;
case 3: text="Moyen"; break;
case 4: text="Bon"; break;
case 5: text="Excellent"; break;
default:text="";
}
//text = nb+" étoiles";
elemComment.innerHTML = text;
}
function compter(){
tabCom = document.getElementsByName("commentaire");
for (i=0; i< tabCom.length; i++){
if (tabCom[i].firstChild != null){
//alert(tabCom[0].firstChild.nodeValue);
switch (tabCom[i].firstChild.nodeValue){
case "Médiocre" : alert("1"); break;
case "Mauvais" : alert("2"); break;
case "Moyen" : alert("3"); break;
case "Bon" : alert("4"); break;
case "Excellent": alert("5"); break;
default:;
}
}
else
alert(0);
}
}
</script>
<!-- ImageReady Slices (actualites.psd) -->
<style type="text/css">
<!--
.Style1 {color: #FF0000}
-->
</style>
<table id="Tableau_01" width="590" height="367" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<img src="images/actualites_01.gif" width="28" height="35" alt=""></td>
<td background="images/actualites_02.gif"><center><b><font color="#FFFFFF" size="1" face="Verdana">EVALUATION</font></b></center></td>
<td>
<img src="images/actualites_03.gif" width="26" height="35" alt=""></td>
</tr>
<tr>
<td background="images/actualites_04.gif"></td>
<td width="536" height="297" background="images/spacer.gif" bgcolor="#D0DDEC">
<? /////////////////////////// ?>
<?php
include("connexionbd.php");
require_once("evaluation.class.php");
$log=$_SESSION['logss'];
$clt=$_SESSION['idclient'];
$prd=$_GET["produit"];
$nom=$_GET["nom"];
$compteurCom = 0;
/// Instanciation
$eva = new evaluation($page,'where code_client=\''.$clt.'\'');
echo '<table border="1">';
echo '<caption><font size="1" face="Verdana" color="#041f2e"><b>Evaluation du '.$nom.' </b></font></caption>'; ?>
<? while(!$eva->eof){
$req=mysql_query("select Critere from critere where id='".$eva->id_critere."'");
while($res=mysql_fetch_array($req)){
?>
<tr>
<td>
<? echo '<font size="2" face="Verdana" color="#041f2e">'.$res['Critere'].'</font>' ; ?>
</td>
<td valign="middle">
<?
$compteurCom++;
echo '<table border=0>
<tr>
<td>
<div id="classement'.$compteurCom.'" name="cls">
<script>init($compteurCom);</script>
</div>
</td>
<td>
<div id="commentaire'.$compteurCom.'"></div>
</td>
</table>' ?>
</td>
</tr>
<? }
$eva->Movenext();
}
echo '</table>';
?>
<? //////////////////////// ?>
</td>
<td background="images/actualites_06.gif"></td>
</tr>
<tr>
<td>
<img src="images/actualites_07.gif" width="28" height="35" alt=""></td>
<td background="images/actualites_08.gif"></td>
<td>
<img src="images/actualites_09.gif" width="26" height="35" alt=""></td>
</tr>
</table>
<!-- End ImageReady Slices --> |
Partager