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

<?php if (!empty($_POST['id_cliente'])) {
    $idcliente = $_POST['id_cliente']; ?>

    <div class="col-md-6" style="width: 150px; left: 200px">
        <label class="control-label ">Diagnostico</label>
            <?php $pd = consultas::get_datos("select * from v_servicios_diagnostico where diag_estado='ACTIVO' and id_cliente = $idcliente "); ?>                                 
        <select name="vdiagnostico" class="select2" autofocus="" required="" onchange="div_entrada_detalle()" id="iddiag" style="width: 240px">
            <?php if (!empty($pd)) { ?>
                <option value="0">Seleccione un diagnostico</option>
            <?php foreach ($pd as $p) {
                    ?>
                    <option value="<?php echo $p['id_diag']; ?>">
                    <?php echo $p['diagnostico']; ?></option>
                    <?php
                }
            } else {
                ?>
                <option value="">No existen registros confirmados</option>
    <?php } ?>
        </select> 
    </div>

    <div class="row" id="div_entrada_detalle1">

    </div>

<?php } ?>



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