@extends('layouts.master')
@section('main')
    <?php Fun::lang();

    $br = myBranch();
    $menu = [
        'dashboard' => [
            'icon' => 'dashboard',
            'route' => '#',
            'text' => __('administrator.dashboard'),
            'gate' => '',
            'wos' => array(
                'route' => route('app_dashboard'),
                'text' => __('administrator.app'),
                'gate' => 'Warehouse System',
            ),
            'hr' => array(
                'route' => route('hr-dashboard.index'),
                'text' => __('administrator.hr'),
                'gate' => 'HRM System',
            ),
            'accounting' => array(
                'route' => route('accounting-dashboard.index'),
                'text' => __('administrator.accounting'),
                'gate' => 'Accounting System',
            ),
        ],
        'accounting' => [
            'icon' => 'buysellads',
            'route' => '#',
            'text' => __('administrator.accounting'),
            'gate' => '',
            'add_journal' => array(
                'route' => route('journal.create'),
                'text' => __('administrator.add_journal'),
                'gate' => '',
            ),
            'journal_list' => array(
                'route' => route('journal.index'),
                'text' => __('administrator.journal_list'),
                'gate' => '',
            ),
        ],
        'accounting_report' => [
            'route' => '#',
            'text' => __('administrator.accounting_report'),
            'gate' => '',
            'ledger' => array(
                'route' => route('accounting-report.ledger'),
                'text' => __('administrator.ledger'),
                'gate' => '',
            ),
            'trial_balance' => array(
                'route' => route('accounting-report.trail-balance'),
                'text' => __('administrator.trial_balance'),
                'gate' => '',
            ),
            'balance_sheet' => array(
                'route' => route('accounting-report.balance-sheet'),
                'text' => __('administrator.balance_sheet'),
                'gate' => '',
            ),
            'income_statement' => array(
                'route' => route('accounting-report.income-statement'),
                'text' => __('administrator.income_statement'),
                'gate' => '',
            ),
        ],
        'accounting_setup' => [
            'route' => '#',
            'text' => __('administrator.accounting_setup'),
            'gate' => '',
            'account_type' => array(
                'route' => route('account.type'),
                'text' => __('administrator.account_type'),
                'gate' => '',
            ),
            'account_chart' => array(
                'route' => route('account-chart.index'),
                'text' => __('administrator.account_chart'),
                'gate' => '',
            ),
        ],
    ];

    ?>
    @component('layouts.menu', ['menu' => $menu,'br'=>$br])@endcomponent
    <nav class="navbar default display-none">
        <div class="container-fluid">
            <div class="navbar-header">
                <div class="w-80">
                <a class="navbar-brand" href="{{asset('/')}}">
                    @if($br->logo)
                        <img src="{{asset($br->logo)}} " style="width: 60px;width: 60px">
                    @else
                        <h4>{{$br->name}}</h4>
                    @endif
                </a>
                </div>
            </div>
            <ul class="nav navbar-nav menu">
                <li class="dropdown tag-menu">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <span class="header-menu"><i class="fa fa-chevron-circle-down"></i></span>
                        {{__('administrator.dashboard')}}
                        <span class="caret"></span>
                    </a>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="{{route('app_dashboard')}}">
                                {{__('administrator.app')}}
                            </a>
                        </li>
                        <li>
                            <a href="{{route('hr-dashboard.index')}}">
                                {{__('administrator.hr')}}
                            </a>
                        </li>
                        <li>
                            <a href="{{route('accounting-dashboard.index')}}">
                                {{__('administrator.accounting')}}
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown tag-menu">

                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        <span class="header-menu">
                            <i class="fa fa-users"></i>
                        </span>
                        {{__('administrator.accounting')}}

                        <span class="caret"></span>
                    </a>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="{{route('journal.create')}}">
                                <span>{{__('administrator.add_journal')}}</span>
                            </a>
                        </li>
                        <li>
                            <a href="{{route('journal.index')}}">
                                <span>{{__('administrator.journal_list')}}</span>
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown tag-menu">

                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        <span class="header-menu">
                            <i class="fa fa-users"></i>
                        </span>
                        {{__('administrator.accounting_report')}}

                        <span class="caret"></span>
                    </a>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="{{route('accounting-report.ledger')}}">
                                <span>{{__('administrator.ledger')}}</span>
                            </a>
                        </li>
                        <li>
                            <a href="{{route('accounting-report.trail-balance')}}">
                                <span>{{__('administrator.trial_balance')}}</span>
                            </a>
                        </li>
                        <li>
                            <a href="{{route('accounting-report.balance-sheet')}}">
                                <span>{{__('administrator.balance_sheet')}}</span>
                            </a>
                        </li>
                        <li>
                            <a href="{{route('accounting-report.income-statement')}}">
                                <span>{{__('administrator.income_statement')}}</span>
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown tag-menu">

                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        <span class="header-menu">
                            <i class="fa fa-users"></i>
                        </span>
                        {{__('administrator.accounting_setup')}}

                        <span class="caret"></span>
                    </a>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="{{route('account.type')}}">
                                <span>{{__('administrator.account_type')}}</span>
                            </a>
                        </li>
                        <li>
                            <a href="{{route('account-chart.index')}}">
                                <span>{{__('administrator.account_chart')}}</span>
                            </a>
                        </li>
                    </ul>
                </li>
            </ul>

        </div>
    </nav>
    <div class="main-content">
        @yield('content')
    </div>
@endsection


@section('script')
    @yield('js')
    @stack('script')
@endsection
