eaiovnaovbqoebvqoeavibavo AddExtGState(array('ca'=>$alpha, 'CA'=>$alpha, 'BM'=>'/'.$bm)); $this->SetExtGState($gs); } function AddExtGState($parms) { $n = count($this->extgstates)+1; $this->extgstates[$n]['parms'] = $parms; return $n; } function SetExtGState($gs) { $this->_out(sprintf('/GS%d gs', $gs)); } function _enddoc() { if(!empty($this->extgstates) && $this->PDFVersion<'1.4') $this->PDFVersion='1.4'; parent::_enddoc(); } function _putextgstates() { for ($i = 1; $i <= count($this->extgstates); $i++) { $this->_newobj(); $this->extgstates[$i]['n'] = $this->n; $this->_put('<extgstates[$i]['parms']; $this->_put(sprintf('/ca %.3F', $parms['ca'])); $this->_put(sprintf('/CA %.3F', $parms['CA'])); $this->_put('/BM '.$parms['BM']); $this->_put('>>'); $this->_put('endobj'); } } function _putresourcedict() { parent::_putresourcedict(); $this->_put('/ExtGState <<'); foreach($this->extgstates as $k=>$extgstate) $this->_put('/GS'.$k.' '.$extgstate['n'].' 0 R'); $this->_put('>>'); } function _putresources() { $this->_putextgstates(); parent::_putresources(); } //girar texto function TextWithDirection($x, $y, $txt, $direction='R') { if ($direction=='R') $s=sprintf('BT %.2F %.2F %.2F %.2F %.2F %.2F Tm (%s) Tj ET',1,0,0,1,$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt)); elseif ($direction=='L') $s=sprintf('BT %.2F %.2F %.2F %.2F %.2F %.2F Tm (%s) Tj ET',-1,0,0,-1,$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt)); elseif ($direction=='U') $s=sprintf('BT %.2F %.2F %.2F %.2F %.2F %.2F Tm (%s) Tj ET',0,1,-1,0,$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt)); elseif ($direction=='D') $s=sprintf('BT %.2F %.2F %.2F %.2F %.2F %.2F Tm (%s) Tj ET',0,-1,1,0,$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt)); else $s=sprintf('BT %.2F %.2F Td (%s) Tj ET',$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt)); if ($this->ColorFlag) $s='q '.$this->TextColor.' '.$s.' Q'; $this->_out($s); } function TextWithRotation($x, $y, $txt, $txt_angle, $font_angle=0) { $font_angle+=90+$txt_angle; $txt_angle*=M_PI/180; $font_angle*=M_PI/180; $txt_dx=cos($txt_angle); $txt_dy=sin($txt_angle); $font_dx=cos($font_angle); $font_dy=sin($font_angle); $s=sprintf('BT %.2F %.2F %.2F %.2F %.2F %.2F Tm (%s) Tj ET',$txt_dx,$txt_dy,$font_dx,$font_dy,$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt)); if ($this->ColorFlag) $s='q '.$this->TextColor.' '.$s.' Q'; $this->_out($s); } //**************************************************************************** */ // Tabla coloreada function GenerarCuadro($id_grado, $bimestre, $id_curso, $nombre_curso) { //FONDO $this->Image('assets/img/logo_ceg_redondo2.png','185','10','17','17','PNG'); //datos encabezado $this->SetFont('Arial','',15); $this->SetTextColor(20); $this->setXY(20,10); $this->SetFont('Arial','B',9);$this->Cell(40,10,utf8_decode("CENTRO EDUCATIVO GETSEMANÍ")); $this->setXY(20,15); $this->SetFont('Arial','B',9);$this->Cell(40,10,utf8_decode("Registro de Resultados de Evaluación Bimestral")); $this->setXY(20,20); $this->SetFont('Arial','B',9);$this->Cell(40,10,"del Rendimiento Escolar - Ciclo Escolar 2025"); $this->setXY(160,25); $this->SetFont('Arial','B',9);$this->Cell(40,10,"Bimestre: ".$bimestre); $this->setXY(160,31); $this->SetFont('Arial','B',9);$this->Cell(40,10,"Maestro: ". utf8_decode($_SESSION['CEGS_nombre_corto'])); $this->setXY(160,37); date_default_timezone_set('America/Guatemala'); $this->SetFont('Arial','B',9);$this->Cell(40,10,"Hora: ". date('d-m-Y h:i:s a', time())); $this->setXY(30,55); //datos $consultas=new Imprimir2(); $Grado=$consultas->BuscarNG($id_grado); foreach($Grado as $grados){ $this->SetFont('Arial','B',12);$this->Cell(40,10,$grados['nombre_corto']); } $this->setXY(20,75); $this->Cell(55,15,'',1,0,'C',false); $this->setXY(20,78); $this->SetFont('Arial','B',6); $this->Cell(40,10,utf8_decode($nombre_curso)); //Empieza la cabecera //Buscamos las actiidades $Actividades=$consultas->buscarActividades($id_curso, $bimestre); if($Actividades){ $cantAct=sizeof($Actividades); }else{ $cantAct=0; } $this->SetFillColor(225,228,242); $this->SetTextColor(0,0,0); $this->SetDrawColor(0, 0, 0); $this->SetFont('Arial','I',6); $this->setXY(78,45); $espaciosEnc=0; if($Actividades){ foreach($Actividades as $fActividades){ $textoA=$this->TextWithDirection(82+$espaciosEnc,88,utf8_decode($fActividades['nombre']).'('.$fActividades['valor'].' pts)','U'); $this->Cell(6,45,$textoA,1,0,'C',false); $espaciosEnc=$espaciosEnc+6; } } $textoA=$this->TextWithDirection(82+$espaciosEnc,88,'Responsabilidad (5 pts)','U'); $this->Cell(6,45,$textoA,1,0,'C',false); $textoA=$this->TextWithDirection(88+$espaciosEnc,88,utf8_decode('Desempeño en clase (5 pts)'),'U'); $this->Cell(6,45,$textoA,1,0,'C',false); $textoA=$this->TextWithDirection(94+$espaciosEnc,88,'Total zona y afectivo (70 pts)','U'); $this->Cell(6,45,$textoA,1,0,'C',false); $textoA=$this->TextWithDirection(100+$espaciosEnc,88,'Primer Parcial (15 pts)','U'); $this->Cell(6,45,$textoA,1,0,'C',false); $textoA=$this->TextWithDirection(106+$espaciosEnc,88,'Segundo Parcial (15 pts)','U'); $this->Cell(6,45,$textoA,1,0,'C',false); $textoA=$this->TextWithDirection(112+$espaciosEnc,88,'Mejoramiento (15 pts)','U'); $this->Cell(6,45,$textoA,1,0,'C',false); $textoA=$this->TextWithDirection(118+$espaciosEnc,88,utf8_decode('Total exámenes (30 pts)'),'U'); $this->Cell(6,45,$textoA,1,0,'C',false); $this->SetFont('Arial','',7); $this->setXY(78,90); $this->Cell($espaciosEnc,5,'Procedimental',1,0,'C',true); $this->Cell(12,5,'Afectivo',1,0,'C',true); $this->Cell(6,10,'',1,0,'C',true); $this->Cell(24,5,'Cognositivo',1,0,'C',true); $this->SetFont('Arial','',7); $this->setXY(17,95); $this->Cell(5,5,'No',1,0,'C',true); $this->Cell(8,5,'Carnet',1,0,'C',true); $this->Cell(48,5,'Apellidos y nombres del alumno',1,0,'C',true); for($i=0; $i<$cantAct; $i++){ $this->Cell(6,5,$i+1,1,0,'C',true); } $this->Cell(6,5,'1',1,0,'C',true); $this->Cell(6,5,'2',1,0,'C',true); $this->Cell(6,5,'T',1,0,'C',true); $this->Cell(6,5,'1',1,0,'C',true); $this->Cell(6,5,'2',1,0,'C',true); $this->Cell(6,5,'3',1,0,'C',true); $this->Cell(6,5,'T',1,0,'C',true); $this->Cell(6,5,'F',1,0,'C',true); $this->Ln(); //Buscar los datos $datosNotas=$consultas->buscarRegistroNotas($id_curso, $bimestre); if($datosNotas){ $contadorRojo=0; $contadorAmarillo=0; $contadorVerde=0; $notaMayor=0; $notaMenor=100; $totalAlumnos=0; $promedio=0; $totalNotaTodos=0; $contador=1; $carnetValidar=""; $auxGeneral=0; $contadorSalto=0; $totalZona=0; $posicionY=95.5; $punteoAux=0; foreach($datosNotas as $fila){ if($carnetValidar!=$fila['carnet']){ $totalZona=0; $this->SetFont('Arial','I',6); $this->setX(17); $this->Cell(5,5,$contador,1,0,'C',false); $this->Cell(8,5,$fila['carnet'],1,0,'C',false); $this->SetFont('Arial','I',7); $this->Cell(48,5,utf8_decode($fila['apellidos'].', '.$fila['nombres']),1,0,'L',false); if($fila['punteo']=="" || $fila['punteo']==null){ $punteoAux=0; }else{ $punteoAux=$fila['punteo']; } $this->Cell(6,5,$punteoAux,1,0,'C',false); $totalZona+=intval($fila['punteo']); $contador++; $contadorSalto++; if($contadorSalto==($cantAct+6)){ $this->Ln(); $contadorSalto=0; } }else{ if($fila['punteo']=="" || $fila['punteo']==null){ $punteoAux=0; }else{ $punteoAux=$fila['punteo']; } $this->Cell(6,5,$punteoAux,1,0,'C',false); $totalZona+=intval($fila['punteo']); $contadorSalto++; if(isset($datosNotas[$auxGeneral+1])){ if($datosNotas[$auxGeneral]['carnet']!=$datosNotas[$auxGeneral+1]['carnet']){ $notaSecundaria=$consultas->buscarNS($fila['carnet'], $id_curso, $bimestre); if($notaSecundaria){ $contadorTotal=0; $totalEval=0; $primerP=0; $segundoP=0; $mejoramiento=0; $notaFinal=0; foreach($notaSecundaria as $fila2){ if($contadorTotal==2){ $this->Cell(6,5,$totalZona,1,0,'C',true); } if($contadorTotal==2){ $primerP=intval($fila2['punteo']); } if($contadorTotal==3){ $segundoP=intval($fila2['punteo']); } if($contadorTotal==4){ $mejoramiento=intval($fila2['punteo']); } if($contadorTotal==5){ if($primerP>$segundoP){ if($segundoP>$mejoramiento){ $totalEval=$primerP+$segundoP; }else{ if($primerP>$mejoramiento){ $totalEval=$primerP+$mejoramiento; }else{ $totalEval=$primerP+$mejoramiento; } } }else{ if($primerP>$mejoramiento){ $totalEval=$primerP+$segundoP; }else{ if($segundoP>$mejoramiento){ $totalEval=$segundoP+$mejoramiento; }else{ $totalEval=$segundoP+$mejoramiento; } } } $this->Cell(6,5,$totalEval,1,0,'C',true); $totalEval=0; $primerP=0; $segundoP=0; $mejoramiento=0; } if($fila2['punteo']=="" || $fila2['punteo']==null){ $punteoAux=0; }else{ $punteoAux=$fila2['punteo']; } $this->Cell(6,5,$punteoAux,1,0,'C',false); $totalZona+=intval($fila2['punteo']); $contadorSalto++; $contadorTotal++; $notaFinal=$fila2['punteo']; } $posicionX=128+$espaciosEnc; $posicionY+=5; if ($notaFinal<60){ $this->Image('assets/img/incorrecto.png',$posicionX,$posicionY,'4','4','PNG'); $contadorRojo++; }elseif($notaFinal<70){ $this->Image('assets/img/advertencia.png',$posicionX,$posicionY,'4','4','PNG'); $contadorAmarillo++; }else{ $this->Image('assets/img/check.png',$posicionX,$posicionY,'4','4','PNG'); $contadorVerde++; } if($notaFinal>$notaMayor){ $notaMayor=$notaFinal; } if($notaFinal<$notaMenor){ $notaMenor=$notaFinal; } $totalAlumnos++; $totalNotaTodos+=$notaFinal; $this->Ln(); } } }else{ $notaSecundaria=$consultas->buscarNS($fila['carnet'], $id_curso, $bimestre); if($notaSecundaria){ $contadorTotal=0; $totalEval=0; $primerP=0; $segundoP=0; $mejoramiento=0; $notaFinal=0; foreach($notaSecundaria as $fila2){ if($contadorTotal==2){ $this->Cell(6,5,$totalZona,1,0,'C',true); } if($contadorTotal==2){ $primerP=intval($fila2['punteo']); } if($contadorTotal==3){ $segundoP=intval($fila2['punteo']); } if($contadorTotal==4){ $mejoramiento=intval($fila2['punteo']); } if($contadorTotal==5){ if($primerP>$segundoP){ if($segundoP>$mejoramiento){ $totalEval=$primerP+$segundoP; }else{ if($primerP>$mejoramiento){ $totalEval=$primerP+$mejoramiento; }else{ $totalEval=$primerP+$mejoramiento; } } }else{ if($primerP>$mejoramiento){ $totalEval=$primerP+$segundoP; }else{ if($segundoP>$mejoramiento){ $totalEval=$segundoP+$mejoramiento; }else{ $totalEval=$segundoP+$mejoramiento; } } } $this->Cell(6,5,$totalEval,1,0,'C',true); $totalEval=0; $primerP=0; $segundoP=0; $mejoramiento=0; } if($fila2['punteo']=="" || $fila2['punteo']==null){ $punteoAux=0; }else{ $punteoAux=$fila2['punteo']; } $this->Cell(6,5,$punteoAux,1,0,'C',false); $totalZona+=intval($fila2['punteo']); $contadorSalto++; $contadorTotal++; $notaFinal=$fila2['punteo']; } $posicionX=128+$espaciosEnc; $posicionY+=5; if ($notaFinal<60){ $this->Image('assets/img/incorrecto.png',$posicionX,$posicionY,'4','4','PNG'); $contadorRojo++; }elseif($notaFinal<70){ $this->Image('assets/img/advertencia.png',$posicionX,$posicionY,'4','4','PNG'); $contadorAmarillo++; }else{ $this->Image('assets/img/check.png',$posicionX,$posicionY,'4','4','PNG'); $contadorVerde++; } if($notaFinal>$notaMayor){ $notaMayor=$notaFinal; } if($notaFinal<$notaMenor){ $notaMenor=$notaFinal; } $totalAlumnos++; $totalNotaTodos+=$notaFinal; $this->Ln(); } } } $carnetValidar=$fila['carnet']; $auxGeneral++; } $this->setXY(20,295); $this->Cell(40,3,"Total Alumnos evaluados: ".$totalAlumnos,1,0,'C',false);$this->Ln(); $this->setX(20); $this->Cell(40,3, "Criterio",1,0,"L",true); $this->Cell(15,3, "No.",1,0,"L",true); $this->Cell(15,3, "%.",1,0,"L",true);$this->Ln(); $this->setX(20); $this->Cell(40,3, "De 0 a 59",1,0,"L",false); $this->Cell(15,3, $contadorRojo,1,0,"L",false); $this->Cell(15,3, round(($contadorRojo*100)/$totalAlumnos,0)."%",1,0,"L",false);$this->Ln(); $this->setX(20); $this->Cell(40,3, "De 60 a 69",1,0,"L",false); $this->Cell(15,3, $contadorAmarillo,1,0,"L",false); $this->Cell(15,3, round(($contadorAmarillo*100)/$totalAlumnos,0)."%",1,0,"L",false);$this->Ln(); $this->setX(20); $this->Cell(40,3, "De 70 a 100",1,0,"L",false); $this->Cell(15,3, $contadorVerde,1,0,"L",false); $this->Cell(15,3, round(($contadorVerde*100)/$totalAlumnos,0)."%",1,0,"L",false);$this->Ln(); $this->setX(20); $this->Cell(40,3, utf8_decode("Nota Máxima"),1,0,"L",false); $this->Cell(15,3, $notaMayor,1,0,"L",false);$this->Ln(); $this->setX(20); $this->Cell(40,3, utf8_decode("Nota Mínima"),1,0,"L",false); $this->Cell(15,3, $notaMenor,1,0,"L",false);$this->Ln(); $this->setX(20); //calcular el promedio $promedio=round($totalNotaTodos/$totalAlumnos,0); $this->Cell(40,3, "Nota Promedio",1,0,"L",false); $this->Cell(15,3, $promedio,1,0,"L",false); } } } ?>