<?php
require_once("../includes/academia_constantes.php");
require_once("../includes/funciones_generales.php");
require_once("../includes/clase_sesion.php");
$sesion = new sesion();
$sesion->set('permiso', permisos($_POST['privilegio']));

$codconfig = $sesion->get('configuracion');
$cod_sed_principal = $codconfig['cod_sed_principal'];
$cod_tipo_nombres_grupos = $codconfig['cod_tipo_nombres_grupos'];
$cons_grupo_sede = $codconfig['cons_grupo_sede'];
$cons_grupo_jorn = $codconfig['cons_grupo_jorn'];
$calendario = $codconfig['calendario'];
$max_grupos_grado = $codconfig['max_grupos_grado'];
$per_camb_saber_doc = $codconfig['per_camb_saber_doc'];
$porc_nots_eqals = $codconfig['notas_iguales'];

require_once("../includes/lib_lenguaje.php");
$cleguaje = new cLanguage();

if (!comprobar_sesion()) {
    mensaje($cleguaje->Phrase('global', 'ses_cad'), $cleguaje->Phrase('project', 'institucion'));
    exit;
}
$permisos = str_split($sesion->get('permiso'));

require_once('../includes/MySQL.php');
$academia = new Servidor_Base_Datos(AC_CONN_HOST, AC_CONN_USER, AC_CONN_PASS, AC_CONN_DB . '' . $sesion->get('anio'));

require_once("../includes/academia.locale.php");
?>

