';
@@ -243,7 +244,7 @@ echo '
//affichage de la description du sondage
if ($dsondage->commentaires) {
$commentaires = $dsondage->commentaires;
- $commentaires=nl2br(str_replace("\\","",$commentaires));
+ $commentaires=nl2br(str_replace('\\', '', $commentaires));
echo '
'._("Description") .'
@@ -260,12 +261,12 @@ $nblignes = $user_studs->RecordCount();
//on teste pour voir si une ligne doit etre modifiée
$testmodifier = false;
$ligneamodifier = -1;
-for ($i=0;$i<$nblignes;$i++) {
- if (isset($_POST["modifierligne$i"])) {
+for ($i=0; $i < $nblignes; ++$i) {
+ if (isset($_POST['modifierligne'. $i])) {
$ligneamodifier = $i;
}
- //test pour voir si une ligne est a modifier
+ //test pour voir si une ligne est à modifier
if (isset($_POST['validermodifier'.$i])) {
$modifier = $i;
$testmodifier = true;
@@ -274,19 +275,20 @@ for ($i=0;$i<$nblignes;$i++) {
//si le test est valide alors on affiche des checkbox pour entrer de nouvelles valeurs
if ($testmodifier) {
+ // TODO reuse getNewChoiceFromPOST of adminstuds.php see 8272e0db84fb65210eddf5a370e0c5a2411fea79
$nouveauchoix = '';
for ($i=0;$i<$nbcolonnes;$i++) {
// radio checked 1 = Yes, 2 = Ifneedbe, 0 = No
if (isset($_POST["choix$i"])) {
switch ($_POST["choix$i"]) {
- case 1: $nouveauchoix .= "1";break;
- case 2: $nouveauchoix .= "2";break;
- default: $nouveauchoix .= "0";break;
+ case 1: $nouveauchoix .= "1"; break;
+ case 2: $nouveauchoix .= "2"; break;
+ default: $nouveauchoix .= "0";
}
}
}
- $compteur=0;
+ $compteur = 0;
while ($data = $user_studs->FetchNextObject(false) ) {
//mise a jour des données de l'utilisateur dans la base SQL
if ($compteur == $modifier) {
@@ -298,7 +300,7 @@ if ($testmodifier) {
Utils::sendEmail( "$dsondage->mail_admin", "[".NOMAPPLICATION."] " . _("Poll's participation") . " : ".html_entity_decode($dsondage->titre, ENT_QUOTES, 'UTF-8'), "\"".html_entity_decode($data->nom, ENT_QUOTES, 'UTF-8')."\""."" . _("has filled a line.\nYou can find your poll at the link") . " :\n\n" . Utils::getUrlSondage($numsondage) . " \n\n" . _("Thanks for your confidence.") . "\n".NOMAPPLICATION );
}
}
- $compteur++;
+ ++$compteur;
}
}
@@ -350,7 +352,7 @@ if ($dsondage->format=="D"||$dsondage->format=="D+"||$dsondage->format=="D-") {
} else {
$border[$i] = true;
$tr_months .= '
';
- for ($i = 0; isset($toutsujet[$i]); $i++) {
+ for ($i = 0; isset($toutsujet[$i]); ++$i) {
- $td_headers[$i]='';$radio_title[$i]=''; // init before concatenate
+ $td_headers[$i] = '';
+ $radio_title[$i] = ''; // init before concatenate
// Subjects
preg_match_all('/\[!\[(.*?)\]\((.*?)\)\]\((.*?)\)/',$toutsujet[$i],$md_a_img); // Markdown [![alt](src)](href)
@@ -498,9 +501,9 @@ while ($data = $user_studs->FetchNextObject(false)) {
// variable pour afficher la valeur cochée
$car_html[0]='value="0"';$car_html[1]='value="1"';$car_html[2]='value="2"';
switch ($car) {
- case "1": $car_html[1]='value="1" checked';break;
- case "2": $car_html[2]='value="2" checked';break;
- default: $car_html[0]='value="0" checked';break;
+ case '1': $car_html[1]='value="1" checked'; break;
+ case '2': $car_html[2]='value="2" checked'; break;
+ default: $car_html[0]='value="0" checked';
}
echo '
@@ -535,7 +538,7 @@ while ($data = $user_studs->FetchNextObject(false)) {
if (isset($somme[$k]) === false) {
$somme[$k] = 0;
}
- $somme[$k]++; break;
+ ++$somme[$k]; break;
case "2": echo '
() ' . _('Yes') . _(', ifneedbe') . '
'."\n"; break;
default: echo '
' . _('No') . '
'."\n";
}
@@ -553,8 +556,8 @@ while ($data = $user_studs->FetchNextObject(false)) {
}
//demande de confirmation pour modification de ligne
- for ($i=0;$i<$nblignes;$i++) {
- if (isset($_POST["modifierligne$i"])) {
+ for ($i=0; $i < $nblignes; ++$i) {
+ if (isset($_POST['modifierligne'. $i])) {
if ($compteur == $i) {
echo '