'. _("Confirm removal of the poll ") .'"'.$dsondage->id_sondage.'
'._('Keep this poll!').'
'._('Remove this poll!').'
';
}
// 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 */
$subjects = $connect->Execute("SELECT * FROM sujet_studs WHERE id_sondage='$dsondage->id_sondage'");
$dsujets = $subjects->FetchObject(false);
$user_studs = $connect->Execute("SELECT * from user_studs WHERE id_sondage='$dsondage->id_sondage'");
$nb_users = $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 '
'.$nb_users.'
' . _('See the poll') . '
' . _("Change the poll") . '
' . _('Remove the poll') . '
'."\n";
++$i;
}
echo '