From 8fa78b55ac2327f87d492cf483a7d77b79ae8db0 Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Sun, 29 Dec 2013 15:08:33 +0100 Subject: first api new files --- includes/model/Room_model.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 includes/model/Room_model.php (limited to 'includes/model/Room_model.php') diff --git a/includes/model/Room_model.php b/includes/model/Room_model.php new file mode 100644 index 00000000..fea241a6 --- /dev/null +++ b/includes/model/Room_model.php @@ -0,0 +1,31 @@ + 0) + return $room_source; + return null; +} + + +/** + * Returns room by id. + * + * @param $id RID + */ +function mRoom($id) { + $room_source = sql_select("SELECT * FROM `Room` WHERE `RID`=" . sql_escape($id) . " LIMIT 1"); + if ($room_source === false) + return false; + if (count($room_source) > 0) + return $room_source[0]; + return null; +} + + +?> -- cgit v1.2.3-54-g00ecf