Execute("select * from sondage"); echo'
'."\n"; // Test et affichage du bouton de confirmation en cas de suppression de sondage while($dsondage = $sondage->FetchNextObject(false)) { if (Utils::issetAndNoEmpty('supprimersondage'.$dsondage->id_sondage) === true) { echo '

'. _("Confirm removal of the poll ") .'"'.$dsondage->id_sondage.'

'; } // Traitement de la confirmation de suppression if (Utils::issetAndNoEmpty('confirmesuppression'.$dsondage->id_sondage) === true) { // On inclut la routine de suppression $date=date('H:i:s d/m/Y'); if (Utils::remove_sondage($connect, $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\n", 3, 'logs_studs.txt'); } } } $sondage=$connect->Execute("select * from sondage WHERE date_fin > DATE_SUB(now(), INTERVAL 3 MONTH) ORDER BY date_fin ASC"); $nbsondages=$sondage->RecordCount(); $btn_logs = (is_readable('logs_studs.txt')) ? ''. _("Logs") .'' : ''; echo '

' . $nbsondages. ' ' . _("polls in the database at this time") . $btn_logs .'

'."\n"; // tableau qui affiche tous les sondages de la base 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"; $i++; } echo '
'. _("Poll ID") .' '. _("Format") .' '. _("Title") .' '. _("Author") .' '. _("Email") .' '. _("Expiration's date") .' '. _("Users") .' '. _("Actions") .'
'.$dsondage->id_sondage.' '.$dsondage->format.' '. stripslashes($dsondage->titre).' '.stripslashes($dsondage->nom_admin).' '.stripslashes($dsondage->mail_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"; bandeau_pied(true); // si on annule la suppression, rafraichissement de la page if (Utils::issetAndNoEmpty('annulesuppression') === true) { }