<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Depto. de Planeación Programación y Presupuestación</title>

    <!-- Bootstrap -->
    <link href="<?php echo e(asset('/master/vendors/bootstrap/dist/css/bootstrap.min.css')); ?>" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="<?php echo e(asset('/master/vendors/font-awesome/css/font-awesome.min.css')); ?>" rel="stylesheet">
    <!-- NProgress -->
    <link href="<?php echo e(asset('/master/vendors/nprogress/nprogress.css')); ?>" rel="stylesheet">
    <!-- iCheck -->
    <link href="<?php echo e(asset('/master/vendors/iCheck/skins/flat/green.css')); ?>" rel="stylesheet">
    <!-- Dropzone.js -->
    <link href="<?php echo e(asset('/master/vendors/dropzone/dist/min/dropzone.min.css')); ?>" rel="stylesheet">
    <!-- PNotify -->
    <link href="<?php echo e(asset('/master/vendors/pnotify/dist/pnotify.css')); ?>" rel="stylesheet">
    <link href="<?php echo e(asset('/master/vendors/pnotify/dist/pnotify.buttons.css')); ?>" rel="stylesheet">
    <link href="<?php echo e(asset('/master/vendors/pnotify/dist/pnotify.nonblock.css')); ?>" rel="stylesheet">

    <!-- Custom Theme Style -->
    <link href="<?php echo e(asset('/master/build/css/custom.min.css')); ?>" rel="stylesheet">
    <!-- Mi estilo -->
    <link href="<?php echo e(asset('/docs/css/estilo.css?v=4.4')); ?>" rel="stylesheet">
    <!--<link href="<?php echo e(asset('/docs/css/font_boton/flaticon.css')); ?>" rel="stylesheet">-->
  </head>

  <body class="nav-md" onload="principal();">
    <?php $persona = json_decode(session('persona')); $depto = json_decode(session('departamento')); ?>
    <div id="loading" style="display: none;">
      <div class="container-fluid" style=" position:absolute; top:50%; left:50%;">
      <img src=" <?php echo e(asset('docs/img/Petirrojos.jpg')); ?>" class="imgPeti" style="width:70px; height:70px;">
      <div class="spinner">
        <div class="bounce1"></div>
        <div class="bounce2"></div>
        <div class="bounce3"></div>
      </div></div>
    </div>
    
    <div class="container body">
      <div class="main_container">
        <div class="col-md-3 left_col">
          <div class="left_col scroll-view">
            <div class="navbar nav_title" style="border: 0;">
              <a href="javascript:principal();" class="site_title" data-toggle="tooltip" data-placement="left" title="" data-original-title="Página Principal <?php echo e($depto->nombre); ?>" style="display:inline-flex; align-items:center; padding: 0px;">
                <!--<i class="fa fa-empire"></i>-->
                <img src="<?php echo e(asset('docs/img/tecnm_menu.png')); ?>" height="60px">
                <span style="font-size:13px; padding-left:10px;"><?php echo e($depto->nombre); ?></span></a>
            </div>

            <div class="clearfix"></div>

            <!-- menu profile quick info -->
            <div class="profile clearfix">
              <div class="profile_pic">
                
                <img src="<?php echo e(asset('laravel/public/perfiles/'.$persona->imagen)); ?>" alt="..." class="img-circle profile_img" style="margin-top: 50%;">
                
              </div>
              <div class="profile_info">
                <span>Bienvenido,</span>
                <h2><?php echo e($persona->titulo); ?> <?php echo e($persona->nombre); ?> <?php echo e($persona->apellido_paterno); ?> <?php echo e($persona->apellido_materno); ?></h2>
              </div>
            </div>
            <!-- /menu profile quick info -->

            <br />

            <!-- sidebar menu -->
            <div id="sidebar-menu" class="main_menu_side hidden-print main_menu">
              <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('configuracion')): ?>
                <div class="menu_section">
                  <h3>Estructura del ITZ</h3>
                  <ul class="nav side-menu">
                    <li><a><i class="fa fa-sitemap"></i> Configuración <span class="fa fa-chevron-down"></span></a>
                      <ul class="nav child_menu">
                          <li><a>Departamento <span class="fa fa-chevron-down"></span></a>
                            <ul class="nav child_menu">
                              <li class="sub_menu"><a href="#" id='departamento_listado'>Listado</a></li>
                              <li><a href="#" id='departamento_nuevo'>Nuevo</a></li>
                              <li><a href="#" onclick="alert('En construcción');">Jerarquia</a></li>
                            </ul>
                          </li>
                          <li><a>Personal<span class="fa fa-chevron-down"></span></a>
                            <ul class="nav child_menu">
                              <li class="sub_menu"><a href="#" id='personal_listado'>Listado</a></li>
                              <li><a href="#" id='personal_nuevo' onclick="alert('En construcción');">Nuevo</a></li>
                            </ul>
                          </li>
                          <li><a href="#" id='puesto_listado'>Puestos</a></li>
                          <li><a href="#" id='departamento_puesto_listado'>Asignación</a></li>
                      </ul>
                    </li>
                  </ul>
                </div>
              <?php endif; ?>

              <?php if(auth()->user()->hasAnyPermission(['programa_trabajo_anual', 'programa_operativo_anual'])): ?>
                <div class="menu_section">
                  <h3>Información Anual</h3>

                  <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('programa_trabajo_anual')): ?>
                    <ul class="nav side-menu">
                      <li><a><i class="fa fa-calculator"></i> Programa Trabajo <span class="fa fa-chevron-down"></span></a>
                        <ul class="nav child_menu">
                          <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('pta_listado')): ?> <li><a href="#" id='pta_listado'>Consultar</a></li> <?php endif; ?>
                          <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('pta_subir')): ?> <li><a href="#" id='pta_subir'>Subir Información</a></li> <?php endif; ?>
                          <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('pta_subir')): ?> <li><a href="#" id='pta_cambio_clave'>Cambiar Claves</a></li> <?php endif; ?>
                        </ul>
                      </li>
                    </ul>
                  <?php endif; ?>

                  <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('programa_operativo_anual')): ?>
                    <ul class="nav side-menu">
                      <li><a><i class="fa fa-folder"></i> Programa Operativo <span class="fa fa-chevron-down"></span></a>
                        <ul class="nav child_menu">
                            <?php if(auth()->user()->hasAnyPermission(['poa_subir_normal', 'poa_subir_restringidas', 'poa_subir_cinco_mil'])): ?>
                              <li><a>Subir <span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">
                                  <li class="sub_menu"><a href="#" id='poa_subir_partida_normal'>Partidas Normales</a></li>
                                  <li><a href="#" id='poa_subir_partida_restringida'>3000-4000</a></li>
                                  <li><a href="#" onclick="alert('En construcción');">5000</a></li>
                                </ul>
                              </li>
                            <?php endif; ?>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('poa_limites_actualizar')): ?> <li><a href="#" id='poa_limites'>Limites</a></li> <?php endif; ?>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('poa_consultar')): ?> <li><a href="#" id='poa_consultar'>Consultar</a></li> <?php endif; ?>
                        </ul>
                      </li>
                    </ul>
                  <?php endif; ?>
                </div>
              <?php endif; ?>

              <?php if(auth()->user()->hasAnyPermission(['requisicion'])): ?> <!-- Agregar los subpresupuestos-->
                <div class="menu_section">
                  <h3>Registros</h3>
                  <ul class="nav side-menu">
                    
                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('spr')): ?>
                      <li><a><i class="fa fa-sitemap"></i> Subpresupuestos <span class="fa fa-chevron-down"></span></a>
                        <ul class="nav child_menu">
                            <li><a>Partidas Restringidas<span class="fa fa-chevron-down"></span></a>
                              <ul class="nav child_menu">
                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('spr_listado')): ?> <li class="sub_menu"><a href="#" id='spr_listado'>Listado</a></li> <?php endif; ?>
                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('spr_nuevo')): ?> <li><a href="#" id='spr_nuevo'>Nuevo</a></li> <?php endif; ?>
                              </ul>
                            </li>
                            <!--<li><a>Bienes de Inversión<span class="fa fa-chevron-down"></span></a>
                              <ul class="nav child_menu">
                                <li class="sub_menu"><a href="#" onclick="alert('En construcción');">Consultar</a></li>
                                <li><a href="#" onclick="alert('En construcción');">Nuevo</a></li>
                              </ul>
                            </li>
                            </li>-->
                        </ul>
                      </li>
                    <?php endif; ?>

                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('requisicion')): ?>
                      <li><a><i class="fa fa-calculator"></i> Requisiciones  <span class="fa fa-chevron-down"></span></a>
                        <ul class="nav child_menu">
                          <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('requisicion_listado')): ?> <li><a href="#" id='requi_listado'>Listado</a></li> <?php endif; ?>
                          <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('requisicion_nueva')): ?> <li><a href="#" id='requi_nueva'>Nueva </a></li> <?php endif; ?>
                        </ul>
                      </li>
                    <?php endif; ?>
                  </ul>
                </div>
              <?php endif; ?>

              <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('interna')): ?>
                <div class="menu_section">
                  <h3>Movimientos</h3>
                  <ul class="nav side-menu">
                      <li><a><i class="fa fa-sitemap"></i> Adecuaciones <span class="fa fa-chevron-down"></span></a>
                        <ul class="nav child_menu">
                            <li><a>Interna<span class="fa fa-chevron-down"></span></a>
                              <ul class="nav child_menu">
                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('ai_listado')): ?><li class="sub_menu"><a href="#" id='ia_temp_listado'>Listado</a></li><?php endif; ?>
                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('ai_nueva')): ?><li><a href="#" id='ia_temp_nueva'>Nueva</a></li><?php endif; ?>
                              </ul>
                            </li>
                            <li><a>Externa<span class="fa fa-chevron-down"></span></a>
                              <ul class="nav child_menu">
                                <li class="sub_menu"><a href="#" id="ea_temp_listado">Listado</a></li>
                                <li><a href="#" id="ea_temp_nueva">Nueva</a></li>
                              </ul>
                            </li>
                        </ul>
                      </li>
                    
                  </ul>
                </div>
              <?php endif; ?>

            </div>


            <!-- /sidebar menu -->

            <!-- /menu footer buttons -->
            <div class="sidebar-footer hidden-small">
              <!--<a data-toggle="tooltip" data-placement="top" title="En Construcción">
                <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
              </a>
              <a data-toggle="tooltip" data-placement="top" title="En Construcción">
                <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
              </a>-->
              <a data-toggle="tooltip" data-placement="top" title="Cambiar de departamento" href="https://poa.zitacuaro.tecnm.mx/seleccion">
                <span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span>
              </a>
              <a data-toggle="tooltip" data-placement="top" title="Cerrar Sesión" href="/logout" >
                <span class="glyphicon glyphicon-off" aria-hidden="true"></span>
              </a>
            </div>
            <!-- /menu footer buttons -->
          </div>
        </div>

        <?php $noti = App\NotificacionDetalle::where('personal_id', $persona->id)->whereHas('notificacion', function($query)use($depto){$query->where('departamento_id', $depto->id); })->with('notificacion')->limit(6)->orderBy('id', 'desc')->get(); ?>

        <!-- top navigation -->
        <div class="top_nav">
            <div class="nav_menu">
                <div class="nav toggle">
                  <a id="menu_toggle"><i class="fa fa-bars"></i></a>
                </div>
                <nav class="nav navbar-nav">
                <ul class=" navbar-right">
                  <li class="nav-item dropdown open" style="padding-left: 15px;">
                    <a href="javascript:;" class="user-profile dropdown-toggle" aria-haspopup="true" id="navbarDropdown" data-toggle="dropdown" aria-expanded="false">
                      <img src="<?php echo e(asset('laravel/public/perfiles/'.$persona->imagen)); ?>" alt=""><?php echo e($persona->titulo); ?> <?php echo e($persona->nombre); ?>

                    </a>
                    <div class="dropdown-menu dropdown-usermenu pull-right" aria-labelledby="navbarDropdown">
                      <!--<a class="dropdown-item"  href="javascript:;"> Profile</a>
                      <a class="dropdown-item"  href="javascript:;">
                        <span class="badge bg-red pull-right">50%</span>
                        <span>Settings</span>
                      </a>
                      <a class="dropdown-item"  href="javascript:;">Help</a>-->
                      <a class="dropdown-item"  href="/"><i class="fa fa-sign-out pull-right"></i>Cerrar Sesión</a>
                    </div>
                  </li>

                  <?php if($noti->count()>0): ?>
                    <li role="presentation" class="nav-item dropdown open">
                      <a href="javascript:;" class="dropdown-toggle info-number" id="navbarDropdown1" data-toggle="dropdown" aria-expanded="false">
                        <i class="fa fa-envelope-o"></i>
                        
                        <?php $tn=0; ?>
                        <?php $__currentLoopData = $noti; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $n): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <?php if($n->visto==0): ?> <?php $tn = $tn+1; ?> <?php endif; ?> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <span class="badge bg-green"><?php echo e($tn); ?></span>

                      </a>
                      <ul class="dropdown-menu list-unstyled msg_list" role="menu" aria-labelledby="navbarDropdown1">
                        <?php $__currentLoopData = $noti; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $d): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                          
                          <li class="nav-item <?php if($d->visto==1): ?> visto <?php endif; ?> " >
                            <a class="dropdown-item">
                              <!--color de la campana del alert yellow - red - green -->
                              <?php switch($d->notificacion->tipo):
                                  case (1): ?> <?php $color = 'green'; ?> <?php break; ?>
                                  <?php case (2): ?> <?php $color = 'yellow'; ?> <?php break; ?>
                                  <?php case (3): ?> <?php $color = 'red'; ?> <?php break; ?>
                              <?php endswitch; ?>
                              
                              <span class="image"><img src="<?php echo e(asset('/docs/img/png/notification-'.$color.'.png')); ?>" alt="Alerta" /></span>
                              <span>
                                <span>Subpresupuesto</span>
                                <span class="time"><?php echo e(\Carbon\Carbon::createFromTimeStamp(strtotime($d->notificacion->created_at))->diffForHumans()); ?></span>
                              </span>
                              <span class="message"><?php echo $d->notificacion->movimiento; ?></span>
                            </a>
                          </li>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <!--<li class="nav-item">
                          <div class="text-center">
                            <a class="dropdown-item">
                              <strong>See All Alerts</strong>
                              <i class="fa fa-angle-right"></i>
                            </a>
                          </div>
                        </li>-->
                      </ul>
                    </li>
                  <?php endif; ?>

                </ul>
              </nav>
            </div>
          </div>
        <!-- /top navigation -->

        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">
              <div class="title_left">
                <h3 id='titulo_principal'><small id='subtitulo_principal'></small></h3>
              </div>

              <div class="title_right">
                <div class="col-md-5 col-sm-5   form-group pull-right top_search">

                </div>
              </div>
            </div>

            <div class="clearfix"></div>

            <div style="display: block;" id='contenido_principal'>
              
            </div>
          </div>
        </div>
        <!-- /page content -->

        <!-- footer content -->
        <footer>
          <div class="pull-right">
            I.T. Zitácuaro 2020
          </div>
          <div class="clearfix"></div>
        </footer>
        <!-- /footer content -->

        <!-- Modal mediano firma autorizacion -->
          <div id='modal-firma' class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" style="display: none;">
            <div class="modal-dialog modal-dialog-centered">
              <div class="modal-content">

                <div class="modal-header bg-green" style=''>
                  <h5 class="modal-title" id="myModalLabel2">Modal title</h5>
                  <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
                  </button>
                </div>
                <div class="modal-body"></div>
                <div class="modal-footer">
                  <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                  <button type="button" class="btn btn-primary">Save changes</button>
                </div>

              </div>
            </div>
          </div>
        <!-- Fin modal mediano firma autorizacion -->

        <!-- Modal grande para consultar -->
          <div id='modal-consulta' class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" style="display: none;">
            <div class="modal-dialog modal-xl">
              <div class="modal-content">

                <div class="modal-header bg-green text-white" style=''>
                  <h5 class="modal-title" id="myModalLabel2">Modal title</h5>
                  <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
                  </button>
                </div>
                <div class="modal-body"></div>
                <!--<div class="modal-footer">
                  <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                  <button type="button" class="btn btn-primary">Save changes</button>
                </div>-->

              </div>
            </div>
          </div>
        <!-- Fin modal grande para consultar -->
      </div>
    </div>

    <!-- jQuery -->
    <script src="<?php echo e(asset('/master/vendors/jquery/dist/jquery.min.js')); ?>"></script>
    <!-- Bootstrap -->
    <script src="<?php echo e(asset('/master/vendors/bootstrap/dist/js/bootstrap.bundle.min.js')); ?>"></script>
    <!-- FastClick -->
    <script src="<?php echo e(asset('/master/vendors/fastclick/lib/fastclick.js')); ?>"></script>
    <!-- NProgress -->
    <script src="<?php echo e(asset('/master/vendors/nprogress/nprogress.js')); ?>"></script>
    <!-- iCheck -->
    <script src="<?php echo e(asset('/master/vendors/iCheck/icheck.min.js')); ?>"></script>
    <!-- Dropzone.js -->
    <script src="<?php echo e(asset('/master/vendors/dropzone/dist/min/dropzone.min.js')); ?>"></script>
    <!-- PNotify -->
    <script src="<?php echo e(asset('/master/vendors/pnotify/dist/pnotify.js')); ?>"></script>
    <script src="<?php echo e(asset('/master/vendors/pnotify/dist/pnotify.buttons.js')); ?>"></script>
    <script src="<?php echo e(asset('/master/vendors/pnotify/dist/pnotify.nonblock.js')); ?>"></script>

    <!-- Custom Theme Scripts -->
    <script src="<?php echo e(asset('/master/build/js/custom.min.js')); ?>"></script>
    
    <!-- Funciones del sistema -->
    <script src="<?php echo e(asset('/docs/js/genericas.js?v=5.5')); ?>"></script>
    <script src="<?php echo e(asset('/docs/js/funciones.js?v=5.6')); ?>"></script>
  </body>
</html>
<?php /**PATH /home/itzitacu/public_html/poa/laravel/resources/views/principal.blade.php ENDPATH**/ ?>