From fcc478bb9306eea805173fce705cb445f910aa7e Mon Sep 17 00:00:00 2001 From: Olivier PEREZ Date: Wed, 17 Dec 2014 13:39:12 +0100 Subject: [PATCH] Add headers to th cells when editing vote --- studs.php | 6 ++++++ tpl/studs.tpl | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/studs.php b/studs.php index 042d4ab..f2850be 100644 --- a/studs.php +++ b/studs.php @@ -48,7 +48,10 @@ if (!$poll) { exit; } +// ------------------------------- // A vote is going to be edited +// ------------------------------- + if (!empty($_POST['edit_vote'])) { // TODO Try what does filter_input with a wrong value $editingVoteId = filter_input(INPUT_POST, 'edit_vote', FILTER_VALIDATE_INT); @@ -57,7 +60,10 @@ if (!empty($_POST['edit_vote'])) { } +// ------------------------------- // Something to save (edit or add) +// ------------------------------- + if (!empty($_POST['save'])) { // Save edition of an old vote $editedVote = filter_input(INPUT_POST, 'save', FILTER_VALIDATE_INT); $choices = $inputService->filterArray($_POST['choices'], FILTER_VALIDATE_REGEXP, ['options'=>['regexp'=>'/^[012]$/']]); diff --git a/tpl/studs.tpl b/tpl/studs.tpl index 729ea90..ef76135 100644 --- a/tpl/studs.tpl +++ b/tpl/studs.tpl @@ -116,7 +116,7 @@ {if $editingVoteId == $vote->id} {foreach $vote->choices as $k=>$choice} - +