diff options
author | Philip Häusler <msquare@notrademark.de> | 2011-09-06 20:45:06 +0200 |
---|---|---|
committer | Philip Häusler <msquare@notrademark.de> | 2011-09-06 20:45:06 +0200 |
commit | e665d1701ff588ad6d25ebad0876eca0ca72eafd (patch) | |
tree | 2a6419162ee7164e2050eeb7c0463a335d9f9792 | |
parent | 28b50acb88292392be2913be9df3e975829bb1dc (diff) |
create multiple shifts
-rw-r--r-- | includes/pages/admin_shifts.php | 50 | ||||
-rw-r--r-- | public/css/base.css | 32 | ||||
-rw-r--r-- | public/index.php | 4 | ||||
-rw-r--r-- | public/pic/engelsystem_logo.png | bin | 8736 -> 8177 bytes | |||
-rw-r--r-- | templates/admin_shifts.html | 67 | ||||
-rw-r--r-- | templates/admin_shifts_angel_types.html | 14 |
6 files changed, 167 insertions, 0 deletions
diff --git a/includes/pages/admin_shifts.php b/includes/pages/admin_shifts.php new file mode 100644 index 00000000..b6239f17 --- /dev/null +++ b/includes/pages/admin_shifts.php @@ -0,0 +1,50 @@ +<?php + + +// Assistent zum Anlegen mehrerer neuer Schichten +function admin_shifts() { + $msg = ""; + $ok = true; + + // Name/Bezeichnung der Schicht, darf nicht leer sein + if (isset ($_REQUEST['name']) && strlen($_REQUEST['name']) > 0) + $name = strip_request_item('name'); + else { + $ok = false; + $name = ""; + $msg .= error("Gib bitte einen Namen für die Schicht(en) an."); + } + + // Auswahl der sichtbaren Locations für die Schichten + $rooms = sql_select("SELECT * FROM `Room` WHERE `show`='Y' ORDER BY `Name`"); + $room_array = array (); + foreach ($rooms as $room) + $room_array[$room['RID']] = $room['Name']; + + if (isset ($_REQUEST['rid']) && preg_match("/^[0-9]+$/") && isset ($room_array[$_REQUEST['rid']])) + $rid = $_REQUEST['rid']; + else { + $ok = false; + $rid = 0; + $msg .= error("Wähle bitte einen Raum aus."); + } + + + + $room_select = html_select_key('rid', $room_array, ''); + + $types = sql_select("SELECT * FROM `AngelTypes` ORDER BY `Name`"); + $angel_types = ""; + foreach ($types as $type) { + $angel_types .= template_render('../templates/admin_shifts_angel_types.html', array ( + 'id' => $type['TID'], + 'type' => $type['Name'], + 'value' => "0" + )); + } + return template_render('../templates/admin_shifts.html', array ( + 'angel_types' => $angel_types, + 'room_select' => $room_select + )); +} +?>
\ No newline at end of file diff --git a/public/css/base.css b/public/css/base.css index 2849f244..e93d2a9b 100644 --- a/public/css/base.css +++ b/public/css/base.css @@ -108,6 +108,15 @@ table { border-collapse: collapse; } +fieldset hr { + background-color: #f0f0f0; + border: none; + color: #f0f0f0; + height: 1px; + margin: 0; + padding: 0; +} + fieldset table { margin: 4px; } @@ -115,6 +124,7 @@ fieldset table { fieldset p { clear: both; margin: 4px; + min-height: 23px; } fieldset p label { @@ -123,6 +133,11 @@ fieldset p label { width: 200px; } +fieldset p label input { + float: right; + margin: 2px 10px 0 0; +} + th { background: #f0f0f0; } @@ -226,3 +241,20 @@ tr:hover .hidden { .done { text-decoration: line-through; } + +.spinner a { + background: #f0f0f0; + border: 1px solid #888; + padding: 1px 5px; + text-decoration: none; +} + +.spinner input { + border: 1px solid #888; + border-left: none; + border-right: none; + padding: 3px 3px 1px 3px; + margin: 0; + text-align: right; + width: 42px; +} diff --git a/public/index.php b/public/index.php index 7f24ee42..22a139ef 100644 --- a/public/index.php +++ b/public/index.php @@ -122,6 +122,10 @@ if (in_array($p, $privileges)) { require_once ('includes/pages/admin_import.php'); $content = admin_import(); } + elseif ($p == "admin_shifts") { + require_once ('includes/pages/admin_shifts.php'); + $content = admin_shifts(); + } elseif ($p == "admin_log") { require_once ('includes/pages/admin_log.php'); $content = admin_log(); diff --git a/public/pic/engelsystem_logo.png b/public/pic/engelsystem_logo.png Binary files differindex b017302e..6713dfcd 100644 --- a/public/pic/engelsystem_logo.png +++ b/public/pic/engelsystem_logo.png diff --git a/templates/admin_shifts.html b/templates/admin_shifts.html new file mode 100644 index 00000000..3c8da90c --- /dev/null +++ b/templates/admin_shifts.html @@ -0,0 +1,67 @@ +<form action="" method="post"> + <fieldset> + <p> + <label> + Name/Beschreibung: + </label> + <input type="text" name="name" value="%name%" /> + </p> + <p> + <label> + Ort: + </label>%room_select% + </p> + <p> + <label> + Beginn: + </label> + <input type="text" value="" /> + </p> + <p> + <label> + Ende: + </label> + <input type="text" value="" /> + </p><h2>Modus:</h2> + <p> + <label> + <input type="radio" name="method" value="single" /> + </label>Eine Schicht erstellen. + </p> + <p> + <label> + <input type="radio" name="method" value="multi" /> + </label>Mehrere Schichten erstellen: + </p> + <p> + <label> + Schichtlänge in Minuten: + </label> + <input type="text" name="length" value="120" /> + </p> + <p> + <label> + <input type="radio" name="method" value="variable" /> + </label>Mehrere Schichten mit variabler Länge erstellen: + </p> + <p> + <label> + Schichtwechsel-Stunden: + </label> + <input type="text" name="change_hours" value="00, 04, 08, 10, 12, 14, 16, 18, 20, 22" /> + </p><h2>Benötigte Engel:</h2> + <p> + <label> + <input type="radio" name="angelmode" value="location" /> + </label>Benötigte Engel vom Ort übernehmen. + </p> + <p> + <label> + <input type="radio" name="angelmode" value="manually" /> + </label>Es werden folgende Engel benötigt: + </p>%angel_types% + <p> + <input type="submit" name="preview" value="Vorschau" /> + </p> + </fieldset> +</form>
\ No newline at end of file diff --git a/templates/admin_shifts_angel_types.html b/templates/admin_shifts_angel_types.html new file mode 100644 index 00000000..49f60ce1 --- /dev/null +++ b/templates/admin_shifts_angel_types.html @@ -0,0 +1,14 @@ +<p> + <label> + %type%: + </label> + <span class="spinner"><a id="type_%id%_down" href="#">-</a><input type="text" id="type_%id%" name="type_%id%" value="%value%" /><a id="type_%id%_up" href="#">+</a></span> + <script type="text/javascript"> + document.getElementById("type_%id%_up").onclick = function(e){ + document.getElementById("type_%id%").value = parseInt(document.getElementById("type_%id%").value) + 1; + }; + var down = document.getElementById("type_%id%_down").onclick = function(e){ + document.getElementById("type_%id%").value = parseInt(document.getElementById("type_%id%").value) - 1; + }; + </script> +</p> |