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
| <!DOCTYPE>
<html>
<head>
<title>Association Sportive St Joseph</title>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" media="screen" type="text/css" href="../style.css" />
</head>
<body>
<?php include("../includes/menuad.php"); ?>
<div id="corps">
<div id='blog'>
<form method="GET" action="publicationconvo.php">
<?php
mysql_connect("localhost", "Florian", "22051996");
mysql_select_db("toingma43265com13990_");;
// ici on récupère la variable passer en GET
$classe = $_GET [ 'classe' ];
// ici on récupère la variable passer en POST
$sport = $_GET [ 'sport' ];
$sexe = $_GET [ 'sexe' ];
$reponse = mysql_query("SELECT id, nom, prenom, date_de_naissance, sexe, classe, sport, statut FROM eleves WHERE statut = 0 AND classe = '".mysql_real_escape_string($classe)."' AND sport = '".mysql_real_escape_string($sport)."' AND sexe = '".mysql_real_escape_string($sexe)."'");
$reponse = mysql_query ("UPDATE eleves SET convocation = 0 WHERE sport = '".mysql_real_escape_string($sport)."' AND classe = '".mysql_real_escape_string($classe)."'");
$rows = array();
$hsc = function($p) { return htmlspecialchars($p, ENT_QUOTES, 'utf-8'); };
//fin de la boucle, le tableau contient toute la BDD
mysql_close(); //deconnection de mysql
mysql_connect("localhost", "Florian", "22051996");
mysql_select_db("toingma43265com13990_");
$reponse = mysql_query("SELECT id, nom, prenom, date_de_naissance, sexe, classe, sport, statut, convocation FROM eleves WHERE statut= 0 AND classe = '".mysql_real_escape_string($classe)."' AND sport = '".mysql_real_escape_string($sport)."'");
$rows = array();
$ligne=0;
$hsc = function($p) { return htmlspecialchars($p, ENT_QUOTES, 'utf-8'); };
while($row = mysql_fetch_array($reponse))
{
$rows[] = <<<html
<tr><center>
<td>{$hsc(++$ligne)}</td>
<td>{$hsc($row['nom'])}</td>
<td>{$hsc($row['prenom'])}</td>
<td>{$hsc($row['classe'])}</td>
<td><center><input type="checkbox" name="id[]" value={$row['id']}></td>
html;
?>
<?php
//fin de la boucle, le tableau contient toute la BDD
} mysql_close(); //deconnection de mysql
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Affichage en colonne avec BD - solution 2</title>
</head>
<body>
<center>
<table id="gestion">
<thead>
<tr>
<tr>
<th>Date</th>
<td style='background-color:#a0ffdf'><input type="text" name="date" id="date" style='background-color:#a0ffdf'/></td>
<th>Lieu</th>
<td style='background-color:#a0ffdf'><input type="text" name="lieu" id="lieu" style='background-color:#a0ffdf' /></td></td>
</tr>
<th>N°</th>
<th>Nom</th>
<th>Prenom</th>
<th>Classe</th>
<th>Sélectionner</th>
</tr>
</thead>
<tbody>
<?php echo implode('', $rows); ?>
</tbody>
</table>
<br><input method="get" name="submit" type="submit" value="Envoyer" />
</form>
</body>
</div>
<div id="footer">
<a> Dupuis & Rochet Copyright - Tous droits réservés 2014-2015 </a>
</div>
</div>
</body>
</html> |
Partager