<?php
require '../../conexion.php';
?>

<div class="form-group">
    <label class="col-md-2 col-sm-2 col-lg-2 control-label">Presupuestos: </label>
        <div class="col-md-6 col-sm-6 col-lg-6">
        <?php $ordenes = consultas::get_datos("select * from v_servicios_ordent where ot_estado='TERMINADO' and id_cliente = ".$_REQUEST['id_cliente']." order by id_ordent"); ?> 
               <select name="ventrada" class="select2 form-control" required="" style="width: 100%" onchange="div_entrada_detalle();" id="identrada" >
                <option value="">Seleccione una Orden</option>                       
                <?php if (!empty($ordenes)) {
                    foreach ($ordenes as $o) { ?>
                <option value="<?php echo $o['id_ordent']; ?>"><?php echo "#".$o['id_ordent']." Fecha:".date("d/m/Y", strtotime($o['ot_fecha']))." Total:". number_format($o['total'],0,",","."); ?></option>
                <?php
                    }
                } else {
                    ?>
                    <option value="null">No existen ordendes confirmadas</option>
                <?php } ?>
            </select>                                               
    </div>
</div>


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