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


<a class="btn btn-outline-primary mb-2" type="button" href="<?php echo base_url; ?>cotizaciones"><i class="fas fa-plus"></i></a>
<button class="btn btn-outline-danger mb-2 btn-toolbar-status" disabled type='button' onclick="generarPdfLocation(base_url+'cotizaciones/generarPdf/'+active_row)"><i class="fas fa-file-pdf"></i></button>
<button class="btn btn-outline-info mb-2 btn-toolbar-status" disabled type="button" onclick="verCotizacion(active_row);"><i class="fas fa-eye"></i></button>


<div class="card shadow-lg">
    <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="cot_desde">
            </div>
            <div class="col-md-4">
                <label for="">Hasta</label>
                <input class="form-control" id="max" type="date" name="cot_hasta">
            </div>
            <div class="col-md-4">
                <div class="form-group">
                    <label for="my-input">Registros</label><br>
                    <button class="btn btn-outline-primary btn-block" type="button" name="historial_cotizacion" onclick="mostrarTodo(event)">Mostrar Todo</button>
                </div>
            </div>
        </div>
        <div class="table-responsive">
            <table class="table table-bordered table-striped table-hover display responsive nowrap" id="t_cotizacion_historial" style="width: 100%;">
                <thead>
                    <tr>
                        <th>Id</th>
                        <th>Cliente</th>
                        <th>Total</th>
                        <th>Fecha</th>
                        <th>Estado</th>
                    </tr>
                </thead>
                <tbody>
                </tbody>
                <tfoot>
                    <tr>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>
                </tfoot>
            </table>
        </div>
    </div>
</div>

<div id="verCotizacion" 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">Cotización</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>
                <div class="card">
                    <div class="card-body">
                        <div class="row">
                            <div class="col-md-3">
                                <div class="form-group">
                                    <label for="condicion_pago">Condición de Pago</label>
                                    <input type="text" class="form-control" id="condicion_pago" disabled>
                                </div>
                            </div>
                            <div class="col-md-2">
                                <div class="form-group">
                                    <label for="validez_oferta">Validez de Oferta</label>
                                    <input type="text" class="form-control" id="validez_oferta" disabled>
                                </div>
                            </div>
                            <div class="col-md-3">
                                <div class="form-group">
                                    <label for="fecha">Fecha Cotización</label>
                                    <input type="text" class="form-control" id="fecha" disabled>
                                    <input type="hidden" id="fecha_actual">
                                </div>
                            </div>
                            <div class="col-md-4">
                                <div class="form-group">
                                    <label for="nota">Nota</label>
                                    <textarea id="nota" rows="1" class="form-control" disabled></textarea>
                                </div>
                            </div>
                        </div>
                    </div>
                </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>Stock</td>
                                <td>Sub Total</td>
                            </tr>
                        </thead>
                        <tbody id="detalle_cot">
                        </tbody>
                    </table>
                </div>
                <div class="col-md-4 ml-auto">
                    <div class="form-group">
                        <label for="cotizacion_total">Total</label>
                        .<div class="float-right">
                            <label for="restante">Fin: </label>
                            <span class="badge badge-primary" id="restante"></span>
                        </div>
                        <input class="form-control" type="text" id="cotizacion_total" disabled>
                    </div>
                    <div class="form-group" id="accionCot">

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