summaryrefslogtreecommitdiff
path: root/includes/model
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2016-09-29 12:45:06 +0200
committermsquare <msquare@notrademark.de>2016-09-29 12:45:06 +0200
commit07ddbb0f4c76253b1d888ceab555bdf26992fd01 (patch)
tree9c4b6f3528e144bf675c78c6ddae848bf41c2cd6 /includes/model
parentc231070dcc91d976a879674dd3fae7972cb064cf (diff)
make short variable names longer
Diffstat (limited to 'includes/model')
-rw-r--r--includes/model/AngelType_model.php6
-rw-r--r--includes/model/Message_model.php16
-rw-r--r--includes/model/Room_model.php6
-rw-r--r--includes/model/Shifts_model.php14
-rw-r--r--includes/model/User_model.php12
5 files changed, 27 insertions, 27 deletions
diff --git a/includes/model/AngelType_model.php b/includes/model/AngelType_model.php
index 47c13667..21ab3bf2 100644
--- a/includes/model/AngelType_model.php
+++ b/includes/model/AngelType_model.php
@@ -133,11 +133,11 @@ function AngelType_ids() {
/**
* Returns angelType by id.
*
- * @param $id angelType
+ * @param $angeltype_id angelType
* ID
*/
-function AngelType($id) {
- $angelType_source = sql_select("SELECT * FROM `AngelTypes` WHERE `id`='" . sql_escape($id) . "' LIMIT 1");
+function AngelType($angeltype_id) {
+ $angelType_source = sql_select("SELECT * FROM `AngelTypes` WHERE `id`='" . sql_escape($angeltype_id) . "' LIMIT 1");
if ($angelType_source === false) {
return false;
}
diff --git a/includes/model/Message_model.php b/includes/model/Message_model.php
index 92b76a80..0195fbea 100644
--- a/includes/model/Message_model.php
+++ b/includes/model/Message_model.php
@@ -10,11 +10,11 @@ function Message_ids() {
/**
* Returns message by id.
*
- * @param $id message
+ * @param $message_id message
* ID
*/
-function Message($id) {
- $message_source = sql_select("SELECT * FROM `Messages` WHERE `id`='" . sql_escape($id) . "' LIMIT 1");
+function Message($message_id) {
+ $message_source = sql_select("SELECT * FROM `Messages` WHERE `id`='" . sql_escape($message_id) . "' LIMIT 1");
if ($message_source === false) {
return false;
}
@@ -29,19 +29,19 @@ function Message($id) {
* TODO: global $user con not be used in model!
* send message
*
- * @param $id User
+ * @param $receiver_user_id User
* ID of Reciever
* @param $text Text
* of Message
*/
-function Message_send($id, $text) {
+function Message_send($receiver_user_id, $text) {
global $user;
$text = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($text));
- $to = preg_replace("/([^0-9]{1,})/ui", '', strip_tags($id));
+ $receiver_user_id = preg_replace("/([^0-9]{1,})/ui", '', strip_tags($receiver_user_id));
- if (($text != "" && is_numeric($to)) && (sql_num_query("SELECT * FROM `User` WHERE `UID`='" . sql_escape($to) . "' AND NOT `UID`='" . sql_escape($user['UID']) . "' LIMIT 1") > 0)) {
- sql_query("INSERT INTO `Messages` SET `Datum`='" . sql_escape(time()) . "', `SUID`='" . sql_escape($user['UID']) . "', `RUID`='" . sql_escape($to) . "', `Text`='" . sql_escape($text) . "'");
+ if (($text != "" && is_numeric($receiver_user_id)) && (sql_num_query("SELECT * FROM `User` WHERE `UID`='" . sql_escape($receiver_user_id) . "' AND NOT `UID`='" . sql_escape($user['UID']) . "' LIMIT 1") > 0)) {
+ sql_query("INSERT INTO `Messages` SET `Datum`='" . sql_escape(time()) . "', `SUID`='" . sql_escape($user['UID']) . "', `RUID`='" . sql_escape($receiver_user_id) . "', `Text`='" . sql_escape($text) . "'");
return true;
} else {
return false;
diff --git a/includes/model/Room_model.php b/includes/model/Room_model.php
index 1768b61b..4d03260a 100644
--- a/includes/model/Room_model.php
+++ b/includes/model/Room_model.php
@@ -34,10 +34,10 @@ function Room_create($name, $from_frab, $public) {
/**
* Returns room by id.
*
- * @param $id RID
+ * @param $room_id RID
*/
-function Room($id) {
- $room_source = sql_select("SELECT * FROM `Room` WHERE `RID`='" . sql_escape($id) . "' AND `show` = 'Y'");
+function Room($room_id) {
+ $room_source = sql_select("SELECT * FROM `Room` WHERE `RID`='" . sql_escape($room_id) . "' AND `show` = 'Y'");
if ($room_source === false) {
return false;
diff --git a/includes/model/Shifts_model.php b/includes/model/Shifts_model.php
index cca5139d..2f90ae48 100644
--- a/includes/model/Shifts_model.php
+++ b/includes/model/Shifts_model.php
@@ -229,16 +229,16 @@ function Shifts_filtered() {
/**
* Returns Shift by id.
*
- * @param $id Shift
+ * @param $shift_id Shift
* ID
*/
-function Shift($id) {
+function Shift($shift_id) {
$shifts_source = sql_select("
SELECT `Shifts`.*, `ShiftTypes`.`name`
FROM `Shifts`
JOIN `ShiftTypes` ON (`ShiftTypes`.`id` = `Shifts`.`shifttype_id`)
- WHERE `SID`='" . sql_escape($id) . "'");
- $shiftsEntry_source = sql_select("SELECT `id`, `TID` , `UID` , `freeloaded` FROM `ShiftEntry` WHERE `SID`='" . sql_escape($id) . "'");
+ WHERE `SID`='" . sql_escape($shift_id) . "'");
+ $shiftsEntry_source = sql_select("SELECT `id`, `TID` , `UID` , `freeloaded` FROM `ShiftEntry` WHERE `SID`='" . sql_escape($shift_id) . "'");
if ($shifts_source === false) {
return false;
@@ -249,14 +249,14 @@ function Shift($id) {
$result['ShiftEntry'] = $shiftsEntry_source;
$result['NeedAngels'] = [];
- $temp = NeededAngelTypes_by_shift($id);
+ $temp = NeededAngelTypes_by_shift($shift_id);
foreach ($temp as $e) {
- $result['NeedAngels'][] = array(
+ $result['NeedAngels'][] = [
'TID' => $e['angel_type_id'],
'count' => $e['count'],
'restricted' => $e['restricted'],
'taken' => $e['taken']
- );
+ ];
}
return $result;
diff --git a/includes/model/User_model.php b/includes/model/User_model.php
index 3d5416da..7f9170df 100644
--- a/includes/model/User_model.php
+++ b/includes/model/User_model.php
@@ -160,10 +160,10 @@ function User_validate_Nick($nick) {
/**
* Returns user by id.
*
- * @param $id UID
+ * @param $user_id UID
*/
-function User($id) {
- $user_source = sql_select("SELECT * FROM `User` WHERE `UID`='" . sql_escape($id) . "' LIMIT 1");
+function User($user_id) {
+ $user_source = sql_select("SELECT * FROM `User` WHERE `UID`='" . sql_escape($user_id) . "' LIMIT 1");
if ($user_source === false) {
return false;
}
@@ -177,10 +177,10 @@ function User($id) {
* TODO: Merge into normal user function
* Returns user by id (limit informations.
*
- * @param $id UID
+ * @param $user_id UID
*/
-function mUser_Limit($id) {
- $user_source = sql_select("SELECT `UID`, `Nick`, `Name`, `Vorname`, `Telefon`, `DECT`, `Handy`, `email`, `jabber` FROM `User` WHERE `UID`='" . sql_escape($id) . "' LIMIT 1");
+function mUser_Limit($user_id) {
+ $user_source = sql_select("SELECT `UID`, `Nick`, `Name`, `Vorname`, `Telefon`, `DECT`, `Handy`, `email`, `jabber` FROM `User` WHERE `UID`='" . sql_escape($user_id) . "' LIMIT 1");
if ($user_source === false) {
return false;
}