//affichage des note $qs=array(); $ml=0; for($i=0;$i<$nbResult+1;$i++){ $req17=("SELECT note FROM test WHERE idT='$ff[$i]' AND num='$num' AND idS='$g'"); echo $req17."</br>"; $mark=mysql_query($req17); while($tt=mysql_fetch_array($mark)){$fg=$tt['note']; $qs[$ml]=$fg; } echo "<th><input type='text' name='monInput_".$num."_".$i."' id='imp_".$i."' value='$fg'/></th>"; }} ?>
for($i=0;$i<$nbResult+1;$i++){ $req17="SELECT note FROM test WHERE idT='$ff[$i]' AND num='$num' AND idS='$g'"; //echo $req17."</br>"; $mark=mysql_query($req17); while($tt=mysql_fetch_array($mark)){ $fg=$tt['note']; $noteG = $noteG + $fg; echo "<td style='font-weight: bold;'> <input type='text' name='monInput_".$num."_".$i."' id='imp_".$i."' value='$fg'/> </td>"; } echo "<td style='font-weight: bold;'> <input type='text' name='noteG_".$num."_".$i."' id='imp_".$i."' value='$noteG'/> </td>";
for($i=0;$i<$nbResult;$i++){ $req17="SELECT a.coeffT,(t.note) FROM assocts AS a,test as t where t.idS = '$g' AND t.idT=a.idT AND t.num='$num'"; //echo $req17."</br>"; $mark=mysql_query($req17); while($tt=mysql_fetch_array($mark)){ $fg=$tt['note']; $ml=$tt['coeffT']; $noteG=0; $noteG = $noteG + ($fg*$ml); echo $noteG.'</br>'; echo "<td style='font-weight: bold;'> <input type='text' name='monInput_".$num."_".$i."' id='imp_".$i."' value='$fg'/> </td>"; $noteG=$noteG/100; }} echo $noteG.'</br>'; echo "<td style='font-weight: bold;'> <input type='text' name='noteG_".$num."_".$i."' id='imp_".$i."' value='$notG'/> </td>" }
<input type='text' name='noteG_".$num."_".$i."' id='imp_".$i."' value='$notG'/>
<input type='text' name='noteG_".$num."_".$i."' id='imp_".$i."' value='".$noteG."'/>
// Reinit de $noteG pour chaque élève $noteG=0; for($i=0;$i<$nbResult;$i++){ $req17="SELECT a.coeffT ,t.note FROM assocts AS a,test as t where t.idS = '$g' AND t.idT=a.idT AND t.num='$num'"; //echo $req17."</br>"; $mark=mysql_query($req17); while($tt=mysql_fetch_array($mark)){ $fg=$tt['note']; $ml=$tt['coeffT']; //$noteG=0; $noteG = $noteG + ($fg*$ml); //echo $noteG.'</br>'; echo "<td style='font-weight: bold;'> <input type='text' name='monInput_".$num."_".$i."' id='imp_".$i."' value='".$fg."'/> </td>"; } } //echo $noteG.'</br>'; $noteG=$noteG/100; echo "<td style='font-weight: bold;'> <input type='text' name='noteG_".$num."_".$i."' id='imp_".$i."' value='".$noteG."'/> </td>" }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question//affichage des types d'évaluations crée par un prof $sql1="SELECT t.TYPE ,t.idT FROM TYPE AS t , assocts AS l , smodule AS s , filiere AS f WHERE t.idT = l.idT AND l.idS = s.idS AND nomF = '$e' AND annee ='$d' AND nomS ='$c'"; $u=mysql_query($sql1); $nbResult = mysql_num_rows($u); while($resu=mysql_fetch_array($u)) { $type1 = $resu['TYPE']; echo "<th>".$type1."</th>"; } echo'<th>Note General</th>'; echo'<th>Decision </th>'; //------------------------------------------------------------ //affichage des étudiants $ff=array(); $sql="SELECT t.idT FROM TYPE AS t , assocts AS l , smodule AS s , filiere AS f WHERE t.idT = l.idT AND l.idS = s.idS AND nomF = '$e' AND annee ='$d' AND nomS ='$c'"; $q="select s.idS from smodule as s,module as m,composer as c where s.nomS='$c' AND m.nomM='$w' AND s.idS=c.idS AND m.idM=c.idM "; $f=mysql_query($q); while($tth=mysql_fetch_array($f)){$g=$tth['idS'];} echo $g; $_SESSION['g']=$g; $i=0; $v=mysql_query($sql); $nb = mysql_num_rows($v);// while($resu=mysql_fetch_array($v)) { $k=$resu['idT']; $ff[$i]=$k; $i++; } print_r($ff); $sql=("SELECT t.num, t.nomE, t.prenom FROM etudiant AS t ,filiere AS f WHERE f.nomF = '$e' AND f.annee = '$d' LIMIT 5"); $t=mysql_query($sql); $r = mysql_num_rows($t); while($result=mysql_fetch_array($t)) { $num = $result['num']; $_SESSION['h']=$num; $nom = $result['nomE']; $prenom = $result['prenom']; echo "</tr> <tr> <th>".$num."</th> <th>".$nom."</th> <th>".$prenom."</th>"; //------------------------------------------------------------------------ //affichage des note $req17="SELECT (t.note) FROM test as t where t.idS = '$g' AND t.num='$num'"; //echo $req17."</br>"; $mark=mysql_query($req17); $req18="SELECT a.coeffT FROM assocts AS a,test as t where t.idS = '$g' AND t.idT=a.idT AND t.num='$num'"; $coef=mysql_query($req18); //print_r($as);echo '<br>'; $noteG=0; echo '$noteG : '.$noteG.'<br>'; $req17="SELECT (t.note) FROM test as t where t.idS = '$g' AND t.num='$num'"; //echo $req17."</br>"; $mark=mysql_query($req17); $req18="SELECT a.coeffT FROM assocts AS a,test as t where t.idS = '$g' AND t.idT=a.idT AND t.num='$num'"; $coef=mysql_query($req18); //print_r($as);echo '<br>'; for($i=0;$i<$nbResult;$i++){ while($tt=mysql_fetch_array($mark)){ $fg=$tt['note']; echo "<td style='font-weight: bold;'> <input type='text' name='monInput_".$num."_".$i."' id='imp_".$i."' value='$fg'/> </td>"; while($tt1=mysql_fetch_array($coef)){ $tg=$tt1['coeffT']; $noteG=$noteG+($fg*$tg); echo 'note'.$fg. 'coef'.$tg.'noteG:'.$noteG.'<br>'; }} $noteG=$noteG/100; echo $noteG.'</br>';} echo "<td style='font-weight: bold;'> <input type='text' name='noteG_".$num."_".$i."' id='imp_".$i."' value='$noteG'/> </td>"; } ?>
//affichage des types d'évaluations crée par un prof $sql1="SELECT t.TYPE ,t.idT FROM TYPE AS t , assocts AS l , smodule AS s , filiere AS f WHERE t.idT = l.idT AND l.idS = s.idS AND nomF = '$e' AND annee ='$d' AND nomS ='$c'"; $u=mysql_query($sql1); $nbResult = mysql_num_rows($u); while($resu=mysql_fetch_array($u)) { $type1 = $resu['TYPE']; echo "<th>".$type1."</th>"; } echo'<th>Note General</th>'; echo'<th>Decision </th>'; //------------------------------------------------------------ //affichage des étudiants $ff=array(); $sql="SELECT t.idT FROM TYPE AS t , assocts AS l , smodule AS s , filiere AS f WHERE t.idT = l.idT AND l.idS = s.idS AND nomF = '$e' AND annee ='$d' AND nomS ='$c'"; $q="select s.idS from smodule as s,module as m,composer as c where s.nomS='$c' AND m.nomM='$w' AND s.idS=c.idS AND m.idM=c.idM "; $f=mysql_query($q); while($tth=mysql_fetch_array($f)){$g=$tth['idS'];} echo $g; $_SESSION['g']=$g; $i=0; $v=mysql_query($sql); $nb = mysql_num_rows($v);// while($resu=mysql_fetch_array($v)) { $k=$resu['idT']; $ff[$i]=$k; $i++; } print_r($ff); $sql=("SELECT t.num, t.nomE, t.prenom FROM etudiant AS t ,filiere AS f WHERE f.nomF = '$e' AND f.annee = '$d' LIMIT 5"); $t=mysql_query($sql); $r = mysql_num_rows($t); while($result=mysql_fetch_array($t)) { $num = $result['num']; $nom = $result['nomE']; $prenom = $result['prenom']; echo "</tr> <tr> <th>".$num."</th> <th>".$nom."</th> <th>".$prenom."</th>"; //------------------------------------------------------------------------ //affichage des note $req17="SELECT (t.note) FROM test as t where t.idS = '$g' AND t.num='$num'"; $mark=mysql_query($req17); $req18="SELECT a.coeffT FROM assocts AS a,test as t where t.idS = '$g' AND t.idT=a.idT AND t.num='$num'"; $coef=mysql_query($req18); $noteG=0; for($i=0;$i<$nbResult;$i++){ while($tt=mysql_fetch_array($mark)){ $fg=$tt['note']; echo "<td style='font-weight: bold;'> <input type='text' name='monInput_".$num."_".$i."' id='imp_".$i."' value='$fg'/> </td>"; while($tt1=mysql_fetch_array($coef)){ $tg=$tt1['coeffT']; $noteG=$noteG+($fg*$tg); echo 'note'.$fg. 'coef'.$tg.'noteG:'.$noteG.'<br>'; }} $noteG=$noteG/100; echo $noteG.'</br>';} echo "<td style='font-weight: bold;'> <input type='text' name='noteG_".$num."_".$i."' id='imp_".$i."' value='$noteG'/> </td>"; } ?>
$req18="SELECT a.coeffT ,t.note FROM assocts a ,test t WHERE t.idS = '$g' AND t.idT=a.idT AND t.num='$num'"; $arrNotesCoef =mysql_query($req18); //------------------------------------------------------ // Que donne un print de cette requête ? echo "<be> Resultat de la requête :<br>"; while ($row = mysql_fetch_array($arrNotesCoef )) { print_r($row); } echo "<br>"; //------------------------------------------------------
$sql= "SELECT e.num ,e.nomE ,e.prenom ,a.coeffT ,t.note FROM etudiant e ,filiere f ,assocts a ,test t WHERE f.nomF = '$e' AND f.annee = '$d' AND t.idT = a.idT AND t.num = e.num LIMIT 5"; $t=mysql_query($sql); //------------------------------------------------------ // Que donne un print de cette requête ? echo "<be> Resultat de la requête :<br>"; while ($row = mysql_fetch_array($t)) { print_r($row); } echo "<br>"; //------------------------------------------------------
$req17="SELECT (t.note) FROM test as t where t.idS = '$g' AND t.num='$num'"; //echo $req17."</br>"; $mark=mysql_query($req17); $sql="SELECT ( SUM( a.coeffT * t.note ) /100) AS NG FROM assocts AS a, test AS t WHERE t.idS = '$g' AND t.idT = a.idT AND t.num = '$num' GROUP BY t.num"; $no=mysql_query($sql); //print_r($as);echo '<br>'; for($i=0;$i<$nbResult;$i++){ while($tt=mysql_fetch_array($mark)){ $fg=$tt['note']; echo "<td style='font-weight: bold;'> <input type='text' name='monInput_".$num."_".$i."' id='imp_".$i."' value='$fg'/> </td>"; } while($t=mysql_fetch_array($no)){ $noteG=$t['NG']; echo "<td style='font-weight: bold;'> <input type='text' name='noteG_".$num."_".$i."' id='imp_".$i."' value='$noteG'/> </td>"; if($noteG>=12){ $deciss='valide';} elseif($noteG<=6){$deciss='NV';} echo "<td style='font-weight: bold;'> <input type='text' name='noteG_".$num."_".$i."' id='imp_".$i."' value='$deciss'/> </td>"; }}}