summaryrefslogtreecommitdiff
path: root/includes/model/Room_model.php
blob: fea241a65776c8c33599401f7a205c4c78c033d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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;
}


?>