diff options
author | Christian Klinger | 2016-06-15 10:29:59 +0200 |
---|---|---|
committer | Christian Klinger | 2016-06-15 10:37:36 +0200 |
commit | 949f22713943f7c50df728bdf5c65b2a4e39a737 (patch) | |
tree | 63de1e8056f09cbe1d1058ba6bd8b74f7c89a07d /modules-available/exams | |
parent | added bootstrap module. (diff) | |
download | slx-admin-949f22713943f7c50df728bdf5c65b2a4e39a737.tar.gz slx-admin-949f22713943f7c50df728bdf5c65b2a4e39a737.tar.xz slx-admin-949f22713943f7c50df728bdf5c65b2a4e39a737.zip |
Added date and time pickers.
Diffstat (limited to 'modules-available/exams')
-rw-r--r-- | modules-available/exams/config.json | 2 | ||||
-rw-r--r-- | modules-available/exams/page.inc.php | 4 | ||||
-rw-r--r-- | modules-available/exams/templates/page-add-exam.html | 40 |
3 files changed, 37 insertions, 9 deletions
diff --git a/modules-available/exams/config.json b/modules-available/exams/config.json index e109b27b..6590a595 100644 --- a/modules-available/exams/config.json +++ b/modules-available/exams/config.json @@ -1,5 +1,5 @@ { "category":"main.status", - "dependencies": [ "locations" ], + "dependencies": [ "locations", "visjs", "bootstrap_datepicker", "bootstrap_timepicker"], "permission": "0" } diff --git a/modules-available/exams/page.inc.php b/modules-available/exams/page.inc.php index e5129d38..78d5b21c 100644 --- a/modules-available/exams/page.inc.php +++ b/modules-available/exams/page.inc.php @@ -29,8 +29,8 @@ class Page_Exams extends Page if (Request::isPost()) { /* process form-data */ $locationid = Request::post('location'); - $starttime = Request::post('starttime'); - $endtime = Request::post('endtime'); + $starttime = Request::post('starttime_date') . " " . Request::post('starttime_time'); + $endtime = Request::post('endtime_date') . " " . Request::post('endtime_time'); $res = Database::exec("INSERT INTO exams(locationid, starttime, endtime) VALUES(:locationid, :starttime, :endtime);", compact('locationid', 'starttime', 'endtime')); diff --git a/modules-available/exams/templates/page-add-exam.html b/modules-available/exams/templates/page-add-exam.html index b610fcd8..b6a8f6b1 100644 --- a/modules-available/exams/templates/page-add-exam.html +++ b/modules-available/exams/templates/page-add-exam.html @@ -10,16 +10,44 @@ </select> </div> - <div class="form-group"> - <label for="starttime">Start Time</label> - <input class="form-control" type="datetime" name="starttime" /> + <div class="row"> + <div class="form-group col-xs-6"> + <label for="starttime_date">Start Date</label> + <input class="form-control datepicker" name="starttime_date" /> + </div> + <div class="form-group col-xs-6"> + <label for="starttime_time">Start Time</label> + <input type="text" class="form-control timepicker" name="starttime_time" /> + </div> </div> - <div class="form-group"> - <label for="endtime">Start Time</label> - <input class="form-control" type="datetime" name="endtime" /> + <div class="row"> + <div class="form-group col-xs-6"> + <label for="endtime_date">End Date</label> + <input class="form-control datepicker" name="endtime_date" /> + </div> + <div class="form-group col-xs-6"> + <label for="endtime_time">End Time</label> + <input type="texxt" class="form-control timepicker" name="endtime_time" /> + </div> </div> <input type="hidden" name="token" value="{{token}}" /> <input type="submit" class="btn btn-success" value="Add Exam"></input> </form> + +<script type="application/javascript"><!-- +document.addEventListener("DOMContentLoaded", function () { + var dateSettings = { + format: 'yyyy-mm-dd', + weekStart: 1, + startDate: 'today', + }; + var timeSettings = { + showSeconds: false, + showMeridian: false + }; + $('.datepicker').datepicker(dateSettings); + $('.timepicker').timepicker(timeSettings); +}, false); +// --></script> |