var http = AjaxInitObject(); var http2 = AjaxInitObject(); var var_periodo = CE_PERIODO; var var_ano = CE_ANO; var var_nivel = CE_NIVEL; var secciones = ""; var aux_secciones = ""; var actual_periodo = CE_PERIODO; var actual_ano = CE_ANO; var actual_nivel = CE_NIVEL;var titulo_horario = ""; function ocultarMsg(){ document.getElementById("Layer1").style.display="none"; }function ResponseLista(){ if (http.readyState == 4) { if(http.status == 200){ results = http.responseText; document.getElementById('sec').innerHTML = results; /*document.getElementById('loadsec').innerHTML = '';*/ document.getElementById('consulta').disabled = true; document.getElementById("loadmsg").innerHTML = "<b>LISTO!</b>"; setTimeout("ocultarMsg()",1200); }else{document.getElementById("Layer1").style.display="none";alert('No se pudo cargar la información. Intente de Nuevo');} }else{ document.getElementById("Layer1").style.display="block"; document.getElementById("loadmsg").innerHTML = "<img src='images/indicator.gif' width='16' height='16' align='absmiddle'> <b>Cargando Secciones... Por favor espere</b>"; } }function pista2(celda,asig,prof,aula,sec){ var texto = '<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="2%">&nbsp;</td><td width="17%" class="Estilo3 Estilo5">Asignatura:&nbsp;</td><td width="79%" class="Estilo3 bordecelda">'+asig+'</td><td width="2%">&nbsp;</td></tr><tr><td>&nbsp;</td><td class="Estilo3 Estilo5">Profesor: </td><td class="Estilo3 bordecelda">'+prof+'</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td class="Estilo3 Estilo5">Aula: </td><td class="Estilo3 bordecelda">'+aula+'</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td> <td class="Estilo3 Estilo5">Secci&oacute;n: </td><td class="Estilo3 bordecelda">'+sec+'</td><td>&nbsp;</td></tr><tr> <td height="44">&nbsp;</td><td colspan="2" align="left" valign="middle" class="Estilo5 Estilo3"><strong>Si haces click en esta secci&oacute;n se agregar&aacute; en tu horario.</strong></td><td>&nbsp;</td></tr></table>'; if(celda.innerHTML != "&nbsp;"){ celda.style.cursor = "pointer"; ddrivetip(texto, 250); }else{hideddrivetip();} }function pista(aula1){ var asig = document.getElementById('celda_asig').innerHTML; var prof = document.getElementById('celda_prof').innerHTML; var sec = document.getElementById('celda_sec').innerHTML; var aula = aula1; var texto = '<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="2%">&nbsp;</td><td width="17%" class="Estilo3 Estilo5">Asignatura:&nbsp;</td><td width="79%" class="Estilo3 bordecelda">'+asig+'</td><td width="2%">&nbsp;</td></tr><tr><td>&nbsp;</td><td class="Estilo3 Estilo5">Profesor: </td><td class="Estilo3 bordecelda">'+prof+'</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td class="Estilo3 Estilo5">Aula: </td><td class="Estilo3 bordecelda">'+aula+'</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td> <td class="Estilo3 Estilo5">Secci&oacute;n: </td><td class="Estilo3 bordecelda">'+sec+'</td><td>&nbsp;</td></tr></table>'; ddrivetip(texto, 200); }function cargarsec(niv,ano,per){ var asig = document.getElementById('asignatura').value; var carre2 = document.getElementById('carrera').value; url = "../../includes/servicios_online/utilidades/cargarsecciones.php"; http.open("POST", url, true); http.onreadystatechange = ResponseLista; http.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); http.send("asignatura="+asig+"&nivel="+niv+"&ano="+ano+"&periodo="+per+"&carrera="+carre2); }function ResponseLista2(){ if (http.readyState == 4) { if(http.status == 200){ results = http.responseText; document.getElementById('resultados').innerHTML = results; document.getElementById('horario').innerHTML = 'HORARIO DE LA SECCIÓN'; document.getElementById("loadmsg").innerHTML = "<b>LISTO!</b>"; setTimeout("ocultarMsg()",1200); totalsec = document.getElementById('datos').value.split('!!!!'); for(i=0;i<=totalsec.length-1;i++){ datossec = ""; datossec = totalsec[i].split('//'); ini = datossec[1]; fin = datossec[2]; for(j=parseInt(ini);j<=parseInt(fin);j++){ myjs = "pista('"+datossec[3]+"');"; document.getElementById(j+datossec[0]).innerHTML = datossec[3]; document.getElementById(j+datossec[0]).bgColor="#FFFFCC"; document.getElementById(j+datossec[0]).onmouseover=new Function(myjs); document.getElementById(j+datossec[0]).onmouseout=new Function("hideddrivetip()"); } } }else{document.getElementById("Layer1").style.display="none";alert('No se pudo cargar la información. Intente de Nuevo');} }else{ document.getElementById("Layer1").style.display="block"; document.getElementById("loadmsg").innerHTML = "<img src='images/indicator.gif' width='16' height='16' align='absmiddle'> <b>Cargando Vista... Por favor espere</b>"; } }function cargarhor(){ poslayer(); var asig = document.getElementById('asignatura').value; var seccion = document.getElementById('seccion').value.split(" - "); var carre = document.getElementById('carrera').value; url = "../../includes/servicios_online/utilidades/cargarhorarios.php"; http.open("POST", url, true); http.onreadystatechange = ResponseLista2; http.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); http.send("asignatura="+asig+"&seccion="+seccion[0]+"&turno="+seccion[1]+"&nivel="+var_nivel+"&ano="+var_ano+"&periodo="+var_periodo+"&carrera="+carre); }function cargarhor2(asignat, secc){ url = "../../includes/servicios_online/utilidades/cargarhorarios.php"; var seccion = secc.split("-"); http.open("POST", url, true); http.onreadystatechange = ResponseLista2; http.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); http.send("asignatura="+asignat+"&seccion="+seccion[0]+"&turno="+seccion[1]+"&nivel="+var_nivel+"&ano="+var_ano+"&periodo="+var_periodo); }function ResponseLista3(){ if (http.readyState == 4) { if(http.status == 200){ results = http.responseText; document.getElementById('celdamat').innerHTML = results; /*document.getElementById('loadmat').innerHTML = '';*/ document.getElementById("loadmsg").innerHTML = "<b>LISTO!</b>"; setTimeout("ocultarMsg()",1000);}else{document.getElementById("Layer1").style.display="none";alert('No se pudo cargar la información. Intente de Nuevo');} }else{ document.getElementById("Layer1").style.display="block"; document.getElementById("loadmsg").innerHTML = "<img src='images/indicator.gif' width='16' height='16' align='absmiddle'> <b>Cargando Materias... Por favor espere</b>"; } }function cargarmat(){ var ano = actual_ano; var per = actual_periodo; var niv = actual_nivel; var carre = document.getElementById('carrera').value; var_periodo = per; var_ano = ano; var_nivel = niv; url = "../../includes/servicios_online/utilidades/cargarmaterias.php"; http.open("POST", url, true); http.onreadystatechange = ResponseLista3; http.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); http.send("ano="+ano+"&per="+per+"&niv="+niv+"&car="+carre); }function ResponseCarreras(){ if (http.readyState == 4) { if(http.status == 200){ results = http.responseText; document.getElementById('celdacarrera').innerHTML = results; document.getElementById('resultados').innerHTML = ''; document.getElementById("loadmsg").innerHTML = "<b>LISTO!</b>"; var dat_period = document.getElementById('periodos').value.split('-');ac_niv = dat_period[2];if(ac_niv=='0'){}else{} setTimeout("ocultarMsg()",1000); }else{alert('No se pudo cargar la información. Intente de Nuevo');} }else{ document.getElementById("Layer1").style.display="block"; document.getElementById("loadmsg").innerHTML = "<img src='images/indicator.gif' width='16' height='16' align='absmiddle'> <b>Cargando Carreras... Por favor espere</b>"; } }function cargarcarreras(){ url = "../../includes/servicios_online/utilidades/cargarcarreras.php"; http.open("POST", url, true); http.onreadystatechange = ResponseCarreras; http.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); var datos_periodos = document.getElementById('periodos').value.split('-'); /*Actualizar los datos del periodo al seleccionar un perioro de la lista*/ actual_periodo = datos_periodos[1]; actual_ano = datos_periodos[0]; actual_nivel = datos_periodos[2]; http.send("NE=" + actual_nivel); } function ResponseLista4(){ if (http.readyState == 4) { if(http.status == 200){ results = http.responseText; document.getElementById('resultados').innerHTML = results; document.getElementById('horario').innerHTML = titulo_horario; document.getElementById("loadmsg").innerHTML = "<b>LISTO!</b>"; setTimeout("ocultarMsg()",1200); }else{document.getElementById("Layer1").style.display="none";alert('No se pudo cargar la información. Intente de Nuevo');} }else{ document.getElementById("Layer1").style.display="block"; document.getElementById("loadmsg").innerHTML = "<img src='images/indicator.gif' width='16' height='16' align='absmiddle'> <b>Cargando Vista... Por favor espere</b>"; } }function verificar_crear_horario(){ if(document.getElementById('crearhorario').innerHTML == ''){ return '0'; }else{ return '1'; } }function cargarvistahorario(){ poslayer(); var asignatura = document.getElementById('asignatura').value; var carre = document.getElementById('carrera').value; var noti = verificar_crear_horario(); asignatura = asignatura.split(' - '); url = "../../includes/servicios_online/utilidades/cargarvistaseccion.php";titulo_horario = "HORARIOS POR SECCIÓN"; http.open("POST", url, true); http.onreadystatechange = ResponseLista4; http.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); http.send("asignatura="+asignatura[0]+"&nivel="+var_nivel+"&ano="+var_ano+"&periodo="+var_periodo+"&carrera="+carre+"&notif="+noti); }function cargarvistasemestre(){ poslayer(); var semestre = document.getElementById('semestre').value; var carre = document.getElementById('carrera').value; var noti = verificar_crear_horario(); url = "../../includes/servicios_online/utilidades/cargarvistasemestre.php";titulo_horario = "HORARIOS POR SEMESTRE"; http.open("POST", url, true); http.onreadystatechange = ResponseLista4; http.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); http.send("semestre="+semestre+"&nivel="+var_nivel+"&ano="+var_ano+"&periodo="+var_periodo+"&carrera="+carre+"&notif="+noti); }function cargarvistahorario2(){ var asignatura = document.getElementById('asignatura').value; asignatura = asignatura.split(' - '); url = "../../includes/servicios_online/utilidades/cargarvistaseccion2.php"; http.open("POST", url, true); http.onreadystatechange = ResponseLista4; http.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); http.send("asignatura="+asignatura[0]+"&nivel="+var_nivel+"&ano="+var_ano+"&periodo="+var_periodo); }function elim_seccion(){ for(i=0;i<aux_secciones.length-1;i++){ document.getElementById(aux_secciones[i]).innerHTML='&nbsp;'; document.getElementById(aux_secciones[i]).bgColor = '#FFFFFF'; } }function agregar_seccion_materia(asig,sec,tur,cod){ var theTable = document.getElementById("tablamaterias"); var i = parseInt(theTable.rows.length); var newRow = theTable.insertRow(i); newRow.id = cod; newRow.className = "Default"; var newCell; newCell = newRow.insertCell(0); newCell.id = newCell.uniqueID; newCell.innerHTML = ""; newCell = newRow.insertCell(1); newCell.id = newCell.uniqueID; newCell.innerHTML = cod; newCell = newRow.insertCell(2); newCell.id = newCell.uniqueID; newCell.innerHTML = asig; newCell = newRow.insertCell(3); newCell.id = newCell.uniqueID; newCell.innerHTML = sec; newCell = newRow.insertCell(4); newCell.id = newCell.uniqueID; newCell.innerHTML = tur; }function quitar_seccion(cod){ var tabla = document.getElementById('tablamaterias').tBodies[0]; for(i=1;i<=tabla.rows.length;i++){ if(tabla.rows[i].cells[1].innerHTML == cod){ tabla.deleteRow(i); break; } } }function verificar_materia(cod){ var encontrada = false; var tabla = document.getElementById('tablamaterias').tBodies[0]; for(i=1;i<=tabla.rows.length-1;i++){ if(tabla.rows[i].cells[1].innerHTML == cod){ encontrada = true; break; } } return encontrada; }function Response_crearhorario(){ var choque = false; if (http.readyState == 4) { if(http.status == 200){ results = http.responseText; datos = results.split('!!!!!'); MI_HORARIO = MI_HORARIO + datos[0]+"!!!!!"; secciones = ""; secciones = datos[0].split('/////'); aulas = datos[1].split('/////'); myjs = "var sc = '"+datos[0]+"'; secs = sc.split('/////'); for(i=0;i<secs.length-1;i++){document.getElementById(secs[i]).bgColor = '#CCCCCC';} var agree=confirm('¿Desea eliminar esta sección?'); if(agree){quitar_seccion('"+datos[5]+"'); for(j=0;j<secs.length-1;j++){document.getElementById(secs[j]).innerHTML = '&nbsp;';document.getElementById(secs[j]).bgColor = '#FFFFFF';document.getElementById(secs[j]).onclick=null;document.getElementById(secs[j]).style.cursor='default';}}else{for(i=0;i<secs.length-1;i++){document.getElementById(secs[i]).bgColor = '#FFFFCC';} return;}"; for(i=0;i<secciones.length-1;i++){ if(document.getElementById(secciones[i]).innerHTML != "&nbsp;"){ choque = true; break; } } seccion_encontrada = verificar_materia(datos[5]); if(choque == false && seccion_encontrada == false){ for(i=0;i<secciones.length-1;i++){ document.getElementById(secciones[i]).bgColor = "#FFFFCC"; document.getElementById(secciones[i]).style.cursor = "pointer"; document.getElementById(secciones[i]).title = "Has click para eliminar esta materia de tu horario"; document.getElementById(secciones[i]).innerHTML = datos[5]+"-"+aulas[i]; document.getElementById(secciones[i]).onclick=new Function(myjs); } agregar_seccion_materia(datos[2],datos[3],datos[4],datos[5]); }else{ if(seccion_encontrada==true){ document.getElementById("Layer1").style.display="none"; alert('Ya agregó una sección de esta materia. Si desea seleccionar una seccion distinta a la que agregó debe borrar la seccion perteneciente a este materia e intentar de nuevo.'); }else{document.getElementById("Layer1").style.display="none";alert('Hay un choque de horarios');} } document.getElementById("loadmsg").innerHTML = "<b>LISTO!</b>"; setTimeout("ocultarMsg()",1200); }else{document.getElementById("Layer1").style.display="none";alert('No se pudo cargar la información. Intente de Nuevo');} }else{ document.getElementById("Layer1").style.display="block"; document.getElementById("loadmsg").innerHTML = "<img src='images/indicator.gif' width='16' height='16' align='absmiddle'> <b>Añadiendo Sección... Por favor espere</b>"; } }function crear_horario(_asig,_seccion,_turno,_nivel,_ano,_periodo){ poslayer(); if(document.getElementById('crearhorario').innerHTML != ""){ url = "../../includes/servicios_online/utilidades/llenar_horario_personal.php"; var carre = document.getElementById('carrerasel').value; var semestre = document.getElementById('semestre').value; http.open("POST", url, true); http.onreadystatechange = Response_crearhorario; http.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); http.send("asig="+_asig+"&nivel="+_nivel+"&ano="+_ano+"&periodo="+_periodo+"&turno="+_turno+"&seccion="+_seccion+"&carrera="+carre+"&semestre="+semestre); }else{alert("Has click en el enlace CREAR MI HORARIO para poder añadir las secciones.")} }function crear_horario2(_asig,_seccion,_turno,_nivel,_ano,_periodo){ poslayer(); if(document.getElementById('crearhorario').innerHTML != ""){ url = "../../includes/servicios_online/utilidades/llenar_horario_personal2.php"; var carre = document.getElementById('carrerasel').value; var semestre = document.getElementById('semestre').value; http.open("POST", url, true); http.onreadystatechange = Response_crearhorario; http.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); http.send("asig="+_asig+"&nivel="+_nivel+"&ano="+_ano+"&periodo="+_periodo+"&turno="+_turno+"&seccion="+_seccion+"&carrera="+carre+"&semestre="+semestre); }else{alert("Has click en el enlace CREAR MI HORARIO para poder añadir las secciones.")} }function activarOpcion(form){ if(document.getElementById('asignatura').value!="" && document.getElementById('seccion').value!=""){ document.getElementById('consulta').disabled = false; }else{document.getElementById('consulta').disabled = true;} if(document.getElementById('asignatura').value == ""){ document.getElementById('consulta2').disabled = true; }else{document.getElementById('consulta2').disabled = false;} if(form.carrera.value == ""){ document.getElementById('celdamat').innerHTML = '<select name="asignatura" class="Estilo2" id="asignatura" onChange="cargarsec();activarOpcion(form1)"><option value="" selected>- Seleccione la Asignatura -</option></select>'; document.getElementById('sec').innerHTML = '<select name="seccion" class="Estilo2" id="seccion" onChange="activarOpcion(form1)"><option value="">- Secci&oacute;n -</option></select>'; form.consulta.disabled = true; form.consulta2.disabled = true; } } function Resetear_todos(){ document.getElementById('celdacarrera').innerHTML = '<select name="carrera" id="carrera" class="Default" ><option value="">- Seleccione la Carrera -</option></select>'; document.getElementById('celdamat').innerHTML = '<select name="asignatura" class="Estilo2" id="asignatura" onChange="activarOpcion(form1)"><option value="" selected>- Seleccione la Asignatura -</option></select>'; document.getElementById('sec').innerHTML = '<select name="seccion" class="Estilo2" id="seccion" onChange="activarOpcion(form1)"><option value="">- Secci&oacute;n -</option></select>'; document.getElementById('consulta').disabled = true; document.getElementById('consulta2').disabled = true; document.getElementById('Submit4').disabled = true; }function Resetear(){ document.getElementById('celdamat').innerHTML = '<select name="asignatura" class="Estilo2" id="asignatura" onChange="activarOpcion(form1)"><option value="" selected>- Seleccione la Asignatura -</option></select>'; document.getElementById('sec').innerHTML = '<select name="seccion" class="Estilo2" id="seccion" onChange="activarOpcion(form1)"><option value="">- Secci&oacute;n -</option></select>'; if(document.getElementById('carrera').value==""){ document.getElementById('semestre').disabled = true; document.getElementById('Submit4').disabled = true; }else{document.getElementById('semestre').disabled = false;document.getElementById('Submit4').disabled = false;} }function ResetearSecciones(){ document.getElementById('sec').innerHTML = '<select name="seccion" class="Estilo2" id="seccion" onChange="activarOpcion(form1)"><option value="">- Secci&oacute;n -</option></select>'; document.getElementById('consulta').disabled = true; }function imprimir(){ var asig = document.getElementById('asigsel').value; var carr = document.getElementById('carrerasel').value; var per = actual_ano + "-" + actual_periodo; OpenBrWindow('../../includes/servicios_online/utilidades/printhorarios.php?asig='+asig+'&per='+per+'&carrera='+carr+"&nivel="+var_nivel+"&ano="+var_ano+"&periodo="+var_periodo,'printhorarios','scrollbars=yes','700','500','true'); }function ResponseVerHorario(){ if (http.readyState == 4) { if(http.status == 200){ results = http.responseText; document.getElementById('crearhorario').innerHTML = results; document.getElementById("loadmsg").innerHTML = "<b>LISTO!</b>"; setTimeout("ocultarMsg()",1200); }else{document.getElementById("Layer1").style.display="none";alert('No se pudo cargar la información. Intente de Nuevo');} }else{ document.getElementById("Layer1").style.display="block"; document.getElementById("loadmsg").innerHTML = "<img src='images/indicator.gif' width='16' height='16' align='absmiddle'> <b>Creando Horario... Por favor espere</b>"; } }function ver_horario(){ poslayer(); url = "../../includes/servicios_online/utilidades/horariopersonal.php"; http.open("POST", url, true); http.onreadystatechange = ResponseVerHorario; http.send(null); document.getElementById('notahorario').innerHTML = '<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" class="borde2"><tr><td width="7%" height="19" align="center" valign="middle" bgcolor="#FFFFC1">&nbsp;</td><td width="93%" align="left" valign="middle" bgcolor="#FFFFC1" class="Estilo2">&nbsp;</td></tr><tr><td align="center" valign="middle" bgcolor="#FFFFC1"><img src="images/nota.gif" width="22" height="22"></td><td height="18" align="left" valign="middle" bgcolor="#FFFFC1" class="Default">En estos Momentos estas armando tu horario, puedes seguir añadiendo secciones a tu horario desde el listado de abajo.</td></tr><tr><td align="center" valign="middle" bgcolor="#FFFFC1">&nbsp;</td><td height="18" align="left" valign="middle" bgcolor="#FFFFC1">&nbsp;</td></tr></table>'; }function ocultar_horario(){ var agree=confirm('¿Desea cancelar el proceso?'); if(agree){ document.getElementById('crearhorario').innerHTML = ''; document.getElementById('notahorario').innerHTML = '<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" class="borde2"><tr><td width="7%" height="19" align="center" valign="middle" bgcolor="#FFFFC1">&nbsp;</td><td width="93%" align="left" valign="middle" bgcolor="#FFFFC1" class="Estilo2">&nbsp;</td></tr><tr><td align="center" valign="middle" bgcolor="#FFFFC1"><img src="images/nota.gif" width="22" height="22"></td><td height="18" align="left" valign="middle" bgcolor="#FFFFC1" class="Default">Para crear su Horario haga click aqui: <a href="javascript:ver_horario();"><b>CREAR MI HORARIO</b></a>. Autom&aacute;ticamente en la parte inferior aparecer&aacute; un formato de Horario en blanco para que Ud. añada las secciones a inscribir. Haga click en la secci&oacute;n que desea inscribir en el listado para agregarla a su horario. </td></tr><tr><td align="center" valign="middle" bgcolor="#FFFFC1">&nbsp;</td><td height="18" align="left" valign="middle" bgcolor="#FFFFC1">&nbsp;</td></tr></table>'; }else{return;} }function limpiar_horario(){ url = "../../includes/servicios_online/utilidades/horariopersonal.php"; http.open("GET", url, true); http.onreadystatechange = ResponseVerHorario; http.send(null); }function imprimirmihorario(){ var carre = document.getElementById('carrera').value; OpenBrWindow('../../includes/servicios_online/utilidades/print_mihorario.php?horario=1&carrera='+carre,'win','scrollbars=yes','700','500','true'); }function imprimir_por_semestre(){ var semestre = document.getElementById('semestre').value; var carre = document.getElementById('carrerasel').value; OpenBrWindow('../../includes/servicios_online/utilidades/print_horsemestre.php?carrera='+carre+'&semestre='+semestre+"&nivel="+var_nivel+"&ano="+var_ano+"&periodo="+var_periodo,'win','scrollbars=yes','700','500','true'); }function namosw_cell_rollover(cell, classname) { if (document.all || document.getElementById) { cell.classBackup = cell.className; cell.className = classname; } }function namosw_cell_rollout(cell) { if (document.all || document.getElementById) { cell.className = cell.classBackup; } } 

