@extends('adminlte::master')

@section('adminlte_css')
    <link rel="stylesheet"
          href="{{ asset('vendor/adminlte/dist/css/skins/skin-' . config('adminlte.skin', 'blue') . '.min.css')}} ">
    <link rel="stylesheet" href="{{ asset('vendor/adminlte/css/layout_style.css')}} ">
    <link rel="stylesheet" href="{{ asset('assets/layouts/loading-style.css')}} ">
    <link rel="stylesheet" href="{{ asset('assets/layouts/small-style.css')}} ">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.css">
    <!-- comment -->
    @stack('css')
    @yield('css')
    <style>
        .show-report {
            width: 100%; background-color: #ffffff; padding: 20px; -webkit-box-shadow: 0px 6px 26px -6px rgba(0,0,0,0.48);
            -moz-box-shadow: 0px 6px 26px -6px rgba(0,0,0,0.48);
            box-shadow: 0px 6px 26px -6px rgba(0,0,0,0.48); border-radius: 5px;overflow: scroll;

        }
        li.active a {
            background-color: #222d32 !important;
        }

        .table-data {
            width: 100%;
        }

        .table-data, .table-data th, .table-data td {
            border-collapse: collapse;
            border: 1px solid #a8a8a8;
        }

        .table-data th {
            text-align: center;
            padding: 5px;
        }

        .table-data td {
            padding: 5px;
        }

        .table-data tbody > tr:nth-child(odd) {
            background-color: #f4f4f4;
            color: #606060;
        }

        .show-report {
            max-height: 640px;
            min-height: 640px;
            overflow: auto;
        }
        .table-bordered-dd tbody tr:hover {
            color: #0012ff !important;
            background-color: #fffdb5 !important;
        }

        .table-bordered-dd tbody td, .table-bordered-dd thead th {
            border: 1px solid #a8a8a8;
            padding-right: 30px;
            cursor: pointer;
        }


    </style>

@stop

@section('body_class', 'skin-' . config('adminlte.skin', 'blue') . ' sidebar-mini ' . (config('adminlte.layout') ? [
'boxed' => 'layout-boxed',
'fixed' => 'fixed',
'top-nav' => 'layout-top-nav'
][config('adminlte.layout')] : '') . (config('adminlte.collapse_sidebar') ? ' sidebar-collapse ' : ''))

@section('body')

    @if ($message = Session::get('success'))

        <div class="alert-message alert-success">
            <button type="button" class="close" data-dismiss="alert">×</button>
            <i class="fa fa-check"></i>
            <h3>Success</h3>
            <p>{{$message}}</p>
        </div>
    @endif
    @if ($message = Session::get('danger'))
        <div class="alert-message alert-danger">
            <button type="button" class="close" data-dismiss="alert">×</button>
            <i class="fa fa-exclamation-triangle"></i>
            <h3>Errors</h3>
            <p>{{$message}}</p>
        </div>
    @endif

    @if ($message = Session::get('warning'))
        <div class="alert-message alert-warning">
            <button type="button" class="close" data-dismiss="alert">×</button>
            <i class="fa fa-exclamation-triangle"></i>
            <h3>Warning</h3>
            <p>{{$message}}</p>
        </div>
    @endif

    @if (count($errors) > 0)
        <div class="alert-message  alert-danger">
            <button type="button" class="close" data-dismiss="alert">×</button>
            <i class="fa fa-exclamation-triangle"></i>
            <h3>Whoops!</h3>
            @foreach ($errors->all() as $error)
                <p>{{ $error }}</p>
            @endforeach
        </div>
    @endif
    <div class="wrapper">

        <!-- Main Header -->
        <header class="main-header">
            @if(config('adminlte.layout') == 'top-nav')
                <nav class="navbar navbar-static-top">
                    <div class="container">
                        <div class="navbar-header">
                            <a href="{{ url(config('adminlte.dashboard_url', 'home')) }}" class="navbar-brand">
                                {!! config('adminlte.logo', '<b>Admin</b>LTE') !!}
                            </a>
                            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                                    data-target="#navbar-collapse">
                                <i class="fa fa-bars"></i>
                            </button>
                        </div>

                        <!-- Collect the nav links, forms, and other content for toggling -->
                        <div class="collapse navbar-collapse pull-left" id="navbar-collapse">
                            <ul class="nav navbar-nav">
                                @each('adminlte::partials.menu-item-top-nav', $adminlte->menu(), 'item')
                            </ul>
                        </div>
                        <!-- /.navbar-collapse -->
                    @else
                        <!-- Logo -->
                            <a href="{{ url(config('adminlte.dashboard_url', 'home')) }}" class="logo">
                                <!-- mini logo for sidebar mini 50x50 pixels -->
                                <span class="logo-mini">{{\Branch::branch_name()}}</span>
                                <!-- logo for regular state and mobile devices -->
                                <span class="logo-lg">{{\Branch::branch_name()}}</span>
                            </a>

                            <!-- Header Navbar -->
                            <nav class="navbar navbar-static-top" role="navigation">
                                <!-- Sidebar toggle button-->
                                <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
                                    <span class="sr-only">{{ trans('adminlte::adminlte.toggle_navigation') }}</span>
                                </a>


                                <div class="navbar-custom-menu pull-left">
                                    <ul class="nav navbar-nav">
                                        <li>
                                            <a href="{{route('dashboard.super-admin')}}">
                                                <i class="fa fa-dashboard"></i> Dashboard
                                            </a>
                                        </li>
                                    </ul>
                                </div>
                            </nav>
                    </div>
                </nav>
        </header>
        @endif
        <aside class="main-sidebar">

            <!-- sidebar: style can be found in sidebar.less -->
            <section class="sidebar">

                <!-- Sidebar Menu -->
                <!-- <ul class="sidebar-menu" data-widget="tree"> -->
                {{--<!-- @each('adminlte::partials.menu-item', $adminlte->menu(), 'item') -->--}}
                @parent
                @include('hr.hr-reports.content')
            </section>
        </aside>


        <!-- Content Wrapper. Contains page content -->
        <div class="content-wrapper">
            @if(config('adminlte.layout') == 'top-nav')
                <div class="container">
                @endif

                <!-- Content Header (Page header) -->
                    <section class="content-header">
                        @yield('content_header')
                    </section>

                    <!-- Main content -->
                    <section class="content">

                        @yield('content')

                    </section>
                    <!-- /.content -->
                    @if(config('adminlte.layout') == 'top-nav')
                </div>
                <!-- /.container -->
            @endif
        </div>
        <!-- /.content-wrapper -->

    </div>
    <!-- ./wrapper -->
    <footer class="main-footer">
        <!-- To the right -->
        <div class="pull-right hidden-xs">
            Version 1.2
        </div>
        <!-- Default to the left -->
        <strong>Copyright © 2019 <a href="https://netsolution.online/" target="blank">netsolution.online</a>.</strong>
        All rights reserved.
    </footer>





