From d2c70cc72d7d6c62990e996f11ab5075750ef651 Mon Sep 17 00:00:00 2001 From: TheMrNomis Date: Thu, 21 Apr 2016 09:18:51 +0200 Subject: [PATCH 1/2] =?UTF-8?q?box-shadow=20sur=20les=20cat=C3=A9gories=20?= =?UTF-8?q?quand=20non=20check=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addEvent.css | 4 ++++ addEvent.php | 15 +++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/addEvent.css b/addEvent.css index 2ac5949..ca4c0ff 100644 --- a/addEvent.css +++ b/addEvent.css @@ -24,6 +24,10 @@ max-height: 300px; } +.bad-checkbox { + box-shadow: 0px 0px 5px red; +} + #buttonDiv { width:80%; text-align: center; diff --git a/addEvent.php b/addEvent.php index 784fe29..5fffed9 100644 --- a/addEvent.php +++ b/addEvent.php @@ -27,10 +27,10 @@ if(!$edit) 'debut-annee'=>date('Y'), 'debut-heure'=>date('G'), 'debut-minutes'=>'0', - 'fin-jour'=>date('j'), - 'fin-mois'=>date('n'), - 'fin-annee'=>date('Y'), - 'fin-heure'=>date('G'), + 'fin-jour'=>date('j', strtotime('+1 hour')), + 'fin-mois'=>date('n', strtotime('+1 hour')), + 'fin-annee'=>date('Y', strtotime('+1 hour')), + 'fin-heure'=>date('G', strtotime('+1 hour')), 'fin-minutes'=>'0', 'description'=>'', 'site'=>'', @@ -246,7 +246,14 @@ else document.getElementById('eventForm').addEventListener('submit', function(e) { if(!checkCheckboxes()) + { e.preventDefault(); + var checkboxes = document.getElementsByClassName("checkbox-cat"); + for(var i = 0; i < checkboxes.length; ++i) + { + checkboxes[i].className += " bad-checkbox"; + } + } }); From b63d32b76785567983d14fdc1a78c1b23cbb47de Mon Sep 17 00:00:00 2001 From: TheMrNomis Date: Thu, 21 Apr 2016 09:20:41 +0200 Subject: [PATCH 2/2] removed TODO comments --- addEvent.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/addEvent.php b/addEvent.php index 5fffed9..f30aedf 100644 --- a/addEvent.php +++ b/addEvent.php @@ -11,8 +11,6 @@ include_once('databaseOperations.php'); include('datetimeOperations.php'); $db = connect(); -//TODO: js at least check one categorie to submit form - $edit = (isset($_GET['id']) && is_numeric($_GET['id'])); if(!$edit) @@ -230,7 +228,6 @@ else