<!doctype html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9" lang=""> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="">
<!--<![endif]-->

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title><?php echo $this->gPageTitle; ?></title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="Shortcut Icon" href="../favicon.ico?v=2"/>
    <script data-cfasync="false">
        var clientexec = {
            sessionHash: "<?php echo $this->gHash; ?>",
            dateFormat: "<?php echo $this->gDateFormat;?>",
            records_per_view: <?php echo $this->recordsPerView;?>,
            admin_id: <?php echo $this->user->getId(); ?>,
            version: '<?php echo $this->gVersion; ?>',
            disableCache: <?php echo (defined('DISABLE_CACHING') && DISABLE_CACHING) ? "true" : "false"; ?>,
            customerId: <?php echo $this->gCustomerId; ?>,
            show_active_customer_panel : <?php echo $this->showingActivePanel ? 'true' : 'false'; ?>,
            show_active_customer_panel_default : <?php echo $this->showingActivePanelDefault ? 'true' : 'false'; ?>,
            admin_email: '<?php echo $this->user->getEmail();?>',
            admin_fullname: "<?php echo $this->escape($this->user->getFullName()) ?>",
            company_url: '<?php echo $this->gClientExecURL;?>',
            company_name: '<?php echo str_replace("'", "\'", $this->gCompanyName);?>',
            ce_version: '<?php echo $this->gInstalledVersion;?>',
            customerId: <?php echo $this->gCustomerId; ?>,
            whoisonline : {},
            tinyBaseURL: '../templates/admin/js/tinymce'
        };

        clientexec.whoisonline = {
            userCount : -1,
            offlineusers : [],
            onlineusers : []
        }

        var gVer = "<?php echo $this->gVersion; ?>";
        var gFuse = "<?php echo $this->gFuse; ?>";
        var gView = "<?php echo $this->gView; ?>";
        var gHash = "<?php echo $this->gHash; ?>";
        var relativePath = "<?php echo $this->gRelativePath; ?>";
    </script>
    <link rel="stylesheet" href="../templates/admin/css/vendor.css">
    <script data-cfasync="false" src="../templates/admin/js/manifest.js"></script>
    <script data-cfasync="false" src="../templates/admin/js/vendor.js"></script>
    <script data-cfasync="false" src="../templates/admin/js/app.js"></script>
</head>