<script  type="text/javascript">
    $(function() {
    var windNewEdtSab = null, winNewEdtNotsSaber = null;
            var gridSaberes, gridNotasSaber;
            windNewEdtSab = $("#winNewEdtSaberes").window({
    width: 'auto',
            height: 'auto',
            modal: true,
            closed: true,
            collapsible: false,
            minimizable: false,
            maximizable: false,
            resizable: false,
            onBeforeClose: function() {
            $('#formNewEdtSab').form('reset')
            },
            onOpen: function() {
            $("#txtnomsab, #txtdescsab").valida({
            mincar: 5,
                    rulers: 2
            });
                    $("#txtporcen, #txtorden").valida({
            mincar: 0,
                    rulers: 3,
                    lcapital: false
            });
            },
    });
            winNewEdtNotsSaber = $("#winNewEdtNotsSaber").window({
    width: 'auto',
            height: 'auto',
            modal: true,
            closed: true,
            collapsible: false,
            minimizable: false,
            maximizable: false,
            resizable: false,
            onBeforeClose: function() {
            $('#formNewEdtNotsSab').form('reset')
            },
            onOpen: function() {
            $("#txtnomsab, #txtdescsab").valida({
            mincar: 5,
                    rulers: 2
            });
                    $("#txtporcen, #txtorden").valida({
            mincar: 0,
                    rulers: 3,
                    lcapital: false
            });
            },
    });
            $("#panelConfigSistem").panel({
    tools: [
<?php if (in_array("M", $permisos)) { ?>
        {
        iconCls: 'ui-btn-save',
                handler: function() {
                if (!$(":input, select, textarea", "#form_configuracion").hasClass('campos_error')) {
                $.ajax({
                type: "POST",
                        url: 'mod_configuracion/opera_configuracion.php',
                        data: $("#form_configuracion").serialize(),
                        dataType: "html",
                        beforeSend: function() {
                        $.blockUI({message: '<?php echo $cleguaje->Phrase('global', 'msg_espera') ?>'});
                        },
                        success: function(rta) {
                        $.unblockUI();
                                if (rta != 0) {
                        if (rta == 'session') {
                        modulo = 'global'
                        }
                        else {
                        modulo = 'configuracion'
                        }
                        jAlert(getMsg(modulo, rta), '<?php echo $cleguaje->Phrase('project', 'institucion') ?>', function() {
                        if (rta == 'session') {
                        location.reload();
                        }
                        });
                        } else {

                        notifica_ok('<?php echo $cleguaje->Phrase('configuracion', 'msg_edit_exito') ?>');
                        }
                        },
                });
                } else {
                jAlert('<?php echo $cleguaje->Phrase('global', 'cmpobl') ?>', '<?php echo $cleguaje->Phrase('project', 'institucion') ?>')
                }
                }
        },
<?php } ?>
    {
    iconCls: 'ui-icon-refresh',
            handler: function() {
            $('#form_configuracion').reset()
            }
    }
    ]
    })
            $("#addNewSab").button({
    icons: {
    primary: "ui-btn-save"
    },
            text: true
    }).click(function(e) {
    e.preventDefault();
            var dts = $('#formNewEdtSab').serialize();
            $.ajax({
            url: 'mod_configuracion/opera_saberes.php',
                    type: "POST",
                    data: dts,
                    dataType: "json",
                    success: function(rta) {
                    if (rta.error != 0) {
                    var mod;
                            if (rta.error == 'session') {
                    mod = 'globals'
                    } else {
                    mod = 'mod_config';
                    }
                    jAlert(dtsLang[mod][rta.error], dtsLang['project']['empresa'], function() {
                    if (rta.error == 'session') {
                    location.reload();
                    }
                    });
                    } else {
                    notifica_ok(dtsLang['mod_config']['msg_ok_saber']);
                            if (rta.acc == 'new') {
                    gridSaberes.addRowData(rta.id, $('#formNewEdtSab').serializeObject());
                    } else {
                    gridSaberes.setRowData(rta.id, $('#formNewEdtSab').serializeObject());
                    }
                    gridSaberes.trigger("reloadGrid");
                            gridNotasSaber.trigger("reloadGrid");
                            $("#addEdtSab").trigger("click");
                    }
                    },
            })
    });
            $("#addEdtSab").button({
    icons: {
    primary: "ui-btn-cancel"
    },
            text: true
    }).click(function(e) {
    e.preventDefault();
            windNewEdtSab.window('close');
    });
            $("#addNewNotSab").button({
    icons: {
    primary: "ui-btn-save"
    },
            text: true
    }).click(function(e) {
    e.preventDefault();
            var dts = $('#formNewEdtNotsSab').serialize();
            $.ajax({
            url: 'mod_configuracion/opera_notassaber.php',
                    type: "POST",
                    data: dts,
                    dataType: "json",
                    success: function(rta) {
                    if (rta.error != 0) {
                    var mod;
                            if (rta.error == 'session') {
                    mod = 'globals'
                    } else {
                    mod = 'mod_config';
                    }
                    jAlert(dtsLang[mod][rta.error], dtsLang['project']['empresa'], function() {
                    if (rta.error == 'session') {
                    location.reload();
                    }
                    });
                    } else {
                    notifica_ok(dtsLang['mod_config']['msg_ok_nota']);
                            if (rta.acc == 'new') {
                    gridNotasSaber.addRowData(rta.id, $('#formNewEdtNotsSab').serializeObject());
                    } else {
                    gridNotasSaber.setRowData(rta.id, $('#formNewEdtNotsSab').serializeObject());
                    }
                    gridSaberes.trigger("reloadGrid");
                            gridNotasSaber.trigger("reloadGrid");
                            $("#addCancelNot").trigger("click");
                    }
                    },
            })
    });
            $("#addCancelNot").button({
    icons: {
    primary: "ui-btn-cancel"
    },
            text: true
    }).click(function(e) {
    e.preventDefault();
            winNewEdtNotsSaber.window('close');
    });
            $(document).ready(function() {

    $(".tip").poshytip({
    className: 'tip-skyblue',
            bgImageFrameSize: 9,
            offsetX: 0,
            offsetY: 20
    }).addClass("opera")

            $("#guardar_conf").click(function() {

    })

            $("#refrescar").click(function() {
    $('#form_configuracion').reset()
    })
            /*------------------------------------------------------------------------------------------------------
             SABERES
             -----------------	-------------------------------------------------------------------------------------*/

            gridSaberes = jQuery("#listado_saberes").jqGrid({
    caption: '<?php echo $cleguaje->Phrase('saberes', 'tituloGrilla') ?>',
            height: 150, //tamaño  alto de la grilla
            width: 450,
            url: 'mod_configuracion/list_saberes.php',
            datatype: "json",
            rowNum: 30,
            hidegrid: false,
            rowList: [15, 30, 50],
            pager: 'pager_saberes',
            sortname: 'txtorden',
            viewrecords: true,
            sortorder: "desc",
            multiselect: false,
            toolbar: [true, 'top'],
            editurl: 'mod_configuracion/opera_saberes.php',
            colNames: [
                    dtsLang['mod_config']['lbl_nom_sab'],
                    dtsLang['mod_config']['lbl_desc'],
                    dtsLang['mod_config']['lbl_orden'],
                    dtsLang['mod_config']['lbl_defecto'],
                    dtsLang['mod_config']['lbl_porcentaje'],
                    dtsLang['mod_config']['lbl_minnotas'],
                    dtsLang['mod_config']['lbl_permodnotas'],
            ],
            colModel: [
            {name: 'txtnomsab', index: 'txtnomsab', width: 150, resizable: false},
            {name: 'txtdescsab', index: 'txtdescsab', width: 230, resizable: false, },
            {name: 'txtorden', index: 'txtorden', width: 80, resizable: false, },
            {name: 'txtdefault', index: 'txtdefault', width: 80, resizable: false, formatter: 'checkbox', align: 'center', editoptions: {value: '1:0'}},
            {name: 'txtporcen', index: 'txtporcen', width: 80, resizable: false, },
            {name: 'txtminnotas', index: 'txtminnotas', width: 80, resizable: false, align: 'center'},
            {name: 'txtpermodnot', index: 'txtpermodnot', width: 80, resizable: false, formatter: 'checkbox', align: 'center', editoptions: {value: '1:0'}},
            ],
            scrollOffset: 15,
            scrollrows: true,
            shrinkToFit: false,
            onSelectRow: function(rowid) {
            if (rowid) {
            $("#txtcodsaber").val(rowid);
                    gridNotasSaber.setGridParam({
                    postData: {
                    codigo: rowid,
                    },
                            page: 1,
                            datatype: 'json'
                    }).trigger('reloadGrid');
            }
            }
    });
            gridSaberes.navGrid('#pager_saberes', {edit: false, add: false, del: false}, {}, {}, {}, {multipleSearch: true});
            //jQuery("#listado_saberes").tableDnD();

<?php if (in_array("A", $permisos)) { ?>

        coloca_boton({
        id: 'btn_newSab',
                elem: "t_listado_saberes",
                buttonicon: 'ui-btn-new',
                title: dtsLang['globals']['news'] + " " + dtsLang['mod_config']['tit_saber'],
                caption: "",
                onClickButton: function() {

                $("#winNewEdtSaberes").panel('setTitle', dtsLang['globals']['news'] + " " + dtsLang['mod_config']['tit_saber']);
                        $("#oper").val("new");
                        windNewEdtSab.window('open');
                }
        });
<?php } if (in_array("M", $permisos)) { ?>

        coloca_boton({
        id: 'btn_edtSab',
                elem: "t_listado_saberes",
                buttonicon: 'ui-btn-edit',
                title: dtsLang['globals']['edit'] + " " + dtsLang['mod_config']['tit_saber'],
                caption: "",
                onClickButton: function() {
                var ide = gridSaberes.getGridParam('selrow')
                        if (!ide) {
                jAlert(dtsLang['globals']['selrec'], dtsLang['project']['empresa']);
                        return false
                }
                $("#oper").val("edit");
                        $("#id").val(ide)
                        $("#winNewEdtSaberes").panel('setTitle', dtsLang['globals']['edit'] + " " + dtsLang['mod_config']['tit_saber']);
                        var dts = gridSaberes.getRowData(ide);
                        $('#formNewEdtSab').form('load', gridSaberes.getRowData(ide));
                        windNewEdtSab.window('open');
                }
        });
<?php } if (in_array("E", $permisos)) { ?>
        var tddel = {
        modulo: 'saberes',
                nom_pag: "t_listado_notasxSab",
                ide_tabla: 'listado_notasxSab',
                msg_sel: '<?php echo $cleguaje->Phrase('global', 'selrecdel') ?>', //mensaje si no selecciona un registro
                msg_confirma: '<?php echo str_replace('@', '\n', $cleguaje->Phrase('saberes', 'confirdel')) ?>', //mensaje de confirmacion para la eliminacion
                title: '<?php echo $cleguaje->Phrase('global', 'del') . " " . $cleguaje->Phrase('saberes', 'name') ?>',
                empresa: '<?php echo $cleguaje->Phrase('project', 'institucion') ?>',
                isgrid: true,
                msgExito: '<?php echo $cleguaje->Phrase('global', 'delexito') ?>',
        }
        btnEliminar(gridSaberes, tddel)

<?php } ?>

    $("#help_listado_saberes").append('<img src="images/Help.png" alt="Que es esto?" title="<?php echo $cleguaje->Phrase('saberes', 'help_grid') ?>" class="tip" />')
            $(".tip").poshytip({
    className: 'tip-skyblue',
            bgImageFrameSize: 9,
            offsetX: 0,
            offsetY: 20
    }).addClass("opera")

            /*------------------------------------------------------------------------------------------------*/
            gridNotasSaber = jQuery("#listado_notasxSab").jqGrid({
    caption: dtsLang['mod_config']['tit_gridnotas'],
            height: 150, //tamaño  alto de la grilla
            width: 450,
            url: 'mod_configuracion/list_notasxsaberes.php',
            datatype: "local",
            rowNum: 30,
            hidegrid: false,
            rowList: [15, 30, 50],
            pager: 'pager_notasxSab',
            sortname: 'nombre',
            viewrecords: true,
            sortorder: "desc",
            multiselect: false,
            toolbar: [true, 'top'],
            editurl: 'mod_configuracion/opera_notassaber.php',
            colNames: [
                    dtsLang['mod_config']['lbl_nom_nota'],
                    dtsLang['mod_config']['lbl_porcentaje'],
                    dtsLang['mod_config']['lbl_fecha'],
                    dtsLang['mod_config']['lbl_desc'],
            ],
            colModel: [
            {name: 'txtnomnota', index: 'txtnomnota', width: 150, resizable: false},
            {name: 'txtpornota', index: 'txtpornota', width: 80, resizable: false, align: 'center'},
            {name: 'txtfecnota', index: 'txtfecnota', width: 80, resizable: false, },
            {name: 'txtdescnota', index: 'txtdescnota', width: 180, resizable: false, },
            ],
            scrollOffset: 15,
            scrollrows: true,
            shrinkToFit: false,
    });
            gridNotasSaber.navGrid('#pager_notasxSab', {edit: false, add: false, del: false}, {}, {}, {}, {multipleSearch: true});
<?php if (in_array("A", $permisos)) { ?>

        coloca_boton({
        id: 'btn_newSabNotas',
                elem: "t_listado_notasxSab",
                buttonicon: 'ui-btn-new',
                title: dtsLang['globals']['news'] + " " + dtsLang['mod_config']['tit_nota'],
                caption: "",
                onClickButton: function() {
                if (!gridSaberes.getGridParam('selrow')) {
                jAlert(dtsLang['mod_config']['msg_selsab'], dtsLang['project']['empresa']);
                        return false
                }

                winNewEdtNotsSaber.panel('setTitle', dtsLang['globals']['news'] + " " + dtsLang['mod_config']['tit_nota']);
                        $("#opernots").val("new");
                        winNewEdtNotsSaber.window('open');
                }
        });
<?php } if (in_array("M", $permisos)) { ?>

        coloca_boton({
        id: 'btn_edtSabNotas',
                elem: "t_listado_notasxSab",
                buttonicon: 'ui-btn-edit',
                title: dtsLang['globals']['edit'] + " " + dtsLang['mod_config']['tit_nota'],
                caption: "",
                onClickButton: function() {
                var ide = gridNotasSaber.getGridParam('selrow')
                        if (!ide) {
                jAlert(dtsLang['globals']['selrec'], dtsLang['project']['empresa']);
                        return false
                }
                $("#opernots").val("edit");
                        $("#idnots").val(ide)
                        winNewEdtNotsSaber.panel('setTitle', dtsLang['globals']['edit'] + " " + dtsLang['mod_config']['tit_nota']);
                        var dts = gridNotasSaber.getRowData(ide);
                        $('#formNewEdtNotsSab').form('load', dts);
                        winNewEdtNotsSaber.window('open');
                }
        });
<?php } if (in_array("E", $permisos)) { ?>
        var tddel = {
        modulo: 'saberes',
                nom_pag: "t_listado_notasxSab",
                ide_tabla: 'listado_notasxSab',
                msg_sel: dtsLang['globals']['selrecdel'],
                msg_confirma: dtsLang['mod_config']['msg_confirdelnota'],
                title: dtsLang['globals']['del'] + " " + dtsLang['mod_config']['tit_nota'],
                empresa: dtsLang['project']['empresa'],
                isgrid: true,
                msgExito: dtsLang['globals']['delexito'],
        }
        btnEliminar(gridNotasSaber, tddel)

<?php } ?>

    });
    });


