<?php
$logo = \App\Models\Utility::get_file('uploads/logo/');
$company_favicon = \App\Models\Utility::getValByName('company_favicon');
$company_logo = \App\Models\Utility::GetLogo();
$SITE_RTL = \App\Models\Utility::getValByName('SITE_RTL');
$setting = \App\Models\Utility::colorset();
$color = !empty($setting['theme_color']) ? $setting['theme_color'] : 'theme-3';
$pusher_setting = \App\Models\Utility::settings();
$getseo = App\Models\Utility::getSeoSetting();
$metatitle = isset($getseo['meta_title']) ? $getseo['meta_title'] : '';
$metadesc = isset($getseo['meta_description']) ? $getseo['meta_description'] : '';
$meta_image = \App\Models\Utility::get_file('uploads/meta/');
$meta_logo = isset($getseo['meta_image']) ? $getseo['meta_image'] : '';
$enable_cookie = \App\Models\Utility::getCookieSetting('enable_cookie');
$lang = 'en';
if (isset($setting['color_flag']) && $setting['color_flag'] == 'true') {
    $themeColor = 'custom-color';
} else {
    $themeColor = $color;
}
?>

<!DOCTYPE html>
<html lang="<?php echo e(str_replace('_', '-', app()->getLocale())); ?>" dir="<?php echo e($SITE_RTL == 'on' ? 'rtl' : ''); ?>">

    <head>

        <title>
            <?php echo e(\App\Models\Utility::getValByName('title_text') ? \App\Models\Utility::getValByName('title_text') : config('app.name', 'HRMGo SaaS')); ?>

            - <?php echo $__env->yieldContent('page-title'); ?>
            </title>

        <!-- SEO META -->
        <meta name="title" content="<?php echo e($metatitle); ?>">
        <meta name="description" content="<?php echo e($metadesc); ?>">
        <!-- Open Graph / Facebook -->
        <meta property="og:type" content="website">
        <meta property="og:url" content="<?php echo e(env('APP_URL')); ?>">
        <meta property="og:title" content="<?php echo e($metatitle); ?>">
        <meta property="og:description" content="<?php echo e($metadesc); ?>">
        <meta property="og:image"
            content="<?php echo e(isset($meta_logo) && !empty(asset('storage/uploads/meta/' . $meta_logo)) ? asset('storage/uploads/meta/' . $meta_logo) : 'hrmgo.png'); ?>">

        <!-- Twitter -->
        <meta property="twitter:card" content="summary_large_image">
        <meta property="twitter:url" content="<?php echo e(env('APP_URL')); ?>">
        <meta property="twitter:title" content="<?php echo e($metatitle); ?>">
        <meta property="twitter:description" content="<?php echo e($metadesc); ?>">
        <meta property="twitter:image"
            content="<?php echo e(isset($meta_logo) && !empty(asset('storage/uploads/meta/' . $meta_logo)) ? asset('storage/uploads/meta/' . $meta_logo) : 'hrmgo.png'); ?>">


        <meta charset="utf-8" />
        <meta name="csrf-token" content="<?php echo e(csrf_token()); ?>">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="Dashboard Template Description" />
        <meta name="keywords" content="Dashboard Template" />
        <meta name="author" content="WorkDo" />


        <!-- Favicon icon -->
        <link rel="icon" href="<?php echo e(asset('assets/images/payraty-favicon.png')); ?>" type="image/x-icon" />
        <!-- for calender-->
        <link rel="stylesheet" href="<?php echo e(asset('assets/css/plugins/main.css')); ?>">

        <link rel="stylesheet" href="<?php echo e(asset('assets/css/plugins/datepicker-bs5.min.css')); ?>">
        <link rel="stylesheet" href="<?php echo e(asset('assets/css/plugins/style.css')); ?>">
        <!-- font css -->
        <link rel="stylesheet" href="<?php echo e(asset('assets/css/plugins/bootstrap-switch-button.min.css')); ?>">
        <link rel="stylesheet" href="<?php echo e(asset('assets/fonts/tabler-icons.min.css')); ?>">
        <link rel="stylesheet" href="<?php echo e(asset('assets/fonts/feather.css')); ?>">
        <link rel="stylesheet" href="<?php echo e(asset('assets/fonts/fontawesome.css')); ?>">
        <link rel="stylesheet" href="<?php echo e(asset('assets/fonts/material.css')); ?>">
        <link rel="stylesheet" href="<?php echo e(asset('css/custom.css')); ?>">

        <!-- vendor css -->

        <link rel="stylesheet" href="<?php echo e(asset('assets/css/customizer.css')); ?>">
        <link rel="stylesheet" href="<?php echo e(asset('css/custom.css')); ?>">


        <?php if($SITE_RTL == 'on'): ?>
            <link rel="stylesheet" href="<?php echo e(asset('assets/css/style-rtl.css')); ?>">
        <?php endif; ?>

        <?php if($setting['cust_darklayout'] == 'on'): ?>
            <link rel="stylesheet" href="<?php echo e(asset('assets/css/style-dark.css')); ?>">
        <?php else: ?>
            <link rel="stylesheet" href="<?php echo e(asset('assets/css/style.css')); ?>" id="main-style-link">
        <?php endif; ?>

        <meta name="url" content="<?php echo e(url('') . '/' . config('chatify.routes.prefix')); ?>"
            data-user="<?php echo e(Auth::user()->id); ?>">

        <link rel='stylesheet' href='https://unpkg.com/nprogress@0.2.0/nprogress.css' />

        <?php if($setting['cust_darklayout'] == 'on'): ?>
            <link rel="stylesheet" href="<?php echo e(asset('assets/css/custom-dark.css')); ?>">
        <?php endif; ?>

        <style>
            :root {
                --color-customColor: '#164c9d';
            }
        </style>
        <link rel="stylesheet" href="<?php echo e(asset('css/custom-color.css')); ?>">

        <?php echo $__env->yieldPushContent('css-page'); ?>
        </head>



    <body class="<?php echo e($themeColor); ?>">
        <!-- [ Pre-loader ] start -->
        <div class="loader-bg">
            <div class="loader-track">
                <div class="loader-fill"></div>
            </div>
        </div>
        <!-- [ Pre-loader ] End -->
        <!-- [ navigation menu ] start -->
        <?php echo $__env->make('partial.Admin.menu', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
        <!-- [ navigation menu ] end -->
        <!-- [ Header ] start -->

        <?php echo $__env->make('partial.Admin.header', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

        <!-- Modal -->
        <div class="modal notification-modal fade" id="notification-modal" tabindex="-1" role="dialog"
            aria-hidden="true">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-body">
                        <button type="button" class="btn-close float-end" data-bs-dismiss="modal"
                            aria-label="Close"></button>
                        <h6 class="mt-2">
                            <i data-feather="monitor" class="me-2"></i>Desktop settings
                        </h6>
                        <hr />
                        <div class="form-check form-switch">
                            <input type="checkbox" class="form-check-input" id="pcsetting1" checked />
                            <label class="form-check-label f-w-600 pl-1" for="pcsetting1">Allow desktop
                                notification</label>
                        </div>
                        <p class="text-muted ms-5">
                            you get lettest content at a time when data will updated
                        </p>
                        <div class="form-check form-switch">
                            <input type="checkbox" class="form-check-input" id="pcsetting2" />
                            <label class="form-check-label f-w-600 pl-1" for="pcsetting2">Store Cookie</label>
                        </div>
                        <h6 class="mb-0 mt-5">
                            <i data-feather="save" class="me-2"></i>Application settings
                        </h6>
                        <hr />
                        <div class="form-check form-switch">
                            <input type="checkbox" class="form-check-input" id="pcsetting3" />
                            <label class="form-check-label f-w-600 pl-1" for="pcsetting3">Backup Storage</label>
                        </div>
                        <p class="text-muted mb-4 ms-5">
                            Automaticaly take backup as par schedule
                        </p>
                        <div class="form-check form-switch">
                            <input type="checkbox" class="form-check-input" id="pcsetting4" />
                            <label class="form-check-label f-w-600 pl-1" for="pcsetting4">Allow guest to print
                                file</label>
                        </div>
                        <h6 class="mb-0 mt-5">
                            <i data-feather="cpu" class="me-2"></i>System settings
                        </h6>
                        <hr />
                        <div class="form-check form-switch">
                            <input type="checkbox" class="form-check-input" id="pcsetting5" checked />
                            <label class="form-check-label f-w-600 pl-1" for="pcsetting5">View other user chat</label>
                        </div>
                        <p class="text-muted ms-5">Allow to show public user message</p>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-light-danger btn-sm" data-bs-dismiss="modal">
                            Close
                        </button>
                        <button type="button" class="btn btn-light-primary btn-sm">
                            Save changes
                        </button>
                    </div>
                </div>
            </div>
        </div>
        <!-- [ Header ] end -->


        <!-- [ Main Content ] start -->
        <section class="dash-container">
            <div class="dash-content">

                <div class="page-header">
                    <div class="page-block">
                        <div class="row align-items-center">
                            <div class="col-auto">
                                <div class="page-header-title">
                                    <h4 class="m-b-10">
                                        <?php echo $__env->yieldContent('page-title'); ?>
                                    </h4>
                                </div>
                                <ul class="breadcrumb">
                                    <?php echo $__env->yieldContent('breadcrumb'); ?>
                                </ul>
                            </div>
                            <div class="col-sm-auto col-md">
                                <div class="float-end " <?php if($SITE_RTL == 'on'): ?> style=" float: left !important;" <?php endif; ?>>
                                    <?php echo $__env->yieldContent('action-button'); ?>
                                </div>

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

                <!-- [ breadcrumb ] end -->
                <!-- [ Main Content ] start -->
                <!-- [ basic-table ] start -->
                <?php echo $__env->yieldContent('content'); ?>
                <!-- [ basic-table ] end -->
                <!-- [ Main Content ] end -->
                </div>
                </section>
                <div class="modal fade" id="commonModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
                    aria-hidden="true">
                    <div class="modal-dialog" role="document">
                        <div class="modal-content">
                            <div class="modal-header">
                                <h5 class="modal-title" id="exampleModalLabel"></h5>
                                <button type="button" class="btn-close" data-bs-dismiss="modal"
                                    aria-label="Close"></button>
                                </div>
                                <div class="body">
                                </div>
                                </div>
                                </div>
                                </div>

        <div class="modal fade" id="commonModalOver" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
            aria-hidden="true">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title" id="exampleModalLabel"></h5>
                        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                    </div>
                    <div class="modal-body">
                    </div>
                </div>
            </div>
        </div>

        <div class="position-fixed top-0 end-0 p-3" style="z-index: 99999">
            <div id="liveToast" class="toast text-white  fade" role="alert" aria-live="assertive" aria-atomic="true">
                <div class="d-flex">
                    <div class="toast-body"></div>
                    <button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast"
                        aria-label="Close"></button>
                </div>
            </div>
        </div>
        <!-- Warning Section Ends -->
        <!-- Required Js -->
        <script src="<?php echo e(asset('assets/js/plugins/choices.min.js')); ?>"></script>
        <script src="<?php echo e(asset('js/jquery.min.js')); ?>"></script>
        <script src="<?php echo e(asset('js/jquery.form.js')); ?>"></script>

        <script src="<?php echo e(asset('js/letter.avatar.js')); ?>"></script>
        <script src="<?php echo e(asset('assets/js/plugins/datepicker-full.min.js')); ?>"></script>
        <script src="<?php echo e(asset('assets/js/plugins/popper.min.js')); ?>"></script>
        <script src="<?php echo e(asset('assets/js/plugins/simplebar.min.js')); ?>"></script>
        <script src="<?php echo e(asset('assets/js/plugins/perfect-scrollbar.min.js')); ?>"></script>
        <script src="<?php echo e(asset('assets/js/plugins/bootstrap.min.js')); ?>"></script>
        <script src="<?php echo e(asset('assets/js/plugins/feather.min.js')); ?>"></script>
        <script src="<?php echo e(asset('assets/js/plugins/bootstrap-switch-button.min.js')); ?>"></script>
        <script src="<?php echo e(asset('assets/js/dash.js')); ?>"></script>
        <script src="<?php echo e(asset('assets/js/plugins/sweetalert2.all.min.js')); ?>"></script>
        <script src="<?php echo e(asset('assets/js/plugins/simple-datatables.js')); ?>"></script>
        <script src="<?php echo e(asset('assets/js/plugins/flatpickr.min.js')); ?>"></script>

        <script src="<?php echo e(asset('js/custom.js')); ?>"></script>

        <script src="<?php echo e(asset('js/chatify/autosize.js')); ?>"></script>
        <script src='https://unpkg.com/nprogress@0.2.0/nprogress.js'></script>
        <script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>



        <script>
            const dataTable = new simpleDatatables.DataTable("#pc-dt-simple");
        </script>

        <script>
            feather.replace();
            var pctoggle = document.querySelector("#pct-toggler");
            if (pctoggle) {
                pctoggle.addEventListener("click", function() {
                    if (
                        !document.querySelector(".pct-customizer").classList.contains("active")
                    ) {
                        document.querySelector(".pct-customizer").classList.add("active");
                    } else {
                        document.querySelector(".pct-customizer").classList.remove("active");
                    }
                });
            }
            var themescolors = document.querySelectorAll(".themes-color > a");
            for (var h = 0; h < themescolors.length; h++) {
                var c = themescolors[h];
                c.addEventListener("click", function(event) {
                    var targetElement = event.target;
                    if (targetElement.tagName == "SPAN") {
                        targetElement = targetElement.parentNode;
                    }
                    var temp = targetElement.getAttribute("data-value");
                    removeClassByPrefix(document.querySelector("body"), "theme-");
                    document.querySelector("body").classList.add(temp);
                });
            }
            // var custthemebg = document.querySelector("#cust_theme_bg");
            // custthemebg.addEventListener("click", function() {
            // if (custthemebg.checked) {
            // document.querySelector(".dash-sidebar").classList.add("transprent-bg");
            // document
            // .querySelector(".dash-header:not(.dash-mob-header)")
            // .classList.add("transprent-bg");
            // } else {
            // document.querySelector(".dash-sidebar").classList.remove("transprent-bg");
            // document
            // .querySelector(".dash-header:not(.dash-mob-header)")
            // .classList.remove("transprent-bg");
            // }
            // });
            // var custdarklayout = document.querySelector("#cust_darklayout");
            // custdarklayout.addEventListener("click", function() {
            // if (custdarklayout.checked) {
            // document
            // .querySelector("#main-style-link")
            // .setAttribute("href", "<?php echo e(asset('assets/css/style-dark.css')); ?>");
            // document
            // .querySelector(".m-header > .b-brand > .logo-lg")
            // .setAttribute("src", "<?php echo e(asset('/storage/uploads/logo/logo-light.png')); ?>");
            // } else {
            // document
            // .querySelector("#main-style-link")
            // .setAttribute("href", "<?php echo e(asset('assets/css/style.css')); ?>");
            // document
            // .querySelector(".m-header > .b-brand > .logo-lg")
            // .setAttribute("src", "<?php echo e(asset('/storage/uploads/logo/logo-dark.png')); ?>");
            // }
            // });

            function removeClassByPrefix(node, prefix) {
            for (let i = 0; i < node.classList.length; i++) { let value=node.classList[i]; if (value.startsWith(prefix))
                { node.classList.remove(value); } } } </script>

        <script>
            $(document).on('click', '.local_calender .fc-daygrid-event', function(e) {
                        // if (!$(this).hasClass('project')) {
                        e.preventDefault();
                        var event = $(this);
                        var title = $(this).find('.fc-event-title').html();

                var size = 'md';
                var url = $(this).attr('href');
                $("#commonModal .modal-title ").html(title);
                $("#commonModal .modal-dialog").addClass('modal-' + size);
                $.ajax({
                url: url,
                success: function(data) {
                $('#commonModal .body').html(data);
                $("#commonModal").modal('show');
                if ($(".d_week").length > 0) {
                $($(".d_week")).each(function(index, element) {
                var id = $(element).attr('id');

                                (function() {
                                    const d_week = new Datepicker(document
                                    .querySelector('#' +
                                    id), {
                                    buttonClass: 'btn',
                                    format: 'yyyy-mm-dd',
                                    });
                                    })();

                            });
                            }

                    },
                    error: function(data) {
                    data = data.responseJSON;
                    toastrs('Error', data.error, 'error')
                    }
                    });
                    // }
                    });

            $('#dismissWelcome').on('click', function() {
            $('.welcome-back-wrapper-box').addClass('hidden-box');
            });
            </script>

        <script src="https://js.pusher.com/5.0/pusher.min.js"></script>



        <?php if(\Auth::user()->type != 'super admin'): ?>
            <script>
                $(document).ready(function() {
                    pushNotification('<?php echo e(Auth::id()); ?>');
                });

                function pushNotification(id) {

                    // ajax setup form csrf token
                    $.ajaxSetup({
                        headers: {
                            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                        }
                    });

                    // Enable pusher logging - don't include this in production
                    Pusher.logToConsole = false;

                    var pusher = new Pusher('<?php echo e($pusher_setting['pusher_app_key']); ?>', {
                        cluster: '<?php echo e($pusher_setting['pusher_app_cluster']); ?>',
                        forceTLS: true
                    });

                    // Pusher Notification
                    var channel = pusher.subscribe('send_notification');
                    channel.bind('notification', function(data) {
                        if (id == data.user_id) {
                            $(".notification-toggle").addClass('beep');
                            $(".notification-dropdown #notification-list").prepend(data.html);
                        }
                    });

                    // Pusher Message
                    var msgChannel = pusher.subscribe('my-channel');
                    msgChannel.bind('my-chat', function(data) {

                        if (id == data.to) {
                            getChat();
                        }
                    });
                }

                // Get chat for top ox
            </script>
        <?php endif; ?>


        <?php if($message = Session::get('success')): ?>
            <script>
                    show_toastr('Success', <?php echo json_encode($message, 15, 512) ?>, 'success');
            </script>
        <?php endif; ?>
        <?php if($message = Session::get('error')): ?>
            <script>
                    show_toastr('Error', <?php echo json_encode($message, 15, 512) ?>, 'error');
            </script>
        <?php endif; ?>


        <?php echo $__env->yieldContent('script'); ?>
        <?php echo $__env->yieldPushContent('script-page'); ?>

        <?php echo $__env->yieldPushContent('scripts'); ?>
        <?php echo $__env->make('Chatify::layouts.footerLinks', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

        <?php echo $__env->yieldPushContent('custom-scripts'); ?>

    </body>

</html>
<?php /**PATH /var/www/payraty/hris/resources/views/layouts/admin.blade.php ENDPATH**/ ?>