From 78c56796f7c2264660bc74de51a359b38a07ef25 Mon Sep 17 00:00:00 2001 From: "Spanti Nicola (RyDroid)" Date: Thu, 27 Nov 2014 00:52:47 +0100 Subject: [PATCH] Small cleaning of admin/index.php --- admin/index.php | 57 +++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/admin/index.php b/admin/index.php index 584aaa7..f03fa77 100644 --- a/admin/index.php +++ b/admin/index.php @@ -26,10 +26,10 @@ include_once __DIR__ . '/../bandeaux.php'; // de l'application. // Affichage des balises standards -Utils::print_header( _("Polls administrator") ); -bandeau_titre(_("Polls administrator")); +Utils::print_header( _('Polls administrator') ); +bandeau_titre(_('Polls administrator')); -$sondage=$connect->Execute("select * from sondage"); +$sondage=$connect->Execute('SELECT * FROM sondage'); echo'
'."\n"; @@ -39,15 +39,15 @@ while($dsondage = $sondage->FetchNextObject(false)) { 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'); + $date = date('H:i:s d/m/Y'); if (Utils::remove_sondage($connect, $dsondage->id_sondage)) { // ecriture des traces dans le fichier de logs @@ -56,7 +56,7 @@ while($dsondage = $sondage->FetchNextObject(false)) { } } -$sondage=$connect->Execute("select * from sondage WHERE date_fin > DATE_SUB(now(), INTERVAL 3 MONTH) ORDER BY date_fin ASC"); +$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") .'' : ''; @@ -66,24 +66,24 @@ echo '

' . $nbsondages. ' ' . _("polls in the database at this time") . $btn_l // 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); + $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'"); - $nbuser=$user_studs->RecordCount(); + $user_studs = $connect->Execute("SELECT * from user_studs WHERE id_sondage='$dsondage->id_sondage'"); + $nb_users = $user_studs->RecordCount(); echo ' @@ -94,19 +94,19 @@ while($dsondage = $sondage->FetchNextObject(false)) { '; if (strtotime($dsondage->date_fin) > time()) { - echo ' - '; + echo ''; } else { - echo ' - '; + echo ''; } echo ' - - - - + + + + '."\n"; - $i++; + ++$i; } echo '
'. _("Poll ID") .''. _("Format") .''. _("Title") .''. _("Author") .''. _("Email") .''. _("Expiration's date") .''. _("Users") .''. _("Actions") .''. _('Poll ID') .''. _('Format') .''. _('Title') .''. _('Author') .''. _('Email') .''. _('Expiration\'s date') .''. _('Users') .''. _('Actions') .'
'.stripslashes($dsondage->mail_admin).''.date("d/m/y",strtotime($dsondage->date_fin)).''.date('d/m/y', strtotime($dsondage->date_fin)).''.date("d/m/y",strtotime($dsondage->date_fin)).'' + . date('d/m/y', strtotime($dsondage->date_fin)) + . ''.$nbuser.'' . _("See the poll") . '' . _("Change the poll") . ''.$nb_users.'' . _('See the poll') . '' . _("Change the poll") . '

'."\n"; @@ -115,4 +115,5 @@ bandeau_pied(true); // si on annule la suppression, rafraichissement de la page if (Utils::issetAndNoEmpty('annulesuppression') === true) { + // TODO }