104 lines
3.6 KiB
PHP
Executable File
104 lines
3.6 KiB
PHP
Executable File
<!-- lien pour le css -->
|
|
<LINK href="calendrier/calendrier.css" type=text/css rel=StyleSheet>
|
|
<!-- fin lien css -->
|
|
<?
|
|
include("conf.php");
|
|
$db_connection=mysql_connect($db_host,$db_user,$password);
|
|
mysql_select_db($db_name,$db_connection);
|
|
$mois_courrant=date("m");
|
|
$jour=date("j");
|
|
$club=$_GET['club'];
|
|
$requete1="SELECT nom,nb_cours,telephone FROM club WHERE id_club LIKE '$club'";
|
|
$result1=mysql_query($requete1,$db_connection) or die ("Erreur no".mysql_errno()." : ".mysql_error()."<br>");
|
|
$reponse1=mysql_fetch_object($result1);
|
|
|
|
echo"<META HTTP-EQUIV='Refresh' CONTENT='120;URL=gestion_terrains_public.php?mois=$mois_courrant&jour=$jour&club=$club'>";
|
|
$titre="Occupation des terrains de $reponse1->nom";
|
|
include("enTete.php");
|
|
include("calendrier/calendrier.inc2.php");
|
|
include("calendrier/string.inc.php");
|
|
$annee=date("Y");
|
|
$mois_courrant=$mois_courrant-1;
|
|
echo "<center><table><tr><td bgcolor='#FFDEAD' WIDTH='260' HEIGHT='40'><center>";
|
|
if($mois_courrant==0){
|
|
$gestion_mois=12;
|
|
$gestion_annee=$annee-1;
|
|
echo showCalendar($gestion_annee."-".$gestion_mois,$club);
|
|
}
|
|
else{
|
|
echo showCalendar($annee."-".$mois_courrant,$club);
|
|
}
|
|
|
|
echo "</td><td></td><td bgcolor='#FFEEAD' WIDTH='260' HEIGHT='40'><center>";
|
|
$mois_courrant=$mois_courrant+1;
|
|
echo showCalendar($annee."-".$mois_courrant,$club);
|
|
echo "</td><td></td><td bgcolor='#FFDEAD' WIDTH='260' HEIGHT='40'><center>";
|
|
if($mois_courrant==12){
|
|
$mois_courrant=1;
|
|
$annee=$annee+1;
|
|
echo showCalendar($annee."-".$mois_courrant,$club);
|
|
}
|
|
else{
|
|
$mois_courrant=$mois_courrant+1;
|
|
echo showCalendar($annee."-".$mois_courrant,$club);
|
|
}
|
|
|
|
echo "</td></tr>";
|
|
|
|
|
|
$mois=$_GET['mois'];
|
|
if ($mois==''){
|
|
$mois=date("m");
|
|
}
|
|
$jour=$_GET['jour'];
|
|
if ($jour==''){
|
|
$jour=date("j");
|
|
}
|
|
//echo 'jour : ',$jour;
|
|
$heure=$_GET['heure'];
|
|
//echo 'heure : ',$heure;
|
|
$court=$_GET['court'];
|
|
//echo 'court : ',$court;
|
|
$nom=$_GET['nom'];
|
|
//echo 'nom : ',$nom;
|
|
$annee=date("Y");
|
|
echo "<tr><td colspan='5'><center><b>";
|
|
echo "Le ",$jour," ",monthNumToName($mois)," ",$annee;
|
|
|
|
echo "</center><br>Réserver un terrain par téléphone au $reponse1->telephone";
|
|
if ($club=='3'){
|
|
echo"</b>ou par mail : <A
|
|
HREF='mailto:tennis@airtria.fr'>tennis@airtria.fr</a><br>Stages / Cours de tennis Renseignements / Inscriptions : <li>\tThierry PRETAT -> 06 81 33 31 09</li><li>\tClub House -> 02 96 15 31 54</li>";
|
|
}
|
|
echo"<br>En tournoi : Vainqueur/Perdant";
|
|
echo "<center><table border=1>";
|
|
echo"<tr bgcolor='#FFDEAD'><td>Horaires</td>";
|
|
for ($j=1;$j<=$reponse1->nb_cours;$j++){
|
|
echo"<td>Court $j</td>";
|
|
}
|
|
echo"</tr>";
|
|
for ($i=8;$i<=20;$i++){
|
|
echo"<tr><td bgcolor='#FFDEAD'>$i h</td>";
|
|
for ($j=1;$j<=$reponse1->nb_cours;$j++){
|
|
if ($mois<10 and strlen($mois)<2) { $mois = "0".$mois; }
|
|
$requete="SELECT id_reservation FROM reservation WHERE court LIKE '$j' AND heure LIKE '$i' AND mois LIKE '$mois' AND jour LIKE '$jour' AND club LIKE '$club'";
|
|
$result=mysql_query($requete,$db_connection) or die ("Erreur no".mysql_errno()." : ".mysql_error()."<br>");
|
|
$exist = mysql_numrows($result);
|
|
if ($exist==0){
|
|
echo"<td bgcolor='#CCFF99' WIDTH='100' HEIGHT='40'> </td>";
|
|
}
|
|
else{
|
|
echo"<td bgcolor='FF9966' WIDTH='100' HEIGHT='40'><center>";
|
|
$requete="SELECT nom,type FROM reservation WHERE court LIKE '$j' AND heure LIKE '$i' AND mois LIKE '$mois' AND jour LIKE '$jour' AND club LIKE '$club'";
|
|
$result=mysql_query($requete,$db_connection) or die ("Erreur no".mysql_errno()." : ".mysql_error()."<br>");
|
|
$reponse=mysql_fetch_object($result);
|
|
echo "<font size=1 >$reponse->type<br><b>$reponse->nom</td>";
|
|
}
|
|
}
|
|
echo"</tr>";
|
|
}
|
|
echo "</table>";
|
|
echo "</td></tr></table>";
|
|
include("piedDePage.php");
|
|
?>
|