62 lines
1.9 KiB
PHP
Executable File
62 lines
1.9 KiB
PHP
Executable File
<?php
|
|
session_start();
|
|
header('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"');
|
|
if(isset($_SESSION['Admin']) and $_SESSION['Admin']==2 and isset($_SESSION['Club'])) {
|
|
$id_club=$_SESSION['Club'];
|
|
?>
|
|
<html>
|
|
|
|
<head>
|
|
<meta http-equiv="Content-Language" content="fr">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
|
|
<title>LE SERVEUR VOCAL DE RESERVATION DES SALLES DE TENNIS</title>
|
|
<link rel="stylesheet" href="style.css" type="text/css">
|
|
</head>
|
|
|
|
<body>
|
|
<div id="tout">
|
|
<?php
|
|
include("enTete.php");
|
|
include("menu.php");
|
|
include("conf.php");
|
|
|
|
echo "<div id='contenu'>";
|
|
echo "<center><h1>Modification du terrain</h1></center><br />";
|
|
|
|
$nom_terrain=$_POST['nom_terrain'];
|
|
$id_terrain=$_POST['id_terrain'];
|
|
$type=$_POST['type'];
|
|
$protection=$_POST['protection'];
|
|
$surface=$_POST['surface'];
|
|
$lieu=$_POST['lieu'];
|
|
$heure_ouv=$_POST['heure_ouv'];
|
|
$heure_fer=$_POST['heure_fer'];
|
|
|
|
/* controle des heures d'ouverture et de fermeture */
|
|
list($h,$m)=explode(":",$heure_ouv);
|
|
if($h<10) { $h="0".$h; }
|
|
$heure_ouv="$h:$m:00";
|
|
list($h,$m)=explode(":",$heure_fer);
|
|
if($h<10) { $h="0".$h; }
|
|
$heure_fer="$h:$m:00";
|
|
|
|
$requete="UPDATE reservable SET id_club='$id_club', nom='$nom_terrain', type='$type', protection='$protection', surface='$surface', lieu='$lieu', heure_ouverture='$heure_ouv', heure_fermeture='$heure_fer' WHERE id_reservable='$id_terrain'";
|
|
$reponse=mysqli_query( $db_connection, $requete) or die ("Erreur no".mysqli_errno($db_connection)()." : ".mysqli_error($db_connection)()."<br>");
|
|
|
|
echo "Le terrain a été modifié avec succès.<br />";
|
|
echo "Cliquez sur retour pour revenir au menu principal.";
|
|
|
|
echo "<br /><br />";
|
|
include("deco_admin_club.php");
|
|
include("piedDePage.php");
|
|
/* sinon si la personne n'est pas autorisé la renvoyer àla page de login */
|
|
}
|
|
else
|
|
{
|
|
echo("Non autorisé - Redirection vers la page d'identification dans 2 secondes");
|
|
sleep(2);
|
|
include("identification_admin.php");
|
|
}
|
|
?>
|