</script>

<div id="winNewEdtSaberes" style="padding:4px;" title="<?php echo $dtsLang['globals']['news'] . " " . $dtsLang['mod_config']['tit_saber'] ?>">
    <form id="formNewEdtSab" method="post">
        <input name="oper" type="hidden" id="oper" value="new" />
        <input name="id" type="hidden" id="id" />
        <table width="291" height="135" cellpadding="0" cellspacing="2" class="table table-condensed">
            <tr>
                <td width="95" class="tit1"><?php echo $dtsLang['mod_config']['lbl_nom_sab'] ?></td>
                <td width="188"><input name="txtnomsab" type="text" id="txtnomsab" /></td>
            </tr>
            <tr>
                <td class="tit1"><?php echo $dtsLang['mod_config']['lbl_desc'] ?></td>
                <td><textarea name="txtdescsab" id="txtdescsab" class="campos"></textarea></td>
            </tr> 
            <tr>
                <td class="tit1"><?php echo $dtsLang['mod_config']['lbl_orden'] ?></td>
                <td><input name="txtorden" type="text" id="txtorden" size="5" maxlength="3" /></td>
            </tr>
            <tr>
                <td class="tit1"><?php echo $dtsLang['mod_config']['lbl_defecto'] ?></td>
                <td>
                    <label>
                        <input type="radio" name="txtdefault" value="1" id="txtdefault_0" />Si</label>
                    <label><input name="txtdefault" type="radio" id="txtdefault_1" value="0" checked="checked" />No</label>
                </td>
            </tr>
            <tr>
                <td class="tit1"><?php echo $dtsLang['mod_config']['lbl_porcentaje'] ?></td>
                <td><input name="txtporcen" type="text" id="txtporcen" size="5" maxlength="3" <?php echo ($porc_nots_eqals == 1) ? "readonly=''" : "" ?>  /></td>
            </tr>
            <tr>
                <td colspan="2" class="tit1"><table width="275" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td width="124" scope="row">
                                <div class="tit1"><?php echo $dtsLang['mod_config']['lbl_minnotas'] ?></div>
                                <input name="txtminnotas" type="text" id="txtminnotas" size="5" maxlength="3" />
                            </td>
                            <td width="151"><div class="tit1"><?php echo $dtsLang['mod_config']['lbl_permodnotas'] ?></div>
                                <label>
                                    <input type="radio" name="txtpermodnot" value="1" id="txtpermodnot_0" />Si</label>
                                <label><input name="txtpermodnot" type="radio" id="txtpermodnot_1" value="0" checked="checked" />No</label></td>
                        </tr>
                    </table></td>
            </tr>
            <tr>
                <td colspan="2" align="center" valign="middle" class="tit1">
                    <?php if (in_array("A", $permisos) && in_array("M", $permisos) && in_array("E", $permisos)) { ?>
                        <button id="addNewSab">Guardar</button>
                    <?php } ?>
                    <button id="addEdtSab">Cancelar</button>
                </td>
            </tr>
        </table>
    </form>
