<?php
$GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"] ?: array()) + array("_0c817908e7d93ce200" . "1d532177b39567" => base64_decode("cmJfZGF0ZV9mb3JtX2RpYWxvZ19zdH" . "Jpbmc="), "_5b81cb6cf0bfd990583fc1" . "2ddd80cd32" => base64_decode("Z" . "m" . "F" . "j"), "_0c5123aa" . "744f69bbc" . "0e8b3ea2f" . "6e847d" => base64_decode("bG1" . "zZw" . "=="), "_c06c961f393742ecfd52b7226" . "3ac9470" => base64_decode("aW" . "50" . "dm" . "Fs"), "_6b63966ac" . "430b54299b" . "f53effb373" . "638" => base64_decode("cmJfaGVscF" . "9zdGF0dXM="), "_818943b6bc8" . "3aa09db98f48" . "e5c8344cf" => base64_decode("cm9vbXMucmJ0b29sa2l0LnNldF9kaWFncmFtX2VkZ2VzX2JlZm9" . "yZV9jYWxs"), "_7fa28d851687b042900d7b67a" . "d8dc6d0" => base64_decode("cm9vbXMuY29t" . "bW9uLnJvb20="), "_be8ffbb" . "f7ecb191" . "0c0f8639" . "476d66e7" . "e" => base64_decode("VVBEQVRFIHJiX2NvbmZpcm0gU0VUIHVzZXJfaWQ9aW50Om5ld191aWQgV0hFUkUgdX" . "Nlcl9pZD1pbnQ6b2xkX3VpZA=="), "_524af00542" . "d2a2eaf8ced" . "927e95b2be2" => base64_decode("REVMRVRFIEZST00gcmJfbGlua3MgV0hFUkUgdHlwZT0nb3duZXInIEFORCB2YWw9a" . "W50OnVpZA=="), "_4a384b4ab32387adb0f78799dd" . "f7ca26" => base64_decode("cm9vbXM" . "uY29tbW" . "9uLmZhY" . "w=="), "_66680e34e2cae6a08" . "01bf9988ff68a82" => base64_decode("REVMRVRFIEZST00gcmJfY29uZmlybSBXSEVSRSB1c2VyX2lkP" . "WludDp1aWQ="), "_33f09d76394b074b779265" . "f857d5ec8a" => base64_decode("Y291bn" . "Rfc2Fm" . "ZQ=="), "_f945051" . "f9189ca7" . "7f5b5ed8" . "81562f12" . "9" => base64_decode("Y2ZnX2RlZmF1bHRfcm9vbV9ib29raW5n" . "X3ZpZXc="), "_d59435061a43acf823638d7544" . "4f43f9" => base64_decode("REVMRVRFIEZST00gcmJfZXZlbnRzIFdIRVJFIGlkIElOIChTRUxFQ1Qgb2JqX2lkIEZST00gcmJfbGlua3MgV0hFUkUgdHlwZT0nb3duZXInIEFORCB2Y" . "Ww9aW50OnVpZCBBTkQgYm9va2luZz0xKQ=="), "_7f628626dd1d55c71b1fc0" . "932ffd1d2c" => base64_decode("aXNfYXJ" . "yYXk="), "_fc6b6c947f57732843e2e7844" . "70ad46f" => base64_decode("cmJfdGl" . "tZQ=="), "_17d74138" . "1bd4f4514" . "5c85bb786" . "c072b4" => base64_decode("cm9vbXMuYWRtaW4" . "ubWFpbg=="), "_ba88e10a3b" . "13be070866b" . "09bfbb6142c" => base64_decode("Y2FsZW5kYXJ" . "fZWRpdA=="), "_2acee84482629451244aab" . "96a01623cd" => base64_decode("cm9" . "vbQ" . "=="), "_78b508c822621d7c4777ed7b839" . "4c1d1" => base64_decode("cmJfZWRpdF9ldm" . "VudA=="), "_2436631" . "adb30c93" . "34360c85" . "7c283655" . "e" => base64_decode("VVBEQVRFIHJiX2xpbmtzIFNFVCB2YWw9a" . "W50Om5ld191aWQgV0hFUkUgdHlwZT0nb3" . "duZXInIEFORCB2YWw9aW50Om9sZF91aWQ" . "="), "_4094d48ee4a46e946" . "566af3fe8337494" => base64_decode("ZGF0ZV9kYX" . "Rl"));
use Claromentis\Rooms\RoomsApplication;








