<html> <head> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="style.css"> <title>Parking - Attribution de place</title> </head> <body> <div id="bloc_page"> <?php require "inc/header.php"; ?> <?php erase_notif($_GET['client']); // ON SUPPRIME LA NOTIF AVEC LA FONCTION PERSO if (isset($_GET['client']) && is_numeric($_GET['client']) && isset($_GET['nbjours']) && is_numeric($_GET['nbjours'])) { if ($_GET['nbjours'] < 16 || $_GET['nbjours'] > 0) { //On recupère la valeur dans l'URL $client = intval($_GET['client']); $nbjours = intval($_GET['nbjours']); } else { header('Location:gestion.php'); } } else { header('Location:gestion.php'); } ?> <section> <article>
<?php require "inc/config.php"; #Connexion a la base (inclusion de la connexion par CLASSE PDO:Statement) require 'functions.php'; session_start(); if (!isset($_SESSION['numutil'])) { header('Location:index.php'); } if ($_SESSION['admin'] != 1) { header('Location:accueil.php'); } if (isset($_POST['listedattente'])) { erase_notif($_POST['client']); $verif = $bdd->query("SELECT * FROM listedattente WHERE codeclient = " . $_POST['client']); if (!($verifs = $verif->fetch())) { //ON COMPTE LE NOMBRE DE PERSONNE EN LISTE DATTENTE $req = $bdd->query("SELECT COUNT(*) AS nbattentes FROM listedattente"); $occurence = $req->fetch(); $count = $occurence['nbattentes']; $count++; //ON AJOUTE UNE PERSONNE EN LISTE DATTENTE $reukette = $bdd->prepare("INSERT INTO listedattente(positionattente, codeclient) VALUES (:position, :code)"); $reukette->execute(array('position' => $count, 'code' => $_POST['client'])) or exit(print_r($reukette->errorInfo())); header('Location:gestion.php'); } else { header('Location:gestion.php'); } } else { header('Location:gestion.php'); }
$raisultat = $raisultat['nbnotifss']; if ($raisultat == 0) { echo '<p>Il n\'y a aucune notifications !</p>'; } if ($raisultat > 0) { ?> <form action ="gestion.php" method="POST"> <input type="submit" name="supp" value="Supprimer toutes les notifications" /> </form><?php //BOUTON POUR SUPPRIMER UNE NOTIF if (isset($_POST['supp'])) { erase_notif(1); erase_notif(2); erase_notif(3); erase_notif(4); erase_notif(5); } $check->closeCursor(); //ON VERIFIE LES NOTIFS $check = $bdd->query("SELECT * FROM notifications ORDER BY datenotif DESC"); while ($notifs = $check->fetch()) { $users = $bdd->prepare('SELECT nomutil, prenomutil FROM utilisateurs WHERE numutil = :num'); $users->execute(array('num' => $notifs['numuser'])) or exit(print_r($users->errorInfo())); $userfound = $users->fetch(); $client = $notifs['numuser']; ?> <p><strong><?php date_maker($notifs['datenotif']); ?> </strong> : <?php