Treffen | " . html_select_key('eTreffen', 'eTreffen', array (
'1' => "Ja",
'0' => "Nein"
diff --git a/includes/pages/admin_questions.php b/includes/pages/admin_questions.php
index 1e410f07..516d52c9 100644
--- a/includes/pages/admin_questions.php
+++ b/includes/pages/admin_questions.php
@@ -18,28 +18,42 @@ function admin_questions() {
if (!isset ($_REQUEST['action'])) {
$open_questions = "";
$questions = sql_select("SELECT * FROM `Questions` WHERE `AID`=0");
- foreach ($questions as $question)
+ foreach ($questions as $question) {
+ $user_source = User($question['UID']);
+ if($user_source === false)
+ engelsystem_error("Unable to load user.");
+
$open_questions .= template_render(
'../templates/admin_question_unanswered.html', array (
- 'question_nick' => UID2Nick($question['UID']),
+ 'question_nick' => User_Nick_render($user_source),
'question_id' => $question['QID'],
'link' => page_link_to("admin_questions"),
'question' => str_replace("\n", ' ', $question['Question'])
));
+ }
$answered_questions = "";
$questions = sql_select("SELECT * FROM `Questions` WHERE `AID`>0");
- foreach ($questions as $question)
+ foreach ($questions as $question) {
+ $user_source = User($question['UID']);
+ if($user_source === false)
+ engelsystem_error("Unable to load user.");
+
+ $answer_user_source = User($question['AID']);
+ if($answer_user_source === false)
+ engelsystem_error("Unable to load user.");
+
$answered_questions .= template_render(
'../templates/admin_question_answered.html', array (
'question_id' => $question['QID'],
- 'question_nick' => UID2Nick($question['UID']),
+ 'question_nick' => User_Nick_render($user_source),
'question' => str_replace("\n", " ", $question['Question']),
- 'answer_nick' => UID2Nick($question['AID']),
+ 'answer_nick' => User_Nick_render($answer_user_source),
'answer' => str_replace("\n", " ", $question['Answer']),
'link' => page_link_to("admin_questions"),
));
+ }
return template_render('../templates/admin_questions.html', array (
'link' => page_link_to("admin_questions"),
diff --git a/includes/pages/admin_user.php b/includes/pages/admin_user.php
index 0c9f9bbe..58b2947e 100644
--- a/includes/pages/admin_user.php
+++ b/includes/pages/admin_user.php
@@ -26,38 +26,38 @@ function admin_user() {
$html .= "\n";
$html .= " Nick | " .
" | \n";
+ $user_source['Nick'] . "\">\n";
$html .= " lastLogIn | " .
- date("Y-m-d H:i", mysql_result($Erg, 0, "lastLogIn")) . " | \n";
+ date("Y-m-d H:i", $user_source['lastLogIn']) . "\n";
$html .= " Name | " .
" | \n";
+ $user_source['Name'] . "\">\n";
$html .= " Vorname | " .
" | \n";
+ $user_source['Vorname'] . "\">\n";
$html .= " Alter | " .
" | \n";
+ $user_source['Alter'] . "\">\n";
$html .= " Telefon | " .
" | \n";
+ $user_source['Telefon'] . "\">\n";
$html .= " Handy | " .
" | \n";
+ $user_source['Handy'] . "\">\n";
$html .= " DECT | " .
" | \n";
+ $user_source['DECT'] . "\">\n";
$html .= " email | " .
" | \n";
+ $user_source['email'] . "\">\n";
$html .= " ICQ | " .
" | \n";
+ $user_source['ICQ'] . "\">\n";
$html .= " jabber | " .
" | \n";
+ $user_source['jabber'] . "\">\n";
$html .= " Size | " .
- html_select_key('size', 'eSize', $tshirt_sizes, mysql_result($Erg, 0, "Size")) . " | \n";
+ html_select_key('size', 'eSize', $tshirt_sizes, $user_source['Size']) . "\n";
$options = array (
'1' => "Yes",
@@ -66,21 +66,21 @@ function admin_user() {
// Gekommen?
$html .= " Gekommen | \n";
- $html .= html_options('eGekommen', $options, mysql_result($Erg, 0, "Gekommen")) . " | \n";
+ $html .= html_options('eGekommen', $options, $user_source['Gekommen']) . "\n";
// Aktiv?
$html .= " Aktiv | \n";
- $html .= html_options('eAktiv', $options, mysql_result($Erg, 0, "Aktiv")) . " | \n";
+ $html .= html_options('eAktiv', $options, $user_source['Aktiv']) . "\n";
// T-Shirt bekommen?
$html .= " T-Shirt | \n";
- $html .= html_options('eTshirt', $options, mysql_result($Erg, 0, "Tshirt")) . " | \n";
+ $html .= html_options('eTshirt', $options, $user_source['Tshirt']) . "\n";
$html .= " Hometown | " .
" | \n";
+ $user_source['Hometown'] . "\">\n";
- $html .= " \n | " . displayavatar($id, false) . " |
";
+ $html .= "\n';
$html .= '';
$html .= date("Y-m-d H:i", $news['Datum']) . ', ';
- $html .= UID2Nick($news['UID']);
+
+ $user_source = User($news['UID']);
+ if($user_source === false)
+ engelsystem_error("Unable to load user.");
+
+ $html .= User_Nick_render($user_source);
if ($p != "news_comments")
$html .= ', Kommentare (' . sql_num_query("SELECT * FROM `news_comments` WHERE `Refid`='" . sql_escape($news['ID']) . "'") . ') »';
$html .= ' ';
@@ -69,11 +74,15 @@ function user_news_comments() {
$comments = sql_select("SELECT * FROM `news_comments` WHERE `Refid`='" . sql_escape($nid) . "' ORDER BY 'ID'");
foreach ($comments as $comment) {
+ $user_source = User($comment['UID']);
+ if($user_source === false)
+ engelsystem_error("Unable to load user.");
+
$html .= '';
diff --git a/includes/pages/user_questions.php b/includes/pages/user_questions.php
index 5d55f647..97035546 100644
--- a/includes/pages/user_questions.php
+++ b/includes/pages/user_questions.php
@@ -12,7 +12,12 @@ function user_questions() {
$questions = sql_select("SELECT * FROM `Questions` WHERE `AID`>0 AND `UID`=" . sql_escape($user['UID']));
foreach ($questions as $question) {
$answered_questions .= '' . str_replace("\n", ' ', $question['Question']) . ' | ';
- $answered_questions .= '' . UID2Nick($question['AID']) . ' | ' . str_replace("\n", ' ', $question['Answer']) . ' | ';
+
+ $answer_user_source = User($question['AID']);
+ if($answer_user_source === false)
+ engelsystem_error("Unable to load user.");
+
+ $answered_questions .= '' . User_Nick_render($answer_user_source) . ' | ' . str_replace("\n", ' ', $question['Answer']) . ' | ';
$answered_questions .= 'Löschen |
';
}
diff --git a/includes/pages/user_wakeup.php b/includes/pages/user_wakeup.php
index c897d43e..63aff97c 100644
--- a/includes/pages/user_wakeup.php
+++ b/includes/pages/user_wakeup.php
@@ -1,86 +1,87 @@
getTimestamp();
- $bemerkung = strip_request_item_nl('Bemerkung');
- $ort = strip_request_item('Ort');
- $SQL = "INSERT INTO `Wecken` (`UID`, `Date`, `Ort`, `Bemerkung`) "
- . "VALUES ('" . sql_escape($user['UID']) . "', '"
- . sql_escape($date) . "', '" . sql_escape($ort) . "', " . "'"
- . sql_escape($bemerkung) . "')";
- sql_query($SQL);
- $html .= success(Get_Text(4), true);
- } else
- $html .= error("Broken date!", true);
- break;
+ if (isset ($_REQUEST['action'])) {
+ switch ($_REQUEST['action']) {
+ case 'create' :
+ $date = DateTime::createFromFormat("Y-m-d H:i", $_REQUEST['Date']);
+ if ($date != null) {
+ $date = $date->getTimestamp();
+ $bemerkung = strip_request_item_nl('Bemerkung');
+ $ort = strip_request_item('Ort');
+ $SQL = "INSERT INTO `Wecken` (`UID`, `Date`, `Ort`, `Bemerkung`) "
+ . "VALUES ('" . sql_escape($user['UID']) . "', '"
+ . sql_escape($date) . "', '" . sql_escape($ort) . "', " . "'"
+ . sql_escape($bemerkung) . "')";
+ sql_query($SQL);
+ $html .= success(Get_Text(4), true);
+ } else
+ $html .= error("Broken date!", true);
+ break;
- case 'delete' :
- if (isset ($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id']))
- $id = $_REQUEST['id'];
- else
- return error("Incomplete call, missing wake-up ID.", true);
+ case 'delete' :
+ if (isset ($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id']))
+ $id = $_REQUEST['id'];
+ else
+ return error("Incomplete call, missing wake-up ID.", true);
- $wakeup = sql_select("SELECT * FROM `Wecken` WHERE `ID`=" . sql_escape($id) . " LIMIT 1");
- if (count($wakeup) > 0 && $wakeup[0]['UID'] == $user['UID']) {
- sql_query("DELETE FROM `Wecken` WHERE `ID`=" . sql_escape($id) . " LIMIT 1");
- $html .= success("Wake-up call deleted.", true);
- } else
- return error("No wake-up found.", true);
- break;
- }
- }
+ $wakeup = sql_select("SELECT * FROM `Wecken` WHERE `ID`=" . sql_escape($id) . " LIMIT 1");
+ if (count($wakeup) > 0 && $wakeup[0]['UID'] == $user['UID']) {
+ sql_query("DELETE FROM `Wecken` WHERE `ID`=" . sql_escape($id) . " LIMIT 1");
+ $html .= success("Wake-up call deleted.", true);
+ } else
+ return error("No wake-up found.", true);
+ break;
+ }
+ }
- $html .= "" . Get_Text("Hello") . User_Nick_render($user) . ",
"
- . Get_Text("pub_wake_beschreibung") . "
\n\n";
- $html .= Get_Text("pub_wake_beschreibung2");
- $html .= '
-
+ $html .= "" . Get_Text("Hello") . User_Nick_render($user) . ",
"
+ . Get_Text("pub_wake_beschreibung") . "
\n\n";
+ $html .= Get_Text("pub_wake_beschreibung2");
+ $html .= '
+
- ' . Get_Text("pub_wake_Datum") . ' |
- ' . Get_Text("pub_waeckliste_Nick") . ' |
- ' . Get_Text("pub_wake_Ort") . ' |
- ' . Get_Text("pub_wake_Bemerkung") . ' |
- |
-
-';
+ ' . Get_Text("pub_wake_Datum") . ' |
+ ' . Get_Text("pub_waeckliste_Nick") . ' |
+ ' . Get_Text("pub_wake_Ort") . ' |
+ ' . Get_Text("pub_wake_Bemerkung") . ' |
+ |
+
+ ';
- $sql = "SELECT * FROM `Wecken` ORDER BY `Date` ASC";
- $Erg = sql_query($sql);
- $count = mysql_num_rows($Erg);
+ $wecken_source = sql_select("SELECT * FROM `Wecken` ORDER BY `Date` ASC");
+ foreach($wecken_source as $wecken) {
+ $html .= '';
+ $html .= '' . date("Y-m-d H:i", $wecken['Date']) . ' | ';
- for ($i = 0; $i < $count; $i++) {
- $row = mysql_fetch_row($Erg);
- $html .= '
';
- $html .= '' . date("Y-m-d H:i", mysql_result($Erg, $i, "Date")) . ' | ';
- $html .= '' . UID2Nick(mysql_result($Erg, $i, "UID")) . ' | ';
- $html .= '' . mysql_result($Erg, $i, "Ort") . ' | ';
- $html .= '' . mysql_result($Erg, $i, "Bemerkung") . ' | ';
- if (mysql_result($Erg, $i, "UID") == $user['UID'])
- $html .= '" . Get_Text("pub_wake_del") . ' | ';
- else
- $html .= ' | ';
- $html .= '
';
- }
+ $user_source = User($wecken['UID']);
+ if($user_source === false)
+ engelsystem_error("Unable to load user.");
- $html .= '
' . Get_Text("pub_wake_Text2");
+ $html .= '' . User_Nick_render($user_source) . ' | ';
+ $html .= '' . $wecken['Ort'] . ' | ';
+ $html .= '' . $wecken['Bemerkung'] . ' | ';
+ if ($wecken['UID'] == $user['UID'])
+ $html .= '" . Get_Text("pub_wake_del") . ' | ';
+ else
+ $html .= ' | ';
+ $html .= '';
+ }
- $html .= template_render('../templates/user_wakeup.html', array (
- 'wakeup_link' => page_link_to("user_wakeup"),
- 'date_text' => Get_Text("pub_wake_Datum"),
- 'date_value' => date("Y-m-d H:i"),
- 'place_text' => Get_Text("pub_wake_Ort"),
- 'comment_text' => Get_Text("pub_wake_Bemerkung"),
- 'comment_value' => "Knock knock Leo, follow the white rabbit to the blue tent",
- 'submit_text' => Get_Text("pub_wake_bouton")
- ));
- return $html;
+ $html .= '
' . Get_Text("pub_wake_Text2");
+
+ $html .= template_render('../templates/user_wakeup.html', array (
+ 'wakeup_link' => page_link_to("user_wakeup"),
+ 'date_text' => Get_Text("pub_wake_Datum"),
+ 'date_value' => date("Y-m-d H:i"),
+ 'place_text' => Get_Text("pub_wake_Ort"),
+ 'comment_text' => Get_Text("pub_wake_Bemerkung"),
+ 'comment_value' => "Knock knock Leo, follow the white rabbit to the blue tent",
+ 'submit_text' => Get_Text("pub_wake_bouton")
+ ));
+ return $html;
}
?>
diff --git a/includes/sys_auth.php b/includes/sys_auth.php
index 4ca56632..a2fd98d8 100644
--- a/includes/sys_auth.php
+++ b/includes/sys_auth.php
@@ -31,8 +31,7 @@ function generate_salt($length = 16) {
// set the password of a user
function set_password($uid, $password) {
- $res = sql_query("UPDATE `User` SET `Passwort` = '" . sql_escape(crypt($password, CRYPT_ALG . '$' . generate_salt(16) . '$')) . "' WHERE `UID` = " . intval($uid) . " LIMIT 1");
- return $res && (mysql_affected_rows() > 0);
+ return sql_query("UPDATE `User` SET `Passwort` = '" . sql_escape(crypt($password, CRYPT_ALG . '$' . generate_salt(16) . '$')) . "' WHERE `UID` = " . intval($uid) . " LIMIT 1");
}
// verify a password given a precomputed salt.
@@ -72,8 +71,6 @@ function json_auth_service() {
if (count($Erg) == 1) {
$Erg = $Erg[0];
if (verify_password($Pass, $Erg["Passwort"], $Erg["UID"])) {
- $UID = mysql_result($Erg, 0, "UID");
-
$user_privs = sql_select("SELECT `Privileges`.`name` FROM `User` JOIN `UserGroups` ON (`User`.`UID` = `UserGroups`.`uid`) JOIN `GroupPrivileges` ON (`UserGroups`.`group_id` = `GroupPrivileges`.`group_id`) JOIN `Privileges` ON (`GroupPrivileges`.`privilege_id` = `Privileges`.`id`) WHERE `User`.`UID`=" . sql_escape($UID) . ";");
foreach ($user_privs as $user_priv)
$privileges[] = $user_priv['name'];
diff --git a/includes/sys_lang.php b/includes/sys_lang.php
deleted file mode 100644
index 3a043614..00000000
--- a/includes/sys_lang.php
+++ /dev/null
@@ -1,38 +0,0 @@
- "Deutsch",
- 'EN' => "English"
-);
-
-function Get_Text($TextID, $NoError = false) {
- global $con, $error_messages, $debug;
-
- if (!isset ($_SESSION['Sprache']))
- $_SESSION['Sprache'] = "EN";
- if ($_SESSION['Sprache'] == "")
- $_SESSION['Sprache'] = "EN";
- if (isset ($_GET["SetLanguage"]))
- $_SESSION['Sprache'] = $_GET["SetLanguage"];
-
- $SQL = "SELECT * FROM `Sprache` WHERE TextID=\"$TextID\" AND Sprache ='" . $_SESSION['Sprache'] . "'";
- @ $Erg = mysql_query($SQL, $con);
-
- if (mysql_num_rows($Erg) == 1)
- return mysql_result($Erg, 0, "Text");
- elseif ($NoError && !$debug)
- return "";
- elseif ($debug)
- return "Error Data, '$TextID' found " . mysql_num_rows($Erg) . "x";
- else
- return $TextID;
-}
-
-function Print_Text($TextID, $NoError = false) {
- echo Get_Text($TextID, $NoError);
-}
-?>
diff --git a/includes/sys_mysql.php b/includes/sys_mysql.php
deleted file mode 100644
index 1315a4f6..00000000
--- a/includes/sys_mysql.php
+++ /dev/null
@@ -1,84 +0,0 @@
-
diff --git a/includes/sys_page.php b/includes/sys_page.php
index 06e41274..a49e76cb 100644
--- a/includes/sys_page.php
+++ b/includes/sys_page.php
@@ -46,59 +46,4 @@ function check_email($email) {
return (bool) preg_match("#^([a-zA-Z0-9_+\-])+(\.([a-zA-Z0-9_+\-])+)*@((\[(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5]))\]))|((([\p{L}0-9])+(([\-])+([\p{L}0-9])+)*\.)+([\p{L}])+(([\-])+([\p{L}0-9])+)*))$#u", $email);
}
-/**
- * Gibt zwischengespeicherte Fehlermeldungen zurück und löscht den Zwischenspeicher
- */
-function msg() {
- if (!isset ($_SESSION['msg']))
- return "";
- $msg = $_SESSION['msg'];
- $_SESSION['msg'] = "";
- return $msg;
-}
-
-/**
- * Rendert eine Information
- */
-function info($msg, $immediatly = false) {
- if ($immediatly) {
- if ($msg == "")
- return "";
- return '' . $msg . '
';
- } else {
- if (!isset ($_SESSION['msg']))
- $_SESSION['msg'] = "";
- $_SESSION['msg'] .= info($msg, true);
- }
-}
-
-/**
- * Rendert eine Fehlermeldung
- */
-function error($msg, $immediatly = false) {
- if ($immediatly) {
- if ($msg == "")
- return "";
- return '' . $msg . '
';
- } else {
- if (!isset ($_SESSION['msg']))
- $_SESSION['msg'] = "";
- $_SESSION['msg'] .= error($msg, true);
- }
-}
-
-/**
- * Rendert eine Erfolgsmeldung
- */
-function success($msg, $immediatly = false) {
- if ($immediatly) {
- if ($msg == "")
- return "";
- return '' . $msg . '
';
- } else {
- if (!isset ($_SESSION['msg']))
- $_SESSION['msg'] = "";
- $_SESSION['msg'] .= success($msg, true);
- }
-}
?>
diff --git a/includes/sys_shift.php b/includes/sys_shift.php
deleted file mode 100644
index 728e7a83..00000000
--- a/includes/sys_shift.php
+++ /dev/null
@@ -1,454 +0,0 @@
- $r) {
- $Room[$i] = array (
- 'RID' => $r['RID'],
- 'Name' => $r['Name']
- );
- $RoomID[$r['RID']] = $r['Name'];
- }
-
- // erstellt ein Array der Engeltypen
- $engel_types = sql_select("SELECT * FROM `EngelType` ORDER BY `name`");
- foreach ($engel_types as $engel_type) {
- $EngelType[$i] = array (
- 'id' => $engel_type['id'],
- 'name' => $engel_type['name'] . Get_Text("inc_schicht_engel")
- );
- $EngelTypeID[$engel_type['id']] = $engel_type['name'] . Get_Text("inc_schicht_engel");
- $TID2Name[$engel_type['id']] = $engel_type['name'];
- }
-
- // Erste Schicht suchen
- $Pos = 0;
- $first_shift = sql_select("SELECT `DateS` FROM `Shifts` ORDER BY `DateS` LIMIT 1");
- if (count($first_shift) > 0) {
- do {
- // Startdatum einlesen und link ausgeben
- $DateS = substr($first_shift[0]['DateS'], 0, 10);
- $VeranstaltungsTage[$Pos++] = $DateS;
-
- // auslesen den endes und eventuelle weitere tage ausgeben
- $last_shift = sql_select("SELECT MAX(`DateE`) FROM `Shifts` WHERE ( (`DateS` like '" . sql_escape($DateS) . "%') AND NOT (`DateE` like '%00:00:00'))");
- $DateE = substr($last_shift[0]['DateE'], 0, 10);
-
- if (strlen($DateE) == 0)
- $DateE = $DateS;
- else
- while ($DateS != $DateE) {
- $DateS = DatumUm1TagErhoehen($DateS);
- $VeranstaltungsTage[$Pos++] = $DateS;
- }
-
- // suchen den nächsten eintrag
- $first_shift = sql_select("SELECT `DateS` FROM `Shifts` " . "WHERE (`DateS` > '" . sql_escape($DateE) . " 23:59:59' ) " . "ORDER BY `DateS` " . "LIMIT 1");
- } while (count($first_shift) > 0);
- }
-
- $VeranstaltungsTageMax = $Pos -1;
-}
-
-/*#######################################################
-# gibt die engelschischten aus #
-#######################################################*/
-function ausgabe_Feld_Inhalt($SID, $Man) {
- // gibt, nach �bergabe der der SchichtID (SID) und der RaumBeschreibung,
- // die eingetragenden und und offenden Schichteint�ge zur�ck
- global $EngelType, $EngelTypeID, $TID2Name, $con, $debug, $gmdateOffset;
-
- $Spalten = "";
-
- if (!isset ($_GET["Icon"]))
- $_GET["Icon"] = 1;
-
- ///////////////////////////////////////////////////////////////////
- // Schow Admin Page
- ///////////////////////////////////////////////////////////////////
- $Spalten .= funktion_isLinkAllowed_addLink_OrEmpty("admin/schichtplan.php?action=change&SID=$SID", "edit
\n");
-
- ///////////////////////////////////////////////////////////////////
- // Ausgabe des Schichtnamens
- ///////////////////////////////////////////////////////////////////
- $SQL = "SELECT `URL` FROM `Shifts` WHERE (`SID` = '$SID');";
- $Erg = mysql_query($SQL, $con);
- if (mysql_result($Erg, 0, 0) != "")
- $Spalten .= "$Man:
";
- else
- $Spalten .= "" .
- $Man . ":
";
-
- ///////////////////////////////////////////////////////////////////
- // SQL abfrage f�r die ben�tigten schichten
- ///////////////////////////////////////////////////////////////////
- $SQL = "SELECT * FROM `ShiftEntry` WHERE (`SID` = '" . sql_escape($SID) . "') ORDER BY `TID`, `UID` DESC ;";
- $Erg = mysql_query($SQL, $con);
-
- $Anzahl = mysql_num_rows($Erg);
- $Feld = 0;
- $Temp_TID_old = -1;
- for ($i = 0; $i < $Anzahl; $i++) {
- if (isset ($Temp[$Feld]["TID"]))
- $Temp_TID_old = $Temp[$Feld]["TID"];
- if (isset ($Temp[$Feld]["UID"]))
- $Temp_UID_old = $Temp[$Feld]["UID"];
-
- $Temp_TID = mysql_result($Erg, $i, "TID");
-
- // wenn sich der Type �ndert wird zumn�sten feld geweckselt
- if ($Temp_TID_old != $Temp_TID)
- $Feld++;
-
- $Temp[$Feld]["TID"] = $Temp_TID;
- $Temp[$Feld]["UID"] = mysql_result($Erg, $i, "UID");
-
- // sonderfall ersten durchlauf
- if ($i == 0) {
- $Temp_TID_old = $Temp[$Feld]["TID"];
- $Temp_UID_old = $Temp[$Feld]["UID"];
- }
-
- // ist es eine zu vergeben schicht?
- if ($Temp[$Feld]["UID"] == 0) {
- if (isset ($Temp[$Feld]["free"]))
- $Temp[$Feld]["free"]++;
- else
- $Temp[$Feld]["free"] = 1;
- } else
- $Temp[$Feld]["Engel"][] = $Temp[$Feld]["UID"];
- } // FOR
-
- ///////////////////////////////////////////////////////////////////
- // Aus gabe der Schicht
- ///////////////////////////////////////////////////////////////////
- if (isset ($Temp))
- if (count($Temp))
- foreach ($Temp as $TempEntry => $TempValue) {
- if (!isset ($TempValue["free"]))
- $TempValue["free"] = 0;
-
- // ausgabe EngelType
- $Spalten .= $EngelTypeID[$TempValue["TID"]] . " ";
-
- // ausgabe Eingetragener Engel
- if (isset ($TempValue["Engel"]))
- if (count($TempValue["Engel"]) > 0) {
- if (count($TempValue["Engel"]) == 1)
- $Spalten .= Get_Text("inc_schicht_ist") . ":
\n";
- else
- $Spalten .= Get_Text("inc_schicht_sind") . ":
\n";
-
- foreach ($TempValue["Engel"] as $TempEngelEntry => $TempEngelID) {
- if (funktion_isLinkAllowed("admin/user.php") === TRUE) {
- // add color, wenn Engel "Gekommen"
- $TempText = ((UIDgekommen($TempEngelID) == "1") ? "" : "") .
- UID2Nick($TempEngelID) . "";
- } else {
- $TempText = UID2Nick($TempEngelID);
- }
-
- // add link to user
- $TempText = funktion_isLinkAllowed_addLink_OrLinkText("admin/userChangeNormal.php?enterUID=$TempEngelID&Type=Normal", $TempText);
-
- $Spalten .= " " . $TempText .
- (($_GET["Icon"] == 1) ? DisplayAvatar($TempEngelID) : "") .
- "
\n";
-
- }
- $Spalten = substr($Spalten, 0, strlen($Spalten) - 7);
- }
-
- // ausgabe ben�tigter Engel
- ////////////////////////////
- //in vergangenheit
- $SQLtime = "SELECT `DateE` FROM `Shifts` WHERE (`SID`='" . sql_escape($SID) . "' AND `DateE` >= '" .
- gmdate("Y-m-d H:i:s", time() + $gmdateOffset) . "')";
- $Ergtime = mysql_query($SQLtime, $con);
- if (mysql_num_rows($Ergtime) > 0) {
- //wenn keien rechte definiert sind
- if (!isset ($_SESSION['CVS'][$TID2Name[$TempValue["TID"]]]))
- $_SESSION['CVS'][$TID2Name[$TempValue["TID"]]] = "Y";
-
- if ($_SESSION['CVS'][$TID2Name[$TempValue["TID"]]] == "Y")
- if ($TempValue["free"] > 0) {
- $Spalten .= "
\n ";
- $Spalten .= $TempValue["free"];
- if ($TempValue["free"] != 1)
- $Spalten .= Get_Text("inc_schicht_weitere") .
- " " . Get_Text("inc_schicht_Engel") .
- Get_Text("inc_schicht_wird");
- else
- $Spalten .= Get_Text("inc_schicht_weiterer") .
- " " . Get_Text("inc_schicht_Engel") .
- Get_Text("inc_schicht_werden");
- $Spalten .= Get_Text("inc_schicht_noch_gesucht");
- $Spalten .= "";
- }
- } else {
- if (isset ($TempValue["free"]))
- if ($TempValue["free"] > 0)
- $Spalten .= "
\n ";
- }
- $Spalten .= "
\n";
-
- } // FOREACH
- return $Spalten;
-} // function Ausgabe_Feld_Inhalt
-
-/*#######################################################
-# gibt die engelschischten Druckergerecht aus #
-#######################################################*/
-function Ausgabe_Feld_Inhalt_Druck($RID, $Man) {
- // gibt, nach �bergabe der der SchichtID (SID) und der RaumBeschreibung,
- // die eingetragenden und und offenden Schichteint�ge zur�ck
-
-} // function Ausgabe_Feld_Inhalt
-
-/*#######################################################
-# Ausgabe der Raum Spalten #
-#######################################################*/
-function CreateRoomShifts($raum) {
- global $Spalten, $ausdatum, $con, $debug, $GlobalZeileProStunde, $error_messages;
-
- /////////////////////////////////////////////////////////////
- // beginnt die erste schicht vor dem heutigen tag und geht dar�ber hinaus
- /////////////////////////////////////////////////////////////
- $SQLSonder = "SELECT `SID`, `DateS`, `DateE` , `Len`, `Man` FROM `Shifts` " .
- "WHERE ((`RID` = '" . sql_escape($raum) . "') AND (`DateE` > '$ausdatum 23:59:59') AND " .
- "(`DateS` < '" . sql_escape($ausdatum) . " 00:00:00') ) ORDER BY `DateS`;";
- $ErgSonder = mysql_query($SQLSonder, $con);
- if ((mysql_num_rows($ErgSonder) > 1)) {
- if (funktion_isLinkAllowed("admin/schichtplan.php") === TRUE) {
- echo "" . Get_Text("pub_schichtplan_colision") . "
";
- for ($i = 0; $i < mysql_num_rows($ErgSonder); $i++) {
- echo "" .
- mysql_result($ErgSonder, $i, "DateS") .
- " '" . mysql_result($ErgSonder, $i, "Man") . "' (RID $raum) (00-24)" .
- "
\n";
- }
- }
- }
- elseif ((mysql_num_rows($ErgSonder) == 1)) {
- $Spalten[0] .= "\n" .
- "↑↑↑" .
- Ausgabe_Feld_Inhalt(mysql_result($ErgSonder, 0, "SID"), mysql_result($ErgSonder, 0, "Man")) .
- "↓↓↓" .
- "\n | \n";
- return;
- }
-
- $ZeitZeiger = 0;
-
- /////////////////////////////////////////////////////////////
- // beginnt die erste schicht vor dem heutigen tag?
- /////////////////////////////////////////////////////////////
- $SQLSonder = "SELECT `SID`, `DateS`, `DateE` , `Len`, `Man` FROM `Shifts` " .
- "WHERE ((`RID` = '" . sql_escape($raum) . "') AND (`DateE` > '" . sql_escape($ausdatum) . " 00:00:00') AND " .
- "(`DateS` < '" . sql_escape($ausdatum) . " 00:00:00') ) ORDER BY `DateS`;";
-
- $ErgSonder = mysql_query($SQLSonder, $con);
- if ((mysql_num_rows($ErgSonder) > 1)) {
- if (funktion_isLinkAllowed("admin/schichtplan.php") === TRUE) {
- echo "" . Get_Text("pub_schichtplan_colision") . "
";
- for ($i = 0; $i < mysql_num_rows($ErgSonder); $i++) {
- echo "" .
- mysql_result($ErgSonder, $i, "DateS") .
- " '" . mysql_result($ErgSonder, $i, "Man") . "' (RID $raum) (00-xx)" .
- "
\n";
- }
- }
- }
- elseif ((mysql_num_rows($ErgSonder) == 1)) {
- $ZeitZeiger = substr(mysql_result($ErgSonder, 0, "DateE"), 11, 2) + (substr(mysql_result($ErgSonder, 0, "DateE"), 14, 2) / 60);
- $Spalten[0] .= "\n" .
- "↑↑↑" .
- Ausgabe_Feld_Inhalt(mysql_result($ErgSonder, 0, "SID"), mysql_result($ErgSonder, 0, "Man")) .
- "\n | \n";
- }
-
- /////////////////////////////////////////////////////////////
- // gibt die schichten f�r den tag aus
- /////////////////////////////////////////////////////////////
- $SQL = "SELECT `SID`, `DateS`, `Len`, `Man` FROM `Shifts` " .
- "WHERE ((`RID` = '" . sql_escape($raum) . "') and " .
- "(`DateS` >= '" . sql_escape($ausdatum) . ' ' . sql_escape($ZeitZeiger) . ":00:00') and " .
- "(`DateS` like '" . sql_escape($ausdatum) . "%')) ORDER BY `DateS`;";
- $Erg = mysql_query($SQL, $con);
- for ($i = 0; $i < mysql_num_rows($Erg); ++ $i) {
- $ZeitPos = substr(mysql_result($Erg, $i, "DateS"), 11, 2) + (substr(mysql_result($Erg, $i, "DateS"), 14, 2) / 60);
- $len = mysql_result($Erg, $i, "Len");
-
- if ($len <= 0)
- array_push($error_messages, "Error in shift denition SID=" . mysql_result($Erg, $i, "SID") . " Len=$len");
-
- if ($ZeitZeiger < $ZeitPos) {
- $Spalten[$ZeitZeiger * $GlobalZeileProStunde] .= " | \n";
-
- $ZeitZeiger += $ZeitPos - $ZeitZeiger;
- }
- if ($ZeitZeiger == $ZeitPos) {
- //sonderfall wenn die schicht �ber dei 24 stunden hinaus geht
- // (eintrag abk�rzen, pfeiel ausgeben)
- $Spalten[$ZeitZeiger * $GlobalZeileProStunde] .= "\n" .
- "" .
- Ausgabe_Feld_Inhalt(mysql_result($Erg, $i, "SID"), mysql_result($Erg, $i, "Man")) .
- ((($ZeitZeiger + $len) > 24) ? "↓↓↓" : "") .
- "\n | \n";
- $ZeitZeiger += $len;
- } else {
- echo "" . Get_Text("pub_schichtplan_colision") . "
";
- echo "" .
- mysql_result($Erg, $i, "DateS") .
- " '" . mysql_result($Erg, $i, "Man") . "' " .
- " (" . mysql_result($Erg, $i, "SID") . " R$raum) (xx-xx)
";
- }
- }
- if ($ZeitZeiger < 24)
- $Spalten[($ZeitZeiger * $GlobalZeileProStunde)] .= " | \n";
-} // function CreateRoomShifts
-
-/*#######################################################
-# Ausgabe der freien schichten #
-#######################################################*/
-function showEmptyShifts() {
- global $con, $debug, $RoomID, $gmdateOffset;
-
- echo "\n";
- echo "\n";
- echo "" . Get_Text("inc_schicht_date") . " | \n";
- echo "" . Get_Text("inc_schicht_time") . " | \n";
- echo "" . Get_Text("inc_schicht_room") . " | \n";
- echo "" . Get_Text("inc_schicht_commend") . " | \n";
- echo "
\n";
-
- $sql = "SELECT `SID`, `DateS`, `Man`, `RID` FROM `Shifts` " .
- "WHERE (`Shifts`.`DateS`>='" . gmdate("Y-m-d H:i:s", time() + $gmdateOffset) . "') " .
- "ORDER BY `DateS`, `RID`;";
- $Erg = mysql_query($sql, $con);
-
- $angezeigt = 0;
- for ($i = 0;($i < mysql_num_rows($Erg)) && ($angezeigt < 15); $i++)
- if (isset ($RoomID[mysql_result($Erg, $i, "RID")]))
- if ($RoomID[mysql_result($Erg, $i, "RID")] != "") {
- $Sql2 = "SELECT `UID` FROM `ShiftEntry` " .
- "WHERE `SID`=" . mysql_result($Erg, $i, "SID") . " AND " .
- "`UID`='0';";
- $Erg2 = mysql_query($Sql2, $con);
-
- if (mysql_num_rows($Erg2) > 0) {
- $angezeigt++;
- echo "\n";
- echo "" . substr(mysql_result($Erg, $i, "DateS"), 0, 10) . " | \n";
- echo "" . substr(mysql_result($Erg, $i, "DateS"), 11) . " | \n";
- echo "" . $RoomID[mysql_result($Erg, $i, "RID")] . " | \n";
- echo "" .
- ausgabe_Feld_Inhalt(mysql_result($Erg, $i, "SID"), mysql_result($Erg, $i, "Man")) .
- " | \n";
- echo "
\n";
- }
- }
-
- echo "
\n";
-
-} //function showEmptyShifts
-
-/*#######################################################
-# Gibt die anzahl der Schichten im Raum zur�ck #
-#######################################################*/
-function SummRoomShifts($raum) {
- global $ausdatum, $con, $debug, $GlobalZeileProStunde;
-
- $SQLSonder = "SELECT `SID`, `DateS`, `Len`, `Man` FROM `Shifts` " .
- "WHERE ((`RID` = '" . sql_escape($raum) . "') AND (`DateE` >= '$ausdatum 00:00:00') AND " .
- "(`DateS` <= '$ausdatum 23:59:59') ) ORDER BY `DateS`;";
-
- $ErgSonder = mysql_query($SQLSonder, $con);
-
- return mysql_num_rows($ErgSonder);
-}
-
-function DatumUm1TagErhoehen($Datum) {
- $Jahr = substr($Datum, 0, 4);
- $Monat = substr($Datum, 5, 2);
- $Tag = substr($Datum, 8, 2);
-
- $Tag++;
-
- switch ($Monat) {
- case 1 :
- $Mmax = 31;
- break;
- case 2 :
- $Mmax = 28;
- break;
- case 3 :
- $Mmax = 31;
- break;
- case 4 :
- $Mmax = 30;
- break;
- case 5 :
- $Mmax = 31;
- break;
- case 6 :
- $Mmax = 30;
- break;
- case 7 :
- $Mmax = 31;
- break;
- case 8 :
- $Mmax = 31;
- break;
- case 9 :
- $Mmax = 30;
- break;
- case 10 :
- $Mmax = 31;
- break;
- case 11 :
- $Mmax = 30;
- break;
- case 12 :
- $Mmax = 31;
- break;
- }
-
- if ($Tag > $Mmax) {
- $Tag = 1;
- $Monat++;
- }
-
- if ($Monat > 12) {
- $Monat = 1;
- $Jahr++;
- }
-
- $Tag = strlen($Tag) == 1 ? "0" . $Tag : $Tag;
- $Monat = strlen($Monat) == 1 ? "0" . $Monat : $Monat;
-
- return ("$Jahr-$Monat-$Tag");
-}
-?>
diff --git a/includes/sys_template.php b/includes/sys_template.php
index a120bb2d..e15af7f8 100644
--- a/includes/sys_template.php
+++ b/includes/sys_template.php
@@ -5,17 +5,17 @@
* Liste der verfügbaren Themes
*/
$themes = array (
- "1" => "Standard-Style",
- "2" => "ot/Gelber Style",
- "3" => "Club-Mate Style",
- "5" => "Debian Style",
- "6" => "c-base Style",
- "7" => "Blau/Gelber Style",
- "8" => "Pastel Style",
- "4" => "Test Style",
- "9" => "Test Style 21c3",
- "10" => "Engelsystem 2.0",
- "11" => "msquare (29c3)"
+ "1" => "Standard-Style",
+ "2" => "ot/Gelber Style",
+ "3" => "Club-Mate Style",
+ "5" => "Debian Style",
+ "6" => "c-base Style",
+ "7" => "Blau/Gelber Style",
+ "8" => "Pastel Style",
+ "4" => "Test Style",
+ "9" => "Test Style 21c3",
+ "10" => "Engelsystem 2.0",
+ "11" => "msquare (29c3)"
);
/**
@@ -26,14 +26,14 @@ $themes = array (
* @param selected Array mit den Keys, die ausgewählt sind
*/
function form_checkboxes($name, $label, $items, $selected) {
- $html = "";
- return form_element($label, $html);
+ $html = "";
+ return form_element($label, $html);
}
/**
@@ -45,197 +45,223 @@ function form_checkboxes($name, $label, $items, $selected) {
* @param disabled Wie selected, nur dass die entsprechenden Checkboxen deaktiviert statt markiert sind
*/
function form_multi_checkboxes($names, $label, $items, $selected, $disabled = array()) {
- $html = "";
- return form_element($label, $html);
+ $html = "";
+ return form_element($label, $html);
}
/**
* Rendert eine Checkbox
*/
function form_checkbox($name, $label, $selected, $value = 'checked') {
- return form_element("", '');
+ return form_element("", '');
}
/**
* Rendert einen Infotext in das Formular
*/
function form_info($label, $text) {
- return form_element($label, $text, "");
+ return form_element($label, $text, "");
}
/**
* Rendert den Absenden-Button eines Formulars
*/
function form_submit($name, $label) {
- return form_element('', "");
+ return form_element('', "");
}
/**
* Rendert ein Formular-Textfeld
*/
function form_text($name, $label, $value, $disabled = false) {
- $disabled = $disabled ? ' disabled="disabled"' : '';
- return form_element($label, '', 'form_' . $name);
+ $disabled = $disabled ? ' disabled="disabled"' : '';
+ return form_element($label, '', 'form_' . $name);
}
/**
* Rendert ein Formular-Passwortfeld
*/
function form_password($name, $label, $disabled = false) {
- $disabled = $disabled ? ' disabled="disabled"' : '';
- return form_element($label, '', 'form_' . $name);
+ $disabled = $disabled ? ' disabled="disabled"' : '';
+ return form_element($label, '', 'form_' . $name);
}
/**
* Rendert ein Formular-Textfeld
*/
function form_textarea($name, $label, $value, $disabled = false) {
- $disabled = $disabled ? ' disabled="disabled"' : '';
- return form_element($label, '', 'form_' . $name);
+ $disabled = $disabled ? ' disabled="disabled"' : '';
+ return form_element($label, '', 'form_' . $name);
}
/**
* Rendert ein Formular-Auswahlfeld
*/
function form_select($name, $label, $values, $selected) {
- return form_element($label, html_select_key('form_' . $name, $name, $values, $selected), 'form_' . $name);
+ return form_element($label, html_select_key('form_' . $name, $name, $values, $selected), 'form_' . $name);
}
/**
* Rendert ein Formular-Element
*/
function form_element($label, $input, $for = "") {
- return '';
+ return '';
}
/**
* Rendert ein Formular
*/
function form($elements, $action = "") {
- return '';
+ return '';
}
/**
* Generiert HTML Code für eine "Seite". Fügt dazu die übergebenen Elemente zusammen.
*/
function page($elements) {
- return join($elements);
+ return join($elements);
}
/**
* Rendert eine Datentabelle
*/
function table($columns, $rows, $data = true) {
- if (count($rows) == 0)
- return info("No data available.", true);
- $html = "";
- $html .= '';
- $html .= '';
- foreach ($columns as $key => $column)
- $html .= '' . $column . ' | ';
- $html .= '
';
- $html .= '';
- foreach ($rows as $row) {
- $html .= '';
- foreach ($columns as $key => $column)
- if (isset ($row[$key]))
- $html .= '' . $row[$key] . ' | ';
- else
- $html .= ' | ';
- $html .= '
';
- }
- $html .= '';
- $html .= '
';
- return $html;
+ if (count($rows) == 0)
+ return info("No data available.", true);
+ $html = "";
+ $html .= '';
+ $html .= '';
+ foreach ($columns as $key => $column)
+ $html .= '' . $column . ' | ';
+ $html .= '
';
+ $html .= '';
+ foreach ($rows as $row) {
+ $html .= '';
+ foreach ($columns as $key => $column)
+ if (isset ($row[$key]))
+ $html .= '' . $row[$key] . ' | ';
+ else
+ $html .= ' | ';
+ $html .= '
';
+ }
+ $html .= '';
+ $html .= '
';
+ return $html;
}
/**
* Rendert einen Knopf
*/
function button($href, $label, $class = "") {
- return '' . $label . '';
+ return '' . $label . '';
}
/**
* Rendert eine Toolbar mit Knöpfen
*/
function buttons($buttons = array ()) {
- return '' . join(' ', $buttons) . '
';
+ return '' . join(' ', $buttons) . '
';
}
// Load and render template
function template_render($file, $data) {
- if (file_exists($file)) {
- $template = file_get_contents($file);
- if (is_array($data))
- foreach ($data as $name => $content) {
- $template = str_replace("%" . $name . "%", $content, $template);
- }
- return $template;
- } else {
- die('Cannot find template file «' . $file . '».');
- }
+ if (file_exists($file)) {
+ $template = file_get_contents($file);
+ if (is_array($data))
+ foreach ($data as $name => $content) {
+ $template = str_replace("%" . $name . "%", $content, $template);
+ }
+ return $template;
+ } else {
+ die('Cannot find template file «' . $file . '».');
+ }
}
function shorten($str) {
- if (strlen($str) < 50)
- return $str;
- return '' . substr($str, 0, 47) . '...';
+ if (strlen($str) < 50)
+ return $str;
+ return '' . substr($str, 0, 47) . '...';
}
function table_body($array) {
- $html = "";
- foreach ($array as $line) {
- $html .= "
";
- if (is_array($line)) {
- foreach ($line as $td)
- $html .= "" . $td . " | ";
- } else {
- $html .= "" . $line . " | ";
- }
- $html .= "
";
- }
- return $html;
+ $html = "";
+ foreach ($array as $line) {
+ $html .= "";
+ if (is_array($line)) {
+ foreach ($line as $td)
+ $html .= "" . $td . " | ";
+ } else {
+ $html .= "" . $line . " | ";
+ }
+ $html .= "
";
+ }
+ return $html;
}
function html_options($name, $options, $selected = "") {
- $html = "";
- foreach ($options as $value => $label)
- $html .= ' ' . $label;
+ $html = "";
+ foreach ($options as $value => $label)
+ $html .= ' ' . $label;
- return $html;
+ return $html;
}
function html_select_key($id, $name, $rows, $selected) {
- $html = '';
- return $html;
+ $html = '';
+ return $html;
}
function img_button($link, $icon, $text, $extra_text = '') {
- $translation = empty($text)? '' : Get_Text($text);
- return '' . (empty($extra_text)? '' : ' ' . $extra_text) . '';
+ $translation = empty($text)? '' : Get_Text($text);
+ return '' . (empty($extra_text)? '' : ' ' . $extra_text) . '';
+}
+
+
+function ReplaceSmilies($neueckig) {
+ $neueckig = str_replace(";o))", "", $neueckig);
+ $neueckig = str_replace(":-))", "", $neueckig);
+ $neueckig = str_replace(";o)", "", $neueckig);
+ $neueckig = str_replace(":)", "", $neueckig);
+ $neueckig = str_replace(":-)", "", $neueckig);
+ $neueckig = str_replace(":(", "", $neueckig);
+ $neueckig = str_replace(":-(", "", $neueckig);
+ $neueckig = str_replace(":o(", "", $neueckig);
+ $neueckig = str_replace(":o)", "", $neueckig);
+ $neueckig = str_replace(";o(", "", $neueckig);
+ $neueckig = str_replace(";(", "", $neueckig);
+ $neueckig = str_replace(";-(", "", $neueckig);
+ $neueckig = str_replace("8)", "", $neueckig);
+ $neueckig = str_replace("8o)", "", $neueckig);
+ $neueckig = str_replace(":P", "", $neueckig);
+ $neueckig = str_replace(":-P", "", $neueckig);
+ $neueckig = str_replace(":oP", "", $neueckig);
+ $neueckig = str_replace(";P", "", $neueckig);
+ $neueckig = str_replace(";oP", "", $neueckig);
+ $neueckig = str_replace("?)", "", $neueckig);
+
+ return $neueckig;
}
?>
diff --git a/includes/sys_user.php b/includes/sys_user.php
deleted file mode 100644
index 53976f5a..00000000
--- a/includes/sys_user.php
+++ /dev/null
@@ -1,133 +0,0 @@
-' . htmlspecialchars($user_source['Nick']) . '';
- else
- return htmlspecialchars($user_source['Nick']);
-}
-
-
-/**
- * Available T-Shirt sizes
- */
-$tshirt_sizes = array (
- '' => "Please select...",
- 'S' => "S",
- 'M' => "M",
- 'L' => "L",
- 'XL' => "XL",
- '2XL' => "2XL",
- '3XL' => "3XL",
- '4XL' => "4XL",
- '5XL' => "5XL",
- 'S-G' => "S Girl",
- 'M-G' => "M Girl",
- 'L-G' => "L Girl",
- 'XL-G' => "XL Girl"
-);
-
-function UID2Nick($UID) {
- if ($UID > 0)
- $SQL = "SELECT Nick FROM `User` WHERE UID='" . sql_escape($UID) . "'";
- else
- $SQL = "SELECT Name FROM `Groups` WHERE UID='" . sql_escape($UID) . "'";
-
- $Erg = sql_select($SQL);
-
- if (count($Erg) > 0) {
- if ($UID > 0)
- return $Erg[0]['Nick'];
- else
- return "Group-" . $Erg[0]['Name'];
- } else {
- if ($UID == -1)
- return "Guest";
- else
- return "UserID $UID not found";
- }
-}
-
-function TID2Type($TID) {
- global $con;
-
- $SQL = "SELECT Name FROM `EngelType` WHERE TID='" . sql_escape($TID) . "'";
- $Erg = mysql_query($SQL, $con);
-
- if (mysql_num_rows($Erg))
- return mysql_result($Erg, 0);
- else
- return "";
-}
-
-function ReplaceSmilies($neueckig) {
- $neueckig = str_replace(";o))", "", $neueckig);
- $neueckig = str_replace(":-))", "", $neueckig);
- $neueckig = str_replace(";o)", "", $neueckig);
- $neueckig = str_replace(":)", "", $neueckig);
- $neueckig = str_replace(":-)", "", $neueckig);
- $neueckig = str_replace(":(", "", $neueckig);
- $neueckig = str_replace(":-(", "", $neueckig);
- $neueckig = str_replace(":o(", "", $neueckig);
- $neueckig = str_replace(":o)", "", $neueckig);
- $neueckig = str_replace(";o(", "", $neueckig);
- $neueckig = str_replace(";(", "", $neueckig);
- $neueckig = str_replace(";-(", "", $neueckig);
- $neueckig = str_replace("8)", "", $neueckig);
- $neueckig = str_replace("8o)", "", $neueckig);
- $neueckig = str_replace(":P", "", $neueckig);
- $neueckig = str_replace(":-P", "", $neueckig);
- $neueckig = str_replace(":oP", "", $neueckig);
- $neueckig = str_replace(";P", "", $neueckig);
- $neueckig = str_replace(";oP", "", $neueckig);
- $neueckig = str_replace("?)", "", $neueckig);
-
- return $neueckig;
-}
-
-function GetPictureShow($UID) {
- global $con;
-
- $SQL = "SELECT `show` FROM `UserPicture` WHERE `UID`='" . sql_escape($UID) . "'";
- $res = mysql_query($SQL, $con);
-
- if (mysql_num_rows($res) == 1)
- return mysql_result($res, 0, 0);
- else
- return "";
-}
-
-function displayPicture($UID, $height = "30") {
- global $url, $ENGEL_ROOT;
-
- if ($height > 0)
- return ("");
- else
- return ("");
-}
-
-function displayavatar($UID, $height = "30") {
- global $con, $url, $ENGEL_ROOT;
-
- if (GetPictureShow($UID) == 'Y')
- return " " . displayPicture($UID, $height);
-
- $user = sql_select("SELECT * FROM `User` WHERE `UID`=" . sql_escape($UID) . " LIMIT 1");
- if (count($user) > 0)
- if ($user[0]['Avatar'] > 0)
- return '' . ("
") . '
';
-}
-
-function UIDgekommen($UID) {
- global $con;
-
- $SQL = "SELECT `Gekommen` FROM `User` WHERE UID='" . sql_escape($UID) . "'";
- $Erg = mysql_query($SQL, $con);
-
- if (mysql_num_rows($Erg))
- return mysql_result($Erg, 0);
- else
- return "0";
-}
-?>
diff --git a/includes/view/Shifts_view.php b/includes/view/Shifts_view.php
new file mode 100644
index 00000000..824f519a
--- /dev/null
+++ b/includes/view/Shifts_view.php
@@ -0,0 +1,11 @@
+
\ No newline at end of file
diff --git a/includes/view/Sprache_view.php b/includes/view/Sprache_view.php
new file mode 100644
index 00000000..88c7435c
--- /dev/null
+++ b/includes/view/Sprache_view.php
@@ -0,0 +1,36 @@
+ "Deutsch",
+ 'EN' => "English"
+);
+
+/**
+ * Display acutual translation of given text id.
+ * @param string $TextID
+ * @param bool $NoError
+ * @return string
+ */
+function Get_Text($TextID, $NoError = false) {
+ global $debug;
+
+ if (!isset ($_SESSION['Sprache']))
+ $_SESSION['Sprache'] = "EN";
+ if ($_SESSION['Sprache'] == "")
+ $_SESSION['Sprache'] = "EN";
+ if (isset ($_GET["SetLanguage"]))
+ $_SESSION['Sprache'] = $_GET["SetLanguage"];
+
+ $sprache_source = Sprache($TextID, $_SESSION['Sprache']);
+ if($sprache_source === false)
+ engelsystem_error("Unable to load text key.");
+ if($sprache_source == null) {
+ if($NoError && !$debug)
+ return "";
+ return $TextID;
+ }
+ return $sprache_source['Text'];
+}
+?>
\ No newline at end of file
diff --git a/includes/view/User_view.php b/includes/view/User_view.php
new file mode 100644
index 00000000..eb69b8c4
--- /dev/null
+++ b/includes/view/User_view.php
@@ -0,0 +1,45 @@
+ "Please select...",
+ 'S' => "S",
+ 'M' => "M",
+ 'L' => "L",
+ 'XL' => "XL",
+ '2XL' => "2XL",
+ '3XL' => "3XL",
+ '4XL' => "4XL",
+ '5XL' => "5XL",
+ 'S-G' => "S Girl",
+ 'M-G' => "M Girl",
+ 'L-G' => "L Girl",
+ 'XL-G' => "XL Girl"
+);
+
+/**
+ * Render a users avatar.
+ * @param User $user
+ * @return string
+ */
+function User_Avatar_render($user) {
+ return '';
+}
+
+/**
+ * Render a user nickname.
+ * @param User $user_source
+ * @return string
+ */
+function User_Nick_render($user_source) {
+ global $user, $privileges;
+ if($user['UID'] == $user_source['UID'] || in_array('user_shifts_admin', $privileges))
+ return '' . htmlspecialchars($user_source['Nick']) . '';
+ else
+ return htmlspecialchars($user_source['Nick']);
+}
+
+
+?>
\ No newline at end of file
--
cgit v1.2.3-70-g09d2