<?php use_helper( 'UrlFunctions' ); ?>
<?php use_helper( 'UtilFunctions' ); ?>
<?php use_helper( 'IncludePartial' ); ?>

<script type="text/javascript">
showAlertBootStrap = function( elm_id_content, class_default, message_alert )
{
    var html_alert = '<div class="alert ' + class_default + ' alert-dismissible fade show" role="alert"> ' +
            '' + message_alert +
            '<button type="button" class="close" data-dismiss="alert" aria-label="Close">' +
                '<span aria-hidden="true">&times;</span>' +
            '</button>' +
        '</div>';
    $( "#" + elm_id_content ).append( html_alert );
}
</script>

<div class="shadow-sm p-3 mb-2 bg-white rounded card card-body">
    <div class="row">
        <div class="col mb-1">
            <h4 class="text-info text-nowrap mb-0">Asignar Estado - <?=$o_MST_UbicacionBN->getNombre()?></h4>
        </div>
    </div>
</div>

<div id="content_alert" style=""></div>

<div class="card">
    <div class="container">
        <form class="was-validated" name="form1" id="form1" method="POST" action="" onsubmit="">
            <input type="hidden" name="idubicacion" id="idubicacion" value="<?=$s_IdUbicacion?>">
            <input type="hidden" name="Control" id="Control" value="1">

            <div class="form-group col-14"><hr style="border-top: 1px solid #8c8b8b;"></div>

            <div class="form-row mx-0">

                <div class="col-md-4 mb-1">
                    <label class="col-form-label" for="Estado">Estado</label>
                    <select class="form-control form-control-sm custom-select my-0 mr-sm-2" id="Estado" name="Estado" required>
                        <?php foreach ( MST_EstadosHabitacionMastFN::selectActivos() as $o_MST_EstadosHabitacionMastBN ){ ?>
                            <?php if( $o_MST_EstadosHabitacionMastBN->getIdEstados() == 3 ){ continue; } ?>
                            <option value="<?=$o_MST_EstadosHabitacionMastBN->getIdEstados()?>"> <?=$o_MST_EstadosHabitacionMastBN->getNombre()?> </option>
                        <?php } ?>
                    </select>
                </div>

            </div>

            <div class="form-group col-14"><hr style="border-top: 1px solid #8c8b8b;"></div>

            <div class="form-row mx-0">
                <div class="col-md-6 mb-1">
                    <button type="button" class="btn btn-primary btn-lg btn-block" onclick="parent.ocultarModal();">CANCELAR</button>
                </div>
                <div class="col-md-6 mb-1">
                    <button type="submit" class="btn btn-primary btn-lg btn-block" onclick="">ACTUALIZAR</button>
                </div>
            </div>

        </form>
    </div>
</div>

<script type="text/javascript">
<?php if( $b_Control ){ ?>
parent.buscarHabitaciones();
parent.ocultarModal();
<?php } ?>
</script>