<div class="col-md-6">
    <h4>Consultas de Clientes</h4>
    <table id="consulta_cliente" class="table  table-bordered table-hover">
        <thead>
            <th class="text-left">Nombre Producto</th>
            <th class="text-center">ID producto</th>
            <th class="text-right">Cantidad</th>
        </thead>
        @foreach($respuesta_fechas as $respuesta)
            @if($respuesta->consulta == 'cliente')
                <tr>
                    <td class="text-left">{{$respuesta->nombre_producto}}</td>
                    <td class="text-center">{{$respuesta->id_producto}}</td>
                    <td class="text-right">{{number_format($respuesta->cantidad, 0, ',', '.')}}</td>
                </tr>
            @endif
        @endforeach
    </table>
</div>


<div class="col-md-6">
    <h4>Consultas Propias</h4>

    <table id="consulta_propia" class="table  table-bordered table-hover">
        <thead>
            <th class="text-left">Nombre Producto</th>
            <th class="text-center">ID producto</th>
            <th class="text-right">Cantidad</th>
        </thead>
        @foreach($respuesta_fechas as $respuesta)
            @if($respuesta->consulta == 'interna')
                <tr>
                    <td class="text-left">{{$respuesta->nombre_producto}}</td>
                    <td class="text-center">{{$respuesta->id_producto}}</td>
                    <td class="text-right">{{number_format($respuesta->cantidad, 0, ',', '.')}}</td>
                </tr>
            @endif
        @endforeach
    </table>
</div>


<div class="col-md-12 text-center">
    <h4>Consultas por Cliente</h4>
    <input type="hidden" id="token" value="{{csrf_token()}}">
    <table id="consulta_por_cliente" class="display dataTable">
        <thead>
            <tr>
                <th class="text-left">Nombre Cliente</th>
                <th class="text-center">Fecha</th>
                <th class="text-center">Productos Contratados</th>
                <th class="text-right">Cantidad</th>
                <th class="text-right">Acción</th>
            </tr>
        </thead>
        @foreach($respuesta_clientes as $respuesta)
            <tr>
                <td class="text-left">{{$respuesta->nombre_cliente}}</td>
                <td class="text-center">{{$respuesta->anio}}-{{$respuesta->mes}}</td>
                <td class="text-center">{{$respuesta->productos_contratados}}</td>
                <td class="text-right">{{$respuesta->total}}</td>
                <td class="text-right">
                    <input data-anio="{{$respuesta->anio}}" data-mes="{{$respuesta->mes}}"
                        data-cliente="{{$respuesta->cliente}}" type="submit" class="ver-detalle btn btn-info btn-fidelitas"
                        value="Ver Detalle">
                </td>
            </tr>
        @endforeach
    </table>
</div>
<div id="modal_productos" class="modal fade" tabindex="-1" role="dialog">
</div>