<link rel="stylesheet" href="<?php echo $this->request->webroot; ?>css/iconarea.css?1.0.0">
<link rel="stylesheet" href="<?php echo $this->request->webroot; ?>rtgv3/css/conv_core.css">

<style>
    @media screen and (max-width: 767px) {
        #avt-flt {
            float: none;
        }
        #cmpny {
            margin-right: calc(100% - 110px);
        }
    }

    ul.submenu-child{
        list-style: none;

        border-radius: 4px;
        margin-top: 5px;
        padding:0;
    }
    .submenu-child li{

    }
    i.child-parent-icon{
        color: orangered !important;
    }
    .submenu-child li a{
        background: crimson !important;
        color: gainsboro !important;
    }
    .submenu-child li a:hover, .submenu-child li a.active{
        color: white !important;
    }
</style>

<?php 
$controller = $this->request->params['controller'];

$method = $this->request->params['action'];

$temp_client_controller = $controller;
$is_active = false;
$temp_controller = ['Personalizes','AutomationSchedule','Education','Help','SetupMemberMessage'];
if($controller == 'Client' && $method == 'clientonboarding'){
    $temp_client_controller = "";
    $is_active = true;
}
if($_SESSION['userType']== CONTACT_USER_INDICATOR){
        //$member_website = CLIENT_PORTAL_DOMAIN;
        $company_name = "";
        $member_phone = $_SESSION['Auth']['User']['member_phone'];//member_phone
        $member_website = $_SESSION['Auth']['User']['member_website'];//member_website
        //$member_website = CLIENT_PORTAL_DOMAIN;//member_website
        if(!empty($_SESSION['Auth']['User']['company_name'])){
            $company_name = $_SESSION['Auth']['User']['company_name'];
        }else if($_SESSION['Auth']['User']['member_name']){
            $company_name = $_SESSION['Auth']['User']['member_name'];
        }

        $client_notification = $_SESSION['client_notification'];
        $total_note_count_for_client = count($client_notification['client_note']);
        
        if(APP_SERVER_HOST_URL == CLIENT_PORTAL_DOMAIN){
            if(empty($_SESSION['Auth']['User']['logo'])){
                $client_logo = $this->Url->build(CLIENT_PORTAL_LOGO);
            }
        }
        
    ?>
 <?php if ($total_note_count_for_client > 0) { ?>

 <?php } ?>
<style>
    .container-fluid, .ka-header {
       padding:0 !important;
       margin-top:0 !important;
    }
    .badge {
    padding: 1px 5px 0px 5px;
    font-size: 10px;
    letter-spacing: 0.1px;
    vertical-align: baseline;
    background-color: transparent;
    border: 1px solid transparent;
}
.dropdown-content-body{
        max-height: 340px;
        overflow-y: auto;
    }
    .dropdown-content-footer{
        display: block;
        padding: 7px;
        text-align: center;
        color: #333333;
    }
    #media-heading-new{
        padding-left: 0;
        color: #009cf9;
        font-weight: bold;
    }
     .width-350.dropdown-menu{
        min-width: 350px;
    }
    
   

</style>
        <div id="new-top-navbar">
            <div class="row">
                <div class="col-md-3 col-sm-6 col-xs-6 col-12">
                    <p class="ntn-first-p">
                        <!-- Fax: (999) 999-9999 <img src="https://i.pravatar.cc/64?img=3" /> -->
                        <img id="cmpny" class="img-responsive ka-logo center-block" src="<?php echo $client_logo; ?>" />
                        <strong><?php echo $company_name; ?></strong><br>
                        <span style="word-break: break-word;">Tel: <?php echo $member_phone; ?> </span><br>
                        <span style="word-break: break-word;"><?php echo $member_website; ?></span>
                    </p>
                </div>
                    <div class="col-md-7 col-sm-6 col-xs-6 col-12 text-right" >
                        
                        <ul class="ka-nav member-notification pull-right">
                            <li class="dropdown">
                                <a title="Notes" href="#" class="dropdown-toggle" data-toggle="dropdown" style="text-decoration:none;">
                                    <i class="fa fa-sticky-note-o"></i>
                                    <span class="badge badge-light note-count" style="background-color:#e94b35;position: absolute;"><?php echo $total_note_count_for_client > 0 ? $total_note_count_for_client:"";  ?></span>
                                    
                                </a>
                                <i style="position: absolute;display:none;top: 0;right: 0;" id="top-id" class="fa fa-spinner fa-spin"></i>
                                 <?php if ($total_note_count_for_client > 0) { ?>
                                        <div class="dropdown-menu dropdown-content width-350">

                                            <div class="dropdown-content-heading">Notes</div>
                                            <ul class="media-list dropdown-content-body">
<!--
                                                                        <li class="media date-step content-divider">
                                                                            <span>Mon, 2020-Jan-27</span>
                                                                        </li>   -->
                                                <?php
                                                if (!empty($client_notification['client_note'])) {
                                                    foreach ($client_notification['client_note'] as $note_id => $title) {
                                                        ?>
                                                        <li class="media" id="notelist-<?php echo $note_id; ?>">
                                                            <div class="media-left">
                                                                <img src="<?php echo $this->request->webroot; ?>rtgv3/images/placeholder.jpg" class="img-circle img-sm" alt="">
                                                                <span class="badge bg-danger-400 media-badge">4</span>
                                                            </div>

                                                            <div class="media-body">
                                                                <a  href="#" onclick="getMessage('<?php echo $note_id;?>','<?php echo $title;?>')" class="media-heading" id="media-heading-new">

                                                                    <span class="text-semibold"><?php echo $title; ?> </span>
                                <!--                                    <span class="media-annotation pull-right">06:55 AM</span>-->
                                                                </a>

<!--                                                                <span class="text-muted"><?php echo $client_message['email']; ?> </span>-->
                                                            </div>
                                                        </li> 
                                                        <?php
                                                    }
                                                }
                                                ?>
                                            </ul>


                                        </div>
                                <?php } ?>
                                </li>
                            <li class="dropdown">
                                <a title="Message" href="<?php echo $this->Url->build(["controller" => 'Clientmessage', "action" => "clientmessage"]); ?>"  style="text-decoration:none;">
                                    <i class="fa fa-envelope-o"></i>
                                    <span class="badge badge-light" style="background-color:#e94b35;position: absolute;"><?php echo $client_notification['client_message'] > 0 ? $client_notification['client_message'] : ""; ?></span>
                                </a>
                            </li>
                        </ul>   
                    </div>
                    <div class="col-md-2 col-sm-6 col-xs-6 col-12 text-right" style="padding-left: 0;">
                    <p class="ntn-last-p">
                        <img id="avt-flt" src="<?php echo $this->Url->build('/images/top_link_img/avatar-30.png'); ?>" />
                        <strong style="display:block;"><?php echo $_SESSION['Auth']['User']['client_name']; ?></strong>
                        <span>
                            <a href="<?php echo $this->Url->build(["controller" => "Cmsusers","action" => "contactedit"]); ?>">My Account</a>
                            &nbsp;|&nbsp;
                            <a href="<?php echo $this->Url->build(["controller" => "users","action" => "logout","member_id"=>$_SESSION['Auth']['User']['id']]);?>">Logout</a>
                        </span>
                    </p>
                </div>
            </div>
        </div>

