'. _("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')) ? '' . $nbsondages. ' ' . _("polls in the database at this time") . $btn_logs .'
'."\n";
// tableau qui affiche tous les sondages de la base
echo '
'. _("Poll ID") .' |
'. _("Format") .' |
'. _("Title") .' |
'. _("Author") .' |
'. _("Email") .' |
'. _("Expiration's date") .' |
'. _("Users") .' |
'. _("Actions") .' |
'."\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 '
'.$dsondage->id_sondage.' |
'.$dsondage->format.' |
'. stripslashes($dsondage->titre).' |
'.stripslashes($dsondage->nom_admin).' |
'.stripslashes($dsondage->mail_admin).' | ';
if (strtotime($dsondage->date_fin) > time()) {
echo '
'.date("d/m/y",strtotime($dsondage->date_fin)).' | ';
} else {
echo '
'.date("d/m/y",strtotime($dsondage->date_fin)).' | ';
}
echo '
'.$nbuser.' |
' . _("See the poll") . ' |
' . _("Change the poll") . ' |
|
'."\n";
$i++;
}
echo '