<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Cache-control" content="no-cache">
    <meta http-equiv="Expires" content="-1">
    <!-- Tell the browser to be responsive to screen width -->
    <?php echo $setting['meta_tag']; ?>
    <?php
        if (!empty($setting['favicon_path'])) {
            $favicon_path = $setting['favicon_path'];
        } else {
            $favicon_path = 'images/favicon/favicon.ico';
        }
        
        if((APP_SERVER_HOST_URL == CLIENT_PORTAL_DOMAIN) || (strpos(CLIENT_PORTAL_DOMAIN, $_SERVER['REDIRECT_REDIRECT_SSL_TLS_SNI']) !== false)){
            $favicon_path = CLIENT_PORTAL_FAVICON;
             $setting['title'] = CLIENT_PORTAL_DEFAULT_HEADER;
        }
        ?>
    <title><?php echo $setting['title']; ?></title>
    <link rel="icon" href="<?php echo $this->request->webroot . 'webroot/' . $favicon_path; ?>" type="image/icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="<?php echo $this->request->webroot; ?>admin_lte/bootstrap/css/bootstrap.min.css">

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

    <link rel="stylesheet" href="<?php echo $this->request->webroot; ?>admin_lte/bootstrap/css/font-awesome.min.css">

    <link rel="stylesheet" href="<?php echo $this->request->webroot; ?>admin_lte/bootstrap/css/ionicons.min.css">

    <link rel="stylesheet" href="<?php echo $this->request->webroot; ?>admin_lte/dist/css/AdminLTE.min.css">

    <link rel="stylesheet" href="<?php echo $this->request->webroot; ?>admin_lte/dist/css/skins/_all-skins.min.css">

    <link rel="stylesheet" href="<?php echo $this->request->webroot; ?>admin_lte/plugins/iCheck/flat/blue.css">

    <link rel="stylesheet"
        href="<?php echo $this->request->webroot; ?>admin_lte/plugins/jvectormap/jquery-jvectormap-1.2.2.css">

    <link rel="stylesheet" href="<?php echo $this->request->webroot; ?>admin_lte/plugins/datepicker/datepicker3.css">

    <link rel="stylesheet"
        href="<?php echo $this->request->webroot; ?>admin_lte/plugins/daterangepicker/daterangepicker-bs3.css">

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


    <link href="<?php echo $this->request->webroot; ?>epicvelocity/theme/build/css/custom.min.css" rel="stylesheet">

    <!--  problem-->
    <link rel="stylesheet" href="<?php echo $this->request->webroot; ?>rtgv3/css/conv_core.css">
    <link rel="stylesheet" href="<?php echo $this->request->webroot; ?>rtgv3/css/conv_components.min.css">
    <link rel="stylesheet" href="<?php echo $this->request->webroot; ?>new_layout/css/style_evlg_sidebar.css">
    <!--  problem-->

    <link href="<?php echo $this->request->webroot; ?>epicvelocity/css/improved.css" rel="stylesheet">
    <link rel="stylesheet" href="<?php echo $this->request->webroot; ?>rtgv3/css/sertg.css">
    <link rel="stylesheet" href="<?php echo $this->request->webroot; ?>css/custom.css">
    <link rel="stylesheet" href="<?php echo $this->request->webroot; ?>new_layout/css/_all-skins.min.css">

    <link href="<?php echo $this->request->webroot; ?>epicvelocity/css/rtg_custom.css" rel="stylesheet">
    <link href="<?php echo $this->request->webroot; ?>epicvelocity/css/datepicker.css" rel="stylesheet">
    <link href="<?php echo $this->request->webroot; ?>epicvelocity/css/evlg-page.css?1.0.0" rel="stylesheet">
    <link href="<?php echo $this->request->webroot; ?>epicvelocity/js/summernote/summernote.css" rel="stylesheet">
    <link href="<?php echo $this->request->webroot; ?>epicvelocity/css/bootstrap-multiselect.css" rel="stylesheet">
    <link href="<?php echo $this->request->webroot; ?>epicvelocity/css/custom.css" rel="stylesheet">
    <link rel="stylesheet" href="<?php echo $this->request->webroot; ?>rtgv3/css/dataTables.css">
    <link rel="stylesheet" href="<?php echo $this->request->webroot; ?>epicvelocity/css/evlg-page.css" />
    <link rel="stylesheet" href="<?php echo $this->request->webroot; ?>rtgv3/css/select2.min.css">
    <?php echo $this->Html->css('select2.custom.css'); ?>
    <?php echo $this->Html->css('letter_steps.css?1.0.6'); ?>
    <style>
    .select2-selection--single .select2-selection__arrow b {
        display: block !important;
    }

    .select2-container--default .select2-selection--single .select2-selection__clear {
        display: none !important;
    }
    </style>

    <style>
    .ka-header {
        padding: 5px 5px 25px 5px !important;
        padding-bottom: 5px !important;
    }

    #upgrade-btn {
        color: #fff !important;
        line-height: 20px !important;
        padding: 10px 15px !important;
    }

    .top-icon-area,
    .ka-main-content {
        margin-left: 0 !important;
    }

    #client-member-message div.box {
        height: initial !important;
        padding: 0;
        background: #ffffff;
        border-top-color: #dd4b39;
        border: none;
        border-top: 3px solid #dd4b39;
    }

    #client-member-message .modal-content {
        width: 50% !important;
    }

    .btn-success {
        background-color: #398439;
    }

    footer {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    .panel {
        margin-bottom: 0 !important;
    }

    .ka-nav {
        font-size: 16px;
    }

    @media screen and (max-width: 480px) {
        .btn2 {
            padding: 10px !important;
        }
    }

    .swal2-icon .swal2-icon-content {
        font-size: 3.75em !important;
    }

    .swal2-popup .swal2-content {
        font-size: 16px !important;
    }

    .swal2-popup .swal2-styled {
        margin-top: 0 !important;
    }

    #member-note-modal-edit .modal-dialog {
        width: 600px !important;
        margin: 30px auto !important;
    }
    </style>
    <link rel="stylesheet" href="<?php echo $this->request->webroot; ?>rtgv3/css/full_page_loader.css?1.0.1">

