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

<head>
    @php 
        $user_id = session()->get('loggedIn')['id'];
        $user_type = session()->get('loggedIn')['user_type'];
        $admin_id = session()->get('loggedIn')['admin_id'];

        $query_id = ($user_type === 'admin') ? $user_id : $admin_id;

        // Fetch data based on the determined ID
        $website = App\Models\AdminDetail::where('admin_id', $query_id)->first();
        
    @endphp
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>
        {{isset($website) ? $website->company_name : 'Balance'}}
    </title>
    <link rel="shortcut icon" href="{{isset($website) && $website->favicon  ? $website->favicon : asset('public/favicon.png') }}" type="image/x-icon">
    <!-- begin::global styles -->
    <link rel="stylesheet" href="{{ asset('public/admin/vendors/bundle.css') }}" type="text/css">
    <!-- end::global styles -->
    <!-- begin::custom styles -->
    <link rel="stylesheet" href="{{ asset('public/admin/css/app.min.css') }}" type="text/css">
    <link rel="stylesheet" href="{{ asset('public/admin/css/custom.css') }}" type="text/css">
    <!-- end::custom styles -->
    <!-- begin::datepicker -->
    <link rel="stylesheet" href="{{ asset('public/admin/vendors/datepicker/daterangepicker.css') }}">
    <!-- begin::datepicker -->
    <!-- begin::vmap -->
    <link rel="stylesheet" href="{{ asset('public/admin/vendors/vmap/jqvmap.min.css') }}">
    <link rel="stylesheet" href="{{ asset('public/admin/vendors/clockpicker/bootstrap-clockpicker.min.css') }}">
    <!-- begin::vmap -->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.1.0/css/toastr.css" rel="stylesheet" />
    <link rel="stylesheet" href="{{ asset('public/admin/css/filter_box.css') }}" type="text/css">
    <!-- JS -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.1.0/js/toastr.js"></script>
    <meta name="csrf-token" content="{{ csrf_token() }}" />
    <link
    rel="stylesheet"
    href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"
  />
   <style>
    thead tr{
        background-color:#E9EEF1;
    }
    th {
            white-space: nowrap; 
            overflow: hidden;    
            text-overflow: ellipsis; 
           
        }
    td{
        text-transform: capitalize;
        white-space: nowrap;
    }

    .blade-pagination nav svg{
        width:20px !important;
    }
    .blade-pagination nav div:first-child{
        display:none !important;
    }

    .blade-pagination .cursor-default{
        background:#18abf5 !important;
    }
    </style>
</head>

<body>
    <!-- begin::page loader-->
    <div class="page-loader">
        <div class="spinner-border"></div>
        <span>Loading</span>
    </div>
   
    @include('components.nav-bar')
    @include('components.side-menu')
    @yield('content')
    
    <!-- end::main content -->
    <div class="modal fade school-modal" id="staticBackdrop" data-backdrop="static" tabindex="-1" role="dialog"
        aria-labelledby="staticBackdropLabel" aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="staticBackdropLabel">Select School</h5>
                </div>
                
                <div class="modal-body">
                
                </div>
            </div>
        </div>
    </div>
    
    <!-- begin::global scripts -->
    <script src="{{ asset('public/admin/vendors/bundle.js') }}"></script>
    <script src="{{ asset('public/admin/js/custom.js') }}"></script>
    <script src="{{ asset('public/admin/js/borderless.min.js') }}"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/2.1.2/sweetalert.min.js"></script>
    <script src="{{ asset('public/admin/vendors/datepicker/daterangepicker.js') }}"></script>
    <script src="{{ asset('public/admin/vendors/clockpicker/bootstrap-clockpicker.min.js') }}"></script>
    <link rel="stylesheet" href="{{ asset('public/admin/vendors/select2/css/select2.min.css') }}" type="text/css">
    <script src="{{ asset('public/admin/vendors/select2/js/select2.min.js') }}"></script>
    <script src="{{ asset('public/admin/js/examples/clockpicker.js') }}"></script>
   
    
    @stack('footer-script')
    <script>
        $(window).on("load",function(){
             // Access the session data
            
            
            
            // Example usage
            if (Laravel.session.userType === 'admin') {
                // Do admin-specific stuff
               // $('body').addClass('admin-view');
            }
            
        });
    $('.select2').select2({
            tags: false
        });

    $(document).ready(function(){
        $(".sidebar-switch-btn").click(function(){
               if($(this).hasClass("open-sidebar"))
               {
                    $(this).removeClass("open-sidebar");
                    $(".side-menu").css({'width':'80px'});
                    //$(".side-menu i").css({'font-size':'20px'});
                    $(".main-content").css({'margin-left':'80px'});
                    $(".side-menu span").addClass("d-none");
                    $(".main-sub-list a").css({"padding-left":"23px"});
                    $(".sub-list").removeClass("d-none");
               }
               else
               {
                    $(this).addClass("open-sidebar");
                    $(".side-menu").css({'width':'250px'});
                    $(".main-content").css({'margin-left':'250px'});
                    $(".side-menu span").removeClass("d-none");
                    $(".main-sub-list a").css({"padding-left":"52px"});
                    $(".sub-list").addClass("d-none");
               }

            });
        
        $(".notification_btn").on("mouseover",function(){
            var notice_id = $(this).attr('notice_id');
             
            $.ajax({
                    type: "post",
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    },
                    data: {
                        notice_id
                    },
                    url: "{{asset('hrms/notification-read')}}",
                    success: function(result) 
                    {  
                        var allData = result;
                        console.log(allData);
            
                    },
                    error:function(xhr,status,error)
                    {
                        console.log(error);
                    }
                });
        });
    });

        
   </script>
 
    

   
</body>

</html>
