#44 angeltypes recreated

main
Philip Häusler 13 years ago
parent 5e5443fad6
commit def9532d6b

@ -69,7 +69,7 @@ function admin_rooms() {
foreach ($room_angel_types as $room_angel_type) {
if ($room_angel_type['count'] == "")
$room_angel_type['count'] = "0";
$angel_types .= '<tr><td>' . $room_angel_type['Name'] . '</td><td><input type="text" name="angel_type_' . $room_angel_type['TID'] . '" value="' . $room_angel_type['count'] . '" /></td></tr>';
$angel_types .= '<tr><td>' . $room_angel_type['name'] . '</td><td><input type="text" name="angel_type_' . $room_angel_type['TID'] . '" value="' . $room_angel_type['count'] . '" /></td></tr>';
}
$html .= template_render('../templates/admin_rooms_edit_form.html', array (

@ -24,7 +24,7 @@ function admin_shifts() {
$types = sql_select("SELECT * FROM `AngelTypes` ORDER BY `name`");
$needed_angel_types = array ();
foreach ($types as $type)
$needed_angel_types[$type['TID']] = 0;
$needed_angel_types[$type['id']] = 0;
if (isset ($_REQUEST['preview']) || isset ($_REQUEST['back'])) {
// Name/Bezeichnung der Schicht, darf leer sein
@ -92,11 +92,11 @@ function admin_shifts() {
elseif ($_REQUEST['angelmode'] == 'manually') {
$angelmode = 'manually';
foreach ($types as $type) {
if (isset ($_REQUEST['type_' . $type['TID']]) && preg_match("/^[0-9]+$/", trim($_REQUEST['type_' . $type['TID']]))) {
$needed_angel_types[$type['TID']] = trim($_REQUEST['type_' . $type['TID']]);
if (isset ($_REQUEST['type_' . $type['id']]) && preg_match("/^[0-9]+$/", trim($_REQUEST['type_' . $type['id']]))) {
$needed_angel_types[$type['id']] = trim($_REQUEST['type_' . $type['id']]);
} else {
$ok = false;
$msg .= error("Bitte überprüfe die Eingaben für die benötigten Engel des Typs " . $type['Name'] . ".");
$msg .= error("Bitte überprüfe die Eingaben für die benötigten Engel des Typs " . $type['name'] . ".");
}
}
if (array_sum($needed_angel_types) == 0) {
@ -196,8 +196,8 @@ function admin_shifts() {
$shifts_table .= '<tr><td>' . date("Y-m-d H:i", $shift['start']) . ' - ' . date("H:i", $shift['end']) . '<br />' . $room_array[$shift['RID']] . '</td>';
$shifts_table .= '<td>' . $shift['name'];
foreach ($types as $type) {
if (isset ($needed_angel_types[$type['TID']]) && $needed_angel_types[$type['TID']] > 0)
$shifts_table .= '<br /><b>' . $type['Name'] . ':</b> ' . $needed_angel_types[$type['TID']] . ' missing';
if (isset ($needed_angel_types[$type['id']]) && $needed_angel_types[$type['id']] > 0)
$shifts_table .= '<br /><b>' . $type['name'] . ':</b> ' . $needed_angel_types[$type['id']] . ' missing';
}
$shifts_table .= '</td></tr>';
}
@ -249,8 +249,8 @@ function admin_shifts() {
foreach ($types as $type) {
$angel_types .= template_render('../templates/admin_shifts_angel_types.html', array (
'id' => $type['TID'],
'type' => $type['Name'],
'value' => $needed_angel_types[$type['TID']]
'type' => $type['name'],
'value' => $needed_angel_types[$type['id']]
));
}
return template_render('../templates/admin_shifts.html', array (

@ -3,6 +3,31 @@
// Engel registrieren
function guest_register() {
$nick = "";
$lastname = "";
$prename = "";
$age = 23;
$tel = "";
$dect = "";
$mobile = "";
$mail = "";
return page(array (
Get_Text("makeuser_text1"),
form(array (
form_text('nick', Get_Text("makeuser_Nickname") . "*", $nick),
form_text('lastname', Get_Text("makeuser_Nachname"), $lastname),
form_text('lastname', Get_Text("makeuser_Vorname"), $lastname),
form_text('age', Get_Text("makeuser_Alter"), $age),
form_text('tel', Get_Text("makeuser_Telefon"), $tel),
form_text('dect', Get_Text("makeuser_DECT"), $tel),
form_text('mobile', Get_Text("makeuser_Handy"), $mobile),
form_text('mail', Get_Text("makeuser_E-Mail") . "*", $mail),
info(Get_Text("makeuser_text3"), true),
form_submit('submit', Get_Text("makeuser_Anmelden"))
))
));
global $SubscribeMailinglist, $enable_tshirt_size;
$html = "";
@ -170,7 +195,7 @@ function guest_register() {
$engel_types = sql_select("SELECT * FROM `AngelTypes` ORDER BY `name`");
foreach ($engel_types as $engel_type) {
$Name = $engel_type['Name'] . Get_Text("inc_schicht_engel");
$Name = $engel_type['name'] . Get_Text("inc_schicht_engel");
$html .= "<option value=\"" . $Name . "\"";
if ($_POST["Art"] == $Name)

@ -79,11 +79,11 @@ function user_shifts() {
}
foreach ($types as $type) {
if (isset ($_REQUEST['type_' . $type['TID']]) && preg_match("/^[0-9]+$/", trim($_REQUEST['type_' . $type['TID']]))) {
$needed_angel_types[$type['TID']] = trim($_REQUEST['type_' . $type['TID']]);
if (isset ($_REQUEST['type_' . $type['id']]) && preg_match("/^[0-9]+$/", trim($_REQUEST['type_' . $type['id']]))) {
$needed_angel_types[$type['id']] = trim($_REQUEST['type_' . $type['id']]);
} else {
$ok = false;
$msg .= error("Bitte überprüfe die Eingaben für die benötigten Engel des Typs " . $type['Name'] . ".");
$msg .= error("Bitte überprüfe die Eingaben für die benötigten Engel des Typs " . $type['name'] . ".");
}
}
if (array_sum($needed_angel_types) == 0) {
@ -105,8 +105,8 @@ function user_shifts() {
foreach ($types as $type) {
$angel_types .= template_render('../templates/admin_shifts_angel_types.html', array (
'id' => $type['TID'],
'type' => $type['Name'],
'value' => $needed_angel_types[$type['TID']]
'type' => $type['name'],
'value' => $needed_angel_types[$type['id']]
));
}
return template_render('../templates/user_shifts_edit.html', array (
@ -206,7 +206,7 @@ function user_shifts() {
'title' => $shift['name'],
'location' => $shift['Name'],
'angel' => $user_text,
'type' => $type['Name'],
'type' => $type['name'],
'comment' => ""
));
} else {
@ -262,7 +262,7 @@ function user_shifts() {
} else
$entry_list[] = ($angeltype['count'] - count($entries)) . ' Helfer gebraucht';
$shift_row .= '<b>' . $angeltype['Name'] . ':</b> ';
$shift_row .= '<b>' . $angeltype['name'] . ':</b> ';
$shift_row .= join(", ", $entry_list);
$shift_row .= '<br />';
}

@ -24,14 +24,14 @@ function load_shift_basics() {
}
// erstellt ein Array der Engeltypen
$engel_types = sql_select("SELECT `TID`, `Name` FROM `EngelType` ORDER BY `Name`");
$engel_types = sql_select("SELECT * FROM `EngelType` ORDER BY `name`");
foreach ($engel_types as $engel_type) {
$EngelType[$i] = array (
'TID' => $engel_type['TID'],
'Name' => $engel_type['Name'] . Get_Text("inc_schicht_engel")
'id' => $engel_type['id'],
'name' => $engel_type['name'] . Get_Text("inc_schicht_engel")
);
$EngelTypeID[$engel_type['TID']] = $engel_type['Name'] . Get_Text("inc_schicht_engel");
$TID2Name[$engel_type['TID']] = $engel_type['Name'];
$EngelTypeID[$engel_type['id']] = $engel_type['name'] . Get_Text("inc_schicht_engel");
$TID2Name[$engel_type['id']] = $engel_type['name'];
}
// Erste Schicht suchen

@ -200,6 +200,7 @@ tr:hover .hidden {
border: 1px solid #888;
border-radius: 2px;
color: #000;
margin-bottom: 10px;
padding: 5px;
}

Loading…
Cancel
Save