</head>


<body class="hold-transition skin-blue sidebar-mini">
    <div class="loading" id="full-page-loader">
        <div class='uil-ring-css' style='transform:scale(0.79);'>
            <div></div>
            <h3></h3>
        </div>
    </div>
    <!--header navbar-->
    <?= $this->element('header_navbar') ?>
    <!--header navbar-->
    <div class="container-fluid ka-body">

        <!--Start of Main Navigation-->
        <?php if ($_SESSION['userType'] == CRM_USER_INDICATOR && !$this->Common->isEmployeeAsAdmin()) { ?>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
        <?= $this->element('new_user_dashboard_nav') ?>
        <?php } else {
                ?>

        <?= $this->element('dashboard_nav') ?>
        <?php } ?>

        <!--End of Main Navigation-->

        <div class="col-sm-9">
            <?= $this->element('top_link') ?>
            <div class="ka-main-content">
                <?= $this->Flash->render() ?>
                <?= $this->fetch('content') ?>
            </div>
        </div>

    </div>
    <footer class="">
        <div class="ka-footer">
            <?= $this->element('footer') ?>

        </div>
    </footer>


    <div class="modal fade fa fa-users" id="stt-info" style="display: none;">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">×</span></button>
                    <h4 class="modal-title">Letter Sets</h4>
                </div>
                <div class="modal-body">

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-outline pull-left" data-dismiss="modal">Close</button>
                    <button type="button" class="btn btn-outline">Save changes</button>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>


    <link rel="stylesheet" href="<?php echo $this->request->webroot; ?>css/modal_custom.css?1.0.6" />
    <script src="<?php echo $this->request->webroot; ?>epicvelocity/theme/jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap -->
    <script src="<?php echo $this->request->webroot; ?>epicvelocity/theme/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- FastClick -->
    <!--    <script src="<?php echo $this->request->webroot; ?>epicvelocity/theme/fastclick/lib/fastclick.js"></script>-->

    <!-- NProgress -->
    <!--    <script src="<?php echo $this->request->webroot; ?>epicvelocity/theme/nprogress/nprogress.js"></script>-->

    <!-- bootstrap-wysiwyg -->
    <script
        src="<?php echo $this->request->webroot; ?>epicvelocity/theme/bootstrap-wysiwyg/js/bootstrap-wysiwyg.min.js">
    </script>
    <script src="<?php echo $this->request->webroot; ?>epicvelocity/theme/jquery.hotkeys/jquery.hotkeys.js"></script>
    <script src="<?php echo $this->request->webroot; ?>epicvelocity/theme/google-code-prettify/src/prettify.js">
    </script>
    <!--            sweetalert2-->
    <script src="<?php echo $this->request->webroot;?>js/sweetalert2/sweetalert2.min.js"></script>
    <!-- Custom Theme Scripts -->
    <script src="<?php echo $this->request->webroot; ?>epicvelocity/theme/build/js/custom.min.js"></script>
    <script>
    var GET_CLIENT_LETTER_URL = '<?php echo $this->Url->build('/Epicvelocity/getClientLetters/'); ?>';
    var GET_CLIENT_INFO = '<?php echo $this->Url->build('/Epicvelocity/getClientInfo/'); ?>';
    var GET_LETTER_URL = '<?php echo $this->Url->build('/Epicvelocity/getletter/'); ?>';
    var LETTER_VIEW_URL = '<?php echo $this->Url->build('/Epicvelocity/edit'); ?>';
    var EPICVELOCITY_AJAX_URL = '<?php echo $this->Url->build('/Epicvelocity/ajaxFunction'); ?>';
    var APP_SERVER_HOST_URL_JS = '<?php echo json_encode(APP_SERVER_HOST_URL); ?>';
    </script>
    <script src="<?php echo $this->request->webroot; ?>rtgv3/js/dataTables.js"></script>
    <script src="<?php echo $this->request->webroot; ?>epicvelocity/js/select2.full.min.js"></script>
    <script src="<?php echo $this->request->webroot; ?>epicvelocity/js/summernote/summernote.min.js"></script>
    <script src="<?php echo $this->request->webroot; ?>epicvelocity/js/bootstrap-multiselect.js"></script>
    <script src="<?php echo $this->request->webroot; ?>epicvelocity/js/datepicker.js"></script>
    <script src="<?php echo $this->request->webroot; ?>epicvelocity/js/evlg-page_111.js?1.0.6"></script>
    <script type="text/javascript">
    function validDate(dValue) {
        if (dValue == '')
            dValue = $('#exp_date').val();
        var result = false;
        dValue = dValue.split('/');
        var pattern = /^\d{2}$/;
        var pattern1 = /^\d{4}$/;
        if (dValue[0] < 1 || dValue[0] > 12)
            result = true;

        if (!pattern.test(dValue[0]) || !pattern1.test(dValue[1]))
            result = true;

        if (dValue[2])
            result = true;

        if (result) {
            alert("Please enter a valid date in MM/YYYY format.");
            $('#exp_date').val('');
            return false;
        } else {
            return true;
        }
    }
    </script>
    <!--    <script type="text/javascript" src="https://cdn.ywxi.net/js/1.js" async></script>  -->
    <script>
    $("#upgrade-btn").click(function() {
        alert("Please contact customer support Francine (614-547-6222)");
        return false;
    });
    $('.close-btn').click(function() {
        $.ajax({
            type: "POST",
            url: '<?php echo $this->Url->build('/Dashboard/ajaxrequest/'); ?>',
            dataType: "jsonp",
            data: {},
            success: function(response) {
                console.log('updated', response);
            }
        });
    })
    </script>

    <script>
    var currentdate = new Date();
    currentdate.setDate(currentdate.getDate());
    $(".date-only").datepicker({
        startDate: currentdate,
        autoclose: true,
        todayHighlight: true,
        format: 'yyyy-mm-dd'
    });

    var ENVIROMENT = '<?php echo ENVIROMENT; ?>'
    </script>
    <script src="<?php echo $this->request->webroot; ?>js/unwanted_char_remove.js?1.0.8"></script>
    <script src="<?php echo $this->request->webroot;?>js/js.input.validation.js?1.0.0"></script>
    <?php echo $this->element('sidebar_js'); ?>
    <script>
    function autoSelectNextDate(elem) {
        $("input[name=next_section_date]").val('');
        var value = $(elem).val();
        if (value) {
            var currentdate = new Date();
            var new_date = currentdate.setDate(currentdate.getDate() + parseInt(value));
            var date = moment(new_date).format("YYYY-MM-DD");
            $(".date-only").datepicker('update', date);
        }
    }

    function getSttInfo() {
        event.preventDefault();
        var client_id = $('#client_id').val();
        console.log('client_id', client_id)
        if (client_id > 0) {

            $('.loading').show();

            var formData = {};
            formData['client_id'] = client_id;
            //formData['member_id'] = $('input[name=member_id]').val();
            formData['action'] = "STT_PI_LETTER_SET";

            $.ajax({
                type: 'POST',
                url: '<?php echo $this->Url->build('/epicvelocity/ajaxFunction'); ?>',
                data: formData,
                cache: false,
                success: function(data) {
                    $('.loading').hide();
                    data = JSON.parse(data);

                    if (data['status']) {
                        $('#stt-info .modal-body').html(data['html'])
                        $('#stt-info').modal('show')
                    }
                }
            });
        }

    }
    </script>
</body>

</html>