<?php
$html_dir = (in_array($this->_('AppController.lang.dir', true), ['ltr', 'rtl']) ? $this->_('AppController.lang.dir', true) : 'ltr');
$html_lang = (!empty($language) ? substr($language, 0, 2) : 'en');
?><!DOCTYPE html>
<html dir="<?php (print (isset($html_dir) ? $this->Html->safe($html_dir) : null));?>" lang="<?php (print (isset($html_lang) ? $this->Html->safe($html_lang) : null));?>" xml:lang="<?php (print (isset($html_lang) ? $this->Html->safe($html_lang) : null));?>">
    <head>
        <meta http-equiv="content-type" content="text/html" />
        <meta name="referrer" content="never" />
        <meta charset="UTF-8" />
        <title><?php echo $this->Html->safe(((isset($page_title) ? $page_title : null) ? $page_title . ' | ' : '') . (isset($system_company->name) ? $system_company->name : null));?></title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <?php if (!empty($client_icon)) {  ?> <link rel="shortcut icon" href="<?php echo $this->Html->safe($client_icon);?>" /> <?php } 
        else {  ?>
        <link rel="shortcut icon" href="<?php echo $this->view_dir;?>images/favicon.ico" />
        <?php }?>

        <link href="<?php echo $this->view_dir;?>css/application.min.css" rel="stylesheet" type="text/css" />
        <?php
        // Theme CSS
        if (isset($theme_css)) {
        ?>
        <link href="<?php (print (isset($theme_css) ? $this->Html->safe($theme_css) . '&hash=' . $this->Html->safe($theme_hash ?? '') : null));?>" rel="stylesheet" type="text/css" media="screen" />
<?php
}
if (!empty($custom_css)) {
?>
<style><?php echo $custom_css;?></style><?php
        }
        if ($this->_('AppController.lang.dir', true) == 'rtl') {
        ?>
        <link href="<?php echo $this->view_dir;?>css/rtl.css" rel="stylesheet" type="text/css" media="screen" />
        <?php
        }
        ?>
        <link href="<?php echo $this->view_dir;?>css/font-awesome.min.css" rel="stylesheet" type="text/css" />
        <link href="<?php echo $this->view_dir;?>css/font-awesome-shims.min.css" rel="stylesheet" type="text/css" />

        <script type="text/javascript" src="<?php echo $this->view_dir;?>javascript/jquery.min.js"></script>
        <script type="text/javascript" src="<?php echo $this->view_dir;?>javascript/jquery-migrate.min.js"></script>
        <!--[if lt IE 10]>
            <script type="text/javascript" src="<?php echo $this->view_dir;?>javascript/history/json2.js"></script>
        <![endif]-->
        <script type="text/javascript" src="<?php echo $this->view_dir;?>javascript/history/history.adapter.jquery.js"></script>
        <script type="text/javascript" src="<?php echo $this->view_dir;?>javascript/history/history.js"></script>
        <!--[if lt IE 10]>
            <script type="text/javascript" src="<?php echo $this->view_dir;?>javascript/history/history.html4.js"></script>
        <![endif]-->
        <script type="text/javascript" src="<?php echo $this->Html->safe($this->view_dir . 'javascript/app.min.js' . (!empty($hash_version) ? '?v=' . $hash_version : ''));?>"></script>

        <?php
        echo $this->Javascript->getFiles('head');
        echo (isset($custom_head) ? $custom_head : null);
        ?>

        <!--[if lt IE 9]>
            <script src="<?php echo $this->view_dir;?>javascript/html5shiv.js" type="text/javascript"></script>
            <script src="<?php echo $this->view_dir;?>javascript/respond.min.js" type="text/javascript"></script>
        <![endif]-->
        <?php echo (isset($head) ? $head : null);?>
    </head>
    <body class="<?php echo $this->Html->safe($css_route_class ?? ''); ?>">
        <?php echo (isset($body_start) ? $body_start : null);?>

          <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
        <div class="container">
       <div class="logo">
                    <a href="<?php echo $this->Html->safe($this->base_uri);?>">
                        <?php
                        if (!empty($theme_logo)) {
                        ?>
                            <img src="<?php $this->Html->_($theme_logo);?>" alt="<?php echo $this->Html->ifSet($system_company->name); ?>" />
                        <?php
                        } elseif (!empty($blesta_logo)) {
                        ?>
                            <img class="blesta" src="<?php $this->Html->_($blesta_logo);?>" alt="Blesta" />
                        <?php
                        } else {
                        ?>
                            <img class="blesta" src="<?php echo $this->view_dir;?>images/logo-color.svg" alt="Blesta" />
                        <?php
                        }
                        ?>
                    </a>
                </div>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        
        <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <ul class="navbar-nav mr-auto">
           <?php
                        $active_nav = null;
                        ?>
                            <?php
                            foreach ($this->Html->ifSet($nav, []) as $link => $value) {
                                $attributes = ['class' => ['nav-item']];
                                $link_attributes = ['class' => ['nav-link']];
                                $dropdown = !empty($value['sub']);
                                $active = false;

                                if ($value['active']) {
                                    $active = true;
                                    $attributes['class'][] = 'active';
                                    $active_nav = $value;
                                }
                                if ($dropdown) {
                                    $attributes['class'][] = 'dropdown';
                                    $link_attributes['class'][] = 'dropdown-toggle';
                                    $link_attributes['data-toggle'][] = 'dropdown';

                                    // Set parent to active if child is
                                    if (!$active) {
                                        foreach ($this->Html->ifSet($value['sub'], []) as $sub_link => $sub_value) {
                                            if ($sub_value['active']) {
                                                $attributes['class'][] = 'active';
                                                break;
                                            }
                                        }
                                    }
                                }
                            ?>
                            <li<?php echo $this->Html->buildAttributes($attributes);?>>
                                <a href="<?php $this->Html->_($link);?>"<?php echo $this->Html->buildAttributes($link_attributes);?>>
                                    <i class="<?php $this->Html->_($value['icon']);?>"></i>
                                    <?php
                                    $this->Html->_($value['name']);
                                    ?>
                                </a>
                                <?php
                                if (!empty($value['sub'])) {
                                ?>
                                <div class="dropdown-menu">
                                    <?php
                                    foreach ($this->Html->ifSet($value['sub'], []) as $sub_link => $sub_value) {
                                    ?>
                                    <a class="dropdown-item" href="<?php $this->Html->_($sub_link);?>"><i class="<?php $this->Html->_($sub_value['icon']);?>"></i> <?php $this->Html->_($sub_value['name']);?></a>
                                    <?php
                                    }
                                    ?>
                                </div>
                                <?php
                                }
                                ?>
                            </li>
                            <?php
                            }
                            ?>
                        </ul>
                        <ul class="navbar-nav">
                            <?php
                            if ($this->Html->ifSet($logged_in)) {
                            ?>
                            <li class="nav-item dropdown">
                                <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">
                                    <?php $this->Html->_($contact->first_name);?> <?php $this->Html->_($contact->last_name);?>
                                    <b class="caret"></b>
                                </a>
                                <div class="dropdown-menu">
                                    <a class="dropdown-item" href="<?php echo $this->Html->safe($this->client_uri . 'main/edit/');?>"><i class="fas fa-edit fa-fw"></i> <?php $this->_('AppController.client_structure.text_update_account');?></a>
                                    <?php
                                    if ($this->Html->ifSet($has_email_permission)) {
                                    ?>
                                    <a class="dropdown-item" href="<?php echo $this->Html->safe($this->client_uri . 'emails/');?>"><i class="fas fa-inbox fa-fw"></i> <?php $this->_('AppController.client_structure.text_emails');?></a>
                                    <?php
                                    }

                                    if ($this->Html->ifSet($portal_installed, false)) {
                                    ?>
                                    <a class="dropdown-item" href="<?php echo $this->Html->safe(WEBDIR);?>"><i class="far fa-circle fa-fw"></i> <?php $this->_('AppController.client_structure.text_return_to_portal');?></a>
                                    <?php
                                    }
                                    ?>
                                    <div class="dropdown-divider"></div>
                                    <a class="dropdown-item" href="<?php echo $this->Html->safe($this->client_uri . 'logout/');?>"><i class="fas fa-sign-out-alt fa-fw"></i> <?php $this->_('AppController.client_structure.text_logout');?></a>
                                </div>
                            </li>
                            <?php
                            } else {
                            ?>
                            <li class="nav-item">
                                <a class="nav-link" href="<?php echo $this->Html->safe($this->client_uri . 'login/');?>">
                                    <?php $this->_('AppController.client_structure.text_login');?>
                                </a>
                            </li>
                            <?php
                            }
                            ?>
                      
            </ul>

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

        <br />

        <?php echo $this->Html->ifSet($body_start);?>

        <?php
        if ($this->Html->ifSet($show_header, true)) {
        ?>

        <!--
        <div class="header">
            <div class="container-md">
                <div class="logo">
                    <a href="<?php echo $this->Html->safe($this->base_uri);?>">
                        <?php
                        if (!empty($theme_logo)) {
                        ?>
                            <img src="<?php (print (isset($theme_logo) ? $this->Html->safe($theme_logo) : null));?>" alt="<?php echo (isset($system_company->name) ? $system_company->name : null); ?>" />
                        <?php
                        } elseif (!empty($blesta_logo)) {
                        ?>
                            <img class="blesta" src="<?php (print (isset($blesta_logo) ? $this->Html->safe($blesta_logo) : null));?>" alt="Blesta" />
                        <?php
                        } else {
                        ?>
                            <img class="blesta" src="<?php echo $this->view_dir;?>images/logo-color.svg" alt="Blesta" />
                        <?php
                        }
                        ?>
                    </a>
                </div>
                <?php
                if ((isset($staff_as_client) ? $staff_as_client : null)) {
                ?>
                <span class="badge badge-pill badge-info float-right"><a href="<?php echo $this->Html->safe($this->admin_uri . 'clients/logoutasclient/');?>"><span class="fas fa-info-circle"></span> <?php $this->_('AppController.client_structure.staff_as_client_note');?></a></span>
                <?php
                } elseif ((isset($show_language) ? $show_language : null) && count((isset($languages) ? $languages : [])) > 1) {
                ?>
                <div class="top-nav float-right">
                    <?php
                    $this->Form->create($this->client_uri . 'main/setlanguage/', ['id' => 'language_selector']);
                    $this->Form->fieldHidden('redirect_uri', (isset($request_uri) ? $request_uri : null));
                    $this->Form->fieldHidden('language_code', Configure::get('Blesta.language'), ['id' => 'language_code']);
                    $this->Form->end();
                    ?>
                    <ul>
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo (isset($languages[Configure::get('Blesta.language')]) ? $this->Html->safe($languages[Configure::get('Blesta.language')]) : null); ?> <b class="caret"></b></a>
                            <ul class="dropdown-menu dropdown-menu-right" id="language_switcher">
                                <?php
                                foreach ($languages as $code => $language) {
                                ?>
                                <li class="language_code" language_code="<?php echo $this->Html->safe($code);?>"><a href="#"><?php echo $this->Html->safe($language);?></a></li>
                                <?php
                                }
                                ?>
                            </ul>
                        </li>
                    </ul>
                </div>
                <?php
                }
                ?>
            </div>
        </div>
        -->

        <!--
        <div class="nav-content">
            <nav class="navbar navbar-expand-md navbar-dark">
                <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#main-navbar">
                    <span class="navbar-toggler-icon"></span>
                </button>
                <div class="collapse navbar-collapse pb-2 pb-md-0" id="main-navbar">
                    <div class="container-md flex-column flex-md-row align-items-start">
                        <?php
                        $active_nav = null;
                        ?>
                        <ul class="navbar-nav">
                            <?php
                            foreach ((isset($nav) ? $nav : []) as $link => $value) {
                                $attributes = ['class' => ['nav-item']];
                                $link_attributes = ['class' => ['nav-link']];
                                $active = false;

                                if ($value['active']) {
                                    $active = true;
                                    $attributes['class'][] = 'active';
                                    $active_nav = $value;
                                }

                                // Build dropdown
                                $dropdown = false;
                                if (
                                    isset($value['sub'])
                                    && is_array($value['sub'])
                                    && (count($value['sub']) > 1 || !array_key_exists($link, (array)$value['sub']))
                                ) {
                                    $dropdown = true;
                                    $attributes['class'][] = 'dropdown';
                                    $link_attributes['class'][] = 'dropdown-toggle';
                                    $link_attributes['data-toggle'][] = 'dropdown';

                                    // Set parent to active if child is
                                    if (!$active) {
                                        foreach ((isset($value['sub']) ? $value['sub'] : []) as $sub_link => $sub_value) {
                                            if ($sub_value['active']) {
                                                $attributes['class'][] = 'active';
                                                break;
                                            }
                                        }
                                    }
                                }
                            ?>
                            <li<?php echo $this->Html->buildAttributes($attributes);?>>
                                <a href="<?php (print (isset($link) ? $this->Html->safe($link) : null));?>"<?php echo $this->Html->buildAttributes($link_attributes);?>>
                                    <i class="<?php (print (isset($value['icon']) ? $this->Html->safe($value['icon']) : null));?>"></i>
                                    <?php
                                    (print (isset($value['name']) ? $this->Html->safe($value['name']) : null));
                                    ?>
                                </a>
                                <?php
                                if ($dropdown) {
                                ?>
                                <div class="dropdown-menu">
                                    <?php
                                    foreach ((isset($value['sub']) ? $value['sub'] : []) as $sub_link => $sub_value) {
                                    ?>
                                    <a class="dropdown-item" href="<?php (print (isset($sub_link) ? $this->Html->safe($sub_link) : null));?>"><i class="<?php (print (isset($sub_value['icon']) ? $this->Html->safe($sub_value['icon']) : null));?>"></i> <?php (print (isset($sub_value['name']) ? $this->Html->safe($sub_value['name']) : null));?></a>
                                    <?php
                                    }
                                    ?>
                                </div>
                                <?php
                                }
                                ?>
                            </li>
                            <?php
                            }
                            ?>
                        </ul>
                        <ul class="navbar-nav">
                            <?php
                            if ((isset($logged_in) ? $logged_in : null)) {
                            ?>
                            <li class="nav-item dropdown">
                                <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">
                                    <?php (print (isset($contact->first_name) ? $this->Html->safe($contact->first_name) : null));?> <?php (print (isset($contact->last_name) ? $this->Html->safe($contact->last_name) : null));?>
                                    <b class="caret"></b>
                                </a>
                                <div class="dropdown-menu">
                                    <a class="dropdown-item" href="<?php echo $this->Html->safe($this->client_uri . 'main/edit/');?>"><i class="fas fa-edit fa-fw"></i> <?php $this->_('AppController.client_structure.text_update_account');?></a>
                                    <a class="dropdown-item" href="<?php echo $this->Html->safe($this->client_uri . 'accounts/');?>"><i class="fas fa-credit-card fa-fw"></i> <?php $this->_('AppController.client_structure.text_accounts');?></a>
                                    <a class="dropdown-item" href="<?php echo $this->Html->safe($this->client_uri . 'contacts/');?>"><i class="fas fa-users fa-fw"></i> <?php $this->_('AppController.client_structure.text_contacts');?></a>
                                    <?php
                                    if ((isset($has_email_permission) ? $has_email_permission : null)) {
                                    ?>
                                    <a class="dropdown-item" href="<?php echo $this->Html->safe($this->client_uri . 'emails/');?>"><i class="fas fa-inbox fa-fw"></i> <?php $this->_('AppController.client_structure.text_emails');?></a>
                                    <?php
                                    }

                                    if ((isset($portal_installed) ? $portal_installed : false)) {
                                    ?>
                                    <a class="dropdown-item" href="<?php echo $this->Html->safe(WEBDIR);?>"><i class="far fa-circle fa-fw"></i> <?php $this->_('AppController.client_structure.text_return_to_portal');?></a>
                                    <?php
                                    }
                                    ?>
                                    <div class="dropdown-divider"></div>
                                    <a class="dropdown-item" href="<?php echo $this->Html->safe($this->client_uri . 'logout/');?>"><i class="fas fa-sign-out-alt fa-fw"></i> <?php $this->_('AppController.client_structure.text_logout');?></a>
                                </div>
                            </li>
                            <?php
                            } else {
                            ?>
                            <li class="nav-item">
                                <a class="nav-link" href="<?php echo $this->Html->safe($this->client_uri . 'login/');?>">
                                    <?php $this->_('AppController.client_structure.text_login');?>
                                </a>
                            </li>
                            <?php
                            }
                            ?>
                        </ul>
                    </div>
                </div>
            </nav>
        </div>
        <div class="title">
            <div class="container-md">
                <h3><?php echo ((isset($title) ? $title : null) ? (isset($title) ? $this->Html->safe($title) : null) : $this->_('AppController.client_structure.default_title', true));?></h3>
            </div>
        </div>
        <?php
        }
        ?>

        <!-- Begin Content -->
        <div class="container-md">
            <div class="row<?php echo (!(isset($show_header) ? $show_header : true) ? ' login' : '');?>">
                <?php
                if (!empty($active_nav['secondary'])) {
                ?>
                    <div class="col-md-3">
                        <div class="list-group">
                            <?php
                            foreach ($active_nav['secondary'] as $link => $value) {
                                $link = $this->Html->safe((isset($link) ? $link : ''));
                                $prefix = !str_contains($link, '://') ? (isset($this->base_uri) ? $this->Html->safe($this->base_uri) : null) : '';
                            ?>
                                <a href="<?php echo $prefix . $link;?>" class="list-group-item list-group-item-action <?php echo ($value['active'] ? 'active' : '');?>">
                                    <i class="<?php (print (isset($value['icon']) ? $this->Html->safe($value['icon']) : null));?> fa-fw"></i>
                                    <?php
                                    (print (isset($value['name']) ? $this->Html->safe($value['name']) : null));
                                    ?>
                                </a>
                            <?php
                            }
                            ?>
                        </div>
                    </div>
                    <div class="col-md-9">
                        <div class="row">
                            <?php echo $content;?>
                        </div>
                    </div>
                <?php
                } else {
                    echo $content;
                }
                ?>
            </div>
   </div>

   <br />

            <div class="footer" style="background: rgb(29, 29, 29) !important;">
  <div class="container">
     <div class="row">

         <div class="col-md-3">
           <li><a href="web-hosting.php">Web Hosting</a></li>
           <li><a href="virtual-private-servers.php">Virtual Private Servers</a></li>
           <li><a href="dedicated-servers.php">Dedicated Hosting</a></li>
           <li><a href="game-servers.php">Game Servers</a></li>
           <li><a href="#">Domain Registration</a></li>
         </div>

           <div class="col-md-3">
               <li><a href="#">Announcements</a></li>
               <li><a href="#">About us</a></li>
               <li><a href="#">Contact us</a></li>
               <li><a href="tos.php">Terms of Service</a></li>
               <li><a href="#">Acceptable Use Policy</a></li>
           </div>

           <div class="col-md-2">
           <br />
             <a href="#"><i class="fa fa-facebook-square" aria-hidden="true"></i></a>
             <a href="#"><i class="fa fa-twitter-square" aria-hidden="true"></i></a>
             <a href="#"><i class="fa fa-google-plus-square" aria-hidden="true"></i></a>
             </p>
             <a href="#"><i class="fa fa-instagram" aria-hidden="true"></i></a>
             <a href="#"><i class="fa fa-youtube-square" aria-hidden="true"></i></a>
             <a href="#"><i class="fa fa-linkedin-square" aria-hidden="true"></i></a>
           </div>

           <div class="col-md-4">
             <img class="flogo" src="<?php $this->Html->_($blesta_logo);?>">
             <hr style="border-color: rgba(255,255,255,0.06); !important;">
             <p>Lowendhost is a company located in United Kingdom that provides
              Web, VPS and Dedicated hosting. We are you hosting choise.</p>

             <!-- We recommend not removing this -->
                <p><small>Theme designed by <a href="https://aalayer.com">AALayer</a></small></p>
             <!-- As it is a free theme. -->


           </div>



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

           <!--
            <div class="container-fluid">
                <div class="row footer">
                    <div class="col-md-12">
                        <hr />
                        <p class="text-center m-3">Powered by <a href="http://www.blesta.com/">Blesta</a>, &copy; Phillips Data, Inc.</p>
                    </div>
                </div>
            </div>
            -->

        </div>

        <div class="modal fade" id="global_modal" tabindex="-1" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="global_modal_title"></h5>
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                    <div class="modal-body">
                        <i class="fas fa-spinner fa-spin"></i>
                    </div>
                    <div class="modal-footer">
                    </div>
                </div>
            </div>
        </div>

        <?php echo $this->Javascript->getFiles('body');?>
        <?php echo $this->Javascript->getInline();?>
        <?php echo (isset($body_end) ? $body_end : null);?>
    </body>
</html>
