@extends('layouts.app')

@section('title')
  {{ config('app.name') }} | Cartera
@endsection

@section('header')
  <a href="{{ route('home') }}" class="w3-bar-item w3-button"><span class="fa fa-home fa-fw"></span> Home</a>
@endsection

@section('content')
  @php
    extract($_REQUEST);

    if(!isset($busqueda))
    {
      $busqueda = null;
    }

    if(!isset($co))
    {
      $co = null;
    }

    if(!isset($anio))
    {
      $anio = null;
    }

    if(!isset($mes))
    {
      $mes = null;
    }

    if(!isset($dia))
    {
      $dia = null;
    }
  @endphp

  @if(\Auth::user()->rol->rol_nombre == 'Administrador' || \Auth::user()->rol->rol_nombre == 'Manager' || \Auth::user()->rol->rol_nombre == 'Cartera')
    <div class="w3-row w3-text-theme">
      <div class="w3-col s12 m9 l9">
        <h2><span class="fa fa-coins fa-fw"></span> Cartera</h2>
      </div>

      <!--Buscador para small screens-->
      {{-- <div class="w3-col s12 m3 l3 w3-hide-large-">
        {!! Form::open(['route' => 'erc.recibos.cartera', 'method' => 'get']) !!}
          <div class="input-group w3-col s12 w3-right">
            {{ Form::hidden('filtro', $filtro) }}
            {{ Form::text('busqueda', null, ['class' => 'w3-input w3-text-grey w3-border w3-border-theme', 'placeholder' => 'Buscar', 'aria-describedby' => 'search',]) }}
            <span class="input-group-addon" id="search"><i class="fa fa-search"></i></span>
            <a class="w3-bar-item" data-toggle="tooltip" data-placement="auto bottom" title="Puede buscar un recibo por centro de Operación, código de Liquidación, suscriptor, email de quien lo realizó, consecutivo o por fecha de radicación."><span class="fa fa-question-circle fa-fw"></span></a>
          </div>
        {!! Form::close() !!}
      </div> --}}

      <!--Buscador para large screens-->
      {{-- <div class="w3-col 12 w3-hide-small">
        {!! Form::open(['route' => 'erc.recibos.cartera', 'method' => 'get']) !!}
          <div class="input-group w3-col s4 w3-right">
            {{Form::hidden('filtro', $filtro)}}
            {{ Form::text('busqueda', null, ['class' => 'w3-input w3-text-grey w3-border-theme', 'placeholder' => 'Buscar', 'aria-describedby' => 'search',]) }}
            <span class="input-group-addon" id="search"><i class="fa fa-search"></i></span>
            <a class="w3-bar-item" data-toggle="tooltip" data-placement="auto bottom" title="Puede buscar un recibo por centro de Operación, código de Liquidación, suscriptor, email de quien lo realizó, consecutivo o por fecha de radicación."><span class="fa fa-question-circle fa-fw"></span></a>
          </div>
        {!! Form::close() !!}
      </div> --}}
    </div>

    <!--Buscador-->
    <div class="w3-row-padding">
      {!! Form::open(['route' => 'erc.recibos.cartera', 'method' => 'get']) !!}
        {{ Form::hidden('filtro', $filtro) }}
        <div class="w3-col s12 m2 l2">
          {{ Form::label('co', 'Centro Operación') }}
          {{ Form::select('co', $centros_operacion->pluck('centrooperacion_nombre', 'centrooperacion_id'), null, ['class' => 'w3-input w3-border w3-border-theme', 'placeholder' => 'Seleccionar']) }}          
        </div>

        <div class="w3-col s12 m1 l1">
          {{ Form::label('anio', 'Año') }}
          {{ Form::select('anio', $anios->pluck('anio', 'anio'), null, ['class' => 'w3-input w3-border w3-border-theme', 'placeholder' => 'Seleccionar']) }}
        </div>

        <div class="w3-col s12 m2 l2">
          {{ Form::label('mes', 'Mes') }}
          {{ Form::select('mes', ['01' => 'Enero', '02' => 'Febrero', '03' => 'Marzo', '04' => 'Abril', '05' => 'Mayo', '06' => 'Junio', '07' => 'Julio', '08' => 'Agosto', '09' => 'Septiembre', '10' => 'Octubre', '11' => 'Noviembre', '12' => 'Diciembre'], null, ['class' => 'w3-input w3-border w3-border-theme', 'placeholder' => 'Seleccionar']) }}
        </div>

        <div class="w3-col s12 m2 l2">
          {{ Form::label('dia', 'Día') }}
          <div class="input-group w3-col s12 w3-right-">
            {{ Form::select('dia', ['01' => '01', '02' => '02', '03' => '03', '04' => '04', '05' => '05', '06' => '06', '07' => '07', '08' => '08', '09' => '09', '10' => '10', '11' => '11', '12' => '12', '13' => '13', '14' => '14', '15' => '15', '16' => '16', '17' => '17', '18' => '18', '19' => '19', '20' => '20', '21' => '21', '22' => '22', '23' => '23', '24' => '24', '25' => '25', '26' => '26', '27' => '27', '28' => '28', '29' => '29', '30' => '30', '31' => '31'], null, ['class' => 'w3-input w3-border w3-border-theme', 'placeholder' => 'Seleccionar', 'aria-describedby' => 'filter']) }}
        
            {{-- Form::label('filtrar', 'Filtrar') }}<br>--}}
            <span class="input-group-addon" id="filter"><button type="submit" class="w3-btn- w3-white- w3-border- w3-small-" style="background-color: transparent; border: 0;"><i class="fa fa-filter fa-fw"></i></button></span>
            <span class="input-group-addon" id="filter"><a href="{{ route('erc.recibos.cartera', ['filtro' => $filtro]) }}" class="w3-btn- w3-white- w3-border- w3-small-"><i class="fa fa-ban fa-fw"></i></a></span>
          </div>
        </div>
      {!! Form::open() !!}
      <!--Buscador-->
      <div class="w3-col s12 m4 l4">
        {!! Form::open(['route' => 'erc.recibos.cartera', 'method' => 'get']) !!}
          <br>
          <div class="input-group w3-col s8 w3-right">
            {{ Form::hidden('filtro', $filtro) }}         
            {{ Form::text('busqueda', null, ['class' => 'w3-input w3-text-grey w3-border w3-border-theme', 'placeholder' => 'Buscar', 'aria-describedby' => 'search']) }}
            <span class="input-group-addon" id="search"><button type="submit" style="background-color: transparent; border: 0;"><i class="fa fa-search"></i></button></span>
            <a class="w3-bar-item" data-toggle="tooltip" data-placement="auto bottom" title="Puede buscar un recibo por centro de Operación, código de Liquidación, suscriptor, email de quien lo realizó, consecutivo o por fecha de radicación."><span class="fa fa-question-circle fa-fw"></span></a>
          </div>
        {!! Form::close() !!}
      </div>
    </div>
    <hr />

    <!--Menu Tabs-->
    <div class="w3-row w3-bar w3-white">
      <div class="w3-col s6 tablink w3-bottombar" id="1" onclick="openTab(event,'nocontabilizados')">
        <a href="{{ route('erc.recibos.cartera', ['filtro' => '1', 'co' => $co, 'anio' => $anio, 'mes' => $mes, 'dia' => $dia, 'busqueda' => $busqueda]) }}" class="w3-col s12 w3-bar-item w3-button w3-bar w3-white w3-padding" style="text-decoration: none;">No Contabilizados</a>
      </div>

      <div class="w3-col s6 tablink w3-bottombar" id="2" onclick="openTab(event,'contabilizados')">
        <a href="{{ route('erc.recibos.cartera', ['filtro' => '2', 'co' => $co, 'anio' => $anio, 'mes' => $mes, 'dia' => $dia, 'busqueda' => $busqueda]) }}" class="w3-col s12 w3-bar-item w3-button w3-bar w3-white w3-padding" style="text-decoration: none;">Contabilizados</a>
      </div>
    </div>

    <!--Tabs-->
    <div id="nocontabilizados" class="w3-container city">
      <h3>No Contabilizados</h3>
      <p>Registros encontrados: {{ count($recibos->where('estado_id', '=', $filtro)) }}</p>
      {{-- <a href="{{ route('erc.recibos.planetxt') }}" class="w3-btn w3-theme-d5">Descargar .txt</a> --}}
      <p>
          
            <script>
              var tableToExcel = (function() {
  var uri = 'data:application/vnd.ms-excel;base64,'
    , template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>'
    , base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))) }
    , format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p]; }) }
  return function(table, name) {
    if (!table.nodeType) table = document.getElementById(table)
    var ctx = {worksheet: name || 'Worksheet', table: table.innerHTML}
    window.location.href = uri + base64(format(template, ctx))
  }
})()
 </script>
          
          
          <input class="btn btn-primary" type="button" onclick="tableToExcel('testTable', 'W3C Example Table')" value="Descargar EXCEL">
          
          
          
              <!--<table id="example1" class="table table-bordered table-striped">-->
              <!--    <thead>-->
              <!--    <tr>-->
              <!--      <th>Rendering engine</th>-->
              <!--      <th>Browser</th>-->
              <!--      <th>Platform(s)</th>-->
              <!--      <th>Engine version</th>-->
              <!--      <th>CSS grade</th>-->
              <!--    </tr>-->
              <!--    </thead>-->
              <!--    <tbody>-->
              <!--    <tr>-->
              <!--      <td>Trident</td>-->
              <!--      <td>Internet-->
              <!--        Explorer 4.0-->
              <!--      </td>-->
              <!--      <td>Win 95+</td>-->
              <!--      <td> 4</td>-->
              <!--      <td>X</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Trident</td>-->
              <!--      <td>Internet-->
              <!--        Explorer 5.0-->
              <!--      </td>-->
              <!--      <td>Win 95+</td>-->
              <!--      <td>5</td>-->
              <!--      <td>C</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Trident</td>-->
              <!--      <td>Internet-->
              <!--        Explorer 5.5-->
              <!--      </td>-->
              <!--      <td>Win 95+</td>-->
              <!--      <td>5.5</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Trident</td>-->
              <!--      <td>Internet-->
              <!--        Explorer 6-->
              <!--      </td>-->
              <!--      <td>Win 98+</td>-->
              <!--      <td>6</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Trident</td>-->
              <!--      <td>Internet Explorer 7</td>-->
              <!--      <td>Win XP SP2+</td>-->
              <!--      <td>7</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Trident</td>-->
              <!--      <td>AOL browser (AOL desktop)</td>-->
              <!--      <td>Win XP</td>-->
              <!--      <td>6</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Gecko</td>-->
              <!--      <td>Firefox 1.0</td>-->
              <!--      <td>Win 98+ / OSX.2+</td>-->
              <!--      <td>1.7</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Gecko</td>-->
              <!--      <td>Firefox 1.5</td>-->
              <!--      <td>Win 98+ / OSX.2+</td>-->
              <!--      <td>1.8</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Gecko</td>-->
              <!--      <td>Firefox 2.0</td>-->
              <!--      <td>Win 98+ / OSX.2+</td>-->
              <!--      <td>1.8</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Gecko</td>-->
              <!--      <td>Firefox 3.0</td>-->
              <!--      <td>Win 2k+ / OSX.3+</td>-->
              <!--      <td>1.9</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Gecko</td>-->
              <!--      <td>Camino 1.0</td>-->
              <!--      <td>OSX.2+</td>-->
              <!--      <td>1.8</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Gecko</td>-->
              <!--      <td>Camino 1.5</td>-->
              <!--      <td>OSX.3+</td>-->
              <!--      <td>1.8</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Gecko</td>-->
              <!--      <td>Netscape 7.2</td>-->
              <!--      <td>Win 95+ / Mac OS 8.6-9.2</td>-->
              <!--      <td>1.7</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Gecko</td>-->
              <!--      <td>Netscape Browser 8</td>-->
              <!--      <td>Win 98SE+</td>-->
              <!--      <td>1.7</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Gecko</td>-->
              <!--      <td>Netscape Navigator 9</td>-->
              <!--      <td>Win 98+ / OSX.2+</td>-->
              <!--      <td>1.8</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Gecko</td>-->
              <!--      <td>Mozilla 1.0</td>-->
              <!--      <td>Win 95+ / OSX.1+</td>-->
              <!--      <td>1</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Gecko</td>-->
              <!--      <td>Mozilla 1.1</td>-->
              <!--      <td>Win 95+ / OSX.1+</td>-->
              <!--      <td>1.1</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Gecko</td>-->
              <!--      <td>Mozilla 1.2</td>-->
              <!--      <td>Win 95+ / OSX.1+</td>-->
              <!--      <td>1.2</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Gecko</td>-->
              <!--      <td>Mozilla 1.3</td>-->
              <!--      <td>Win 95+ / OSX.1+</td>-->
              <!--      <td>1.3</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Gecko</td>-->
              <!--      <td>Mozilla 1.4</td>-->
              <!--      <td>Win 95+ / OSX.1+</td>-->
              <!--      <td>1.4</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Gecko</td>-->
              <!--      <td>Mozilla 1.5</td>-->
              <!--      <td>Win 95+ / OSX.1+</td>-->
              <!--      <td>1.5</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Gecko</td>-->
              <!--      <td>Mozilla 1.6</td>-->
              <!--      <td>Win 95+ / OSX.1+</td>-->
              <!--      <td>1.6</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Gecko</td>-->
              <!--      <td>Mozilla 1.7</td>-->
              <!--      <td>Win 98+ / OSX.1+</td>-->
              <!--      <td>1.7</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Gecko</td>-->
              <!--      <td>Mozilla 1.8</td>-->
              <!--      <td>Win 98+ / OSX.1+</td>-->
              <!--      <td>1.8</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Gecko</td>-->
              <!--      <td>Seamonkey 1.1</td>-->
              <!--      <td>Win 98+ / OSX.2+</td>-->
              <!--      <td>1.8</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Gecko</td>-->
              <!--      <td>Epiphany 2.20</td>-->
              <!--      <td>Gnome</td>-->
              <!--      <td>1.8</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Webkit</td>-->
              <!--      <td>Safari 1.2</td>-->
              <!--      <td>OSX.3</td>-->
              <!--      <td>125.5</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Webkit</td>-->
              <!--      <td>Safari 1.3</td>-->
              <!--      <td>OSX.3</td>-->
              <!--      <td>312.8</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Webkit</td>-->
              <!--      <td>Safari 2.0</td>-->
              <!--      <td>OSX.4+</td>-->
              <!--      <td>419.3</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Webkit</td>-->
              <!--      <td>Safari 3.0</td>-->
              <!--      <td>OSX.4+</td>-->
              <!--      <td>522.1</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Webkit</td>-->
              <!--      <td>OmniWeb 5.5</td>-->
              <!--      <td>OSX.4+</td>-->
              <!--      <td>420</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Webkit</td>-->
              <!--      <td>iPod Touch / iPhone</td>-->
              <!--      <td>iPod</td>-->
              <!--      <td>420.1</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Webkit</td>-->
              <!--      <td>S60</td>-->
              <!--      <td>S60</td>-->
              <!--      <td>413</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Presto</td>-->
              <!--      <td>Opera 7.0</td>-->
              <!--      <td>Win 95+ / OSX.1+</td>-->
              <!--      <td>-</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Presto</td>-->
              <!--      <td>Opera 7.5</td>-->
              <!--      <td>Win 95+ / OSX.2+</td>-->
              <!--      <td>-</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Presto</td>-->
              <!--      <td>Opera 8.0</td>-->
              <!--      <td>Win 95+ / OSX.2+</td>-->
              <!--      <td>-</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Presto</td>-->
              <!--      <td>Opera 8.5</td>-->
              <!--      <td>Win 95+ / OSX.2+</td>-->
              <!--      <td>-</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Presto</td>-->
              <!--      <td>Opera 9.0</td>-->
              <!--      <td>Win 95+ / OSX.3+</td>-->
              <!--      <td>-</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Presto</td>-->
              <!--      <td>Opera 9.2</td>-->
              <!--      <td>Win 88+ / OSX.3+</td>-->
              <!--      <td>-</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Presto</td>-->
              <!--      <td>Opera 9.5</td>-->
              <!--      <td>Win 88+ / OSX.3+</td>-->
              <!--      <td>-</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Presto</td>-->
              <!--      <td>Opera for Wii</td>-->
              <!--      <td>Wii</td>-->
              <!--      <td>-</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Presto</td>-->
              <!--      <td>Nokia N800</td>-->
              <!--      <td>N800</td>-->
              <!--      <td>-</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Presto</td>-->
              <!--      <td>Nintendo DS browser</td>-->
              <!--      <td>Nintendo DS</td>-->
              <!--      <td>8.5</td>-->
              <!--      <td>C/A<sup>1</sup></td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>KHTML</td>-->
              <!--      <td>Konqureror 3.1</td>-->
              <!--      <td>KDE 3.1</td>-->
              <!--      <td>3.1</td>-->
              <!--      <td>C</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>KHTML</td>-->
              <!--      <td>Konqureror 3.3</td>-->
              <!--      <td>KDE 3.3</td>-->
              <!--      <td>3.3</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>KHTML</td>-->
              <!--      <td>Konqureror 3.5</td>-->
              <!--      <td>KDE 3.5</td>-->
              <!--      <td>3.5</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Tasman</td>-->
              <!--      <td>Internet Explorer 4.5</td>-->
              <!--      <td>Mac OS 8-9</td>-->
              <!--      <td>-</td>-->
              <!--      <td>X</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Tasman</td>-->
              <!--      <td>Internet Explorer 5.1</td>-->
              <!--      <td>Mac OS 7.6-9</td>-->
              <!--      <td>1</td>-->
              <!--      <td>C</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Tasman</td>-->
              <!--      <td>Internet Explorer 5.2</td>-->
              <!--      <td>Mac OS 8-X</td>-->
              <!--      <td>1</td>-->
              <!--      <td>C</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Misc</td>-->
              <!--      <td>NetFront 3.1</td>-->
              <!--      <td>Embedded devices</td>-->
              <!--      <td>-</td>-->
              <!--      <td>C</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Misc</td>-->
              <!--      <td>NetFront 3.4</td>-->
              <!--      <td>Embedded devices</td>-->
              <!--      <td>-</td>-->
              <!--      <td>A</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Misc</td>-->
              <!--      <td>Dillo 0.8</td>-->
              <!--      <td>Embedded devices</td>-->
              <!--      <td>-</td>-->
              <!--      <td>X</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Misc</td>-->
              <!--      <td>Links</td>-->
              <!--      <td>Text only</td>-->
              <!--      <td>-</td>-->
              <!--      <td>X</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Misc</td>-->
              <!--      <td>Lynx</td>-->
              <!--      <td>Text only</td>-->
              <!--      <td>-</td>-->
              <!--      <td>X</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Misc</td>-->
              <!--      <td>IE Mobile</td>-->
              <!--      <td>Windows Mobile 6</td>-->
              <!--      <td>-</td>-->
              <!--      <td>C</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Misc</td>-->
              <!--      <td>PSP browser</td>-->
              <!--      <td>PSP</td>-->
              <!--      <td>-</td>-->
              <!--      <td>C</td>-->
              <!--    </tr>-->
              <!--    <tr>-->
              <!--      <td>Other browsers</td>-->
              <!--      <td>All others</td>-->
              <!--      <td>-</td>-->
              <!--      <td>-</td>-->
              <!--      <td>U</td>-->
              <!--    </tr>-->
              <!--    </tbody>-->
              <!--    <tfoot>-->
              <!--    <tr>-->
              <!--      <th>Rendering engine</th>-->
              <!--      <th>Browser</th>-->
              <!--      <th>Platform(s)</th>-->
              <!--      <th>Engine version</th>-->
              <!--      <th>CSS grade</th>-->
              <!--    </tr>-->
              <!--    </tfoot>-->
              <!--  </table> -->
          
          
          
          
          
          <script>
  $(function () {
    $("#example1").DataTable({
      "responsive": true, "lengthChange": false, "autoWidth": false,
      "buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
    }).buttons().container().appendTo('#example1_wrapper .col-md-6:eq(0)');
    $('#example2').DataTable({
      "paging": true,
      "lengthChange": false,
      "searching": false,
      "ordering": true,
      "info": true,
      "autoWidth": false,
      "responsive": true,
    });
  });
