<?php
$prv_cod = $_POST['prv_cod'];
require '../../conexion.php';
?>
<label class="col-md-3 col-lg-3 control-label ">Elija Orden</label>
<div class="col-md-6 col-lg-8">
    <?php $ord = consultas::get_datos("SELECT * from v_compras_orden where orden_estado='PENDIENTE' AND prv_cod = $prv_cod;"); ?>                                 
    <select name="vorden" id="orden_cod" class="select2" required="" style="width: 100%" onchange="div_orden_detalle();">
        <option value="null">Seleccione Orden</option>
        <?php
        if (!empty($ord)) {
            foreach ($ord as $or) {
                ?>
                <option value="<?php echo $or['orden_cod']; ?>">
                    <?php echo $or['orden']; ?></option>
                <?php
            }
        } else {
            ?>
            <option value="null">No hay orden pendiente</option>
        <?php } ?>
    </select>
</div>

<div class="row" id="div_orden_detalle">
</div>

<script type="text/javascript">
    div_orden_detalle();
    $(".select2").select2();
</script>

