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
|
$dr=mysql_query("SELECT e.code, s.name, s.firstname, s.adresse, s.cp, s.city, s.email, e.niveauG, r.semester, r.classe, r.year, e.course FROM entry e, registration r, student s WHERE s.code = r.student AND r.code = e.registration and r.semester='".addslashes ($_POST['c2'])."' and r.year='".addslashes ($_POST['c1'])."' and r.classe='".addslashes ($_POST['c3'])."' and e.course='".addslashes ($_POST['c4'])."'");
while($ligne=mysql_fetch_array($dr))
{
?>
<tr>
<td><?php echo addslashes ($ligne[0]); ?></td>
<input type="hidden" name="code[]" value="<?php echo $ligne[0]; ?>" >
<td><?php echo addslashes ($ligne[1]); ?></td>
<td><?php echo addslashes ($ligne[2]); ?></td>
<td><?php echo addslashes ($ligne[3]); ?></td>
<td><?php echo addslashes ($ligne[4]); ?></td>
<td><?php echo addslashes ($ligne[5]); ?></td>
<td><?php echo addslashes ($ligne[6]); ?></td>
<td> <input type="checkbox" name="chck[]" value="<?php echo $ligne[0]; ?>" <?php if ($ligne[7] == true) echo ' checked="checked"'; ?> ></td>
<td> <input type="image" name="submit" src="img/b_drop.png" value="<?php echo $ligne[0]; ?>" /></td>
</tr>
<?php
}
foreach($_POST['code'] as $key => $value)
{
if(isset($_POST['chck'][$key]))
{
$dr=mysql_query("UPDATE entry SET niveauG='1' WHERE code ='".addslashes ($value)."'");
}
else
{
$dr=mysql_query("UPDATE entry SET niveauG='0' WHERE code ='".addslashes ($value)."'");
}
}
?> |
Partager