<?php
use Predial\Http\Controllers\PagoPredialController;
?>
@extends('layout_forms')
@section('title', 'Pagos Realizados')
@section('style')
<style type="text/css" media="screen">
    .chosen-container{
        width: 100% !important;
        font-size: 10px !important;

    }

    .chosen-container-single .chosen-search input[type="text"]{
        width: 80%;
        font-size: 10px !important;
    }

    .chosen-search-input{
        font-size: 10px !important;
    }

    table .form-control, table .chosen-container, table .select{
        font-size: 10px !important;
        line-height: 1.25 !important;
    }

    .chosen-container-single .chosen-single div:after{
        left: -0.1rem !important;
        height: 1.5rem !important;
    }
</style>
@stop
@section('content')
<div class="col-sm-12 col-md-10 col-lg-10 col-xl-10">
    <h3 class="text-center titulo">Historial de pagos realizados</h3>
    <div class="form-group row sin-salto">
        <div class="col-sm-2 col-md-2 col-lg-1 col-xl-1 superior">
            <a class="btn-sm btn-primary cursor" href="{{ route('infoPredio', encrypt($predio->id_unico)) }}" title="Volver"><i class="fa fa-arrow-left"></i></a>
        </div>
        <div class="col-sm-9 col-md-9 col-lg-10 col-xl-10">
            <h6 class="text-center marca-pagina">{{ "Predio: ".ucwords(mb_strtolower($predio->nombre))}}</h6>
        </div>
    </div>
    <div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 superior2 tamaño-letra">
        <table class="table table-striped table-condensed table-bordered" id="table" data-toggle="dataTable" data-form="deleteForm">
            <thead>
                <tr>
                    <th>Año</th>
                    <th>Número de Pago</th>
                    <th>Fecha de Pago</th>
                    <th>Banco</th>
                    <th>Total</th>
                    <th>Factura</th>
                    <th>Comprobante Ing</th>
                </tr>
            </thead>
            <tbody>
                @foreach($data as $row)
                    <tr class="tamaño-letra">
                        <td>{{ $row->anno }}</td>
                        <td>{{ $row->numero }}</td>
                        <td>{{ $row->fecha }}</td>
                        <td>{{ $row->banco }}</td>
                        <td>{{ number_format($row->total, 0, '.', ',') }}</td>
                        <td>
                            <a target="_blank" href="{{ route("generarVistaFactura", [encrypt($row->factura), encrypt($predio->id_unico)]) }}" title="Factura" class="icons"><li class="fa fa-cloud-download"></li></a>
                        </td>
                        <td>
                            <?php
                            $xpago = PagoPredialController::buscarDetalleComprobante($row->pago);
                             ?>
                            @if(!empty($xpago))
                                <a target="_blank" href="{{ route("ComprobanteIngreso", encrypt($xpago)) }}" title="Comprobante Ingreso" class="icons"><li class="fa fa-cloud-download"></li></a>
                            @endif
                        </td>
                    </tr>
                @endforeach
            </tbody>
        </table>
    </div>
</div>
@stop