コード例 #1
0
ファイル: rsys.php プロジェクト: ilosada/chamilo-lms-icpna
     */
    function get_subscriptions($from, $till)
    {
        $till = Database::escape_string($till);
        $from = Database::escape_string($from);
        // TODO: only return for current user...
        $sql = "SELECT r.*,s.start_at AS tp_start,s.end_at AS tp_end,s.accepted FROM " . Rsys::getTable('subscription') . " s INNER JOIN " . Rsys::getTable('reservation') . " r ON s.reservation_id = r.id WHERE ((r.timepicker=0 AND r.start_at>='" . $from . "' AND r.end_at<='" . $till . "') OR (s.start_at>='" . $from . "' AND s.end_at<='" . $till . "'))";
        $result = Database::query($sql);
        while ($array = Database::fetch_array($result)) {
            $arr[] = $array;
            if ($arr['timepicker'] == 1) {
                $arr['start_at'] = $arr['tp_start'];
                $arr['end_at'] = $arr['tp_end'];
            }
        }
        return $arr;
    }
    function get_item_id($item_name)
    {
        $item_name = Database::escape_string($item_name);
        $sql = "SELECT id FROM " . Rsys::getTable('item') . " WHERE name='" . $item_name . "'";
        $result = Database::query($sql);
        $result_array = Database::fetch_array($result);
        return $result_array['id'];
    }
}
$language_file = 'reservation';
$cidReset = true;
require_once '../inc/global.inc.php';
Rsys::init();
require_once 'rcalendar.php';