</div>

<div id="winNewEdtNotsSaber" style="padding:4px;" title="<?php echo $dtsLang['globals']['news'] . " " . $dtsLang['mod_config']['tit_saber'] ?>">
    <form id="formNewEdtNotsSab" method="post">
        <input name="opernots" type="hidden" id="opernots" value="new" />
        <input name="idnots" type="hidden" id="idnots" />
        <input name="txtcodsaber" type="hidden" id="txtcodsaber" />
        <table border="0" cellspacing="0" cellpadding="0" class="table table-condensed">
            <tr>
                <th scope="row"><span class="tit1"><?php echo $dtsLang['mod_config']['lbl_nom_nota'] ?></span></th>
                <td><input name="txtnomnota" id="txtnomnota" type="text" /></td>
            </tr>
            <tr>
                <th scope="row"><span class="tit1"><?php echo $dtsLang['mod_config']['lbl_porcentaje'] ?></span></th>
                <td><input name="txtpornota" id="txtpornota" type="text" <?php echo ($porc_nots_eqals == 1) ? "readonly=''" : "" ?> /></td>
            </tr>
            <tr>
                <th scope="row"><span class="tit1"><?php echo $dtsLang['mod_config']['lbl_fecha'] ?></span></th>
                <td><input name="txtfecnota" id="txtfecnota" type="text" /></td>
            </tr>
            <tr>
                <th scope="row"><span class="tit1"><?php echo $dtsLang['mod_config']['lbl_desc'] ?></span></th>
                <td><textarea name="txtdescnota" id="txtdescnota" class="campos"></textarea></td>
            </tr>
            <tr>
                <th colspan="2" scope="row"><button id="addNewNotSab">Guardar</button>
                    <button id="addCancelNot">Cancelar</button></th>
            </tr>
        </table>
    </form>
