<script>
    $(document).ready(function(){
        $("#dialog_nueva_ugel").dialog({
            title:"NUEVA UGEL",
            modal:true,
            width:600,
            height:400,
            resizable:false,
            autoOpen:false,
        });
        $("#form_nueva_ugel").submit(function(e){
            $("#dialog_nueva_ugel").dialog("close");
            open_cargar("Espere un momento...");
            e.preventDefault();
            $.post("<?php echo site_url("superadmin/nueva_ugel"); ?>",$("#form_nueva_ugel").serialize(),function(data){
                funcion_nueva_ugel(data);
                close_cargar();
            });
        });
    });
</script>
<div id="dialog_nueva_ugel" style="display:none;">
    <form id="form_nueva_ugel" class="form-horizontal">
        <div class="form-group">
            <label class="col-sm-3">DRE/GRE:</label>
            <div class="col-sm-9">
                <select name="ugel_dre_ide" class="form-control" required>
                    <option value="">::: SELECCIONE UNA OPCION :::</option>
                    <?php foreach ($dres as $reg): ?>
                    <option value="<?php echo $reg->dre_ide; ?>"><?php echo $reg->dre_nombre; ?></option>
                    <?php endforeach ?>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3">NOMBRE:</label>
            <div class="col-sm-9">
                <input name="ugel_nombre" type="text" class="form-control" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3">NOMBRE CORTO:</label>
            <div class="col-sm-6">
                <input name="ugel_corto" type="text" class="form-control" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3">CONTACTO:</label>
            <div class="col-sm-9">
                <input name="ugel_contacto" type="text" class="form-control" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3">CORREO:</label>
            <div class="col-sm-6">
                <input name="ugel_correo" type="email" class="form-control" value="correo@gmail.com" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3">PAGINA WEB:</label>
            <div class="col-sm-9">
                <input name="ugel_web" type="text" class="form-control" required>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-12 text-right">
                <button class="btn btn-sm btn-primary" type="submit">
                    <span class="glyphicon glyphicon-ok"></span>
                    GUARDAR
                </button>
                <button class="btn btn-sm btn-danger" type="button" onclick="$('#dialog_nueva_ugel').dialog('close')">
                    <span class="glyphicon glyphicon-remove"></span>
                    CANCELAR
                </button>
            </div>
        </div>
    </form>
</div>