diff options
author | msquare <msquare@notrademark.de> | 2016-10-03 18:32:25 +0200 |
---|---|---|
committer | msquare <msquare@notrademark.de> | 2016-10-03 18:32:25 +0200 |
commit | f3a0ce865deb9603b77adc9c9237a55cd4d87eeb (patch) | |
tree | 2fb5cc4658fd8ff9b379c2bb6227e8bf8c9a7f37 /includes/model/Room_model.php | |
parent | 09c931dcf585da440879c52bb32b5eb9ef0fb9b4 (diff) |
move sql queries from shifts controller to model
Diffstat (limited to 'includes/model/Room_model.php')
-rw-r--r-- | includes/model/Room_model.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/includes/model/Room_model.php b/includes/model/Room_model.php index 4d03260a..6b6e269e 100644 --- a/includes/model/Room_model.php +++ b/includes/model/Room_model.php @@ -1,8 +1,17 @@ <?php /** + * 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`"); +} + +/** * 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)); |