[session]
security = "all"
redirect = "home"

[staticMenu]
code = "aside"

[account]
redirect = "home"
paramCode = "code"
forceSecure = 0
requirePassword = 0
==
<?php

function onStart(){

 $link = $this->page["url"];

 if(\Auth::user()){
 $acceptPermissions = \Auth::user()->permission2;

 $this["isDirector"] = false;
 $this["isAccountant"] = false;
 $this["crudExtrudor"] = false;
 $this["crudProductionRulon"] = false;
 $this["inboxProductionRulon"] = false;
 $this["crudSewerProduction"] = false;
 $this["crudOrders"] = false;
 $this["rawActions"] = false;
 $this["journal"] = false;
 $this["drobika"] = false;

 $filteredData = array_where($acceptPermissions, function ($permission) {
     return $permission['code'] == 'acceptDirector';
 });

 $filteredData2 = array_where($acceptPermissions, function ($permission2) {
     return $permission2['code'] == 'acceptAccountant';
 });

 $filteredData3 = array_where($acceptPermissions, function ($permission3) {
     return $permission3['code'] == 'crudExtrudor';
 });

 $filteredData4 = array_where($acceptPermissions, function ($permission4) {
     return $permission4['code'] == 'crudProductionRulon';
 });

 $filteredData5 = array_where($acceptPermissions, function ($permission5) {
     return $permission5['code'] == 'inboxProductionRulon';
 });

 $filteredData6 = array_where($acceptPermissions, function ($permission6) {
     return $permission6['code'] == 'crudSewerProduction';
 });

 $filteredData7 = array_where($acceptPermissions, function ($permission7) {
     return $permission7['code'] == 'crudOrders';
 });

 $filteredData8 = array_where($acceptPermissions, function ($permission8) {
     return $permission8['code'] == 'rawActionsCrud';
 });

 $filteredData9 = array_where($acceptPermissions, function ($permission9) {
     return $permission9['code'] == 'journal';
 });

 $filteredData10 = array_where($acceptPermissions, function ($permission10) {
     return $permission10['code'] == 'drobika';
 });


 if($filteredData){
    $this["isDirector"] = true;
 }

 if($filteredData2){
    $this["isAccountant"] = true;
 }

 if($filteredData3){
    $this["crudExtrudor"] = true;
 }

 if($filteredData4){
    $this["crudProductionRulon"] = true;
 }

 if($filteredData5){
    $this["inboxProductionRulon"] = true;
 }

 if($filteredData6){
    $this["crudSewerProduction"] = true;
 }

 if($filteredData7){
    $this["crudOrders"] = true;
 }

 if($filteredData8){
    $this["rawActions"] = true;
 }

 if($filteredData9){
    $this["journal"] = true;
 }

 if($filteredData10){
    $this["drobika"] = true;
 }

 }
}
?>
==
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>GOKBAKJA | {{ this.page.title }}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta content="Gokbakja" name="description" />
    <!-- App favicon -->
    <link rel="shortcut icon" href="{{'assets/images/fav_green.png'|theme}}" />

    {% styles %}
    <!-- jquery.vectormap css -->
    <!-- <link href="{{'assets/libs/admin-resources/jquery.vectormap/jquery-jvectormap-1.2.2.css'|theme}}" rel="stylesheet" type="text/css" /> -->

    <!-- Bootstrap Css -->
    <link
      href="{{'assets/css/bootstrap.min.css'|theme}}"
      id="bootstrap-style"
      rel="stylesheet"
      type="text/css"
    />
    <!-- Icons Css -->
    <link href="{{'assets/css/icons.min.css'|theme}}" rel="stylesheet" type="text/css" />
    <!-- App Css-->
    <link
      href="{{'assets/css/app.min.css'|theme}}"
      id="app-style"
      rel="stylesheet"
      type="text/css"
    />
    <style>
      th {
        text-align: center !important;
      }

      td {
        text-align: center !important;
        vertical-align: middle !important;
      }
    </style>
  </head>

  <body data-topbar="dark">
    {% flash %}
    <p data-control="flash-message" class="flash-message fade {{ type }}" data-interval="5">
      {{ message }}
    </p>
    {% endflash %}

    {% if user %}

        {% partial 'layout-settings-main' %}
    {% else %}
        {% partial 'login-page' %}
    {% endif %}

    <!-- JAVASCRIPT -->
    <script src="{{'assets/libs/jquery/jquery.min.js'|theme}}"></script>
    <script src="{{'assets/libs/bootstrap/js/bootstrap.bundle.min.js'|theme}}"></script>
    <script src="{{'assets/libs/metismenu/metisMenu.min.js'|theme}}"></script>
    <script src="{{'assets/libs/simplebar/simplebar.min.js'|theme}}"></script>
    <script src="{{'assets/libs/node-waves/waves.min.js'|theme}}"></script>

    {% scripts %}
    <!-- App js -->
    <script src="{{'assets/js/app.js'|theme}}"></script>
    {% framework extras %}
  </body>
</html>
