<!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">
    <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; ?>,
        }

        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>
    <script src="https://cdn.datatables.net/v/dt/dt-1.10.22/r-2.2.6/sc-2.0.3/sl-1.7.0/rr-1.2.7/datatables.min.js" crossorigin="anonymous"></script>

    <link rel="stylesheet" href="https://cdn.datatables.net/rowgroup/1.1.2/css/rowGroup.dataTables.min.css">
    <script src="https://cdn.datatables.net/rowgroup/1.1.2/js/dataTables.rowGroup.min.js"></script>

    <script src="../templates/admin/js/tinymce/tinymce.min.js" referrerpolicy="origin" crossorigin="anonymous"></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">
                <div class="logo">
                    <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">
                    <div class="search-toggles">
                        <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">
                        <div class="main-search">
                            <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>
                        <div id="search-results" class="results-list hideResults">
                        </div>
                    </div>
                      <div class="bind-it">
                        <div class="notification-wrap">
                            <!-- <a href="#"><i class="icon-ic-2"></i><span class="count red">2</span></a> -->
                            <a id="crisp-open" href="#">
                                <i class="fas fa-comments"></i>
                            </a>
                            <!-- <a href="#"><i class="icon-ic-4"></i><span class="count gey">8</span></a> -->
                        </div>
                        <div class="current-user">
                            <a href="javascript:void(0)" class="user-toggle">
                                <span class="avatar"><img src="<?php echo $this->adminProfileUrl; ?>" class="img-fluid" alt=""></span>
                                <div class="user-tag">
                                    <span>
                                        <?php echo $this->user->lang("Hello");?>
                                    </span>
                                    <h5><?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> My Profile</a></li>
                                <li><a href="index.php?fuse=admin&view=staffsettings&controller=staff"><span class="icon-engineering"></span> My Preferences</a></li>
                                <li><a id="my-notes" href="#"><span class="icon-engineering"></span> My Notes</a></li>
                                <li><a id="dashboard-settings" href="#"><span class="icon-engineering"></span> Dashboard Settings</a></li>
                                <li><a href="#"><span class="icon-information"></span> Help</a></li>
                                <li><a href="<?php echo $this->urlCsrf(['fuse' => 'admin', 'action' => 'Logout']); ?>"><span class="icon-logout"></span> 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 echo $this->unescape($this->top_global_html);?>
            <?php echo $this->layout()->CONTENT ?>
        </div>

    </div>
    <!-- CONTENT AREA END-->
    <footer class="footer">
        <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();
    });
</script>
<script data-cfasync="false" type="text/javascript" src="//js.clientexec.rocks/ping.js?k=<?php echo $this->e_hash;?>"></script>
</html>