<?php include "Views/templates/header.php"; ?>



<a class="btn btn-primary mb-2" href="<?php echo base_url; ?>apartados"><i class="fas fa-plus"></i></a>





<div class="card">

    <div class="card-body">

        <div class="row">

            <div class="col-md-4">

                <label for="">Desde</label>

                <input class="form-control" id="min" type="date" name="apartado_desde" placeholder="Selecciona Fecha Inicio">

            </div>

            <div class="col-md-4">

                <label for="">Hasta</label>

                <input class="form-control" id="max" type="date" name="apartado_hasta" placeholder="Selecciona Fecha Fin">

            </div>

            <div class="col-md-4">

                <div class="form-group">

                    <label for="my-input">Registros</label><br>

                    <button class="btn btn-primary btn-block" type="button" name="historial_apartados" onclick="mostrarTodo(event)">Mostrar Todo</button>

                </div>

            </div>

        </div>

        <div class="table-responsive">

            <table class="table table-bordered table-hover display responsive nowrap" id="t_apartado_historial" style="width: 100%;">

                <thead>

                    <tr>

                        <th>Id</th>

                        <th>Total</th>

                        <th>Cliente</th>

                        <th>Fecha A.</th>

                        <th>Fecha Recojo</th>

                        <th>Estado</th>

                        <th></th>

                    </tr>

                </thead>

                <tbody>

                </tbody>

                <tfoot>

                    <tr>

                        <td></td>

                        <td></td>

                        <td></td>

                        <td></td>

                        <td></td>

                        <td></td>

                        <td></td>

                    </tr>

                </tfoot>

            </table>

        </div>

    </div>

</div>



<div id="verApartado" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="my-modal-title" aria-hidden="true">

    <div class="modal-dialog modal-xl" role="document">

        <div class="modal-content">

            <div class="modal-header bg-secondary">

                <h5 class="modal-title" id="title">Apartados</h5>

                <button class="close" data-dismiss="modal" aria-label="Close">

                    <span aria-hidden="true">&times;</span>

                </button>

            </div>

            <div class="modal-body">

                <div class="table-responsive">

                    <table class="table table-bordered table-hover">

                        <thead class="bg-info">

                            <tr>

                                <td>Nombre</td>

                                <td>Teléfono</td>

                                <td>Dirección</td>

                            </tr>

                        </thead>

                        <tbody id="detalle_cliente">

                        </tbody>

                    </table>

                </div>

                <h6 class="text-center">Detalle Productos</h6>

                <div class="table-responsive">

                    <table class="table table-bordered table-hover">

                        <thead class="bg-info">

                            <tr>

                                <td>Cantidad</td>

                                <td>Descripción</td>

                                <td>Precio</td>

                                <td>Descuento</td>

                                <td>Sub Total</td>

                            </tr>

                        </thead>

                        <tbody id="detalle_apart">

                        </tbody>

                    </table>

                </div>

                <div class="col-md-4 ml-auto">

                    <div class="form-group">

                        <label for="fecha_recojo">Fecha recojo: </label>

                        <span class="badge badge-primary" id="fecha_recojo"></span>

                    </div>

                    <div class="form-group">

                        <label for="abonado">Abonado</label>

                        <input class="form-control" type="text" id="abonado" disabled>

                    </div>

                    <div class="form-group">

                        <label for="restante">Restante</label>

                        <input class="form-control" type="text" id="restante" disabled>

                    </div>

                    <div class="form-group">

                        <label for="apartado_total">Total</label>

                        <input class="form-control" type="text" id="apartado_total" disabled>

                        <div class="form-group mt-2" id="accionApart">

                        </div>

                    </div>

                </div>

            </div>

        </div>

    </div>

</div>

<?php include "Views/templates/footer.php"; ?>