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

<div class="card">

        <div class="card-header bg-light">
            <button class="btn btn-secondary" type="button" onclick=""><i class="fas fa-caret-square-down"></i></button>
            <button class="btn btn-success " type="button" id="btnAccion"><i class="fas fa-save"></i></button>
            <button class="btn btn-danger  " onclick="location.href='<?php echo base_url; ?>apartados/historial'" type="button"><i class="fas fa-sign-out-alt"></i></button>
        </div>


    <div class="card-body">
        <div class="form-group">
            <label for="buscarApartado"><i class="fas fa-barcode"></i> Buscar Producto</label>
            <input id="buscarApartado" class="form-control" type="text" placeholder="Código o nombre del producto">
            <span class="text-danger" id="error_producto"></span>
        </div>
        <table class="table table-bordered table-hover display responsive nowrap" id="t_apartados_hist" style="width: 100%;">
            <thead>
                <tr>
                    <th>Descripción</th>
                    <th>Cantidad</th>
                    <th>Descuento</th>
                    <th>Precio</th>
                    <th>Sub Total</th>
                    <th></th>
                </tr>
            </thead>
            <tbody id="t_apartados">
            </tbody>
        </table>
    </div>
</div>

<div class="card">
    <div class="card-body">
        <div class="row">
            <div class="col-md-3">
                <div class="form-group">
                    <label for="buscarCliente"><i class="fas fa-users"></i> Buscar Cliente <span class="text-danger">*</span></label>
                    <input type="hidden" id="id_cliente" value="1">
                    <input id="buscarCliente" class="form-control" type="text" placeholder="Nombre del cliente" required>
                </div>
            </div>
            <div class="col-md-3">
                <div class="form-group">
                    <label for="retiro">Fecha de Retiro <span class="text-danger">*</span></label>
                    <input id="retiro" class="form-control" type="date" value="<?php echo date('Y-m-d'); ?>" name="retiro" required>
                </div>
            </div>
            <div class="col-md-3">
                <div class="form-group">
                    <label for="monto_abono">Monto a Abonar <span class="text-danger">*</span></label>
                    <input id="monto_abono" class="form-control" type="number" name="monto_abono" min="1" placeholder="Monto a abonar" required>
                </div>
            </div>
            <div class="col-md-3">
                <div class="form-group">
                    <label for="nota">Nota <span class="text-danger">*</span></label>
                    <textarea id="nota" class="form-control" name="nota" rows="2" placeholder="Nota"></textarea>
                </div>
            </div>
            <div class="col-md-4 ml-auto">
                <div class="form-group">
                    <label for="total" class="font-weight-bold">Total a Pagar</label>
                    <input id="total" class="form-control" type="text" name="total" placeholder="Total" disabled>
                    <button class="btn btn-outline-primary mt-2 btn-block" type="button" id="btnAccion"><i class="fas fa-print"></i> Imprimir</button>
                </div>
            </div>
        </div>
    </div>
</div>

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