create multiple shifts
parent
28b50acb88
commit
e665d1701f
@ -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
|
||||
));
|
||||
}
|
||||
?>
|
Binary file not shown.
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.0 KiB |
@ -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>
|
@ -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>
|
Loading…
Reference in New Issue