@stop

@section('adminlte_js')
    <script type="text/javascript" src="{{ asset('vendor/adminlte/dist/js/adminlte.min.js') }}"></script>

    <link href="{{asset('assets/scripts/datepicker/bootstrap-datepicker.min.css')}}" rel="stylesheet">
    <link href="{{asset('assets/scripts/image-upload/bootstrap-imageupload.css')}}" rel="stylesheet">
    <script type="text/javascript" src="{{asset('assets/scripts/image-upload/bootstrap-imageupload.js')}}"></script>
    <script type="text/javascript" src="{{asset('assets/scripts/datepicker/bootstrap-datepicker.min.js')}}"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.js"></script>

    <script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
    <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css"/>
    @stack('js')
    @yield('js')
    <script type="text/javascript">
        $(".date_picker").datepicker({
            dateFormat: "dd-mm-yy",
            changeMonth: true,
            changeYear: true,
        });

        $(function () {
            $(".create_date_picker").datepicker({
                dateFormat: "dd-mm-yy"
            }).datepicker("setDate", "0");
        });
        $('form').submit(function () {
            $(this).find("input[type='submit']").prop('disabled', true);
            $(this).find("button[type='submit']").prop('disabled', true);
        });

        $('.select2').select2();


        $(".file-upload-image").change(function () {
            readURLs(this, $(this).attr('id'));
        });

        function readURLs(input, BlockImage) {
            if (input.files && input.files[0]) {
                var reader = new FileReader();
                reader.onload = function (e) {
                    $('img#' + BlockImage).attr('src', e.target.result);
                };
                reader.readAsDataURL(input.files[0]);
            }
        }

        var url = window.location;
        $('ul.sidebar-menu a').filter(function () {
            return this.href == url;
        }).parent().addClass('active');
        $('ul.treeview-menu a').filter(function () {
            return this.href == url;
        }).parentsUntil(".sidebar-menu > .treeview-menu").addClass('active');
        window.setTimeout(function () {
            $(".alert-message").fadeOut({
                opacity: 0
            }, 15000).hide('slow');
        }, 4000);

        $("div.alert-message").on("click", "button.close", function () {
            $(this).parent().fadeOut({
                opacity: 0
            }, 15000).hide('slow');
        });

        function readURL(input) {
            if (input.files && input.files[0]) {

                var reader = new FileReader();

                reader.onload = function (e) {
                    $('.image-upload-wrap').hide();

                    $('.file-upload-image').attr('src', e.target.result);
                    $('.file-upload-content').show();

                    $('.image-title').html(input.files[0].name);
                };

                reader.readAsDataURL(input.files[0]);

            } else {
                removeUpload();
            }
        }

        function removeUpload() {
            $('.file-upload-input').replaceWith($('.file-upload-input').clone());
            $('.file-upload-content').hide();
            $('.image-upload-wrap').show();
        }

        $('.image-upload-wrap').bind('dragover', function () {
            $('.image-upload-wrap').addClass('image-dropping');
        });
        $('.image-upload-wrap').bind('dragleave', function () {
            $('.image-upload-wrap').removeClass('image-dropping');
        });


        $(document).on('keypress', '.number-only', function (e) {
            if (isNaN(this.value + "" + String.fromCharCode(e.charCode))) return false;
        });
        $('#datatable').DataTable({
            "paging": false,
            'ordering': false
        });


        $(window).on('hashchange', function () {
            if (window.location.hash) {
                var page = window.location.hash.replace('#', '');
                if (page == Number.NaN || page <= 0) {
                    return false;
                } else {
                    getData(page);
                }
            }
        });

        $(document).ready(function () {
            $(document).on('click', '.pagination a', function (event) {
                event.preventDefault();

                $('li').removeClass('active');
                $(this).parent('li').addClass('active');

                var myurl = $(this).attr('href');
                var page = $(this).attr('href').split('page=')[1];

                getData(page);
            });

        });


        var $imageupload = $('.imageupload');
        $imageupload.imageupload();

        $('#imageupload-disable').on('click', function () {
            $imageupload.imageupload('disable');
            $(this).blur();
        });

        $('#imageupload-enable').on('click', function () {
            $imageupload.imageupload('enable');
            $(this).blur();
        });

        $('#imageupload-reset').on('click', function () {
            $imageupload.imageupload('reset');
            $(this).blur();
        });

        function disable_datatable_features() {
            $('.dataTables_length').hide();
            $('.dataTables_filter').hide();
            $('.dataTables_info').hide();
            $('.dataTables_paginate').hide();
        }
    </script>




@stop