summaryrefslogtreecommitdiff
path: root/includes/model/Room_model.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/model/Room_model.php')
-rw-r--r--includes/model/Room_model.php31
1 files changed, 31 insertions, 0 deletions
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 @@
+<?php
+
+/**
+ * Returns room id array
+ */
+function mRoomList() {
+ $room_source = sql_select("SELECT `RID` FROM `Room`");
+ if ($room_source === false)
+ return false;
+ if (count($room_source) > 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;
+}
+
+
+?>