
<div class="row">
  
  <?php
    $l = $locales->count();
    $t = $tramite->count();
    $a = $autorizar->count();
    $m = $tramitadas->count();


    $divs = 0;
    if ( $l > 0 ) { $divs++; }
    if ( $t > 0 ) { $divs++; }
    if ( $a > 0 ) { $divs++; }
    if ( $m > 0 ) { $divs++; }

    /*switch ($divs) {
      case '1': $cls = "col-xs-12 col-sm-6"; break;
      case '2': $cls = "col-xs-12 col-sm-5 col-md-5 col-lg-5 col-xl-5"; break;
      case '3': $cls = "col-xs-12 col-sm-6 col-md-6 col-lg-6 col-xl-4"; break;
      
      default: $cls = ""; break;
    }*/

    switch ($divs) {
      case '1': $cls = "col-xs-12 col-sm-12"; break;
      case '2': $cls = "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"; break;
      case '3': $cls = "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"; break;
      case '4': $cls = "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"; break;
      
      default: $cls = ""; break;
    }
  ?>

  <?php if( $l>0 || $t>0 || $a>0 || $m>0 ): ?>

    
    

    <?php if($locales->count()>0): ?>
      <div class="<?php echo $cls; ?>">
        <div class='table'>
          <div class="row encabezado">
            <div class="col-lg-3 col-md-4 col-sm-12 d-none d-sm-none d-md-block">ID</div>
            <div class="col-lg-3 col-md-4 col-sm-12 d-none d-sm-none d-md-block">Fecha</div>
            <div class="col-lg-3 col-md-4 col-sm-12 d-none d-sm-none d-md-block">Estado</div>
            <div class="col-lg-3 col-sm-12 d-none d-sm-none d-md-none d-lg-block">Acciones</div>
          </div>
          <div class="row contenido-200">
            <div class='col-md-12'>
              <?php $depto = json_decode(session('departamento')); ?>
              <?php $__currentLoopData = $locales; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $r): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
              
                <div class="row cuerpo text-center">
                  <div class='col-6 d-block d-sm-block d-md-none bg-dark-blue text-white text-center'>ID</div>
                  <div class="col-6 d-block d-sm-block d-md-none bg-dark-blue text-white text-center"><?php echo e($r->id); ?></div>
                  <div class="col-6 col-lg-3 col-md-4 col-sm-6 d-none d-sm-none d-md-block"><?php echo e($r->id); ?></div>
                  
                  <div class='col-6 d-block d-sm-block d-md-none text-center'>Fecha</div>
                  <div class="col-6 col-lg-3 col-md-4 col-sm-6"><?php echo e($r->created_at->format('d/m/Y')); ?></div>
                  
                  <div class='col-6 d-block d-sm-block d-md-none text-center'>Estado</div>
                  <div class="col-6 col-lg-3 col-md-4 col-sm-6"><?php echo e(($depto->id==15&&$r->estado==3) || ($depto->id==19&&$r->estado==4) || ($depto->id==18&&$r->estado==5) || ($depto->id==2&&$r->estado==6) || ($depto->id==19&&$r->estado==7) || ($depto->id==1&&$r->estado==8) ? 'Firmar' : $r->nombre_estado->leyendaDepto); ?></div>
                  
                  <div class="col-12 col-lg-3 col-md-12 col-sm-12 text-center">
                    <div class="btn-group btn-group-xs" role="group" aria-label="...">
                      <!--respetar los colores y botones para consultar, modificar y eliminar -->
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('spr_consultar')): ?>
                          <button class="btn btn-outline-success" type="button" data-toggle="popover" data-trigger="hover" data-placement="left" data-content="Vista Previa" onclick="spr_vista_rapida(<?php echo e($r->id); ?>)"><i class="fa fa-eye"></i></button>
                        <?php endif; ?>
                      
                      <?php if($r->estado ==6 || $r->estado==1 || $r->estado==10 || $r->estado==16): ?>  <!-- Borrador o rechazada u observaciones del tecnm -->
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('spr_editar')): ?>
                          <button class="btn btn-outline-info"    type="button" data-toggle="popover" data-trigger="hover" data-placement="left" data-content="Modificar" onclick="spr_editar(<?php echo e($r->id); ?>)"><i class="fa fa-pencil"></i></button>  
                        <?php endif; ?>
                      <?php endif; ?>
                      
                      <?php if($r->estado ==6 || $r->estado==1 || $r->estado==10 || $r->estado==16): ?>  <!-- Borrador o rechazada u observaciones del tecnm -->
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('spr_eliminar')): ?>
                          <button class="btn btn-outline-danger"  type="button" data-toggle="popover" data-trigger="hover" data-placement="left" data-content="Eliminar" onclick="eliminar_firma('Subpresupuesto de Partidas Restringidas - Eliminar', 'spr_eliminar(<?php echo e($r->id); ?>)');"><i class="fa fa-trash-o"></i></button>
                        <?php endif; ?>
                      <?php endif; ?>
                    </div>
                  </div>
                </div>
              <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
          </div>
          <div class="row pie white text-body">
            <div class="col-md-12 col-sm-12">Pendientes de enviar: <?php echo e($locales->count()); ?></div>
          </div>
        </div>
      </div>
    <?php endif; ?> 

    <?php if($autorizar->count()>0): ?>
      <div class="<?php echo $cls; ?>">
        <div class='table'>
          <div class="row encabezado">
            <div class="col-lg-3 col-md-4 col-sm-12 d-none d-sm-none d-md-block">ID</div>
            <div class="col-lg-3 col-md-4 col-sm-12 d-none d-sm-none d-md-block">Fecha</div>
            <div class="col-lg-3 col-md-4 col-sm-12 d-none d-sm-none d-md-block">Depto.</div>
            <div class="col-lg-3 col-sm-12 d-none d-sm-none d-md-none d-lg-block">Acciones</div>
          </div>
          <div class="row contenido-200">
            <div class='col-md-12'>
              <?php $depto = json_decode(session('departamento')); ?>
              <?php $__currentLoopData = $autorizar; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $r): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
              
                <div class="row cuerpo text-center">
                  <div class='col-6 d-block d-sm-block d-md-none bg-dark-blue text-white text-center'>ID</div>
                  <div class="col-6 d-block d-sm-block d-md-none bg-dark-blue text-white text-center"><?php echo e($r->id); ?></div>
                  <div class="col-6 col-lg-3 col-md-4 col-sm-6 d-none d-sm-none d-md-block"><?php echo e($r->id); ?></div>
                  
                  <div class='col-6 d-block d-sm-block d-md-none text-center'>Fecha</div>
                  <div class="col-6 col-lg-3 col-md-4 col-sm-6"><?php echo e($r->created_at->format('d/m/Y')); ?></div>
                  
                  <div class='col-6 d-block d-sm-block d-md-none text-center'>Departamento</div>
                  <div class="col-6 col-lg-3 col-md-4 col-sm-6"><div data-toggle="popover" data-trigger="hover" data-placement="left" data-content="<?php echo e($r->departamento->nombre); ?>"><?php echo e($r->departamento->abreviatura); ?></div></div>
                  
                  <div class="col-12 col-lg-3 col-md-12 col-sm-12 text-center">
                    <div class="btn-group btn-group-xs" role="group" aria-label="...">
                      <!--respetar los colores y botones para consultar, modificar y eliminar -->
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('spr_consultar')): ?>
                          <button class="btn btn-outline-success" type="button" data-toggle="popover" data-trigger="hover" data-placement="left" data-content="Vista Previa" onclick="spr_vista_rapida(<?php echo e($r->id); ?>)"><i class="fa fa-eye"></i></button>
                        <?php endif; ?>
                      
                      <?php if( ( $depto->id=='15' && ($r->estado=='2' || $r->estado=='12') ) || 
                            ( $depto->id=='19' && ($r->estado=='4' || $r->estado=='14') ) || 
                            ( $depto->id=='18' && ($r->estado=='3' || $r->estado=='13') ) || 
                            ( $depto->id=='2'  && ($r->estado=='5' || $r->estado=='15' || $r->estado=='7' ) ) ||
                            ( $depto->id=='7'  && ($r->estado=='5' || $r->estado=='15' || $r->estado=='7' ) ) ): ?>
                        <button class="btn btn-outline-warning"  type="button" data-toggle="popover" data-trigger="hover" data-placement="left" data-content="Firmar" onclick="spr_consulta_sign(<?php echo e($r->id); ?>);"><i class="fa fa-pencil"></i></button>
                      <?php endif; ?>
                      
                    </div>
                  </div>
                </div>
              <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
          </div>
          <div class="row pie white text-body">
            <div class="col-md-12 col-sm-12">Pendientes de firma: <?php echo e($autorizar->count()); ?></div>
          </div>
        </div>
      </div>
    <?php endif; ?>

    <?php if($tramite->count()>0): ?>
      <div class="<?php echo $cls; ?>">
        <div class='table'>
          <div class="row encabezado">
            <div class="col-lg-2 col-md-4 col-sm-12 d-none d-sm-none d-md-block">ID</div>
            <div class="col-lg-3 col-md-4 col-sm-12 d-none d-sm-none d-md-block">Fecha</div>
            <div class="col-lg-4 col-md-4 col-sm-12 d-none d-sm-none d-md-block">En firma con</div>
            <div class="col-lg-3 col-sm-12 d-none d-sm-none d-md-none d-lg-block">Acciones</div>
          </div>
          <div class="row contenido-200">
            <div class='col-md-12'>
              <?php $depto = json_decode(session('departamento')); ?>
              <?php $__currentLoopData = $tramite; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $r): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
              
                <div class="row cuerpo text-center">
                  <div class='col-6 d-block d-sm-block d-md-none bg-dark-blue text-white text-center'>ID</div>
                  <div class="col-6 d-block d-sm-block d-md-none bg-dark-blue text-white text-center"><?php echo e($r->id); ?></div>
                  <div class="col-6 col-lg-2 col-md-4 col-sm-6 d-none d-sm-none d-md-block"><?php echo e($r->id); ?></div>
                  
                  <div class='col-6 d-block d-sm-block d-md-none text-center'>Fecha</div>
                  <div class="col-6 col-lg-3 col-md-4 col-sm-6"><?php echo e($r->created_at->format('d/m/Y')); ?></div>
                  
                  <div class='col-6 d-block d-sm-block d-md-none text-center'>En firma con</div>
                  <div class="col-6 col-lg-4 col-md-4 col-sm-6"><?php echo e($r->nombre_estado->leyendaDepto); ?></div>
                  
                  <div class="col-12 col-lg-3 col-md-12 col-sm-12 text-center">
                    <div class="btn-group btn-group-xs" role="group" aria-label="...">
                      <!--respetar los colores y botones para consultar, modificar y eliminar -->
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('spr_consultar')): ?>
                          <button class="btn btn-outline-success" type="button" data-toggle="popover" data-trigger="hover" data-placement="left" data-content="Vista Previa" onclick="spr_vista_rapida(<?php echo e($r->id); ?>)"><i class="fa fa-eye"></i></button>
                        <?php endif; ?>
                      
                      <?php if($r->pdf !="" ): ?> <!-- El depto ya la firmo y esta en tramite para firma  -->
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('spr_descargar')): ?>
                          <a class="btn btn-outline-secondary" data-toggle="popover" data-trigger="hover" data-placement="left" data-content="Descargar PDF" target="_blank" href="<?php echo e(asset('storage/spr/2020/'.$r->pdf)); ?>"><i class="fa fa-cloud-download"></i></a>
                        <?php endif; ?>
                      <?php endif; ?>
                      
                    </div>
                  </div>
                </div>
              <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
          </div>
          <div class="row pie white text-body">
            <div class="col-md-12 col-sm-12">En trámite: <?php echo e($tramite->count()); ?></div>
          </div>
        </div>
      </div>
    <?php endif; ?>

    
    <?php if($tramitadas->count()>0): ?>
      <div class="<?php echo $cls; ?>">
        <div class='table'>
          <div class="row encabezado">
            <div class="col-lg-3 col-md-4 col-sm-12 d-none d-sm-none d-md-block">ID</div>
            <div class="col-lg-3 col-md-4 col-sm-12 d-none d-sm-none d-md-block">Fecha</div>
            <div class="col-lg-3 col-md-4 col-sm-12 d-none d-sm-none d-md-block">Departamento</div>
            <div class="col-lg-3 col-sm-12 d-none d-sm-none d-md-none d-lg-block">Acciones</div>
          </div>
          <div class="row contenido-200">
            <div class='col-md-12'>
              <?php $depto = json_decode(session('departamento')); ?>
              <?php $__currentLoopData = $tramitadas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $r): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
              
                <div class="row cuerpo text-center">
                  <div class='col-6 d-block d-sm-block d-md-none bg-dark-blue text-white text-center'>ID</div>
                  <div class="col-6 d-block d-sm-block d-md-none bg-dark-blue text-white text-center"><?php echo e($r->id); ?></div>
                  <div class="col-6 col-lg-3 col-md-4 col-sm-6 d-none d-sm-none d-md-block"><?php echo e($r->id); ?></div>
                  
                  <div class='col-6 d-block d-sm-block d-md-none text-center'>Fecha</div>
                  <div class="col-6 col-lg-3 col-md-4 col-sm-6"><?php echo e($r->created_at->format('d/m/Y')); ?></div>

                  <div class='col-6 d-block d-sm-block d-md-none text-center'>Departamento</div>
                  <div class="col-6 col-lg-3 col-md-4 col-sm-6"><div data-toggle="popover" data-trigger="hover" data-placement="left" data-content="<?php echo e($r->departamento->nombre); ?>"><?php echo e($r->departamento->abreviatura); ?></div></div>
                  
                  
                  
                  <div class="col-12 col-lg-3 col-md-12 col-sm-12 text-center">
                    <div class="btn-group btn-group-xs" role="group" aria-label="...">
                      <!--respetar los colores y botones para consultar, modificar y eliminar -->
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('spr_consultar')): ?>
                          <button class="btn btn-outline-success" type="button" data-toggle="popover" data-trigger="hover" data-placement="left" data-content="Vista Previa" onclick="spr_vista_rapida(<?php echo e($r->id); ?>)"><i class="fa fa-eye"></i></button>
                        <?php endif; ?>

                        <button class="btn btn-outline-warning"  type="button" data-toggle="popover" data-trigger="hover" data-placement="left" data-content="Firmar" onclick="spr_consulta_sign(<?php echo e($r->id); ?>);"><i class="fa fa-pencil"></i></button>
                      
                      
                      
                    </div>
                  </div>
                </div>
              <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
          </div>
          <div class="row pie white text-body">
            <div class="col-md-12 col-sm-12">Trámite en TecNM: <?php echo e($tramitadas->count()); ?></div>
          </div>
        </div>
      </div>
    <?php endif; ?>

    

  <?php else: ?>
    <div class="col">
      <label>No tienes ningún subpresupuesto de partidas restringidas pendiente!</label>
    </div>
  <?php endif; ?>

</div><?php /**PATH /home4/itzitacu/public_html/poa/laravel/resources/views/panel_spr.blade.php ENDPATH**/ ?>