<body>
    <!--[if lt IE 8]>
            <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
        <![endif]-->

    <div class="header">

        <div class="container">
            <div class="wrapper d-flex align-items-center flex-wrap">

                <div class="logo me-3">
                    <a href="index.php?fuse=home&view=dashboard">
                        <img src="../templates/admin/images/logo-black.svg" class="img-fluid" alt="logo">
                    </a>
                </div>


                <div class="header-right d-flex align-items-center">
                    <?php if ($this->canViewGlobalSearch) { ?>
                    <div class="search-toggles me-3">
                        <button class="btn-search show"><i class="icon-ic-1"></i></button>
                        <button class="btn-close hide hidden"><i class="icon-ic-10"></i></button>
                    </div>

                    <div class="search-target me-3">
                        <div class="main-search position-relative">

                            <input type="text" id="searchInput" class="searchBarInput form-control"
                                placeholder="<?php echo $this->user->lang('Quick Search...'); ?>" autocomplete="off">

                            <a id="clear-search" href="#" style="display:none;">
                                <i class="icon-ic-10"></i>
                            </a>

                            <div id="search-results"
                                class="results-list hideResults position-absolute mt-2 bg-white shadow rounded border">
                            </div>

                        </div>
                    </div>
                    <?php } ?>

                    <div class="bind-it d-flex align-items-center ms-auto">

                        <div class="notification-wrap d-flex align-items-center">

                            <a href="#" id="notification-toggle" class="me-3 position-relative">
                                <i class="fas fa-bell"></i>
                                <span class="count red"></span>
                            </a>

                            <?php
                            echo $this->partial(
                                'views/admin/partials/notificationpanel.phtml',
                                []
                            );
                            ?>

                            <a id="crisp-open" href="#" class="me-3 d-none">
                                <i class="fas fa-comment-dots"></i>
                            </a>

                        </div>

                        <div class="current-user ms-2">

                            <a href="javascript:void(0)" class="user-toggle d-flex align-items-center">

                                <span class="avatar me-2">
                                    <img src="<?php echo $this->adminProfileUrl; ?>" class="img-fluid" alt="">
                                </span>

                                <div class="user-tag">
                                    <span>
                                        <?php echo $this->user->lang("Hello"); ?>
                                    </span>
                                    <h5 class="mb-0">
                                        <?php echo $this->escape($this->user->getFirstName()) ?>
                                    </h5>
                                </div>

                            </a>

                            <ul>
                                <li>
                                    <a href="index.php?fuse=admin&view=editaddadminaccount&controller=staff">
                                        <span class="icon-user"></span>
                                        <?php echo $this->user->lang("My Profile"); ?>
                                    </a>
                                </li>

                                <li>
                                    <a href="index.php?fuse=admin&view=staffsettings&controller=staff">
                                        <span class="icon-engineering"></span>
                                        <?php echo $this->user->lang("My Preferences"); ?>
                                    </a>
                                </li>

                                <li>
                                    <a id="my-notes" href="#">
                                        <span class="icon-engineering"></span>
                                        <?php echo $this->user->lang("My Notes"); ?>
                                    </a>
                                </li>

                                <li>
                                    <a id="dashboard-settings" href="#">
                                        <span class="icon-engineering"></span>
                                        <?php echo $this->user->lang("Dashboard Settings"); ?>
                                    </a>
                                </li>

                                <li>
                                    <a id="help-icon" href="#">
                                        <span class="icon-information"></span>
                                        <?php echo $this->user->lang("Help"); ?>
                                    </a>
                                </li>

                                <li>
                                    <a href="<?php echo $this->urlCsrf(['fuse' => 'admin', 'action' => 'Logout']); ?>">
                                        <span class="icon-logout"></span>
                                        <?php echo $this->user->lang("Logout"); ?>
                                    </a>
                                </li>
                            </ul>

                        </div>

                        <?php if ($this->gCustomerId > 0) { ?>
                        <a href="javascript:void(0)" class="settings-btn">
                            <i class="fas fa-users-cog"></i>
                        </a>
                        <?php } ?>

                    </div>
                </div>
            </div>
        </div>
    </div>

    <aside class="left-sidebar">
        <div class="left-toggle"></div>
         <?php
            echo $this->partial(
                'views/admin/partials/mainmenu.phtml',
                [
                    'menucounts' => $this->menucounts,
                    'user' => $this->user,
                    'gView' => $this->gView,
                    'menus' => $this->menus
                ]
            );
        ?>
    </aside>

    <!-- RIGHT SIDE BAR -->
    <aside id="active-customer-panel" class="right-sidebar">
        <?php echo $this->unescape($this->active_customer_panel); ?>
    </aside>
    <!-- RIGHT SIDE BAR END-->

    <!-- CONTENT AREA -->
    <div class="content-area">
        <div class="container content" id="view-<?php echo $this->gView;?>">
        <?php if ($this->gUserLoginDisabledNotice != '') {
            echo '<div class="alert alert-danger" role="alert">'.$this->gUserLoginDisabledNotice.'</div>';
        }?>
            <?php echo $this->unescape($this->top_global_html);?>
            <?php echo $this->layout()->CONTENT ?>
        </div>

    </div>
    <!-- CONTENT AREA END-->
    <footer class="footer mb-3">
        <div class="container">
            <div class="copyright">
                <div class="ce-executiontime small text-muted text-center d-flex flex-column align-items-center">

                    <a href="https://www.clientexec.com?source=feedback"
                       target="_blank"
                       class="text-decoration-none d-inline-flex align-items-center gap-2">
                        <span><?php echo $this->user->lang('Powered by'); ?></span>

                        <img src="../templates/admin/images/logo-black.svg"
                             alt="Clientexec"
                             class="brand-logo img-fluid">

                        <span><?php echo $this->gInstalledVersion; ?></span>
                    </a>

                    <?php if ($this->gLatestVersion != '') { ?>
                        <div>
                            <?php if (defined('HOSTED') && HOSTED === true) { ?>
                                <a target="_blank"
                                   href="//www.clientexec.com/members/index.php?fuse=support&controller=ticket&view=submitticket"
                                   class="text-danger fw-semibold text-decoration-none">
                                    <?php echo $this->gLatestVersion; ?><br>
                                    <span class="fw-normal">
                                        <?php echo $this->user->lang('Please Contact Clientexec Support to Upgrade'); ?>
                                    </span>
                                </a>
                            <?php } else { ?>
                                <a href="index.php?fuse=admin&sessionHash=<?php echo $this->gHash; ?>&action=Logout&upgrade=1"
                                   class="text-danger fw-semibold text-decoration-none">
                                    <?php echo $this->gLatestVersion; ?>
                                </a>
                            <?php } ?>
                        </div>
                    <?php } ?>

                    <?php if ($this->isTrial) { ?>
                        <div class="text-danger fw-semibold">
                            <?php echo $this->user->lang('Trial Version'); ?>
                        </div>
                    <?php } ?>

                    <?php if ($this->gExecutionTime != "") { ?>
                        <div>
                            <?php echo $this->user->lang(
                                'Execution Time: %s seconds',
                                $this->gExecutionTime
                            ); ?>
                        </div>
                    <?php } ?>

                </div>

            </div>
        </div>
    </footer>
</body>
<script data-cfasync="false" type="text/javascript">
    $(document).ready(function() {
    <?php
        //show any messages provided from actions performed
        $alertMsg ="";
        if (count($this->gMessages)>0) {
            foreach ($this->gMessages as $message) {
                $alertMsg .= addslashes($message)." ";
            }
        }
        if (count($this->gErrorMessages)>0) {
            foreach ($this->gErrorMessages as $message) {
                $alertMsg .= addslashes($message)." ";
            }
        }
        if ( ($alertMsg!="") && (count($this->gErrorMessages)>0) ) {
            echo "clientexec.error('".$alertMsg."');";
        } else if ($alertMsg!="") {
            echo "clientexec.msg('".$alertMsg."');";
        }
        //show splashscreen
        if ($this->showSplashScreen) { echo "loadSplahScreen();"; }
    ?>
    });

    $('#dashboard-settings').on('click', function() {
        clientexec.showDashboardSettings();
    });

    $('#my-notes').on('click', function() {
        clientexec.myNotes();
    });

    $('#help-icon').on('click', function(e) {
        $('#feedback_tab').trigger('click');
    })
</script>
<script data-cfasync="false" type="text/javascript" src="//js.clientexec.rocks/ping.js?k=<?php echo $this->e_hash;?>"></script>
<link href="../templates/admin/css/supportwidget.css" media="screen" rel="stylesheet" type="text/css" />
<script src="../templates/admin/js/supportwidget.js" type="text/javascript"></script>
<script data-cfasync="false" type="text/javascript">
    if (typeof(CESupportWidget) !== "undefined") {
        supportwidget_params = {
            url:         "https://www.clientexec.com/members",
            tabPosition: "left",
            tabId:       "help",
            hide_tab: true,
            forceSuggestions: true,
            ticketTypeId: 22
        };
    }
</script>
</html>