Files
resatennis_tyroltenn/www/tyroltenn/creer_info.php

66 lines
2.1 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'];
$id_admin=$_SESSION['Id'];
?>
<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 "<center><h1>Ajout d'une information du club</h1></center><br />";
if(count($_POST)==0) {
echo "<p>Cette page permet d'ajouter une information &agrave; destination des membres du club.</p>";
echo "<br /><br />";
echo "<form action='creer_info.php' method='post'>";
echo "<center><table>";
echo "<tr><td>Entrer votre pr&eacute;nom ainsi que votre nom : </td><td><input type='text' name='posteur' maxlength='50'></td></tr>";
echo "<tr><td>Entrer le texte du message : </td><td><textarea name='info' rows='5' cols='40'></textarea>";
echo "<tr><td></td><td><input type='submit' name='valider' value='Valider'></td></tr>";
echo "</table></center>";
echo "</form>";
}
else {
$info=$_POST['info'];
$posteur=$_POST['posteur'];
$date=date("Y-m-d", time());
$requete="INSERT INTO infos_site(id_club, date, posteur, information) VALUES('$id_club', '$date','$posteur','$info')";
$reponse=mysqli_query($db_connection, $requete) or die ("Erreur no".mysqli_errno($db_connection)()." : ".mysqli_error($db_connection)()."<br>");
echo "</p>L'information a &eacute;t&eacute; ajout&eacute;e avec succ&egrave;s.<br />";
echo "Cliquez <a href='creer_info.php'>ici</a> pour en ajouter une nouvelle ou cliquez sur retour pour revenir au menu principal.</p>";
}
echo "<br /><br />";
include("deco_admin_club.php");
include("piedDePage.php");
}
else {
echo("Non autorisé - Redirection vers la page d'identification dans 2 secondes");
sleep(2);
include("admin_login.php");
}
?>