<?php
require '../../../conexion.php';
require '../../../menu/css_lte.ctp';
?>

<form accept-charset="utf8" class="form-horizontal">
    <input name="opcion" value="2" id="op" type="hidden"/>
    <div class="col-md-6 col-md-offset-0">
        <div class="list-group">
            <a href="#" class="list-group-item active" style="background-color: #330; width: 326px">
                Informes de Compras
            </a>              
        </div>   
        
        <div class="form-group col-md-12">
            <label class="col-sm-2 control-label">Proveedor:</label>
            <div class="col-sm-6">
                <?php $prvs = consultas::get_datos("select * from proveedores"); ?>                                                                 
                <select name="vpag" class="form-control select2" id="vprv">
                    <?php
                    if (!empty($prvs)) {
                        foreach ($prvs as $prv) {
                            ?>
                            <option value="<?php echo $prv['prv_razonsoc']; ?>">
                                <?php echo $prv['prv_razonsoc']; ?></option>
                            <?php
                        }
                    } else {
                        ?>
                        <option value="0">Debe insertar un Prv</option>
                    <?php } ?> 
                </select>
            </div>
            
            <div class="form-group col-md-1">
                <div class="col-sm-1  pull-right">
                    <a onclick="enviar()" rel="tooltip" data-title="Imprimir"
                       class="btn btn-primary" style="background-color: #330" role="button">
                        <span class="fa fa-print"> </span></a>  
                </div>
            </div>
            
        </div> 

    </div> 
</form>

<script>
   function enviar() {
        window.open("/farmmedi/informes/compras/compras/imprimir_compras.php?vprv=" + "'" +  $('#vprv').val() + "'"  + 
                '&vop=' + $('#op').val(), '_blank');
    }
</script>




