From 6b8e3f2b9f9917ee4c04c7afe76e73a9a2efdf54 Mon Sep 17 00:00:00 2001
From: Simon Leblanc <contact@leblanc-simon.eu>
Date: Wed, 11 Jan 2012 02:05:53 +0100
Subject: [PATCH] =?UTF-8?q?fix=20de=20#45=20gr=C3=A2ce=20=C3=A0=20l'applic?=
 =?UTF-8?q?ation=20du=20patch=20fourni=20par=20[fevrier]?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 admin/index.php | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/admin/index.php b/admin/index.php
index aa8dc5b6..5de0e583 100644
--- a/admin/index.php
+++ b/admin/index.php
@@ -72,18 +72,17 @@ $sondage=$connect->Execute("select * from sondage");
 echo'<div class=corps>'."\n";
 echo '<form action="index.php" method="POST">'."\n";
 // Test et affichage du bouton de confirmation en cas de suppression de sondage
-$i=0;
 while($dsondage = $sondage->FetchNextObject(false)) {
-  if (issetAndNoEmpty('supprimersondage'.$i) === true) {
+  if (issetAndNoEmpty('supprimersondage'.$dsondage->id_sondage) === true) {
     echo '<table>'."\n";
-    echo '<tr><td bgcolor="#EE0000" colspan="11">'. _("Confirm removal of the poll ") .'"'.$dsondage->id_sondage.'" : <input type="submit" name="confirmesuppression'.$i.'" value="'. _("Remove this poll!") .'">'."\n";
+    echo '<tr><td bgcolor="#EE0000" colspan="11">'. _("Confirm removal of the poll ") .'"'.$dsondage->id_sondage.'" : <input type="submit" name="confirmesuppression'.$dsondage->id_sondage.'" value="'. _("Remove this poll!") .'">'."\n";
     echo '<input type="submit" name="annullesuppression" value="'. _("Keep this poll!") .'"></td></tr>'."\n";
     echo '</table>'."\n";
     echo '<br>'."\n";
   }
   
   // Traitement de la confirmation de suppression
-  if (issetAndNoEmpty('confirmesuppression'.$i) === true) {
+  if (issetAndNoEmpty('confirmesuppression'.$dsondage->id_sondage) === true) {
     // On inclut la routine de suppression
     $date=date('H:i:s d/m/Y');
 
@@ -96,7 +95,6 @@ while($dsondage = $sondage->FetchNextObject(false)) {
 
   }
 
-  $i++;
 }
 
 $sondage=$connect->Execute("select * from sondage ORDER BY date_fin ASC");
@@ -128,7 +126,7 @@ while($dsondage = $sondage->FetchNextObject(false)) {
   echo'<td>'.$nbuser.'</td>'."\n";
   echo '<td><a href="'.getUrlSondage($dsondage->id_sondage).'">'. _("See the poll") .'</a></td>'."\n";
   echo '<td><a href="'.getUrlSondage($dsondage->id_sondage_admin, true).'">'. _("Change the poll") .'</a></td>'."\n";
-  echo '<td><input type="submit" name="supprimersondage'.$i.'" value="'. _("Remove the poll") .'"></td>'."\n";
+  echo '<td><input type="submit" name="supprimersondage'.$dsondage->id_sondage.'" value="'. _("Remove the poll") .'"></td>'."\n";
 
   echo '</tr>'."\n";
   $i++;
-- 
GitLab