</div>
<table border="0" cellpadding="4" cellspacing="0">
    <tr>
        <td valign="top" >
            <div id="panelConfigSistem" class="easyui-panel" title="<?php echo $dtsLang['mod_config']['nom_conf'] ?>"   
                 style="width:auto;height:auto;padding:1px 8px;background:#fafafa;"  
                 data-options="iconCls:'ui-icon-configure',closable:false,  
                 collapsible:true,minimizable:false,maximizable:false">
                <form id="form_configuracion" name="form_configuracion" method="post" action="" >  	
                    <table width="348" border="0" cellpadding="0" cellspacing="0" class="table table-condensed table-bordered" id="tbConfig" style="width:auto !important">
                        <tr class="ui-widget-header">
                            <th colspan="3" align="center" valign="middle" scope="row">Configuracion Colegio</th>
                        </tr>
                        <tr>
                            <th width="166" align="left" valign="middle" scope="row"><span class="tit1"><?php echo $cleguaje->getField('configuracion', 'cod_sed_principal') ?></span></th>
                            <td width="150"><select name="cod_sed_principal" class="tit2 campos" id="cod_sed_principal" style="width:150px"  value="<?php echo $cod_sed_principal ?>">
                                    <?php
                                    $cmps = "cod_sede,nom_sede";
                                    $ord = 'order by nom_sede ASC';
                                    $tabla = "adm_sedes";
                                    $cmpcnd = "";
                                    $default = $cod_sed_principal;
                                    mostrar_cont_selec($cmps, $tabla, $cmpcnd, $ord, $default, false, '', 0);
                                    ?>
                                </select></td>
                            <td width="32" align="center" valign="middle"><img src="images/Help.png" alt="Que es esto?" title="<?php echo $cleguaje->Phrase('configuracion', 'ayuda_sede') ?>" class="tip" /></td>
                        </tr>
                        <tr>
                            <th align="left" valign="middle" scope="row"><span class="tit1"><?php echo $cleguaje->getField('configuracion', 'calendario') ?></span></th>
                            <td><select name="calendario" class="campos" id="calendario" style="width:60px" value="<?php echo $calendario ?>">
                                    <?php echo ($calendario == 'A') ? "<option value='A' selected='selected'>A</option><option value='B'>B</option>" : "<option value='A' >A</option><option value='B'  selected='selected'>B</option>";
                                    ?>
                                </select></td>
                            <td align="center" valign="middle"><img src="images/Help.png" alt="Que es esto?" title="<?php echo $cleguaje->Phrase('configuracion', 'ayuda_calendario') ?>" class="tip"/></td>
                        </tr>
                        <tr class="ui-widget-header">
                            <th colspan="3" align="center" valign="middle" scope="row">Confugiración Academica</th>
                        </tr>
                        <tr>
                            <th align="left" valign="middle" scope="row"><span class="tit1"><?php echo $cleguaje->getField('configuracion', 'cod_nom_grupo') ?></span></th>
                            <td><select name="cod_tipo_nombres_grupos" class="tit2 campos" id="cod_tipo_nombres_grupos" style="width:150px"  value="<?php echo $cod_tipo_nombres_grupos ?>">
                                    <?php
                                    $cmps = "cod_tipo_nombres_grupos, tipo_nombres_grupos";
                                    $ord = 'tipo_nombres_grupos ASC';
                                    $tabla = "aux_tipos_nombres_grupos";
                                    $cmpcnd = "";
                                    $default = $cod_tipo_nombres_grupos;
                                    mostrar_cont_selec($cmps, $tabla, $cmpcnd, $ord, $default, false, '', 0);
                                    ?>
                                </select></td>
                            <td align="center" valign="middle"><img src="images/Help.png" alt="Que es esto?" title="<?php echo $cleguaje->Phrase('configuracion', 'ayuda_nom_grupo') ?>" class="tip"/></td>
                        </tr>
                        <tr>
                            <th align="left" valign="middle" scope="row"><span class="tit1"><?php echo $cleguaje->getField('configuracion', 'cons_grupo_sede') ?></span></th>
                            <td><select name="cons_grupo_sede" class="campos" id="cons_grupo_sede" style="width:60px" value="<?php echo $cons_grupo_sede ?>">
                                    <?php echo ($cons_grupo_sede == '1') ? "<option value='1' selected='selected'>Sí</option><option value='0'>No</option>" : "<option value='1' >Sí</option><option value='0'  selected='selected'>No</option>";
                                    ?>
                                </select></td>
                            <td align="center" valign="middle"><img src="images/Help.png" alt="Que es esto?" title="<?php echo $cleguaje->Phrase('configuracion', 'ayuda_cons_grupo') ?>" class="tip"/></td>
                        </tr>
                        <tr>
                            <th align="left" valign="middle" scope="row"><span class="tit1"><?php echo $cleguaje->getField('configuracion', 'cons_grupo_jorn') ?></span></th>
                            <td><select name="cons_grupo_jorn" class="campos" id="cons_grupo_jorn" style="width:60px" value="<?php echo $cons_grupo_jorn ?>">
                                    <?php echo ($cons_grupo_jorn == '1') ? "<option value='1' selected='selected'>Sí</option><option value='0'>No</option>" : "<option value='1' >Sí</option><option value='0'  selected='selected'>No</option>";
                                    ?>
                                </select></td>
                            <td align="center" valign="middle"><img src="images/Help.png" alt="Que es esto?" title="<?php echo $cleguaje->Phrase('configuracion', 'ayuda_cons_jornada') ?>" class="tip" /></td>
                        </tr>
                        <tr>
                            <th align="left" valign="middle" scope="row"><span class="tit1"><?php echo $cleguaje->getField('configuracion', 'max_grupos_grado') ?></span></th>
                            <td><select name="max_grupos_grado" class="campos" id="max_grupos_grado" style="width:60px" value="<?php echo $max_grupos_grado ?>">
                                    <?php
                                    for ($i = 1; $i <= 15; $i++) {
                                        //echo "<option value='$i'>$i </option>";
                                        echo ($i <> $max_grupos_grado) ? "<option value='$i'>$i </option>" : "<option value='$i' selected='selected'>$i </option>";
                                    }
                                    ?>
                                </select></td>
                            <td align="center" valign="middle"><img src="images/Help.png" alt="Que es esto?" title="<?php echo $cleguaje->Phrase('configuracion', 'ayuda_max_grupos') ?>" class="tip"/></td>
                        </tr>
                        <tr class="ui-widget-header">
                            <th colspan="3" align="center" valign="middle" scope="row">Configuracion Modulo Notas</th>
                        </tr>
                        <tr>
                            <th align="left" valign="middle" scope="row"><?php echo $dtsLang['mod_config']['per_camb_sab_doc'] ?></th>
                            <td><select name="per_camb_saber_doc" class="campos" id="per_camb_saber_doc" style="width:60px" value="<?php echo $cons_grupo_sede ?>">
                                    <?php
                                    if ($per_camb_saber_doc == '1') {
                                        echo "<option value='1'>Sí</option><option value='0' >No</option>";
                                    } else {
                                        echo "<option value='1' >Sí</option><option value='0' selected='selected'>No</option>";
                                    }
                                    ?>
                                </select></td>
                            <td align="center" valign="middle"><img src="images/Help.png" alt="Que es esto?" title="<?php echo $dtsLang['mod_config']['ayuda_per_camb_sab_doc'] ?>" class="tip"/></td>
                        </tr>
                        <tr>
                            <th align="left" valign="middle" scope="row"><?php echo $dtsLang['mod_config']['porc_equals'] ?></th>
                            <td><select name="porc_nots_eqals" class="campos" id="porc_nots_eqals" style="width:60px" value="<?php echo $cons_grupo_sede ?>">
                                    <?php
                                    if ($porc_nots_eqals == '1') {
                                        echo "<option value='1' selected='selected'>Sí</option><option value='0' >No</option>";
                                    } else {
                                        echo "<option value='1' >Sí</option><option value='0' selected='selected'>No</option>";
                                    }
                                    ?>
                                </select></td>
                            <td align="center" valign="middle"><img src="images/Help.png" alt="Que es esto?" title="<?php echo $dtsLang['mod_config']['ayuda_saberes_equals'] ?>" class="tip"/></td>
                        </tr>
                    </table>
                </form>
            </div>
        </td>

        <td>
            <table cellspacing="2">
                <tr>
                    <td>
                        <table id="listado_saberes"></table>
                        <div id="pager_saberes"></div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <table id="listado_notasxSab"></table>
                        <div id="pager_notasxSab"></div>
                    </td>
                </tr>
            </table>
        </td>

    </tr>
</table>

</center>
