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
| <html>
<head>
</head>
<body>
<center>
<?php
$N=$_POST['Adr'];
//connection avec la BD
$bd = "administrateur";
$connection = mysql_connect("localhost","root","0000");
// test la connection
if ( ! $connection )
die ("connection impossible");
// Connecte la base
mysql_select_db($bd) or die ("pas de connection");
$reponse = mysql_query("SELECT * FROM adresse where Nom='$N'"); // Requête SQL
?>
<form action="valid_ajout_horaire.php" method="POST">
<table border="1" width="600" height="150">
<tr bgcolor="#6699FF">
<td colspan="2"><b>Ajout des horaires</b></td>
</tr>
<tr>
<td colspan="2">Vous allez ajouter les horaires de :</td>
</tr>
<tr>
<td height="50"><input name="Nom" type="text" value="<?php echo $N; ?>" style='text-transform:uppercase'>
</td>
</tr>
<tr>
<td>
<table>
<tr>
<td>Jours d'ouverture</td>
<td class=normal colSpan=2>
du <input name="J1" type="text"> au <input name="J2" type="text" ></td>
</tr>
<tr>
<td>Horaires : </td>
</tr>
<tr>
<td>Matin : </td>
<td>de <input name="HMO" type="text" size="10" > a <input name="HMF" type="text" size="10" ></td>
</tr>
<tr>
<td>Apres-midi : </td>
<td>de <input name="HAO" type="text" size="10" > a <input name="HAF" type="text" size="10"></td>
</tr>
<tr>
<td><input name="Val" type="submit" value="Ajouter"></td>
<td><input name="Val" type="reset" value="Annuler"></td>
</tr>
</table>
</table>
</form>
<?php mysql_close(); ?>
</center>
</body>
</html>
et le code de la page de validation
<html>
<head>
<title>Modifier une adresse</title>
</head>
<body>
<?php
//connection avec la BD
$bd = "administrateur";
$connection = mysql_connect("localhost","root","0000");
// test la connection
if ( ! $connection )
die ("connection impossible");
// Connecte la base
mysql_select_db($bd) or die ("pas de connection");
//récupération des données
$Na=$_POST["Nom"];
$J1=$_POST["J1"];
$J2=$_POST["J2"];
$HMO=$_POST["HMO"];
$HMF=$_POST["HMF"];
$HAO=$_POST["HAO"];
$HAF=$_POST["HAF"];
// test Si la valeur de N égal à la valeur de Nom ????
$requete="select * from horaire where Nom='".mysql_real_escape_string($Na)."'";
if(mysql_num_rows(mysql_query($requete))>0)
{
echo "les horaires pour cette adresse existent deja dans la base de donnees" ;
?>
<br><br>
<A href="../administrateur/accueiladm.php">Revenir au Menu principal</A>
<A href="Ajout_horaire_form.php">Ajouter les horaires d'une autre adresse</A>
<?php
}
else
{
$sql = mysql_query("Insert into horaire (id,Nom,Jour0,JourF,HeurMatO,HeurMatF,HeurApO,HeurAPF) value('','$Na','$J1','$J2','$HMO','$HMF','$HAO','$HAF')"); //requete
?>
<center><b>la mise a jour sur l'adresse <?php echo $Na;?> a bien ete effectuee</b> <br>
<table>
<tr>
<td><A href="ajout_horaire_form.php">Ajouter les horaires d'une autre adresse</A></td>
<td> </td>
<td> </td>
<td><A href="../administrateur/accueiladm.php">Revenir au Menu principal</A></td>
</tr>
</center>
</table>
<?php
}
mysql_close();
?>
</body>
</html> |
Partager