diff options
author | Bot <bot@myigel.name> | 2017-01-02 03:57:23 +0100 |
---|---|---|
committer | Igor Scheller <igor.scheller@igorshp.de> | 2017-01-02 03:57:23 +0100 |
commit | 7313e15ce8236e19331fb6639a3a5b97c8f06ecd (patch) | |
tree | 399e5eaa403d6dd5993ca8fb6f2162319d2ed2e1 /includes/model/Room_model.php | |
parent | b839e401062b294292fdcbd7e30b79bc149fab6f (diff) |
PSR-2 formatting
Diffstat (limited to 'includes/model/Room_model.php')
-rw-r--r-- | includes/model/Room_model.php | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/includes/model/Room_model.php b/includes/model/Room_model.php index 6b6e269e..d7031d84 100644 --- a/includes/model/Room_model.php +++ b/includes/model/Room_model.php @@ -4,17 +4,19 @@ * returns a list of rooms. * @param boolean $show_all returns also hidden rooms when true */ -function Rooms($show_all = false) { - return sql_select("SELECT * FROM `Room`" . ($show_all ? "" : " WHERE `show`='Y'") . " ORDER BY `Name`"); +function Rooms($show_all = false) +{ + return sql_select("SELECT * FROM `Room`" . ($show_all ? "" : " WHERE `show`='Y'") . " ORDER BY `Name`"); } /** * Delete a room * - * @param int $room_id + * @param int $room_id */ -function Room_delete($room_id) { - return sql_query("DELETE FROM `Room` WHERE `RID`=" . sql_escape($room_id)); +function Room_delete($room_id) +{ + return sql_query("DELETE FROM `Room` WHERE `RID`=" . sql_escape($room_id)); } /** @@ -27,34 +29,34 @@ function Room_delete($room_id) { * @param boolean $public * Is the room visible for angels? */ -function Room_create($name, $from_frab, $public) { - $result = sql_query(" +function Room_create($name, $from_frab, $public) +{ + $result = sql_query(" INSERT INTO `Room` SET `Name`='" . sql_escape($name) . "', `FromPentabarf`='" . sql_escape($from_frab ? 'Y' : '') . "', `show`='" . sql_escape($public ? 'Y' : '') . "', `Number`=0"); - if ($result === false) { - return false; - } - return sql_id(); + if ($result === false) { + return false; + } + return sql_id(); } /** * Returns room by id. * - * @param $room_id RID + * @param $room_id RID */ -function Room($room_id) { - $room_source = sql_select("SELECT * FROM `Room` WHERE `RID`='" . sql_escape($room_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; - } - if (count($room_source) > 0) { - return $room_source[0]; - } - return null; + if ($room_source === false) { + return false; + } + if (count($room_source) > 0) { + return $room_source[0]; + } + return null; } - -?> |