engelsystem/includes/model/Room_model.php

31 lines
590 B
PHP
Raw Normal View History

2013-12-29 15:08:33 +01:00
<?php
/**
* Returns room id array
*/
2014-01-07 15:50:16 +01:00
function Room_ids() {
$room_source = sql_select("SELECT `RID` FROM `Room` WHERE `show` = 'Y'");
2013-12-29 15:08:33 +01:00
if ($room_source === false)
return false;
if (count($room_source) > 0)
return $room_source;
return null;
}
/**
* Returns room by id.
*
2014-01-07 15:50:16 +01:00
* @param $id RID
2013-12-29 15:08:33 +01:00
*/
2014-01-07 15:50:16 +01:00
function Room($id) {
2014-12-28 13:44:56 +01:00
$room_source = sql_select("SELECT * FROM `Room` WHERE `RID`='" . sql_escape($id) . "' AND `show` = 'Y' LIMIT 1");
2014-12-28 14:56:02 +01:00
2013-12-29 15:08:33 +01:00
if ($room_source === false)
return false;
if (count($room_source) > 0)
return $room_source[0];
return null;
}
?>