if (file_exists('../../sistemaEvaluativo/sistemaEvaluativo.xml')) { $valido = true; $xml = simplexml_load_file("../../sistemaEvaluativo/sistemaEvaluativo.xml", 'SimpleXMLElement', LIBXML_NOCDATA); $notaInf = $xml->sistema['notaInferior']; } $nomMat = ""; $datos = mysql_query("SELECT nombre FROM materia WHERE id='{$materia}'"); while ($reg = mysql_fetch_array($datos)) { $nomMat = $reg['nombre']; } $porcent = 0; $datos2 = mysql_query("SELECT sum(porcentaje) as total FROM conceptoevaluacion WHERE grupo='{$grupo}' AND materia='{$materia}' AND anio='{$anio}' AND periodo='{$periodo}'"); while ($reg2 = mysql_fetch_array($datos2)) { $porcent = $reg2['total'] == NULL ? 0 : $reg2['total']; } $notaActual = notaFinalEst($matricula, $materia, $anio, $periodo); $porcent2 = $porcent == 0 ? 1 : $porcent; $notaAct2 = $notaActual * 100 / $porcent2; $classdv = $notaAct2 < $notaInf ? "dvPierde" : "dvGana"; $notaActual = round($notaActual, 1); $notaAct2 = round($notaAct2, 1); echo "<div class='{$classdv} divMateriaNotas'>Su nota es de <span>{$notaAct2}({$notaActual})</span> para la materia <span>{$nomMat}</span> cuyo porcentaje evaluado es <span>{$porcent}%</span></div>"; echo "<table border='1' cellpadding='0' cellspacing='0'>\n\t<tr class='titulosTr'>\n\t<td>#</td>\n\t<td>Concepto de evaluación</td>\n\t<td>Porcentaje</td>\n\t<td>Nota</td>\n\t</tr>"; $index = 0; $datos = mysql_query("SELECT c.nombre,c.porcentaje,p.nota FROM planilla p INNER JOIN conceptoevaluacion c ON p.concepto=c.id WHERE p.matricula='{$matricula}' AND c.materia='{$materia}' AND c.grupo='{$grupo}' AND c.periodo='{$periodo}' AND c.anio='{$anio}' ORDER BY c.nombre "); while ($reg = mysql_fetch_array($datos)) { $index++; $nombreC = $reg['nombre']; $porcentajeC = $reg['porcentaje']; $nota = $reg['nota']; $nota2 = $nota * $porcentajeC / 100;
$idEst = $reg['id']; $nomEst = $reg['nombres']; $apeEst = $reg['apellidos']; $index++; echo "<tr>\n\t\t<td>{$index}</td>\n\t\t<td> {$apeEst} {$nomEst}</td>\n\t\t"; $acomuladoArea = 0; $datos2 = mysql_query("SELECT id,porcentaje FROM materia WHERE area='{$area}'"); while ($reg2 = mysql_fetch_array($datos2)) { $idMat = $reg2['id']; $porcenM = $reg2['porcentaje']; $porcentEvaluadoMat = 0; $datos3 = mysql_query("SELECT sum(porcentaje) as total FROM conceptoevaluacion WHERE grupo='{$grupo}' AND materia='{$idMat}' AND anio='{$anio}' AND periodo='{$periodo}'"); while ($reg3 = mysql_fetch_array($datos3)) { $porcentEvaluadoMat = $reg3['total'] == NULL ? 0 : $reg3['total']; } $notaFinalMateria = notaFinalEst($idEst, $idMat, $anio, $periodo); $porcentDivi = $porcentEvaluadoMat == 0 ? 1 : $porcentEvaluadoMat; $notaFinEstMat = $notaFinalMateria * 100 / $porcentDivi; $notaFinEstMat = round($notaFinEstMat, 1); $masRecupera = ""; $noteParaRec = 0; if ($notaFinEstMat < $notaInf) { $textoNotaRe = '"nota de recuperación"'; $datos2I = mysql_query("SELECT m.notarecuperada FROM informerecuperacion i INNER JOIN matricularecuperacion m ON m.informerecuperacion=i.id WHERE i.grupo='{$grupo}' AND i.anio='{$anio}' AND i.periodo='{$periodo}' AND i.materia='{$idMat}' AND m.matricula='{$idEst}'"); while ($reg2I = mysql_fetch_array($datos2I)) { $noteParaRec = $reg2I['notarecuperada']; $masRecupera = "<div class='divsRecuperacion' title='Nota de recuperación' onclick='alert({$textoNotaRe})'>{$noteParaRec}</div>"; } } $noteParaRec = $notaFinEstMat > $noteParaRec ? $notaFinEstMat : $noteParaRec; $sumAcomulado = $noteParaRec * $porcenM / 100;
function acomuladaAnio($idest, $materia, $anio, $nInf, $grupoE) { $acomulada = 0; if (file_exists('../../../sistemaEvaluativo/sistemaEvaluativo.xml')) { $xml = simplexml_load_file("../../../sistemaEvaluativo/sistemaEvaluativo.xml", 'SimpleXMLElement', LIBXML_NOCDATA); foreach ($xml->sistema->periodos->periodo as $periodo2) { $per = $periodo2['nombre']; $porcent = $periodo2['porcentaje']; $nota = 0; $porcentEvaluadoMat = 100; $notaFPer = 0; $notaFPer = notaFinalEst($idest, $materia, $anio, $per); $nota = $notaFPer; if ($nota < $nInf) { $noteParaRec = 0; $datos2I = mysql_query("SELECT m.notarecuperada FROM informerecuperacion i \n\t\t\t\t\t\t INNER JOIN matricularecuperacion m ON m.informerecuperacion=i.id \n\t\t\t\t\t\t\t\t\t\t\t WHERE i.grupo='{$grupoE}' AND i.anio='{$anio}' AND i.periodo='{$per}' \n\t\t\t\t\t\t\t\t\t\t\t AND i.materia='{$materia}' AND m.matricula='{$idest}'"); while ($reg2I = mysql_fetch_array($datos2I)) { $noteParaRec = $reg2I['notarecuperada']; } $nota = $nota < $noteParaRec ? $noteParaRec : $nota; } $datosConceptoM = mysql_query("SELECT sum(porcentaje) as total FROM conceptoevaluacion WHERE grupo='{$grupoE}' AND materia='{$materia}' AND anio='{$anio}' AND periodo='{$per}'"); while ($regConceptoM = mysql_fetch_array($datosConceptoM)) { $porcentEvaluadoMat = $regConceptoM['total'] == NULL ? 0 : $regConceptoM['total']; } $porcentDivi = $porcentEvaluadoMat == 0 ? 1 : $porcentEvaluadoMat; $nota = $nota * 100 / $porcentDivi; $acomulada += $nota * $porcent / 100; } } return $acomulada; }
$datosConcepto = mysql_query("SELECT id FROM informerecuperacion WHERE grupo='{$grupo}' AND materia='{$materia}' AND anio='{$anio}' AND periodo='{$periodo}'"); while ($reg = mysql_fetch_array($datosConcepto)) { $idRec = $reg['id']; } } $valido = false; $notaInf = ""; if (file_exists('../../sistemaEvaluativo/sistemaEvaluativo.xml')) { $valido = true; $xml = simplexml_load_file("../../sistemaEvaluativo/sistemaEvaluativo.xml", 'SimpleXMLElement', LIBXML_NOCDATA); $notaInf = $xml->sistema['notaInferior']; } $datosConcepto = mysql_query("SELECT id FROM matricula WHERE grupo='{$grupo}'"); while ($reg = mysql_fetch_array($datosConcepto)) { $idE = $reg['id']; $notaF = notaFinalEst($idE, $materia, $anio, $periodo); if ($notaF < $notaInf) { $existeEstRe = false; $idRecEst = 0; $datos2 = mysql_query("SELECT id FROM matricularecuperacion WHERE matricula='{$idE}' AND informerecuperacion='{$idRec}'"); while ($reg2 = mysql_fetch_array($datos2)) { $existeEstRe = true; $idRecEst = $reg2['id']; } if ($existeEstRe == false) { mysql_query("INSERT INTO matricularecuperacion (matricula,informerecuperacion,notanormal,notarecuperada) VALUES ('{$idE}','{$idRec}','{$notaF}','0')", $con); } else { mysql_query("UPDATE matricularecuperacion SET notanormal='{$notaF}' WHERE id='{$idRecEst}'", $con); } } else { mysql_query("DELETE FROM matricularecuperacion WHERE informerecuperacion='{$idRec}' AND matricula='{$idE}'");