<?php
$tmpModule=[
    'name'=>'home',
    'DisplayName'=>'Főoldal',
    'big-icon'=>true,
    'icon'=>'ico_home',
    'link'=>'?m=dashboard',
];
if(auth()->user()->hasRole(['root','developer','admin'])){
    $priceListRoute=route('admin.priceList.index');
    $supplierRoute=route('admin.supplier.index');
}else{
    $priceListRoute=route('priceList.index');
    $supplierRoute=route('supplier.index');
};
$Modules=[
    'home'=>[
        'name'=>'home',
        'DisplayName'=>'Főoldal',
        'bigIcon'=>true,
        'icon'=>'home',
        'link'=>route('dashboard.index'),
        'selected'=>true,
        'roles'=>['root','admin','developer','profit-center']
    ],
    'order'=>[
        'name'=>'order',
        'DisplayName'=>'Új megrendelés',
        'icon'=>'bevetelezes',
        //'link'=>'?m=order',
        'link'=>route('order.index'),
        //'link'=>route('order.newOrderShow'),
        'roles'=>['root','profit-center']
    ],
    'activeOrder'=>[
        'name'=>'activeOrder',
        'DisplayName'=>'Megrendelések',
        'icon'=>'tranzakciok',
        'link'=>route('orderArchive.index'),
        //'link'=>'?m=order&a=showActivOrderView',
        //'link'=>'/order',
        'roles'=>['root','developer','admin','profit-center']
    ],
    'productGroup'=>[
        'name'=>'productGroup',
        'DisplayName'=>'Termékcsoportok',
        'icon'=>'category',
        //'link'=>'?m=order',
        'link'=>route('admin.productGroup.index'),
        'roles'=>['root','developer','admin']
    ],
 'product'=>[
        'name'=>'product',
        'DisplayName'=>'Termék',
        'icon'=>'raktar',
        'link'=>route('admin.product.index'),
        'roles'=>['root','developer','admin']
    ],

    'supplier'=>[
        'name'=>'supplier',
        'DisplayName'=>'Beszállító adatbázis',
        'icon'=>'supplier',
        'link'=>$supplierRoute,
        //'link'=>route('order.newOrderShow'),
        'roles'=>['root','developer','admin','profit-center']
    ],

    'priceList'=>[
        'name'=>'priceList',
        'DisplayName'=>'Webrendelős árlisták',
        'icon'=>'price_list2',
        'link'=>$priceListRoute,
        //'link'=>route('order.newOrderShow'),
        'roles'=>['root','developer','admin','profit-center']
    ],

    'priceListProfitCenter'=>[
        'name'=>'priceListUser',
        'DisplayName'=>'PC Árlista',
        'icon'=>'price_list_user',
        'link'=>route('admin.priceListProfitCenter.index'),
        'roles'=>['root','developer','admin']
    ],

    'profitCenter'=>[
        'name'=>'profitCenter',
        'DisplayName'=>'Profitcenter',
        'icon'=>'profitCenter',
        'link'=>route('admin.profitCenter.index'),
        //'link'=>route('order.newOrderShow'),
        'roles'=>['root','developer','admin']
    ],

    'fileBatchUpload'=>[
        'name'=>'fileBatchUpload',
        'DisplayName'=>'Tömeges Feltöltés',
        'icon'=>'upload',
        'link'=>route('admin.fileBatchUpload.index'),
        'roles'=>['root','developer','admin']
    ],
    'statistics'=>[
        'name'=>'statistics',
        'DisplayName'=>'Statisztikák',
        'icon'=>'kimutatasok',
        'link'=>route('admin.statistics.index'),
        'roles'=>['root','developer','admin']
    ],
    'export'=>[
        'name'=>'export',
        'DisplayName'=>'Export',
        'icon'=>'export',
        'link'=>route('admin.export.index'),
        //'link'=>route('order.newOrderShow'),
        'roles'=>['root','developer','admin']
    ],
    /*
    */
    /*    'systemSetup'=>[
            'name'=>'systemParameters',
            'DisplayName'=>'Beállítások',
            'icon'=>'setup',
            'link'=>route('admin.systemParameters.index'),
            //'link'=>route('order.newOrderShow'),
            'roles'=>['root','developer','admin']
        ],*/

];
$Modules=json_decode(json_encode($Modules));
?>
{{--
navbar-expand-sm
--}}
<nav class=" navbar fixed-top  navbar-dark bg-dark speedButtonNavBar ui-widget-content">
    <ul>
        @foreach ($Modules as $ModuleName=>$data )
            @role($data->roles)
            <li class="iconholderModul{{ $data->name }}
            @isset($data->selected)
            @if ($data->selected) selected
                @endif
            @endisset "><a data-name="{{ $data->name }}"
                           href="{{ $data->link }}"
                           @isset($data->bigIcon)
                           @if ($data->bigIcon)
                           data-big-icon="true"
                    @endif
                    @endisset
                >
                    <img src="{{asset('images/icons/ico_'.$data->icon.'.png')}}"  alt="" />{{ $data->DisplayName }}
                </a></li>

            @endrole

        @endforeach
    </ul>
    @if ($site!='PROD')
        <h2>site:{{$site}}</h2>
    @endif

{{--
    <span style="font-size: 3em; color: gray;">
        <i class="fas fa-boxes"></i>
    </span>
--}}
    <div class="d-flex flex-row-reverse ">
        {{--<img src="{{asset('images/pictures/Eurestlogo1.png')}}">
        --}}
        <img style="max-width: none;height: 59px;vertical-align: middle;margin-top: 20px;" src="{{asset('images/pictures/Delirest_logo_green_128x59.png')}}">

        <ul>
            <li>
            <a data-name="logout" data-target="_blank" href="{{route('logout')}}">
                <img src="{{asset('images/icons/ico_logout.png')}}" alt="">
                Kilépés
                <br>[{{auth()->user()->name}}]

            </a>
        </li>
        </ul>
    </div>

</nav>