<?php } ?>
<?php  if($_SESSION['userType']== CRM_USER_INDICATOR && $_SESSION['Auth']['User']['type'] == 1 && !$this->Common->isEmployeeAsAdmin()){
    
    ?>
<div class="row top-icon-area">
    <div class="col-md-12 col-xs-12">
        <ul class="newTopMenu newtopmenu2">
                <li class="<?php echo $controller == 'Statistics' ? 'active' : ''; ?>">
                    <a style="padding:9px;" class="<?php echo $controller == 'Statistics' ? 'active' : ''; ?>" href="<?php echo $this->Url->build(["controller" => 'Statistics', "action" => "index"]); ?>" data-category-id="4" title="Dashboard">
                        <i class="fa fa-bar-chart fa-2x"></i>
                        <span>Dashboard</span>
                    </a>
                </li>
                <li class="<?php echo $controller == 'Project' ? 'active' : ''; ?> <?php echo !$this->Common->isPermitted(PROJECT_CONTROLLER_ID) ? 'disabled-link':''; ?>">
                    <a class="<?php echo $controller == 'Project' ? 'active' : ''; ?>" href="<?php echo $this->Url->build(["controller" => 'Project', "action" => "index"]); ?>" data-category-id="4" title="Project">
                        <i class="fa fa-lightbulb-o fa-2x"></i>
                        <span>Project</span>
                    </a>
                </li>
                <li class="<?php echo $temp_client_controller == 'Client' ? 'active' : ''; ?> <?php echo !$this->Common->isPermitted(CLIENT_CONTROLLER_ID) ? 'disabled-link':''; ?>">
                    <a class="<?php echo $temp_client_controller == 'Client' ? 'active' : ''; ?>" href="<?php echo $this->Url->build(["controller" => 'Client', "action" => "index"]); ?>" data-category-id="4" title="Client">
                        <i class="fa fa-building-o fa-2x"></i>
                        <span>Client</span>
                    </a>
                </li>

                <li class="extra-space-li <?php echo $is_active ? 'active' : ''; ?> <?php echo !$this->Common->isPermitted(CLIENT_CONTROLLER_ID) ? 'disabled-link':''; ?>">
                    <a class="<?php echo $is_active ? 'active' : ''; ?>" href="<?php echo $this->Url->build(["controller" => 'Client', "action" => "clientonboarding"]); ?>" data-category-id="4" title="New Client on Boarding">
                        <i class="fa fa-building-o fa-2x"></i>
                        <span>New Client on Boarding</span>
                    </a>
                </li>

                <li class="<?php echo $controller == 'Affiliate' ? 'active' : ''; ?> <?php echo !$this->Common->isPermitted(AFFILIATE_CONTROLLER_ID) ? 'disabled-link':''; ?>">
                    <a class="<?php echo $controller == 'Affiliate' ? 'active' : ''; ?>" href="<?php echo $this->Url->build(["controller" => 'Affiliate', "action" => "index"]); ?>" data-category-id="4" title="Affiliate">
                        <i class="fa fa-building-o fa-2x"></i>
                        <span>Affiliate</span>
                    </a>
                </li>
            <li class="settingMenu <?php echo in_array($controller, $temp_controller) ? 'active':'';?>" style="position: relative;">
                <a class="<?php
                $controller_list_for_submenu = [
                    'EmployeeToEmployeeMessage',
                    'EmployeeMessage'
                ];
                echo in_array($controller,$controller_list_for_submenu) ? 'active':'';?>" href="javascript:void(0);" data-category-id="4" title="Messages">
                    <i class="fa fa-file-text fa-2x"></i>
                    <span>Messages</span>
                </a>
                <ul class="subMenu">
                    <li><a class="<?php echo $controller == 'EmployeeToEmployeeMessage' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'EmployeeToEmployeeMessage', "action" => "index"]); ?>">&raquo;&nbsp; All Employee Messages</a></li>
                    <li><a class="<?php echo $controller == 'EmployeeMessage' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'EmployeeMessage', "action" => "allemployeemessages"]); ?>">&raquo;&nbsp; Employee Messages</a></li>
                    <li>
                        <a class="<?php echo $controller == 'SetupMemberMessage' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'SetupMemberMessage', "action" => "index"]); ?>">&raquo;&nbsp; Setup Message For Client</a>
                    </li>

                </ul>
            </li>

<!--                <li class="--><?php //echo $controller == 'Invoice' ? 'active' : ''; ?><!-- --><?php //echo !$this->Common->isPermitted(INVOICE_CONTROLLER_ID) ? 'disabled-link':''; ?><!--">-->
<!--                    <a class="--><?php //echo $controller == 'Invoice' ? 'active' : ''; ?><!--" href="--><?php //echo $this->Url->build(["controller" => 'Invoice', "action" => "index"]); ?><!--" data-category-id="4" title="Invoice">-->
<!--                        <i class="fa fa-file-text fa-2x"></i>-->
<!--                        <span>Invoice</span>-->
<!--                    </a>-->
<!--                </li>-->
            <li class="settingMenu extra-space-li <?php echo in_array($controller, $temp_controller) ? 'active':'';?>" style="position: relative;">
                <a class="<?php
                $controller_list_for_submenu = [
                    'MemberCreditAnalysisTemplate',
                    'CreditAnalysisEmailTemplate'
                ];
                echo in_array($controller,$controller_list_for_submenu) ? 'active':'';?>" href="javascript:void(0);" data-category-id="4" title="Credit Analyze">
                    <i class="fa fa-tag fa-2x"></i>
                    <span>Credit Analyze</span>
                </a>
                <ul class="subMenu" >
                    <li>
                        <a class="<?php echo $controller == 'MemberCreditAnalysisTemplate' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'MemberCreditAnalysisTemplate', "action" => "index"]); ?>">&raquo;&nbsp; Credit Analysis Template</a>
                    </li>
                    <li>
                        <a class="<?php echo $controller == 'CreditAnalysisEmailTemplate' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'CreditAnalysisEmailTemplate', "action" => "index"]); ?>">&raquo;&nbsp; Credit Analyzer/Analysis Email</a>
                    </li>
                </ul>
            </li>


<!--                <li class="extra-space-li --><?php //echo $controller == 'Payments' ? 'active' : ''; ?><!-- --><?php //echo !$this->Common->isPermitted(PAYMENT_SETUP_CONTROLLER_ID) ? 'disabled-link':''; ?><!--">-->
<!--                    <a class="--><?php //echo $controller == 'Payments' ? 'active' : ''; ?><!--" href="--><?php //echo $this->Url->build(["controller" => 'Payments', "action" => "index"]); ?><!--" data-category-id="4" title="Payment Setup">-->
<!--                        <i class="fa fa-money fa-2x"></i>-->
<!--                        <span>Payment Setup</span>-->
<!--                    </a>-->
<!--                </li>-->

<!--                <li class="extra-space-li --><?php //echo $controller == 'Subscriptions' ? 'active' : ''; ?><!-- --><?php //echo !$this->Common->isPermitted(SUBSCRIPTION_CONTROLLER_ID) ? 'disabled-link':''; ?><!--">-->
<!--                    <a class="--><?php //echo $controller == 'Subscriptions' ? 'active' : ''; ?><!--" href="--><?php //echo $this->Url->build(["controller" => 'Subscriptions', "action" => "index"]); ?><!--" data-category-id="4" title="Subscriptions">-->
<!--                        <i class="fa fa-rocket fa-2x"></i>-->
<!--                        <span>Subscriptions</span>-->
<!--                    </a>-->
<!--                </li>-->
                <li class="extra-space-li <?php echo $controller == 'Agreement' ? 'active' : ''; ?> <?php echo !$this->Common->isPermitted(AGGREMENT_CONTROLLER_ID) ? 'disabled-link':''; ?>">
                    <a class="<?php echo $controller == 'Agreement' ? 'active' : ''; ?>" href="<?php echo $this->Url->build("/Agreement"); ?>" data-category-id="4" title="Agreement">
                        <i class="fa fa-files-o fa-2x"></i>
                        <span>Agreement</span>
                    </a>
                </li>
                <li class="extra-space-li <?php echo $controller == 'ClientCreditreport' ? 'active' : ''; ?> <?php echo !$this->Common->isPermitted(CREDIT_REPORT_STATUS_CONTROLLER_ID) ? 'disabled-link':''; ?>">
                    <a class="<?php echo $controller == 'ClientCreditreport' ? 'active' : ''; ?>" href="<?php echo $this->Url->build(["controller" => 'ClientCreditreport', "action" => "clientcreditreportlist"]); ?>" data-category-id="4" title="Credit Report Status">
                        <i class="fa fa-credit-card fa-2x"></i>
                        <span>Credit Report Status</span>
                    </a>
                </li>
                <li class="<?php echo $controller == 'Calendar' ? 'active' : ''; ?> <?php echo !$this->Common->isPermitted(CALENDER_CONTROLLER_ID) ? 'disabled-link':''; ?>">
                    <a class="<?php echo $controller == 'Calendar' ? 'active' : ''; ?>" href="<?php echo $this->Url->build(["controller" => 'Calendar', "action" => "index"]); ?>" data-category-id="4" title="Calendar">
                        <i class="fa fa-calendar fa-2x"></i>
                        <span>Calendar</span>
                    </a>
                </li>
                <li class="disabled-link">
                    <a class="<?php echo $controller == 'Crmusers' ? 'active' : ''; ?>" href="#" data-category-id="4" title="Users">
                        <i class="fa fa-users fa-2x"></i>
                        <span>Users</span>
                    </a>
                </li>
                <li class="<?php echo $controller == 'Help' ? 'active':'';?>">
                    <a class="<?php echo $controller == 'Help' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Help', "action" => "index"]); ?>" data-category-id="4" title="Help Setup">
                        <i class="fa fa-rocket"></i>&nbsp;&nbsp;
                        <span>Help Setup</span>
                    </a>
                </li>
                <li class="ulMoreSubMenu" style="position: relative;">
                    <a class="" href="javascript:void(0);" data-category-id="4" title="Item">
                        <i class="fa fa-ellipsis-h fa-2x"></i>
                        <span>More</span>
                    </a>
                    <!-- for MORE sub menu -->
                    <ul class="moreSubMenu">
                        <li class="<?php echo $controller == 'Project' ? 'active' : ''; ?>">
                            <a class="<?php echo $controller == 'Project' ? 'active' : ''; ?>" href="<?php echo $this->Url->build(["controller" => 'Project', "action" => "index"]); ?>" data-category-id="4" title="Project">
                                <i class="fa fa-lightbulb-o"></i>&nbsp;&nbsp;
                                <span>Project</span>
                            </a>
                        </li>
                        <li class="<?php echo $temp_client_controller == 'Client' ? 'active' : ''; ?>">
                            <a class="<?php echo $temp_client_controller == 'Client' ? 'active' : ''; ?>" href="<?php echo $this->Url->build(["controller" => 'Client', "action" => "index"]); ?>" data-category-id="4" title="Client">
                                <i class="fa fa-building-o"></i>&nbsp;&nbsp;
                                <span>Client</span>
                            </a>
                        </li>

                        <li class="extra-space-li <?php echo $is_active ? 'active' : ''; ?>">
                            <a class="<?php echo $is_active ? 'active' : ''; ?>" href="<?php echo $this->Url->build(["controller" => 'Client', "action" => "clientonboarding"]); ?>" data-category-id="4" title="New Client on Boarding">
                                <i class="fa fa-building-o"></i>&nbsp;&nbsp;
                                <span>New Client on Boarding</span>
                            </a>
                        </li>

                        <li class="<?php echo $controller == 'Affiliate' ? 'active' : ''; ?>">
                            <a class="<?php echo $controller == 'Affiliate' ? 'active' : ''; ?>" href="<?php echo $this->Url->build(["controller" => 'Affiliate', "action" => "index"]); ?>" data-category-id="4" title="Affiliate">
                                <i class="fa fa-building-o"></i>&nbsp;&nbsp;
                                <span>Affiliate</span>
                            </a>
                        </li>
                        <li class="settingMenu <?php echo in_array($controller, $temp_controller) ? 'active':'';?>" style="position: relative;">
                            <a class="<?php
                            $controller_list_for_submenu = [
                                'EmployeeToEmployeeMessage',
                                'EmployeeMessage'
                            ];
                            echo in_array($controller,$controller_list_for_submenu) ? 'active':'';?>" href="javascript:void(0);" data-category-id="4" title="Messages">
                                <i class="fa fa-file-text fa-2x"></i>
                                <span>Messages</span>
                            </a>
                            <ul class="subMenu">
                                <li><a class="<?php echo $controller == 'EmployeeToEmployeeMessage' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'EmployeeToEmployeeMessage', "action" => "index"]); ?>">&raquo;&nbsp; All Employee Messages</a></li>
                                <li><a class="<?php echo $controller == 'EmployeeMessage' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'EmployeeMessage', "action" => "allemployeemessages"]); ?>">&raquo;&nbsp; Employee Messages</a></li>
                                <li>
                                    <a class="<?php echo $controller == 'SetupMemberMessage' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'SetupMemberMessage', "action" => "index"]); ?>">&raquo;&nbsp; Setup Message For Client</a>
                                </li>

                            </ul>
                        </li>
<!--                        <li class="--><?php //echo $controller == 'Invoice' ? 'active' : ''; ?><!--">-->
<!--                            <a class="--><?php //echo $controller == 'Invoice' ? 'active' : ''; ?><!--" href="--><?php //echo $this->Url->build(["controller" => 'Invoice', "action" => "index"]); ?><!--" data-category-id="4" title="Invoice">-->
<!--                                <i class="fa fa-file-text"></i>&nbsp;&nbsp;-->
<!--                                <span>Invoice</span>-->
<!--                            </a>-->
<!--                        </li>-->
                        <li class="settingMenu <?php echo in_array($controller, $temp_controller) ? 'active':'';?>" style="position: relative;">
                            <a class="<?php
                            $controller_list_for_submenu = [
                                'MemberCreditAnalysisTemplate',
                                'CreditAnalysisEmailTemplate'
                            ];
                            echo in_array($controller,$controller_list_for_submenu) ? 'active':'';?>" href="javascript:void(0);" data-category-id="4" title="Credit Analyze">
                                <i class="fa fa-tag fa-2x"></i>
                                <span>Credit Analyze</span>
                            </a>
                            <ul class="subMenu" >
                                <li>
                                    <a class="<?php echo $controller == 'MemberCreditAnalysisTemplate' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'MemberCreditAnalysisTemplate', "action" => "index"]); ?>">&raquo;&nbsp; Credit Analysis Template</a>
                                </li>
                                <li>
                                    <a class="<?php echo $controller == 'CreditAnalysisEmailTemplate' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'CreditAnalysisEmailTemplate', "action" => "index"]); ?>">&raquo;&nbsp; Credit Analyzer/Analysis Email</a>
                                </li>
                            </ul>
                        </li>
<!--                        <li class="extra-space-li --><?php //echo $controller == 'Payments' ? 'active' : ''; ?><!--">-->
<!--                            <a class="--><?php //echo $controller == 'Payments' ? 'active' : ''; ?><!--" href="--><?php //echo $this->Url->build(["controller" => 'Payments', "action" => "index"]); ?><!--" data-category-id="4" title="Payment Setup">-->
<!--                                <i class="fa fa-money"></i>&nbsp;&nbsp;-->
<!--                                <span>Payment Setup</span>-->
<!--                            </a>-->
<!--                        </li>-->

<!--                        <li class="extra-space-li --><?php //echo $controller == 'Subscriptions' ? 'active' : ''; ?><!--">-->
<!--                            <a class="--><?php //echo $controller == 'Subscriptions' ? 'active' : ''; ?><!--" href="--><?php //echo $this->Url->build(["controller" => 'Subscriptions', "action" => "index"]); ?><!--" data-category-id="4" title="Subscriptions">-->
<!--                                <i class="fa fa-rocket"></i>&nbsp;&nbsp;-->
<!--                                <span>Subscriptions</span>-->
<!--                            </a>-->
<!--                        </li>-->
                        <li class="extra-space-li <?php echo $controller == 'Agreement' ? 'active' : ''; ?>">
                            <a class="<?php echo $controller == 'Agreement' ? 'active' : ''; ?>" href="<?php echo $this->Url->build("/Agreement"); ?>" data-category-id="4" title="Agreement">
                                <i class="fa fa-files-o"></i>&nbsp;&nbsp;
                                <span>Agreement</span>
                            </a>
                        </li>
                        <li class="extra-space-li <?php echo $controller == 'ClientCreditreport' ? 'active' : ''; ?> <?php echo !$this->Common->isPermitted(CREDIT_REPORT_STATUS_CONTROLLER_ID) ? 'disabled-link':''; ?>">
                            <a class="<?php echo $controller == 'ClientCreditreport' ? 'active' : ''; ?>" href="<?php echo $this->Url->build(["controller" => 'ClientCreditreport', "action" => "clientcreditreportlist"]); ?>" data-category-id="4" title="Credit Report">
                                <i class="fa fa-credit-card"></i>&nbsp;&nbsp;
                                <span>Credit Report Status</span>
                            </a>
                        </li>
                        <li class="<?php echo $controller == 'Calendar' ? 'active' : ''; ?> <?php echo !$this->Common->isPermitted(CALENDER_CONTROLLER_ID) ? 'disabled-link':''; ?>">
                            <a class="<?php echo $controller == 'Calendar' ? 'active' : ''; ?>" href="<?php echo $this->Url->build(["controller" => 'Calendar', "action" => "index"]); ?>" data-category-id="4" title="Calendar">
                                <i class="fa fa-calendar"></i>&nbsp;&nbsp;
                                <span>Calendar</span>
                            </a>
                        </li>
                        <li class="<?php echo !$this->Common->isEmployeeAsAdmin() ? 'disabled-link':''?>">
                            <a class="<?php echo $controller == 'Crmusers' ? 'active' : ''; ?>" href="<?php echo $this->Common->isEmployeeAsAdmin() ? $this->Url->build(["controller" => 'Crmusers', "action" => "index"]):'#'; ?>" data-category-id="4" title="Users">
                                <i class="fa fa-users"></i>&nbsp;&nbsp;
                                <span>Users</span>
                            </a>
                        </li>
                        <li class="<?php echo $controller == 'Help' ? 'active':'';?>">
                            <a class="<?php echo $controller == 'Help' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Help', "action" => "index"]); ?>" data-category-id="4" title="Help Setup">
                                <i class="fa fa-rocket"></i>&nbsp;&nbsp;
                                <span>Help Setup</span>
                            </a>
                        </li>
                    </ul>
                </li>

                <li class="settingMenu <?php echo in_array($controller, $temp_controller) ? 'active' : ''; ?>" style="position: relative;">
                    <a class="<?php echo in_array($controller, $temp_controller) ? 'active' : ''; ?>" href="javascript:void(0);" data-category-id="4" title="Item">
                        <i class="fa fa-archive fa-2x"></i>
                        <span>Settings</span>
                    </a>
                    <ul class="subMenu">
                        <li class="disabled-link">
                            <a class="<?php echo $controller == 'Personalizes' ? 'active' : ''; ?>"  href="#">&raquo;&nbsp; Personalize Your Account</a>
                        </li>
                        <?php if($_SESSION['hasEpicVelocity'] || $_SESSION['hasVelocity'] || $_SESSION['hasLS_Fax_Rtg_user']){  ?>
                        <li class="disabled-link">
                            <a class="<?php echo $controller == 'AutomationSchedule' ? 'active' : ''; ?>" href="<?php echo $this->Url->build(["controller" => 'AutomationSchedule', "action" => "index"]); ?>">&raquo;&nbsp; Automation Schedule</a>
                        </li>
                        <?php } ?>

                        <li class="disabled-link">
                            <a class="<?php echo $controller == 'Education' ? 'active' : ''; ?>" href="<?php echo $this->Url->build(["controller" => 'Education', "action" => "index"]); ?>">&raquo;&nbsp; Education Setup</a>
                        </li>
                            <li>
                                <a
                                        class="<?php
                                        $controller_list_for_submenu = [
                                            'ClientSecurePortalLogin',
                                            'ClientStatusTypes',
                                            'PdfLetters',
                                        ];
                                        echo in_array($controller,$controller_list_for_submenu) ? 'active':'';
                                        ?>"
                                        onclick="submenuHideShow(this)" href="#">&raquo;&nbsp; Clients Usage <i class="fa fa-chevron-down pull-right child-parent-icon"></i></a>
                                <ul class="submenu-child" style="display: none">
                                    <li>
                                        <a class="<?php echo $controller == 'ClientSecurePortalLogin' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'ClientSecurePortalLogin', "action" => "index"]); ?>">&raquo;&nbsp; Client Secure Portal Login</a>
                                    </li>
                                    <?php if($this->Common->isPermitted(SAVE_DOWNLOAD_PRINT_LETTER_CONTROLLER_ID)){  ?>
                                        <li>
                                            <a class="<?php echo $controller == 'PdfLetters' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'PdfLetters', "action" => "index"]); ?>">&raquo;&nbsp; Client Letters</a>
                                        </li>
                                    <?php } ?>
                                </ul>
                            </li>


                        <?php if($this->Common->isPermitted(EVERYTHING_CONTROLLER_ID)){  ?>
                        <li>
                            <a class="<?php echo $controller == 'Everything' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Everything', "action" => "index"]); ?>">&raquo;&nbsp; Team/Client Progress</a>
                        </li>
                        <?php } ?>
                        <?php if($this->Common->isPermitted(MEMBER_EMAIL_SENT_CONTROLLER_ID)){  ?>
                        <li>
                            <a class="<?php echo $controller == 'MemberEmailSent' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'MemberEmailSent', "action" => "index"]); ?>">&raquo;&nbsp; Setup/Send Email</a>
                        </li>
                        <?php } ?>
                        <li>
                            <a
                                    class="<?php
                                    $controller_list_for_submenu = [
                                        'TeamMessaging',
                                        'SetupMemberMessage'
                                    ];
                                    echo in_array($controller,$controller_list_for_submenu) ? 'active':'';
                                    ?>"
                                    onclick="submenuHideShow(this)" href="#">&raquo;&nbsp; Messages <i class="fa fa-chevron-down pull-right child-parent-icon"></i></a>
                            <ul class="submenu-child" style="display: none">
                                <?php if($this->Common->isPermitted(SETUP_MEGGAGE_CONTROLLER_ID)){  ?>
                                    <li>
                                        <a class="<?php echo $controller == 'EmployeeMessage' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'EmployeeMessage', "action" => "index"]); ?>">&raquo;&nbsp; Admin Message</a>
                                    </li>
                                <?php } ?>
                                <li>
                                    <a class="<?php echo $controller == 'TeamMessaging' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'TeamMessaging', "action" => "index"]); ?>">&raquo;&nbsp; Team Messaging</a>
                                </li>
                            </ul>
                        </li>
                        <?php if($this->Common->isPermitted(SETUP_MEGGAGE_CONTROLLER_ID)){  ?>
                            <li>
                                <a class="<?php echo $controller == 'SetupMemberMessage' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'SetupMemberMessage', "action" => "index"]); ?>">&raquo;&nbsp; Setup Message For Client</a>
                            </li>
                        <?php } ?>
                        <li class="disabled-link">
                            <a class="<?php echo $controller == 'Help' ? 'active' : ''; ?>" href="<?php echo $this->Url->build(["controller" => 'Help', "action" => "index"]); ?>">&raquo;&nbsp; Bulk Password Change</a>
                        </li>

                        <li class="disabled-link">
                            <a class="<?php echo $controller == 'Help' ? 'active' : ''; ?>" href="<?php echo $this->Url->build(["controller" => 'Help', "action" => "index"]); ?>">&raquo;&nbsp; Help Setup</a>
                        </li>
                        <li>
                            <a class="<?php echo $controller == 'Remindertask' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Remindertask', "action" => "index"]); ?>">&raquo;&nbsp; Reminder/Tasks</a>
                        </li>
                        <li>
                            <a target="_blank" href="https://www.m2cacademy.com/membership-area">&raquo;&nbsp; Go To Membership Portal</a>
                        </li>
                    </ul>
                </li>
            </ul>
    </div>
</div>
<?php } else { ?>
<div class="row top-icon-area">
                <div class="col-md-12 col-xs-12">
                    <ul class="newTopMenu <?php echo ($_SESSION['userType']== CMS_USER_INDICATOR) || $_SESSION['userType'] == STAF_USER_INDICATOR || $this->Common->isEmployeeAsAdmin() ? 'newtopmenu2':''?> ">
                                <?php
                                
                                

                        if($_SESSION['userType']== CMS_USER_INDICATOR || $_SESSION['userType'] == STAF_USER_INDICATOR || $this->Common->isEmployeeAsAdmin()){
                            
                                ?>
                        <li class="<?php echo $controller == 'Statistics' ? 'active':'';?>">
                            <a style="padding:9px;" class="<?php echo $controller == 'Statistics' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Statistics', "action" => "index"]); ?>" data-category-id="4" title="Dashboard">
                                <i class="fa fa-bar-chart fa-2x"></i>
                                <span>Dashboard</span>
                            </a>
                        </li>
                        <li class="<?php echo $controller == 'Project' ? 'active':'';?>">
                            <a class="<?php echo $controller == 'Project' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Project', "action" => "index"]); ?>" data-category-id="4" title="Project">
                                <i class="fa fa-lightbulb-o fa-2x"></i>
                                <span>Project</span>
                            </a>
                        </li>
                        <li class="<?php echo $temp_client_controller == 'Client' ? 'active':'';?>">
                            <a class="<?php echo $temp_client_controller == 'Client' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Client', "action" => "index"]); ?>" data-category-id="4" title="Client">
                                <i class="fa fa-building-o fa-2x"></i>
                                <span>Client</span>
                            </a>
                        </li>

                        <li class="extra-space-li <?php echo $is_active ? 'active':'';?>">
                            <a class="<?php echo $is_active ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Client', "action" => "clientonboarding"]); ?>" data-category-id="4" title="New Client on Boarding">
                                <i class="fa fa-building-o fa-2x"></i>
                                <span>New Client on Boarding</span>
                            </a>
                        </li>

                        <li class="<?php echo $controller == 'Affiliate' ? 'active':'';?>">
                            <a class="<?php echo $controller == 'Affiliate' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Affiliate', "action" => "index"]); ?>" data-category-id="4" title="Affiliate">
                                <i class="fa fa-building-o fa-2x"></i>
                                <span>Affiliate</span>
                            </a>
                        </li>
                            <li class="settingMenu <?php echo in_array($controller, $temp_controller) ? 'active':'';?>" style="position: relative;">
                                <a class="<?php
                                $controller_list_for_submenu = [
                                    'EmployeeToEmployeeMessage',
                                    'EmployeeMessage'
                                ];
                                echo in_array($controller,$controller_list_for_submenu) ? 'active':'';?>" href="javascript:void(0);" data-category-id="4" title="Messages">
                                    <i class="fa fa-file-text fa-2x"></i>
                                    <span>Messages</span>
                                </a>
                                <ul class="subMenu">
                                    <li><a class="<?php echo $controller == 'EmployeeToEmployeeMessage' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'EmployeeToEmployeeMessage', "action" => "index"]); ?>">&raquo;&nbsp; All Employee Messages</a></li>
                                    <li><a class="<?php echo $controller == 'EmployeeMessage' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'EmployeeMessage', "action" => "allemployeemessages"]); ?>">&raquo;&nbsp; Employee Messages</a></li>
                                    <li>
                                        <a class="<?php echo $controller == 'SetupMemberMessage' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'SetupMemberMessage', "action" => "index"]); ?>">&raquo;&nbsp; Setup Message For Client</a>
                                    </li>

                                </ul>
                            </li>
<!--                        <li class="--><?php //echo $controller == 'Invoice' ? 'active':'';?><!--">-->
<!--                            <a class="--><?php //echo $controller == 'Invoice' ? 'active':'';?><!--" href="--><?php //echo $this->Url->build(["controller" => 'Invoice', "action" => "index"]); ?><!--" data-category-id="4" title="Invoice">-->
<!--                                <i class="fa fa-file-text fa-2x"></i>-->
<!--                                <span>Invoice</span>-->
<!--                            </a>-->
<!--                        </li>-->
                            <li class="settingMenu extra-space-li <?php echo in_array($controller, $temp_controller) ? 'active':'';?>" style="position: relative;">
                                <a class="<?php
                                $controller_list_for_submenu = [
                                    'MemberCreditAnalysisTemplate',
                                    'CreditAnalysisEmailTemplate'
                                ];
                                echo in_array($controller,$controller_list_for_submenu) ? 'active':'';?>" href="javascript:void(0);" data-category-id="4" title="Credit Analyze">
                                    <i class="fa fa-tag fa-2x"></i>
                                    <span>Credit Analyze</span>
                                </a>
                                <ul class="subMenu" >
                                    <li>
                                        <a class="<?php echo $controller == 'MemberCreditAnalysisTemplate' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'MemberCreditAnalysisTemplate', "action" => "index"]); ?>">&raquo;&nbsp; Credit Analysis Template</a>
                                    </li>
                                    <li>
                                        <a class="<?php echo $controller == 'CreditAnalysisEmailTemplate' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'CreditAnalysisEmailTemplate', "action" => "index"]); ?>">&raquo;&nbsp; Credit Analyzer/Analysis Email</a>
                                    </li>
                                </ul>
                            </li>
<!--                        <li class="extra-space-li --><?php //echo $controller == 'Payments' ? 'active':'';?><!--">-->
<!--                            <a class="--><?php //echo $controller == 'Payments' ? 'active':'';?><!--" href="--><?php //echo $this->Url->build(["controller" => 'Payments', "action" => "index"]); ?><!--" data-category-id="4" title="Payment Setup">-->
<!--                                <i class="fa fa-money fa-2x"></i>-->
<!--                                <span>Payment Setup</span>-->
<!--                            </a>-->
<!--                        </li>-->

<!--                        <li class="extra-space-li --><?php //echo $controller == 'Subscriptions' ? 'active':'';?><!--">-->
<!--                            <a class="--><?php //echo $controller == 'Subscriptions' ? 'active':'';?><!--" href="--><?php //echo $this->Url->build(["controller" => 'Subscriptions', "action" => "index"]); ?><!--" data-category-id="4" title="Subscriptions">-->
<!--                                <i class="fa fa-rocket fa-2x"></i>-->
<!--                                <span>Subscriptions</span>-->
<!--                            </a>-->
<!--                        </li>-->
                         <li class="extra-space-li <?php echo $controller == 'Agreement' ? 'active':'';?>">
                            <a class="<?php echo $controller == 'Agreement' ? 'active':'';?>" href="<?php echo $this->Url->build("/Agreement"); ?>" data-category-id="4" title="Agreement">
                                <i class="fa fa-files-o fa-2x"></i>
                                <span>Agreement</span>
                            </a>
                        </li>
                        <li class="extra-space-li <?php echo $controller == 'ClientCreditreport' ? 'active':'';?>">
                            <a class="<?php echo $controller == 'ClientCreditreport' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'ClientCreditreport', "action" => "clientcreditreportlist"]); ?>" data-category-id="4" title="Credit Report Status">
                                <i class="fa fa-credit-card fa-2x"></i>
                                <span>Credit Report Status</span>
                            </a>
                        </li>
                        <li class="<?php echo $controller == 'Calendar' ? 'active':'';?>">
                            <a class="<?php echo $controller == 'Calendar' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Calendar', "action" => "index"]); ?>" data-category-id="4" title="Calendar">
                                <i class="fa fa-calendar fa-2x"></i>
                                <span>Calendar</span>
                            </a>
                        </li>
                        <li class="<?php echo $controller == 'Crmusers' ? 'active':'';?>">
                            <a class="<?php echo $controller == 'Crmusers' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Crmusers', "action" => "index"]); ?>" data-category-id="4" title="Users">
                                <i class="fa fa-users fa-2x"></i>
                                <span>Users</span>
                            </a>
                        </li>

                        <li class="extra-space-li <?php echo $controller == 'Help' ? 'active':'';?>">
                            <a class="<?php echo $controller == 'Help' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Help', "action" => "index"]); ?>" data-category-id="4" title="Help Setup">
                                <i class="fa fa-rocket"></i>&nbsp;&nbsp;
                                <span>Help Setup</span>
                            </a>
                        </li>
                        <li class="ulMoreSubMenu" style="position: relative;">
                            <a class="" href="javascript:void(0);" data-category-id="4" title="More">
                                <i class="fa fa-ellipsis-h fa-2x"></i>
                                <span>More</span>
                            </a>
                            <!-- for MORE sub menu -->
                            <ul class="moreSubMenu">
                                <li class="<?php echo $controller == 'Project' ? 'active':'';?>">
                                    <a class="<?php echo $controller == 'Project' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Project', "action" => "index"]); ?>" data-category-id="4" title="Project">
                                        <i class="fa fa-lightbulb-o"></i>&nbsp;&nbsp;
                                        <span>Project</span>
                                    </a>
                                </li>
                                <li class="<?php echo $temp_client_controller == 'Client' ? 'active':'';?>">
                                    <a class="<?php echo $temp_client_controller == 'Client' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Client', "action" => "index"]); ?>" data-category-id="4" title="Client">
                                        <i class="fa fa-building-o"></i>&nbsp;&nbsp;
                                        <span>Client</span>
                                    </a>
                                </li>

                                <li class="extra-space-li <?php echo $is_active ? 'active':'';?>">
                                    <a class="<?php echo $is_active ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Client', "action" => "clientonboarding"]); ?>" data-category-id="4" title="New Client on Boarding">
                                        <i class="fa fa-building-o"></i>&nbsp;&nbsp;
                                        <span>New Client on Boarding</span>
                                    </a>
                                </li>

                                <li class="<?php echo $controller == 'Affiliate' ? 'active':'';?>">
                                    <a class="<?php echo $controller == 'Affiliate' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Affiliate', "action" => "index"]); ?>" data-category-id="4" title="Affiliate">
                                        <i class="fa fa-building-o"></i>&nbsp;&nbsp;
                                        <span>Affiliate</span>
                                    </a>
                                </li>
                                <li class="settingMenu <?php echo in_array($controller, $temp_controller) ? 'active':'';?>" style="position: relative;">
                                    <a class="<?php
                                    $controller_list_for_submenu = [
                                        'EmployeeToEmployeeMessage',
                                        'EmployeeMessage'
                                    ];
                                    echo in_array($controller,$controller_list_for_submenu) ? 'active':'';?>" href="javascript:void(0);" data-category-id="4" title="Messages">
                                        <i class="fa fa-file-text fa-2x"></i>
                                        <span>Messages</span>
                                    </a>
                                    <ul class="subMenu">
                                        <li><a class="<?php echo $controller == 'EmployeeToEmployeeMessage' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'EmployeeToEmployeeMessage', "action" => "index"]); ?>">&raquo;&nbsp; All Employee Messages</a></li>
                                        <li><a class="<?php echo $controller == 'EmployeeMessage' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'EmployeeMessage', "action" => "allemployeemessages"]); ?>">&raquo;&nbsp; Employee Messages</a></li>
                                        <li>
                                            <a class="<?php echo $controller == 'SetupMemberMessage' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'SetupMemberMessage', "action" => "index"]); ?>">&raquo;&nbsp; Setup Message For Client</a>
                                        </li>

                                    </ul>
                                </li>
<!--                                <li class="--><?php //echo $controller == 'Invoice' ? 'active':'';?><!--">-->
<!--                                    <a class="--><?php //echo $controller == 'Invoice' ? 'active':'';?><!--" href="--><?php //echo $this->Url->build(["controller" => 'Invoice', "action" => "index"]); ?><!--" data-category-id="4" title="Invoice">-->
<!--                                        <i class="fa fa-file-text"></i>&nbsp;&nbsp;-->
<!--                                        <span>Invoice</span>-->
<!--                                    </a>-->
<!--                                </li>-->
                                <li class="settingMenu <?php echo in_array($controller, $temp_controller) ? 'active':'';?>" style="position: relative;">
                                    <a class="<?php
                                    $controller_list_for_submenu = [
                                        'MemberCreditAnalysisTemplate',
                                        'CreditAnalysisEmailTemplate'
                                    ];
                                    echo in_array($controller,$controller_list_for_submenu) ? 'active':'';?>" href="javascript:void(0);" data-category-id="4" title="Credit Analyze">
                                        <i class="fa fa-tag fa-2x"></i>
                                        <span>Credit Analyze</span>
                                    </a>
                                    <ul class="subMenu" >
                                        <li>
                                            <a class="<?php echo $controller == 'MemberCreditAnalysisTemplate' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'MemberCreditAnalysisTemplate', "action" => "index"]); ?>">&raquo;&nbsp; Credit Analysis Template</a>
                                        </li>
                                        <li>
                                            <a class="<?php echo $controller == 'CreditAnalysisEmailTemplate' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'CreditAnalysisEmailTemplate', "action" => "index"]); ?>">&raquo;&nbsp; Credit Analyzer/Analysis Email</a>
                                        </li>
                                    </ul>
                                </li>
<!--                                <li class="extra-space-li --><?php //echo $controller == 'Payments' ? 'active':'';?><!--">-->
<!--                                    <a class="--><?php //echo $controller == 'Payments' ? 'active':'';?><!--" href="--><?php //echo $this->Url->build(["controller" => 'Payments', "action" => "index"]); ?><!--" data-category-id="4" title="Payment Setup">-->
<!--                                        <i class="fa fa-money"></i>&nbsp;&nbsp;-->
<!--                                        <span>Payment Setup</span>-->
<!--                                    </a>-->
<!--                                </li>-->

<!--                                <li class="extra-space-li --><?php //echo $controller == 'Subscriptions' ? 'active':'';?><!--">-->
<!--                                    <a class="--><?php //echo $controller == 'Subscriptions' ? 'active':'';?><!--" href="--><?php //echo $this->Url->build(["controller" => 'Subscriptions', "action" => "index"]); ?><!--" data-category-id="4" title="Subscriptions">-->
<!--                                        <i class="fa fa-rocket"></i>&nbsp;&nbsp;-->
<!--                                        <span>Subscriptions</span>-->
<!--                                    </a>-->
<!--                                </li>-->
                                    <li class="extra-space-li <?php echo $controller == 'Agreement' ? 'active':'';?>">
                                    <a class="<?php echo $controller == 'Agreement' ? 'active':'';?>" href="<?php echo $this->Url->build("/Agreement"); ?>" data-category-id="4" title="Agreement">
                                        <i class="fa fa-files-o"></i>&nbsp;&nbsp;
                                        <span>Agreement</span>
                                    </a>
                                </li>
                                <li class="extra-space-li <?php echo $controller == 'ClientCreditreport' ? 'active':'';?>">
                                    <a class="<?php echo $controller == 'ClientCreditreport' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'ClientCreditreport', "action" => "clientcreditreportlist"]); ?>" data-category-id="4" title="Credit Report">
                                        <i class="fa fa-credit-card"></i>&nbsp;&nbsp;
                                        <span>Credit Report Status</span>
                                    </a>
                                </li>
                                <li class="<?php echo $controller == 'Calendar' ? 'active':'';?>">
                                    <a class="<?php echo $controller == 'Calendar' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Calendar', "action" => "index"]); ?>" data-category-id="4" title="Calendar">
                                        <i class="fa fa-calendar"></i>&nbsp;&nbsp;
                                        <span>Calendar</span>
                                    </a>
                                </li>
                                <li class="<?php echo $controller == 'Crmusers' ? 'active':'';?>">
                                    <a class="<?php echo $controller == 'Crmusers' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Crmusers', "action" => "index"]); ?>" data-category-id="4" title="Users">
                                        <i class="fa fa-users"></i>&nbsp;&nbsp;
                                        <span>Users</span>
                                    </a>
                                </li>

                                <li class="<?php echo $controller == 'Help' ? 'active':'';?>">
                                    <a class="<?php echo $controller == 'Help' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Help', "action" => "index"]); ?>" data-category-id="4" title="Help Setup">
                                        <i class="fa fa-rocket"></i>&nbsp;&nbsp;
                                        <span>Help Setup</span>
                                    </a>
                                </li>
                            </ul>
                        </li>


                        <li class="settingMenu <?php echo in_array($controller, $temp_controller) ? 'active':'';?>" style="position: relative;">
                            <a class="<?php echo in_array($controller, $temp_controller) ? 'active':'';?>" href="javascript:void(0);" data-category-id="4" title="Settings">
                                <i class="fa fa-archive fa-2x"></i>
                                <span>Settings</span>
                            </a>
                            <ul class="subMenu">
                                <li>
                                    <a class="<?php echo $controller == 'Personalizes' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Personalizes', "action" => "index"]); ?>">&raquo;&nbsp; Personalize Your Account</a>
                                </li>
                                <li>
                                    <a onclick="submenuHideShow(this)" class="<?php
                                    $controller_list_for_submenu = [
                                        'EmployeeToEmployeeMessage',
                                        'EmployeeMessage'
                                    ];
                                    echo in_array($controller,$controller_list_for_submenu) ? 'active':'';?>" href="#">&raquo;&nbsp; Messages <i class="fa fa-chevron-down pull-right child-parent-icon"></i></a>
                                    <ul class="submenu-child" style="display: none">
                                        <li><a class="<?php echo $controller == 'EmployeeToEmployeeMessage' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'EmployeeToEmployeeMessage', "action" => "index"]); ?>">&raquo;&nbsp; All Employee Messages</a></li>
                                        <li><a class="<?php echo $controller == 'EmployeeMessage' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'EmployeeMessage', "action" => "allemployeemessages"]); ?>">&raquo;&nbsp; Employee Messages</a></li>
                                        <li>
                                            <a class="<?php echo $controller == 'SetupMemberMessage' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'SetupMemberMessage', "action" => "index"]); ?>">&raquo;&nbsp; Setup Message For Client</a>
                                        </li>
                                    </ul>
                                </li>
                                <li>
                                    <a
                                        class="<?php
                                        $controller_list_for_submenu = [
                                            'MemberEmailNotification',
                                            'SendEmailToClients',
                                            'MemberEmailSent'
                                        ];
                                        echo in_array($controller,$controller_list_for_submenu) ? 'active':'';
                                        ?>"
                                        onclick="submenuHideShow(this)" href="#">&raquo;&nbsp; Email Notifications <i class="fa fa-chevron-down pull-right child-parent-icon"></i></a>
                                    <ul class="submenu-child" style="display: none">
                                        <li>
                                            <a class="<?php echo $controller == 'MemberEmailNotification' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'MemberEmailNotification', "action" => "index"]); ?>">&raquo;&nbsp; Letter Email Notification</a>
                                        </li>
                                        <li>
                                            <a class="<?php echo $controller == 'SendEmailToClients' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'SendEmailToClients', "action" => "index"]); ?>">&raquo;&nbsp; Emails Sent To Client</a>
                                        </li>
                                        <li>
                                            <a class="<?php echo $controller == 'MemberEmailSent' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'MemberEmailSent', "action" => "index"]); ?>">&raquo;&nbsp; Setup/Send Email</a>
                                        </li>
                                    </ul>
                                </li>
                                <li>
                                    <a
                                    class="<?php
                                    $controller_list_for_submenu = [
                                        'MemberCreditAnalysisTemplate',
                                        'CreditAnalysisEmailTemplate'
                                    ];
                                    echo in_array($controller,$controller_list_for_submenu) ? 'active':'';
                                    ?>"
                                        onclick="submenuHideShow(this)" href="#">&raquo;&nbsp; Credit Analyze <i class="fa fa-chevron-down pull-right child-parent-icon"></i></a>
                                    <ul class="submenu-child" style="display: none">
                                        <li>
                                            <a class="<?php echo $controller == 'MemberCreditAnalysisTemplate' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'MemberCreditAnalysisTemplate', "action" => "index"]); ?>">&raquo;&nbsp; Credit Analysis Template</a>
                                        </li>
                                        <li>
                                            <a class="<?php echo $controller == 'CreditAnalysisEmailTemplate' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'CreditAnalysisEmailTemplate', "action" => "index"]); ?>">&raquo;&nbsp; Credit Analyzer/Analysis Email</a>
                                        </li>
                                    </ul>
                                </li>
                                <li>
                                    <a
                                    class="<?php
                                    $controller_list_for_submenu = [
                                        'ClientSecurePortalLogin',
                                        'ClientStatusTypes',
                                        'PdfLetters',
                                    ];
                                    echo in_array($controller,$controller_list_for_submenu) ? 'active':'';
                                    ?>"
                                    onclick="submenuHideShow(this)" href="#">&raquo;&nbsp; Clients Usage <i class="fa fa-chevron-down pull-right child-parent-icon"></i></a>
                                    <ul class="submenu-child" style="display: none">
                                        <li>
                                            <a class="<?php echo $controller == 'ClientSecurePortalLogin' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'ClientSecurePortalLogin', "action" => "index"]); ?>">&raquo;&nbsp; Client Secure Portal Login</a>
                                        </li>
                                        <li>
                                            <a class="<?php echo $controller == 'ClientStatusTypes' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'ClientStatusTypes', "action" => "index"]); ?>">&raquo;&nbsp; Client Status Updates</a>
                                        </li>
                                        <li>
                                            <a class="<?php echo $controller == 'PdfLetters' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'PdfLetters', "action" => "index"]); ?>">&raquo;&nbsp; Client Letters</a>
                                        </li>
                                    </ul>
                                </li>
                                <li>
                                    <a class="<?php echo $controller == 'Everything' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Everything', "action" => "index"]); ?>">&raquo;&nbsp; Team/Client Progress</a>
                                </li>

                                <li>
                                    <a class="<?php echo $controller == 'Remindertask' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Remindertask', "action" => "index"]); ?>">&raquo;&nbsp; Reminder/Tasks</a>
                                </li>
                                <li>
                                    <a class="<?php echo $controller == 'ClientPopups' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'ClientPopups', "action" => "index"]); ?>">&raquo;&nbsp; Client OnBoarding Popups</a>
                                </li> 

                                <li>
                                    <a class="<?php echo $controller == 'DataFurnishur' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'DataFurnishur', "action" => "index"]); ?>">&raquo;&nbsp; Data Furnishers</a>
                                </li>
                                 <?php if($_SESSION['hasEpicVelocity'] || $_SESSION['hasVelocity'] || $_SESSION['hasLS_Fax_Rtg_user']){  ?>
                                <li>
                                    <a class="<?php echo $controller == 'AutomationSchedule' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'AutomationSchedule', "action" => "index"]); ?>">&raquo;&nbsp; Automation Schedule</a>
                                </li>
                                <?php } ?>
                                <li>
                                    <a class="<?php echo $controller == 'Education' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Education', "action" => "index"]); ?>">&raquo;&nbsp; Education Setup</a>
                                </li>
                                <li>
                                    <a class="<?php echo $controller == 'Help' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Help', "action" => "index"]); ?>">&raquo;&nbsp; Help Setup</a>
                                </li>


                                <li>
                                    <a class="" href="" id="importClientCSV" type="button" data-toggle="modal" data-target="#clientPasswordChangeModal">&raquo;&nbsp; Bulk Password Change</a>
                                </li>

                                <li>
                                    <a target="_blank" href="https://www.m2cacademy.com/membership-area">&raquo;&nbsp; Go To Membership Portal</a>
                                </li>
                            </ul>
                        </li>

<!--				<li class="<?php echo $controller == 'Supports' ? 'active':'';?>">
                            <a  href="<?php echo $this->Url->build(["controller" => 'Supports', "action" => "index"]); ?>" data-category-id="4" title="Users">
                                <i class="fa fa-ticket"></i> Supports</a>
                        </li>-->

                        
                                <?php
                                 } else if($_SESSION['userType']== CRM_USER_INDICATOR){
                                ?>
                        <?php if($_SESSION['Auth']['User']['type'] == 2){ ?>
                                 <li class="from-backend-client <?php echo $controller == 'Client' && $method != 'add' ? 'active':'';?>">
                                    <a class="snglForm <?php echo $controller == 'Client' && $method != 'add' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Client', "action" => "index"]); ?>" data-category-id="4" title="Dashboard">
                                        <img src="<?php echo $this->Url->build('/images/top_link_img/dashboard.png'); ?>" alt="">
                                        <span>Dashboard</span>
                                    </a>
                                </li>

                                <li class="from-backend-client <?php echo $controller == 'Affiliate' ? 'active' : ''; ?>">
                                    <a class="snglForm <?php echo $controller == 'Affiliate' ? 'active' : ''; ?>" href="<?php echo $this->Url->build(["controller" => 'Affiliate', "action" => "affiliatechat"]); ?>" data-category-id="4" title="Notes">
                                        <img src="<?php echo $this->Url->build('/images/top_link_img/notes.png'); ?>" alt="">
                                        <span>Notes</span>
                                    </a>
                                </li>
                                <li class="from-backend-client <?php echo $controller == 'Clientmessage' ? 'active':'';?>">
                                    <a class="snglForm  <?php echo $controller == 'Clientmessage' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Clientmessage', "action" => "affiliatemessage"]); ?>" data-category-id="4" title="Messages">
                                        <img src="<?php echo $this->Url->build('/images/top_link_img/message.png'); ?>" alt="">
                                        <span>Messages</span>
                                    </a>
                                </li>
                                <li class="from-backend-client <?php echo strpos($rqstUrl,'Client/creditreportsetup') ? 'active':'';?>">
                                    <a class="snglForm <?php echo $controller == 'Help' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Help', "action" => "gethelpcontent"]); ?>" data-category-id="4" title="Help">
                                        <img src="<?php echo $this->Url->build('/images/top_link_img/help.png'); ?>" alt="">
                                        <span>Contact Us</span>
                                    </a>
                                </li>
                                <li class="client-portal-li">
                                    <label for="">Client Portal</label>
                                </li>
                            <?php } ?>

                                <?php
                                 } else if($_SESSION['userType']== CONTACT_USER_INDICATOR){
                                ?>
                                <?php
                                $controller = $this->request->params['controller'];
                                $access_controller = $_SESSION['access_controller'];
                                if(!empty($access_controller) && false){
                                    foreach($access_controller as $access){
                                ?>

                                <li class="from-backend <?php echo $controller == $access['controller_url'] ? 'active':'';?>">
                                    <a class="snglForm" href="<?php echo $this->Url->build($access['controller_url']); ?>" data-category-id="4" title="Statistics">
                                        <?php echo htmlspecialchars_decode($access['controller_icon']);?>
                                        <span><?php echo str_replace("Management", "", $access['module_name']);?></span>
                                    </a>
                                </li>

                                <?php
                                 }

                                }
                                ?>
                                <?php

                                if($_SESSION['userType'] == CONTACT_USER_INDICATOR){
                                $rqstUrl = $_SERVER['REQUEST_URI'];
                                ?>


                                <li class="from-backend-client <?php echo $controller == 'Clientdashboard' ? 'active':'';?>">
                                    <a class="snglForm <?php echo $controller == 'Clientdashboard' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Clientdashboard', "action" => "index"]); ?>" data-category-id="4" title="Dashboard">
                                        <img src="<?php echo $this->Url->build('/images/top_link_img/dashboard.png'); ?>" alt="">
                                        <span>Dashboard</span>
                                    </a>
                                </li>
                                <li class="from-backend-client <?php echo $controller == 'ClientStatus' ? 'active':'';?>" style="position: relative;">
                                    <a class="snglForm <?php echo $controller == 'ClientStatus' ? 'active':'';?>" href="javascript:void(0);" data-category-id="4" title="Status">
                                        <img src="<?php echo $this->Url->build('/images/top_link_img/status.png'); ?>" alt="">
                                        <span>Status</span>
                                    </a>
                                    <ul class="subMenu subMenuClient">
                                        <li>
                                            <a class="<?php echo $controller == 'ClientStatus' && $method == "creditreportstatus" ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'ClientStatus', "action" => "creditreportstatus"]); ?>">&raquo;&nbsp; Credit Report Status</a>
                                        </li>
<!--                                        <li>
                                            <a class="<?php echo $controller == 'AutomationSchedule' ? 'active':'';?>" href="#">&raquo;&nbsp; Challenge History</a>
                                        </li>-->
                                    </ul>
                                </li>
                                <li class="from-backend-client">
                                    <a class="snglForm <?php echo $controller == 'ClientCreditreport' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'ClientCreditreport', "action" => "index"]); ?>" data-category-id="4" title="Credit Report">
                                       <img src="<?php echo $this->Url->build('/images/top_link_img/creditreport.png'); ?>" alt="">
                                        <span>Credit Report</span>
                                    </a>
                                </li>
                                <li class="from-backend-client <?php echo strpos($rqstUrl,'Client/creditreportsetup') ? 'active':'';?>" style="position: relative;">
                                    <a class="snglForm <?php echo $controller == 'ClientFiles' ? 'active':'';?>" href="javascript:void(0);" data-category-id="4" title="Files">
                                        <img src="<?php echo $this->Url->build('/images/top_link_img/files.png'); ?>" alt="">
                                        <span>Files</span>
                                    </a>
                                    <ul class="subMenu subMenuClient">
<!--                                        <li>
                                            <a class="<?php echo $controller == 'Personalizes' ? 'active':'';?>" href="#">&raquo;&nbsp; Add File</a>
                                        </li>-->
                                        <li>
                                            <a class="<?php echo $controller == 'ClientFiles' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'ClientFiles', "action" => "agreementfiles"]); ?>">&raquo;&nbsp; Agreement Signed Files</a>
                                        </li>
                                    </ul>
                                </li>
                                <li class="from-backend-client <?php echo strpos($rqstUrl,'Client/creditreportsetup') ? 'active':'';?>" style="position: relative;">
                                    <a class="snglForm <?php echo $controller == 'ClientNote' ? 'active':'';?>" href="<?php echo $this->Url->build('/ClientNote/note'); ?>" data-category-id="4" title="Notes">
                                      <img src="<?php echo $this->Url->build('/images/top_link_img/notes.png'); ?>" alt="">
                                        <span>Notes</span>
                                    </a>
<!--                                    <ul class="subMenu">
                                        <li>
                                            <a class="<?php echo $controller == 'Personalizes' ? 'active':'';?>" href="<?php echo $this->Url->build('/client/note'); ?>">&raquo;&nbsp; Add Note</a>
                                        </li>
                                    </ul>-->
                                </li>
                                <li class="from-backend-client <?php echo $controller == 'Clientmessage' ? 'active':'';?>">
                                    <a class="snglForm  <?php echo $controller == 'Clientmessage' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Clientmessage', "action" => "clientmessage"]); ?>" data-category-id="4" title="Messages">
                                        <img src="<?php echo $this->Url->build('/images/top_link_img/message.png'); ?>" alt="">
                                        <span>Messages</span>
                                    </a>
                                </li>
                                <li class="from-backend-client <?php echo strpos($rqstUrl,'Client/creditreportsetup') ? 'active':'';?>">
                                    <a class="snglForm <?php echo $controller == 'Education' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Education', "action" => "geteducationcontent"]); ?>" data-category-id="4" title="Education">
                                        <img src="<?php echo $this->Url->build('/images/top_link_img/education.png'); ?>" alt="">
                                        <span>Education</span>
                                    </a>
                                </li>
<!--                                <li class="from-backend-client --><?php //echo $controller == 'Invoice' ? 'active':'';?><!--">-->
<!--                                    <a class="snglForm --><?php //echo $controller == 'Invoice' ? 'active':'';?><!--" href="--><?php //echo $this->Url->build(["controller" => 'Invoice', "action" => "index"]); ?><!--" data-category-id="4" title="Invoices">-->
<!--                                        <img src="--><?php //echo $this->Url->build('/images/top_link_img/invoices.png'); ?><!--" alt="">-->
<!--                                        <span>Invoices</span>-->
<!--                                    </a>-->
<!--                                </li>-->
                                <li class="from-backend-client <?php echo strpos($rqstUrl,'Client/creditreportsetup') ? 'active':'';?>">
                                    <a class="snglForm <?php echo $controller == 'Help' ? 'active':'';?>" href="<?php echo $this->Url->build(["controller" => 'Help', "action" => "gethelpcontent"]); ?>" data-category-id="4" title="Help">
                                        <img src="<?php echo $this->Url->build('/images/top_link_img/help.png'); ?>" alt="">
                                        <span>Help</span>
                                    </a>
                                </li>
<!--				<li class="from-backend <?php echo strpos($rqstUrl,'Client/uploadmedia') ? 'active':'';?>">
                                    <a class="snglForm" href="<?php echo $this->Url->build(["controller" => 'Client', "action" => "uploadmedia"]); ?>" data-category-id="4" title="Users">
                                        <i class="fa fa-upload"></i> Upload Media
                                    </a>
                                </li>-->
<?php } ?>
                                 <?php } ?>
                    </ul>
                </div>
            </div>
<?php }  ?>

<div id="clientPasswordChangeModal" class="modal fade" role="dialog">
    <div class="modal-dialog">

        <!-- Modal content-->
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Upload CSV to Change Password</h4>
            </div>
            <div class="modal-body">

                <?= $this->Form->create(null, ['type'=>'file','url' => ['controller' => 'Client', 'action' => 'clientpasswordchange']]); ?>
                <div class="row">
                    <div class="col-sm-6">
                        <div class="form-group">
                            <input class="form-control" type="file" name="csvFile"/>
                        </div>
                    </div>
                    <div class="col-sm-4">
                        <button class="btn btn-success" type="submit">Process CSV to Change Password</button>
                    </div>
                    <div class="col-sm-2">
                    <?php echo $this->element('watch_now',['section_name'=>'Upload CSV to Change Password']); ?>
                    </div>
                </div>
                <?= $this->Form->end(); ?>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default btn-orange-color" data-dismiss="modal">Cancel</button>
            </div>
        </div>

    </div>
</div>
<?php echo $this->Html->script('jquery/jquery.min.js');?>
<script>
    function submenuHideShow(elem){
        event.preventDefault();
        $(elem).next('ul.submenu-child').slideToggle()
    }
</script>