</script>

          
          
          
          
          
          
          
          
          
          
      <div class="w3-responsive">
        <table class="w3-table-all w3-striped w3-hoverable" id="testTable">
          <thead>
            <tr class="w3-theme">
              <th>Fecha Radicado</th>
              <th>Centro de Operación</th>
              <th>N° eRC</th>
              <th>Código Liquidación</th>
              <th>Identificación</th>
              <th>Total</th>
              <th>Creado por</th>
              <th>Acción</th>
            </tr>
          </thead>
          <tbody class="w3-text-grey">
            @php
              $total_recibos = 0;
            @endphp
            @foreach($recibos as $recibo)
              @if($recibo->estado_id == 1)
                <tr>
                  <td>{{ $recibo->recibo_created_at }}</td>
                  <td>{{ $recibo->centrooperacion_codigo." - ".$recibo->centrooperacion_nombre }}</td>
                  <td>{{ $recibo->recibo_consecutivo_centro }}</td>
                  <td>{{ $recibo->recibo_codigo_liquidacion }}</td>
                  <td>{{ $recibo->recibo_cliente_identificacion }}</td>
                  <td>$ {{ ($recibo->concepto != null)?number_format($recibo->concepto->concepto_total,0):null }}</td>
                  <td>{{ $recibo->email }}</td>
                  <td>
                    <a href="{{ route('erc.recibos.show', [$recibo, 'filtro' => $filtro, 'co' => $co, 'anio' => $anio, 'mes' => $mes, 'dia' => $dia, 'busqueda' => $busqueda]) }}" class="w3-btn w3-white w3-border" title="Ver"><i class="fa fa-eye fa-fw"></i></a>
                    <a href="{{ url('erc/recibos/download', $recibo) }}" class="w3-btn w3-white w3-border" target="_blank" title="Imprimir"><i class="fa fa-print fa-fw"></i></a>
                  </td>
                </tr>
                @php
                  $total_recibos++;
                @endphp
              @endif
            @endforeach

            @if($total_recibos==0)
              <tr>
                <td colspan="7"><i>No hay registros.</i></td>
              </tr>
            @endif
          </tbody>
        </table>
      </div>
      <div class="w3-center">
        <div class="w3-bar">
          {!! $recibos->appends(['filtro' => '1', 'co' => $co, 'anio' => $anio, 'mes' => $mes, 'dia' => $dia, 'busqueda' => $busqueda])->render() !!}
        </div>
      </div>
      </p>
    </div>

    <div id="contabilizados" class="w3-container city" style="display:none">
      <h3>Contabilizados</h3>
      <p>Registros encontrados: {{ count($recibos->where('estado_id', '=', $filtro)) }}</p>
      <p>
      <div class="w3-responsive">
        <table class="w3-table-all w3-striped w3-hoverable">
          <thead>
            <tr class="w3-theme">
              <th>Fecha Radicado</th>
              <th>Centro de Operación</th>
              <th>N° eRC</th>
              <th>Código Liquidación</th>
              <th>Identificación</th>
              <th>Total</th>
              <th>Creado por</th>
              <th>Acción</th>
            </tr>
          </thead>
          <tbody class="w3-text-grey">
            @php
              $total_recibos = 0;
            @endphp
            @foreach($recibos as $recibo)
              @if($recibo->estado_id == 2)
                <tr>
                  <td>{{ $recibo->recibo_created_at }}</td>
                  <td>{{ $recibo->centrooperacion_codigo." - ".$recibo->centrooperacion_nombre }}</td>
                  <td>{{ $recibo->recibo_consecutivo_centro }}</td>
                  <td>{{ $recibo->recibo_codigo_liquidacion }}</td>
                  <td>{{ $recibo->recibo_cliente_identificacion }}</td>
                  <td>$ {{ ($recibo->concepto != null)?number_format($recibo->concepto->concepto_total,0):null }}</td>
                  <td>{{ $recibo->email }}</td>
                  <td>
                    <a href="{{ route('erc.recibos.show', [$recibo, 'filtro' => $filtro, 'co' => $co, 'anio' => $anio, 'mes' => $mes, 'dia' => $dia, 'busqueda' => $busqueda]) }}" class="w3-btn w3-white w3-border" title="Ver"><i class="fa fa-eye fa-fw"></i></a>
                    <a href="{{ url('erc/recibos/download', $recibo) }}" class="w3-btn w3-white w3-border" title="Imprimir" target="_blank"><i class="fa fa-print fa-fw"></i></a>
                  </td>
                </tr>
                @php
                  $total_recibos++;
                @endphp
              @endif
            @endforeach

            @if($total_recibos==0)
              <tr>
                <td colspan="7"><i>No hay registros.</i></td>
              </tr>
            @endif
          </tbody>
        </table>
      </div>
      <div class="w3-center">
        <div class="w3-bar">
          {!! $recibos->appends(['filtro' => '2', 'co' => $co, 'anio' => $anio, 'mes' => $mes, 'dia' => $dia, 'busqueda' => $busqueda])->render() !!}
        </div>
      </div>
      </p>
    </div>
  @else
    <div class="w3-panel w3-pale-red w3-leftbar w3-border-red">
      <p class="w3-padding"><br />¡Lo sentimos! Usuario no autorizado.</p>
    </div>
  @endif

  <script>
  document.getElementById({{$filtro}}).click();

  function openTab(evt, tabName) {
    var i, x, tablinks;
    x = document.getElementsByClassName("city");
    for (i = 0; i < x.length; i++) {
        x[i].style.display = "none";
    }
    tablinks = document.getElementsByClassName("tablink");
    for (i = 0; i < x.length; i++) {
        tablinks[i].className = tablinks[i].className.replace(" w3-border-theme", "");
    }
    document.getElementById(tabName).style.display = "block";
    evt.currentTarget.className += " w3-border-theme";
  }
  </script>
@endsection