Exemplo n.º 1
0
 function concepto_religion($notas)
 {
     $prom = promedio($notas);
     if ($prom >= 6) {
         return "MB";
     } else {
         if ($prom >= 5 && $prom < 6) {
             return "B";
         } else {
             if ($prom >= 4 && $prom < 5) {
                 return "S";
             } else {
                 if ($prom < 4 && $prom > 1) {
                     return "I";
                 } else {
                     return "EX";
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
                     $pdf->SetTextColor(0, 0, 255);
                 }
                 $pdf->Cell(0, 4, $promfinal, 1, 1, 'C');
                 $promanual[$k] = $promfinal;
                 $k++;
             } else {
                 for ($j = 1; $j <= 15; $j++) {
                     $r1[$j] = $row22["n{$j}"];
                 }
             }
         } else {
             for ($j = 16; $j <= 30; $j++) {
                 $r2[$j] = $row22["n{$j}"];
             }
             $nn[0] = promedio($r1);
             $nn[1] = promedio($r2);
             //			dpr($r1);
             //			echo "<br>".$nn[0]." - ".$nn[1];
             $religion = concepto_religion($nn);
             $rel2 = $religion;
         }
     }
 }
 $aux99 = 0;
 $comprobar = 1;
 for ($j = 0; $j < $k; $j++) {
     if (!$promanual[$j]) {
         $comprobar = 0;
     }
     $aux99 = $promanual[$j] + $aux99;
     //$pdf->Cell(0,4,$k,1,1,'C');
Exemplo n.º 3
0
function grafico_liga ($liga) {
	global $facebook ;
	$jugadores = miembrosliga($liga);
#	$grafico['cantser'] = sizeof($jugadores);
	$grafico['cantser'] = 2;
#	$grafico['nomvar'] = Array ( 0 => 'Goles', 1 => 'Puntos');
	$grafico['nomser'] = Array ( 0 => 'Goles', 1 => 'Puntos');
	$nomjugadores = $facebook->api_client->users_getInfo(miembrosliga($liga),Array('name'));
	foreach ($nomjugadores as $numnomjug => $nomjugador) {
		$nomjug[] = $nomjugador['name'];
		$grafico['ser1'][] = promedio($liga, 'gol', $jugadores[$numnomjug]);
		$grafico['ser2'][] = promedio($liga, 'punto', $jugadores[$numnomjug]);
	}
#	$grafico['nomser'] = $nomjug ;
	$grafico['nomvar'] = $nomjug ;
/*	$r = 1;
	while ( $grafico['cantser'] >= $r ) {
		$jug = $r - 1;
		$grafico['ser' . $r ] = Array ( 'Goles' => promedio($liga, 'gol', $jugadores[$jug]) , 'Puntos'=> promedio ($liga, 'punto', $jugadores[$jug]) );
		$r++;
	}*/
	return grafico(null, $grafico, null) ;
}
Exemplo n.º 4
0
         $notas2[$kk2] = $row2["n{$l1}"];
     }
     $aux = $n[$m][$l1];
     if ($notas1[$kk]) {
         $kk++;
     }
     if ($notas2[$kk2]) {
         $kk2++;
     }
     //	$n[$l1]=number_format($aux,1,".",",");
     if ($aux == 0) {
         $n[$m][$l1] = NULL;
     }
 }
 $promedio1[$m] = promedio($notas1);
 $promedio2[$m] = promedio($notas2);
 $examen1[$m] = $row2["examen1"];
 //echo "lolaso $examen1[$m]";
 $examen2[$m] = $row2["examen2"];
 if (!$examen1[$m]) {
     $examen1[$m] = NULL;
 }
 if (!$examen2[$m]) {
     $examen2[$m] = NULL;
 }
 if ($examen1[$m]) {
     $promedio1[$m] = $examen1[$m] * 0.3 + $promedio1[$m] * 0.7;
     $promedio1[$m] = $promedio1[$m] * 10;
     $promedio1[$m] = round($promedio1[$m]);
     $promedio1[$m] = number_format($promedio1[$m], 0, ".", ",");
     $promedio1[$m] = $promedio1[$m] / 10;
Exemplo n.º 5
0
             $r = array_shift($registronotas->mostrarRegistroNotas($cas['CodCasilleros'], $al['CodAlumno'], $Tri));
             //print_r($r);
             $Totales[$Tri] += $r['NotaFinal'];
             $Totales["Cantidad_" . $Tri]++;
             $fila[] = $r['NotaFinal'];
         }
     }
     //$fila[]=$r['Dps'];
 }
 if (!empty($SeparadorCualitativo)) {
     $fila[] = $SeparadorCualitativo;
 }
 foreach ($Trimestre as $Tri) {
     //$fila[]=$Totales[$Tri];
     //$fila[]=$Totales["Cantidad_".$Tri];
     $notaPromedio = promedio($Totales[$Tri], $Totales["Cantidad_" . $Tri]);
     //$fila[]=$notaPromedio;
     $ncuali = array_shift($notascualitativabimestre->mostrarNota($CodCurso, $Tri));
     $notacomprobar = $notaPromedio;
     if ($notacomprobar >= $LimiteInicio1 && $notacomprobar <= $LimiteFin1) {
         $fila[] = mayuscula($ncuali['PrimerRango']);
     } elseif ($notacomprobar >= $LimiteInicio2 && $notacomprobar <= $LimiteFin2) {
         $fila[] = mayuscula($ncuali['SegundoRango']);
     } elseif ($notacomprobar >= $LimiteInicio3 && $notacomprobar <= $LimiteFin3) {
         $fila[] = mayuscula($ncuali['TercerRango']);
     } elseif ($notacomprobar >= $LimiteInicio4 && $notacomprobar <= $LimiteFin4) {
         $fila[] = mayuscula($ncuali['CuartoRango']);
     }
 }
 /*
 				//$fila[]=$r['Dps'];
Exemplo n.º 6
0
 /**
  * @param PHPExcel_Worksheet $worksheet
  * @param array $style_h2
  * @return PHPExcel_Worksheet
  */
 public function exportExcel(PHPExcel_Worksheet $worksheet, array $style_h2)
 {
     $last_row = $worksheet->getHighestDataRow();
     $last_row += 2;
     $max_col = $worksheet->getHighestDataColumn();
     $worksheet->mergeCells("A{$last_row}:{$max_col}{$last_row}");
     $worksheet->setCellValue("A{$last_row}", utf8_encode($this->getTitulo()) . ' - ' . utf8_encode($this->getSubPregunta()));
     $worksheet->getStyle("A{$last_row}:{$max_col}{$last_row}")->applyFromArray($style_h2);
     $worksheet->getRowDimension($last_row)->setRowHeight(20);
     $last_row += 2;
     $merge = $last_row + 1;
     $worksheet->mergeCells("C{$last_row}:C{$merge}");
     $worksheet->setCellValue("C{$last_row}", utf8_encode($this->getTitulo()));
     $merge = $last_row + 1;
     $worksheet->mergeCells("D{$last_row}:D{$merge}");
     $worksheet->setCellValue("D{$last_row}", 'Votos');
     $worksheet->mergeCells("E{$last_row}:G{$last_row}");
     $worksheet->setCellValue("E{$last_row}", utf8_encode($this->getSubPregunta()));
     $worksheet->getRowDimension($last_row)->setRowHeight(27);
     $last_row++;
     $worksheet->setCellValue("E{$last_row}", utf8_encode('Mínimo'));
     $worksheet->setCellValue("F{$last_row}", utf8_encode('Máximo'));
     $worksheet->setCellValue("G{$last_row}", 'Promedio');
     $first_row = $last_row - 1;
     $last_row += 1;
     foreach ($this->getDatos() as $key => $dato) {
         $worksheet->setCellValue("B{$last_row}", $key + 1);
         $worksheet->setCellValue("C{$last_row}", utf8_encode($dato[0]));
         if (mb_strlen($dato[0]) > 45) {
             $worksheet->getRowDimension($last_row)->setRowHeight(25);
         }
         $worksheet->setCellValue("D{$last_row}", $dato['contador']);
         $worksheet->setCellValue("E{$last_row}", min_mod($dato['detalle']));
         $worksheet->setCellValue("F{$last_row}", max_mod($dato['detalle']));
         $worksheet->setCellValue("G{$last_row}", promedio($dato['detalle'], 1));
         $last_row++;
     }
     $merged = $first_row + 1;
     $worksheet->getStyle("C{$first_row}:G{$merged}")->applyFromArray($this->getEstiloTabla('center', true));
     $last_row -= 1;
     $first_row += 2;
     $worksheet->getStyle("B{$first_row}:G{$last_row}")->applyFromArray($this->getEstiloTabla());
     return $worksheet;
 }
