<?php
$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"] = (@$GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"] ?: array()) + array("_4094d48ee4a" . "46e946566af3" . "fe8337494" => base64_decode("ZGF0Z" . "V9kYX" . "Rl"), "_be8ffbbf7ecb1910c0f8639476d" . "66e7e" => base64_decode("VVBEQVRFIHJiX2NvbmZpcm0gU" . "0VUIHVzZXJfaWQ9aW50Om5ld1" . "91aWQgV0hFUkUgdXNlcl9pZD1" . "pbnQ6b2xkX3VpZA=="), "_ba88e10a" . "3b13be070" . "866b09bfb" . "b6142c" => base64_decode("Y2FsZW5kYX" . "JfZWRpdA=="), "_f945051f9189ca77f5b5ed881562" . "f129" => base64_decode("Y2ZnX2RlZmF1bHRfcm9vb" . "V9ib29raW5nX3ZpZXc="), "_4a384b4ab" . "32387adb0f" . "78799ddf7c" . "a26" => base64_decode("cm9vbXMuY29tbW9uLmZhY" . "w=="), "_7fa28d851687b042900d7" . "b67ad8dc6d0" => base64_decode("cm9vbXMuY" . "29tbW9uLn" . "Jvb20="), "_2436631adb30c9334360c" . "857c283655e" => base64_decode("VVBEQVRFIHJiX2xpbmtzIFNFVCB2YWw9aW50Om5ld191aWQgV0hFU" . "kUgdHlwZT0nb3duZXInIEFORCB2YWw9aW50Om9sZF91aWQ="), "_7f628626dd1d55c71b1fc0932ff" . "d1d2c" => base64_decode("aXNfYXJyYX" . "k="), "_0c817908e7d93c" . "e2001d532177b39" . "567" => base64_decode("cmJfZGF0ZV9mb3JtX2RpYWxvZ19zdHJp" . "bmc="), "_78b508c822" . "621d7c4777e" . "d7b8394c1d1" => base64_decode("cmJfZWRpd" . "F9ldmVudA" . "=="), "_d59435061" . "a43acf8236" . "38d75444f4" . "3f9" => base64_decode("REVMRVRFIEZST00gcmJfZXZlbnRzIFdIRVJFIGlkIElOIChTRUxFQ1Qgb2JqX" . "2lkIEZST00gcmJfbGlua3MgV0hFUkUgdHlwZT0nb3duZXInIEFORCB2YWw9aW" . "50OnVpZCBBTkQgYm9va2luZz0xKQ=="), "_66680e34e2cae6a0801bf9988ff6" . "8a82" => base64_decode("REVMRVRFIEZST00gcmJfY29uZmlybSB" . "XSEVSRSB1c2VyX2lkPWludDp1aWQ="), "_17d741381bd4f45145c" . "85bb786c072b4" => base64_decode("cm9vbXMuYWRtaW4ubWFp" . "bg=="), "_33f09d76394b074b7" . "79265f857d5ec8a" => base64_decode("Y291" . "bnRf" . "c2Fm" . "ZQ=="), "_0c5123aa744" . "f69bbc0e8b3e" . "a2f6e847d" => base64_decode("bG1z" . "Zw=="), "_6b63966ac430b54299bf53effb37363" . "8" => base64_decode("cmJfaGVscF9zdGF0dXM" . "="), "_5b81cb6cf0bfd990583fc12ddd80cd" . "32" => base64_decode("Z" . "m" . "F" . "j"), "_2acee8448262945" . "1244aab96a01623c" . "d" => base64_decode("cm9" . "vbQ" . "=="), "_c06c961f393742ecfd" . "52b72263ac9470" => base64_decode("aW50dmF" . "s"), "_524af00542d2a2eaf" . "8ced927e95b2be2" => base64_decode("REVMRVRFIEZST00gcmJfbGlua3" . "MgV0hFUkUgdHlwZT0nb3duZXIn" . "IEFORCB2YWw9aW50OnVpZA=="), "_818943b6bc83aa09db98f48e5c" . "8344cf" => base64_decode("cm9vbXMucmJ0b29sa" . "2l0LnNldF9kaWFncm" . "FtX2VkZ2VzX2JlZm9" . "yZV9jYWxs"), "_fc6b6c947f57732843e2e78" . "4470ad46f" => base64_decode("cmJfdGltZ" . "Q=="));
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["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_0c817908" . "e7d93ce20" . "01d532177" . "b39567"]])) {
            $_74c89f1628eb5b0bca39b50e92340e2e->LoadFromString($_SESSION[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_0c817908e7" . "d93ce2001d5" . "32177b39567"]]);
        }
        $this->SetDatePeriodDialog($_74c89f1628eb5b0bca39b50e92340e2e);
    }
    public function ResetStateToDefault()
    {
        unset($_SESSION[$GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_fc6b6c9" . "47f57732" . "843e2e78" . "4470ad46" . "f"]]);
        unset($_SESSION[$GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_6b63966ac430b54299bf53" . "effb373638"]]);
        unset($_SESSION[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_ba88e10a3b1" . "3be070866b09" . "bfbb6142c"]]);
        unset($_SESSION[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_78b508c8" . "22621d7c4" . "777ed7b83" . "94c1d1"]]);
        $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["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_f945051" . "f9189ca7" . "7f5b5ed8" . "81562f12" . "9"]);
    }
    public function GetCheckedFacilities()
    {
        return (array) $this->checked_facilities;
    }
    public function GetCheckedRooms()
    {
        return (array) $this->checked_rooms;
    }
    public function GetDiagramEdges()
    {
        if ($GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_7f628626dd1" . "d55c71b1fc09" . "32ffd1d2c"]($this->diagram_edge_array)) {
            return $this->diagram_edge_array;
        }
        throw new Exception($GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_0c5123aa744f69bbc0e8b3ea2f6e" . "847d"]($GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_818943b6bc83aa09db98f48e5c83" . "44cf"]));
    }
    
    
    
    
    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["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_c06c961f" . "393742ecf" . "d52b72263" . "ac9470"]($_697c39cdce3e4154b716cdd3b4e80ff5);
    }
    public function SetDatePeriodDialog($_7a88ba74ced2f19e964be742dd8dea0a)
    {
        $this->date_period_dialog = $_7a88ba74ced2f19e964be742dd8dea0a;
        $this->date_period_dialog->SetPrefix($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_4094d48e" . "e4a46e946" . "566af3fe8" . "337494"]);
        $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["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_0c817908e7d93ce2" . "001d532177b39567"]] = $this->date_period_dialog->CreateSaveString();
    }
    
    
    
    
    
    
    
    public static function DeleteUser($user_id, $_2b54660b2595d6c73e7cccac2a759239)
    {
        global $db;
        if ($_2b54660b2595d6c73e7cccac2a759239) {
            $db->query($GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_2436631adb30c9334360c" . "857c283655e"], $_2b54660b2595d6c73e7cccac2a759239, $user_id);
            $db->query($GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_be8ffbbf7ecb1910c0" . "f8639476d66e7e"], $_2b54660b2595d6c73e7cccac2a759239, $user_id);
        } else {
            $db->query($GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_d59435061a43ac" . "f823638d75444f4" . "3f9"], $user_id);
            $db->query($GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_524af00542d2a2eaf" . "8ced927e95b2be2"], $user_id);
            $db->query($GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_66680e34e2cae6a0801bf9988ff68" . "a82"], $user_id);
        }
    }
    
    
    
    
    
    
    
    public static function getBookingType(string $type) : string
    {
        if ($type === $GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_5b81cb6cf0bfd9905" . "83fc12ddd80cd32"]) {
            return $GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_0c5123aa744f69bb" . "c0e8b3ea2f6e847d"]($GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_4a384b4ab32387adb0f78799ddf7ca2" . "6"]);
        }
        return $GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_0c5123aa744" . "f69bbc0e8b3e" . "a2f6e847d"]($GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_7fa28d851687b0" . "42900d7b67ad8dc" . "6d0"]);
    }
    
    
    
    
    
    
    
    
    public static function getBookingsType(string $type, array $_a966c9aa4a80f731c55a0fa7bc924bb9 = []) : string
    {
        if ($type === $GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_2acee8448262945" . "1244aab96a01623c" . "d"] && $GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_33f09d7" . "6394b074" . "b779265f" . "857d5ec8" . "a"]($_a966c9aa4a80f731c55a0fa7bc924bb9) > 0) {
            return $GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_0c5123aa744f69bbc0e8b3ea" . "2f6e847d"]($GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_17d741381bd4f45145c85bb786c" . "072b4"]);
        }
        return self::getBookingType($type);
    }
}