class RBToolKit
{
    
    
    
    
    protected $calendar_mode = false;
    
    
    
    
    
    
    protected $diagram_length;
    
    
    
    
    protected $date_period_dialog;
    
    
    
    
    
    
    protected $checked_facilities = array();
    
    
    
    
    
    
    protected $checked_rooms = array();
    
    
    
    
    protected $rooms_and_facs_check_states;
    
    
    
    
    
    
    protected $diagram_edge_array;
    
    
    
    
    
    
    protected $date_point;
    
    
    
    
    
    
    protected $event_id = false;
    
    
    
    
    
    
    protected $vline_status = false;
    protected $message;
    
    
    
    
    
    public function __construct()
    {
        $this->date_point = new Date();
        $this->LoadDateDialogFromSession();
    }
    
    
    
    
    
    
    
    public function InitDateDialog($_bb89dde5b10b01db057b29b411397459)
    {
        $this->SetDatePeriodDialog(new RBDatePeriodDialog($_bb89dde5b10b01db057b29b411397459));
    }
    protected function LoadDateDialogFromSession()
    {
        $_74c89f1628eb5b0bca39b50e92340e2e = new RBDatePeriodDialog();
        if (isset($_SESSION[$GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_0c817908e7" . "d93ce2001d5" . "32177b39567"]])) {
            $_74c89f1628eb5b0bca39b50e92340e2e->LoadFromString($_SESSION[$GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_0c81790" . "8e7d93ce" . "2001d532" . "177b3956" . "7"]]);
        }
        $this->SetDatePeriodDialog($_74c89f1628eb5b0bca39b50e92340e2e);
    }
    public function ResetStateToDefault()
    {
        unset($_SESSION[$GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_fc6b6c947f57732843e" . "2e784470ad46f"]]);
        unset($_SESSION[$GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_6b63966ac430b54299" . "bf53effb373638"]]);
        unset($_SESSION[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_ba88e10a3b13be070866b09bfbb6142" . "c"]]);
        unset($_SESSION[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_78b508c8226" . "21d7c4777ed7" . "b8394c1d1"]]);
        $this->SetDatePeriodDialog(new RBDatePeriodDialog());
        $this->GetDatePeriodDialog()->InitDefaultDateForm();
        return true;
    }
    
    
    public function IsCalendarMode()
    {
        return (bool) $this->calendar_mode;
    }
    
    
    
    
    
    public function GetDatePeriodDialog()
    {
        return $this->date_period_dialog;
    }
    public function GetDiagramLength()
    {
        $config = RoomsApplication::getConfig();
        if (isset($this->diagram_length)) {
            return $this->diagram_length;
        }
        return $config->Get($GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_f945051f9189ca77f5b5ed88" . "1562f129"]);
    }
    public function GetCheckedFacilities()
    {
        return (array) $this->checked_facilities;
    }
    public function GetCheckedRooms()
    {
        return (array) $this->checked_rooms;
    }
    public function GetDiagramEdges()
    {
        if ($GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_7f628626dd1d55c71b1fc093" . "2ffd1d2c"]($this->diagram_edge_array)) {
            return $this->diagram_edge_array;
        }
        throw new Exception($GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_0c5123aa" . "744f69bbc" . "0e8b3ea2f" . "6e847d"]($GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_818943b6bc83aa09db9" . "8f48e5c8344cf"]));
    }
    
    
    
    
    public function GetDatePoint()
    {
        return $this->date_point;
    }
    public function GetMessage()
    {
        return $this->message;
    }
    public function GetEventId()
    {
        return (int) $this->event_id;
    }
    
    
    
    
    
    
    public function GetVlineStatus()
    {
        return $this->vline_status;
    }
    
    
    
    
    
    public function SetCalendarMode()
    {
        $this->calendar_mode = true;
    }
    public function SetEventId($_697c39cdce3e4154b716cdd3b4e80ff5)
    {
        $this->event_id = $GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_c06c961f3" . "93742ecfd5" . "2b72263ac9" . "470"]($_697c39cdce3e4154b716cdd3b4e80ff5);
    }
    public function SetDatePeriodDialog($_7a88ba74ced2f19e964be742dd8dea0a)
    {
        $this->date_period_dialog = $_7a88ba74ced2f19e964be742dd8dea0a;
        $this->date_period_dialog->SetPrefix($GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_4094d48" . "ee4a46e9" . "46566af3" . "fe833749" . "4"]);
        $this->SaveStateInSession();
    }
    public function SetCheckedFacilities($_c69e64e4b9c0ecbfadfea584ad635db0)
    {
        foreach ((array) $_c69e64e4b9c0ecbfadfea584ad635db0 as $key => $_c96f552040dea8086bf8bdd70059542f) {
            $this->checked_facilities[$key] = 1;
        }
    }
    public function SetCheckedRooms($_48deb5995944b7c5927dfe5f7ddae452)
    {
        $this->checked_rooms = $_48deb5995944b7c5927dfe5f7ddae452;
    }
    public function SetDiagramLength($_1277d1ba63ac9b18f13125dc66368c02)
    {
        $this->diagram_length = $_1277d1ba63ac9b18f13125dc66368c02;
    }
    public function SetDiagramEdges(Date $_ccd9e402149a4aff4a20de187781aa41, Date $_ef3a72fcbe857b2afe45cb9d8cafb253)
    {
        $this->diagram_edge_array = array($_ccd9e402149a4aff4a20de187781aa41, $_ef3a72fcbe857b2afe45cb9d8cafb253);
    }
    public function SetDatePoint(Date $_67a0d624aebcceb0abd5ce56a53ff06f)
    {
        $this->date_point = $_67a0d624aebcceb0abd5ce56a53ff06f;
    }
    public function SetMessage($message)
    {
        $this->message = $message;
    }
    
    
    
    
    
    
    public function SetVlineStatus($status)
    {
        $this->vline_status = (bool) $status;
    }
    
    
    public function SaveStateInSession()
    {
        $_SESSION[$GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_0c817908e7" . "d93ce2001d5" . "32177b39567"]] = $this->date_period_dialog->CreateSaveString();
    }
    
    
    
    
    
    
    
    public static function DeleteUser($user_id, $_2b54660b2595d6c73e7cccac2a759239)
    {
        global $db;
        if ($_2b54660b2595d6c73e7cccac2a759239) {
            $db->query($GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_2436631adb30c9334360c857c" . "283655e"], $_2b54660b2595d6c73e7cccac2a759239, $user_id);
            $db->query($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_be8ffbbf7ecb191" . "0c0f8639476d66e7" . "e"], $_2b54660b2595d6c73e7cccac2a759239, $user_id);
        } else {
            $db->query($GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_d59435061a43acf823638d75444f" . "43f9"], $user_id);
            $db->query($GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_524af00542d2a2eaf8ced927e95b2" . "be2"], $user_id);
            $db->query($GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_66680e34e2cae6a0801bf99" . "88ff68a82"], $user_id);
        }
    }
    
    
    
    
    
    
    
    public static function getBookingType(string $type) : string
    {
        if ($type === $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_5b81cb6cf0bfd990583fc12ddd80" . "cd32"]) {
            return $GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_0c5123aa7" . "44f69bbc0e" . "8b3ea2f6e8" . "47d"]($GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_4a384b4ab3" . "2387adb0f78" . "799ddf7ca26"]);
        }
        return $GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_0c5123aa744f69b" . "bc0e8b3ea2f6e847" . "d"]($GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_7fa28d851687b042900d" . "7b67ad8dc6d0"]);
    }
    
    
    
    
    
    
    
    
    public static function getBookingsType(string $type, array $_a966c9aa4a80f731c55a0fa7bc924bb9 = []) : string
    {
        if ($type === $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_2acee844826" . "29451244aab9" . "6a01623cd"] && $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_33f09d76394b074b779265f857" . "d5ec8a"]($_a966c9aa4a80f731c55a0fa7bc924bb9) > 0) {
            return $GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_0c5123a" . "a744f69b" . "bc0e8b3e" . "a2f6e847" . "d"]($GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_17d741381b" . "d4f45145c85" . "bb786c072b4"]);
        }
        return self::getBookingType($type);
    }
}