$i = 0;
foreach ($cursos as $nombre_curso => $datos_curso) {
    $ramos = $class_ramo->obtenerRamos($nombre_curso, false);
    $class_notas = new notas();
    if (count($ramos) > 0) {
        foreach ($ramos as $nombre_ramo => $datos_ramo) {
            if ($semestre == "anual") {
                $promedio_asignatura['1S'] = $class_notas->promedioSemestreAsignatura($nombre_ramo, $nombre_curso, '1S');
                $promedio_asignatura['2S'] = $class_notas->promedioSemestreAsignatura($nombre_ramo, $nombre_curso, '2S');
                $notas_aux[] = promedio(array('1S' => $promedio_asignatura['1S'][$nombre_ramo]['promedio'], '2S' => $promedio_asignatura['2S'][$nombre_ramo]['promedio']));
            } else {
                $promedio_asignatura = $class_notas->promedioSemestreAsignatura($nombre_ramo, $nombre_curso, $semestre);
                $notas_aux[] = $promedio_asignatura[$nombre_ramo]['promedio'];
            }
        }
    }
    $data[$i]['nombre_curso'] = mostrar_curso($nombre_curso);
    $data[$i]['promedio_curso'] = promedio($notas_aux);
    $i++;
    unset($notas_aux);
}
switch ($semestre) {
    case '1S':
        $titulo = "Gráfico de Rendimiento Primer Semestre";
        break;
    case '2S':
        $titulo = "Gráfico de Rendimiento Segundo Semestre";
        break;
    case 'anual':
        $titulo = "Gráfico de Rendimiento Anual";
        break;
Exemplo n.º 8
0
     if ($actual == $j) {
         $NotaFinal = promedio($NotaSumada, $actual);
         $Totales[$Tri] += $NotaFinal;
         $Totales["Cantidad_" . $Tri]++;
         $fila[] = $NotaFinal;
         $NotaSumada = 0;
         $pos++;
         $actual = $cantidad[$pos];
         $j = 0;
     }
 }
 if (!empty($SeparadorCualitativo)) {
     $fila[] = $SeparadorCualitativo;
 }
 foreach ($Trimestre as $Tri) {
     $notaPromedio = promedio($Totales[$Tri], $total);
     //$fila[]=$notaPromedio;
     //$fila[]=$Totales[$Tri];
     $ncuali = array_shift($notascualitativabimestre->mostrarNota($CodCurso, $Tri));
     $notacomprobar = $notaPromedio;
     if ($notacomprobar >= $LimiteInicio1 && $notacomprobar <= $LimiteFin1) {
         $fila[] = mayuscula($ncuali['PrimerRango']);
     } elseif ($notacomprobar >= $LimiteInicio2 && $notacomprobar <= $LimiteFin2) {
         $fila[] = mayuscula($ncuali['SegundoRango']);
     } elseif ($notacomprobar >= $LimiteInicio3 && $notacomprobar <= $LimiteFin3) {
         $fila[] = mayuscula($ncuali['TercerRango']);
     } elseif ($notacomprobar >= $LimiteInicio4 && $notacomprobar <= $LimiteFin4) {
         $fila[] = mayuscula($ncuali['CuartoRango']);
     }
 }
 array_push($datos, $fila);
                $incorrectas++;
            }
            $totalpreguntas += 1;
            break;
    }
    $valores = array("codtema" => "'{$codtemas}'", "bimestre" => "'{$bimestre}'", "codestudiante" => "'{$codestudiante}'", "codpractica" => "'{$codpractica}'", "tipo" => "'{$tipo}'", "r1" => "'{$r1}'", "r2" => "'{$r2}'", "r3" => "'{$r3}'", "r4" => "'{$r4}'", "respuesta" => "'{$respuesta}'");
    $respuestaspracticadetalle->insertar($valores);
    /*echo "<br>";
      print_r($valores);
      echo "<br>";*/
}
/*echo $totalpreguntas."-";
echo $correctas."-";
echo $incorrectas;*/
$pcorrectas = promedio($totalpreguntas, $correctas);
$pincorrectas = promedio($totalpreguntas, $incorrectas);
$valores = array("codtema" => "'{$codtemas}'", "bimestre" => "'{$bimestre}'", "codestudiante" => "'{$codestudiante}'", "totalpreguntas" => "'{$totalpreguntas}'", "correctas" => "'{$correctas}'", "incorrectas" => "'{$incorrectas}'", "pcorrectas" => "'{$pcorrectas}'", "pincorrectas" => "'{$pincorrectas}'");
if ($pcorrectas > 50) {
    $respuestaspractica->insertar($valores);
}
?>
<div class="titulo2">Resultado</div>
<center>
<h3>NOTA OBTENIDA:</h3>
<h2 class="<?php 
echo $pcorrectas > 50 ? 'verde' : 'rojo';
?>
"><?php 
echo $pcorrectas;
?>
</h2>
Exemplo n.º 10
0
    $pdf->Cell(1, 5, " ", 1);
    $sql89 = 'SELECT * FROM `transversales` WHERE rut = ' . "'" . $rut . "'";
    $result89 = mysql_query($sql89, $dbh);
    $row89 = mysql_fetch_array($result89);
    $sql99 = 'SELECT * FROM `notas` WHERE rut = ' . "'" . $rut . "' AND ramo = 'RELIGION'";
    $result99 = mysql_query($sql99, $dbh);
    $row99 = mysql_fetch_array($result99);
    unset($n);
    for ($j = 1; $j <= 15; $j++) {
        $r1[$j] = $row99["n{$j}"];
    }
    for ($j = 16; $j <= 30; $j++) {
        $r2[$j] = $row99["n{$j}"];
    }
    $n[1] = promedio($r1);
    $n[2] = promedio($r2);
    $religion = concepto_religion($n);
    $asistencia = $row89["asistencia"];
    $pdf->Cell(7, 5, $religion, 1);
    $pdf->Cell(7, 5, $asistencia, 1);
    $sumatoria = 0;
    $contadorfinal = 0;
    $pdf->ln();
}
$fecha2 = time();
$fechadia = date("j", $fecha2);
$fechames = date("n", $fecha2);
$fechaanio = date("Y", $fecha2);
$fechapago = $fechadia . "/" . $fechames . "/" . $fechaanio;
$pdf->SetTextColor(0, 0, 0);
$pdf->Cell(1, 5, "Documento generado en la fecha:" . $fechapago, 0);