<?
$heuredeb = 1;
$mindeb = 0;
$nompomp = "BOURGIN";
$nompompremplac = "FRATER";
$heurefin = 2;
$minfin = 15;
{
$heuredeb = $_POST['heuredeb'];
$mindeb = $_POST['mindeb'];
$nompomp = $_POST['pompierrempl'];
$nompompremplac = $_POST['pompierremplaçant'];
$heurefin = $_POST['heurefin'];
$minfin = $_POST['minfin'];
}
$query = "Select nom FROM pompier";
$query = "Select heures FROM heure";
$query = "Select minutes FROM minute";
//if ($_POST['heuredeb']>=22)
if (23>=22)
{
$query = "Select heures FROM heure";
}
else
{
$query = "Select heures FROM heure WHERE heures >= $heuredeb";
}
//if ($_POST['heuredeb'] == $_POST['heurefin'])
if (11 == 12)
{
$query = "Select minutes FROM minute WHERE minutes > $mindeb";
}
else
{
$query = "Select minutes FROM minute";
}
$query = "Select id_fonction,groupe FROM multi,pompier WHERE multi.id_pompier = pompier.id_pompier AND nom = '$nompomp'";
$interfon = $datapomparemp['id_fonction'];
$intergroup = $datapomparemp['groupe'];
$query = "Select nom FROM multi,pompier WHERE multi.id_pompier = pompier.id_pompier AND id_fonction = $interfon AND nom <> '$nompomp'";
$id=0;
?>
<html>
<head>
<title>Planning pout les pompiers</title>
</head>
<a href="planning.php?id=<?=1?>">Jour</a></br>
<a href="planning.php?id=<?=2?>">Nuit</a></br>
<?
if ($_GET['id'] == 1)
{
?>
<table width="900" border="1" cellpadding="2" cellspacing="0" align="center">
<?
echo "Jour : $jour. Mois: $mois";
$y = 6;
$i = 00;
$x = 0;
?>
<tr>
<td></td>
<td>Vendredi</td>
<td>Samedi</td>
<td>Dimanche</td>
<td>Lundi</td>
<td>Mardi</td>
<td>Mercredi</td>
<td>Jeudi</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<?
while ($y<20)
{
while ($x<4)
{
?>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<?
$i =$i + 15;
$x = $x + 1;
}
$y = $y + 1;
$i = 00;
$x = 0;
}
if ($y == 20)
{
$i = 0;
?>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<?}?>
</table>
<?
}
if ($_GET['id'] == 2)
{
?>
<table width="900" border="1" cellpadding="2" cellspacing="0" align="center">
<tr>
<td></td>
<td>Vendredi</td>
<td>Samedi</td>
<td>Dimanche</td>
<td>Lundi</td>
<td>Mardi</td>
<td>Mercredi</td>
<td>Jeudi</td>
</tr>
<?
}
?>
</br>
</br>
</br>
</br>
Formulaire de modification
<form method="POST" name="modification">
<table width="400" border="1" cellpadding="2" cellspacing="0" align="center">
<script language ="JavaScript">
function test(champ)
{
if (champ.selectedIndex>=0)
modification.submit()
}
</script>
<tr>
<td>Date</td>
<td></td>
</tr>
<tr>
<td>Heure debut</td>
<td>
<select name="heuredeb" style="width:115px" onchange="test(this)">
<?
{
?>
<option
<?
if ($_POST['heuredeb'] ==
$datahd["heures"]) echo "selected";?>><?
echo $datahd["heures"];?></option>
<?
}
?>
</select>
</td>
</tr>
<tr>
<td>Minute debut</td>
<td>
<select name="mindeb" style="width:115px" onchange="test(this)">
<?
{
?>
<option
<?
if ($_POST['mindeb'] ==
$datamd["minutes"]) echo "selected";?>><?
echo $datamd['minutes'];?></option>
<?
}
?>
</select>
</td>
</tr>
<tr>
<td>Heure de fin</td>
<td>
<select name="heurefin" style="width:115px" onchange="test(this)">
<?
{
?>
<option
<?
if ($_POST['heurefin'] ==
$datahf["heures"]) echo "selected";?>><?
echo $datahf['heures'];?></option>
<?
}
?>
</select>
</td>
</tr>
<tr>
<td>Minute fin</td>
<td>
<select name="minfin" style="width:115px" onchange="test(this)">
<?
{
?>
<option
<?
if ($_POST['minfin'] ==
$datamf["minutes"]) echo "selected";?>><?
echo $datamf['minutes'];?></option>
<?
}
?>
</select>
</td>
</tr>
<tr>
<td>Pompier à remplacer</td>
<td>
<select name="pompierrempl" style="width:115px" onchange="test(this)">
<?
{
?>
<option
<?
if ($_POST['pompierrempl'] ==
$datapompier["nom"]) echo "selected";?>><?
echo $datapompier["nom"];?></option>
<?
}
?>
</select>
</td>
</tr>
<tr>
<td>Pompier remplaçant</td>
<td>
<select name="pompierremplaçant" style="width:115px" onchange="test(this)">
<?
{
?>
<option
<?
if ($_POST['pompierremplaçant'] ==
$datapompierremplaçant
["nom"]) echo "selected";?>><?
echo $datapompierremplaçant
["nom"];?></option>
<?
}
?>
</select>
</td>
</tr>
</table>
<?
echo "<td><input type=\"submit\" style=\"width:85px\" value=\"Valider\" onclick=\"document.location.href='verification.php??heuredeb=$heuredeb&heurefin=$heurefin&mindeb=$mindeb&minfin=$minfin&nomp=$nompomp&nompr=$nompompremplac&group=$intergroup'\"/></td>";
?>
</form>
</html>