Browse Source

Merge branch 'master' of github.com:TheMrNomis/KiWi-calendar

master
AmarOk 10 years ago
parent
commit
0979030173
2 changed files with 15 additions and 7 deletions
  1. +4
    -0
      addEvent.css
  2. +11
    -7
      addEvent.php

+ 4
- 0
addEvent.css View File

@ -24,6 +24,10 @@
max-height: 300px; max-height: 300px;
} }
.bad-checkbox {
box-shadow: 0px 0px 5px red;
}
#buttonDiv { #buttonDiv {
width:80%; width:80%;
text-align: center; text-align: center;


+ 11
- 7
addEvent.php View File

@ -10,8 +10,6 @@ include_once('databaseOperations.php');
include('datetimeOperations.php'); include('datetimeOperations.php');
$db = connect(); $db = connect();
//TODO: js at least check one categorie to submit form
$edit = (isset($_GET['id']) && is_numeric($_GET['id'])); $edit = (isset($_GET['id']) && is_numeric($_GET['id']));
if(!$edit) if(!$edit)
@ -26,10 +24,10 @@ if(!$edit)
'debut-annee'=>date('Y'), 'debut-annee'=>date('Y'),
'debut-heure'=>date('G'), 'debut-heure'=>date('G'),
'debut-minutes'=>'0', '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', 'fin-minutes'=>'0',
'description'=>'', 'description'=>'',
'site'=>'', 'site'=>'',
@ -229,7 +227,6 @@ else
</div> </div>
</body> </body>
<script type="text/javascript"> <script type="text/javascript">
//TODO: check form before sending
function checkCheckboxes() function checkCheckboxes()
{ {
var checkboxes = document.getElementsByClassName("checkbox-cat"); var checkboxes = document.getElementsByClassName("checkbox-cat");
@ -245,7 +242,14 @@ else
document.getElementById('eventForm').addEventListener('submit', function(e) { document.getElementById('eventForm').addEventListener('submit', function(e) {
if(!checkCheckboxes()) if(!checkCheckboxes())
{
e.preventDefault(); e.preventDefault();
var checkboxes = document.getElementsByClassName("checkbox-cat");
for(var i = 0; i < checkboxes.length; ++i)
{
checkboxes[i].className += " bad-checkbox";
}
}
}); });
</script> </script>
</html> </html>

Loading…
Cancel
Save