'."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo 'ADMINISTRATEUR de la base '.NOMAPPLICATION.''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; //Affichage des bandeaux et début du formulaire framanav(); logo(); bandeau_tete(); bandeau_titre(_("Polls administrator")); sous_bandeau_admin(); //print_r($_SESSION); $sondage=$connect->Execute("select * from sondage"); echo'
'."\n"; echo '
'."\n"; // Test et affichage du bouton de confirmation en cas de suppression de sondage $i=0; while($dsondage = $sondage->FetchNextObject(false)) { if ($_POST["supprimersondage$i"]) { echo ''."\n"; echo ''."\n"; echo '
'. _("Confirm removal of the poll ") .'"'.$dsondage->id_sondage.'" : '."\n"; echo '
'."\n"; echo '
'."\n"; } // Traitement de la confirmation de suppression if ($_POST["confirmesuppression$i"]) { $date=date('H:i:s d/m/Y'); // requetes SQL qui font le ménage dans la base $connect->Execute('DELETE FROM sondage LEFT INNER JOIN sujet_studs ON sujet_studs.id_sondage = sondage.id_sondage '. 'LEFT INNER JOIN user_studs ON user_studs.id_sondage = sondage.id_sondage ' . 'LEFT INNER JOIN comments ON comments.id_sondage = sondage.id_sondage ' . "WHERE id_sondage = '$dsondage->id_sondage' "); // ecriture des traces dans le fichier de logs error_log($date . " SUPPRESSION: $dsondage->id_sondage\t$dsondage->format\t$dsondage->nom_admin\t$dsondage->mail_admin\t$nbuser\t$dsujets->sujet\n", 'logs_studs.txt'); } $i++; } $sondage=$connect->Execute("select * from sondage"); $nbsondages=$sondage->RecordCount(); echo $nbsondages.' '. _("polls in the database at this time") .'

'."\n"; // tableau qui affiche tous les sondages de la base echo ''."\n"; echo ''."\n"; $i = 0; while($dsondage = $sondage->FetchNextObject(false)) { /* possible en 1 bonne requête dans $sondage */ $sujets=$connect->Execute( "select * from sujet_studs where id_sondage='$dsondage->id_sondage'"); $dsujets=$sujets->FetchObject(false); $user_studs=$connect->Execute( "select * from user_studs where id_sondage='$dsondage->id_sondage'"); $nbuser=$user_studs->RecordCount(); echo ''; if (strtotime($dsondage->date_fin) > time()) { echo ''; } else { echo ''; } echo''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; $i++; } echo '
'. _("Poll ID") .''. _("Format") .''. _("Title") .''. _("Author") .''. _("Expiration's date") .''. _("Users") .''. _("Actions") .'
'.$dsondage->id_sondage.''.$dsondage->format.''. stripslashes($dsondage->titre).''.stripslashes($dsondage->nom_admin).''.date("d/m/y",strtotime($dsondage->date_fin)).''.date("d/m/y",strtotime($dsondage->date_fin)).''.$nbuser.''. _("See the poll") .''. _("Change the poll") .'
'."\n"; echo'
'."\n"; // fin du formulaire et de la page web echo ''."\n"; echo '
 
'; echo ''."\n"; echo ''."\n"; // si on annule la suppression, rafraichissement de la page if ($_POST["annulesuppression"]) { }