<!-- datatables -->
<link rel="stylesheet" href="<?=base_url()?>assets/librerias/datatablescrm/media/css/jquery.dataTables.min.css">
<link rel="stylesheet" href="<?=base_url()?>assets/css/jquery.tosrus.all.css">
<script src="<?=base_url();?>assets/librerias/datatablescrm/media/js/jquery.dataTables.min.js"></script>
<!-- html2canvas -->
<script src="<?=base_url()?>assets/librerias/html2canvas/html2canvas.min.js"></script>
<script src="<?=base_url()?>assets/js/jquery.tosrus.all.min.js"></script>
<!-- jspdf -->
<script src="<?=base_url()?>assets/librerias/jspdf/jspdf.debug.js"></script>
<style>
    .checkA, .check{
        left: 0 !important;
        visibility: inherit !important;
        position: relative !important;
        margin-left: 15px;
    }
    label.pres_autorizado{
        background-color: #00c851!important;
        color: #fff;
        padding-right: 10px;
        border-radius: 10px;
        margin-left: 10px;
    }
    label.no_autorizado{
        background-color: #ec8585!important;
        color: #fff;
        padding-right: 10px;
        border-radius: 10px;
        margin-left: 10px;
    }

    a[href="<?=site_url('servicio/reportes')?>"]{
        display: none;
    }

    .flatpickr-clear {
        font-size: 100%;
        font-weight: bold;
        cursor: pointer;
        background: #fff;
    }
    button.whatsapp_pres{
        background-color: #79c143;
    }
    .comentario_fotos{
       line-height: normal !important;
        display: block;
        margin-top: 3px !important;
        width: 100%;
        text-align: justify;
        white-space: normal;
    }
    #modalbusqarts{
        overflow:scroll;
    }
</style>
<div class="container">
    <br>
    <div class="row">
        <div class="col-sm-12">
            <blockquote class="blockquote bq-primary htext">
                <b>REPORTE ÓRDENES GENERADAS EN RECEPCIÓN</b>
            </blockquote>
        </div>
    </div>
    <br>
    <div class="row">
        <div class="col-sm-12">
            <h6><b>Seleccione, por favor, un rango de fechas:</b></h6>
        </div>
    </div>
    <br>
    <div class="row">
        <div class="input-group col-sm-5">
          <div class="input-group-prepend">
            <label class="input-group-text" for="fecha_ini">Fecha Inicio</label>
          </div>
          <input placeholder="Fecha Inicio" value="<?php echo date("Y-m").'-1';?>" type="text" id="fecha_ini" class="form-control datepicker input_fecha" >
        </div>
        <div class="input-group col-sm-5">
          <div class="input-group-prepend">
            <label class="input-group-text" for="fecha_fin">Fecha Fin</label>
          </div>
            <input placeholder="Fecha Fin" value="<?php echo date("Y-m-t", strtotime(date("Y-m-d")));?>" type="text" id="fecha_fin" class="form-control datepicker input_fecha">
        </div>
        <div class="col-sm-2">
            <button type="button" id="btn_pdf" class="btn btn-warning btn-sm float-right">Generar PDF</button>
        </div>
    </div><br>
    <div class="row">
        <div class="input-group col-sm-4">
          <div class="input-group-prepend">
            <label class="input-group-text" for="sucursal">Sucursal</label>
          </div>
          <select id="sucursal" name="sucursal" class="browser-default form-control validate[required]">
                <option value="Todos">Todos</option>
                <?php foreach($sucursales as $sucursal): ?>
                    <option value="<?=$sucursal['Sucursal']?>"><?=$sucursal['Nombre']?></option>
                <?php   endforeach; ?>
            </select>
        </div>
        <div class="input-group col-sm-3">
          <div class="input-group-prepend">
            <label class="input-group-text" for="tipo">Tipo</label>
          </div>
            <select id="tipo" name="tipo" class="browser-default form-control validate[required]">
                <option value="Todos">Todos</option>
                <?php foreach($tipos as $tipo): ?>
                <option value="<?=$tipo['TipoOrden']?>"><?=$tipo['TipoOrden']?></option>
                <?php   endforeach; ?>
            </select>
        </div>
        <div class="input-group col-sm-3">
          <div class="input-group-prepend">
            <label class="input-group-text" for="afectadas">Afectadas</label>
          </div>
          <select id="afectadas" name="afectadas" class="browser-default form-control validate[required]">
                <option value="Todos">Todos</option>
                <option value="afectadas">Afectadas</option>
                <option value="borradores">Borradores</option>
            </select>
        </div>
        <div class="col-sm-2">
            <button type="button" id="btn_mostrar" class="btn btn-success btn-sm float-right">Mostrar Órdenes</button>
        </div>
    </div>
    <br>
    <br>
    <div class="row">
        <div class="col-sm-12 table-responsive">
            <table class="table table-bordered table-striped table-hover animated fadeIn tabla_hist" id="tabla_historico">
                <thead class="mdb-color primary-color">
                    <tr>
                        <th>ID</th>
                        <th>SUCURSAL</th>
                        <th>FECHA GENERACIÓN</th>
                        <th>ORDEN</th> 
                        <th>VIN</th>
                        <th>CLIENTE</th>
                        <th>TIPO</th>
                        <th>ASESOR</th>
                        <th>ESTATUS</th>
                        <th>FOTOS</th>
                    </tr>
                </thead>
                <tbody>
                </tbody>
            </table>
        </div>
    </div>
    <br>
</div>