85 lines
2.2 KiB
PHP
Executable File
85 lines
2.2 KiB
PHP
Executable File
<?php
|
|
session_start();
|
|
header('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"');
|
|
|
|
/*Fonctions d'affichage du planning */
|
|
include("fct_affichage_planning.php");
|
|
|
|
$timestamp=time();
|
|
$mois=date('m', $timestamp);
|
|
$jour=date("d", $timestamp);
|
|
$annee=date("Y",$timestamp);
|
|
|
|
/* Matin ou après-midi ? */
|
|
if(! isset($_GET['moment'])) {
|
|
$moment='matin';
|
|
}
|
|
else {
|
|
$moment=$_GET['moment'];
|
|
}
|
|
|
|
/* recupere le numéro du club */
|
|
if(isset($_GET['id_club'])) {
|
|
$id_club=$_GET['id_club'];
|
|
}
|
|
else {
|
|
$id_club=$_POST['id_club'];
|
|
}
|
|
|
|
/* Fichier de constantes */
|
|
include_once("constantes.php");
|
|
|
|
/* init la connexion à la BDD */
|
|
include_once("conf.php");
|
|
|
|
|
|
/* recupere les coordonnées du club */
|
|
$requete1="SELECT nom,telephone FROM club WHERE id_club LIKE '$id_club'";
|
|
$result1=mysqli_query($db_connection, $requete1) or die ("Erreur no".mysqli_errno($db_connection)()." : ".mysqli_error($db_connection)()."<br>");
|
|
$club=mysqli_fetch_object($result1);
|
|
$titre="$club->nom";
|
|
|
|
/* Compte le nombre de terrains présents dans le club */
|
|
$requete2="SELECT COUNT(id_reservable) FROM reservable WHERE id_club LIKE '$id_club'";
|
|
$result2=mysqli_query($db_connection, $requete2) or die ("Erreur no".mysqli_errno($db_connection)()." : ".mysqli_error($db_connection)()."<br>");
|
|
$tmp_terrains=mysqli_fetch_array($result2);
|
|
$nb_terrains=$tmp_terrains[0];
|
|
|
|
if($moment=='matin') {
|
|
$moment_refresh='am';
|
|
}
|
|
else {
|
|
$moment_refresh='matin';
|
|
}
|
|
|
|
echo "<html>";
|
|
echo "<head>";
|
|
echo "<meta http-equiv='Refresh' content='30;url=consult_tv.php?id_club=$id_club&moment=$moment_refresh'>";
|
|
|
|
echo "<title>Consultation des terrains du club $club->nom</title>";
|
|
echo "<link rel='stylesheet' href='style.css' type='text/css'>";
|
|
echo "<link href='calendrier/calendrier.css' type='text/css' rel='StyleSheet'>";
|
|
?>
|
|
<style type='text/css'>
|
|
.droite {
|
|
position: relative;
|
|
right:30px;
|
|
float:right;
|
|
}
|
|
.gauche {
|
|
position: relative;
|
|
left:0px;
|
|
float:left;
|
|
}
|
|
</style>
|
|
<?php
|
|
echo "</head>";
|
|
echo "<body>";
|
|
/* Controle pour fermeture de session */
|
|
/* Affichage des noms de joueurs (meme ceux qui ne sont pas visibles) */
|
|
$adm=1;
|
|
|
|
/* Affichage du planning en fonction de son type */
|
|
affichage_jour($jour,$mois,$annee,$id_club,$adm,1,0,0,$cons,1,$moment);
|
|
?>
|