AND r.id_grado = g.id_grado'; $ejecutar = mysql_query($sql); $i = 0; while ($arreglo = mysql_fetch_assoc($ejecutar)) { if ($i) { $pdf->new_page(); } $pdf->cp->addJpegFromFile('../images/logo.jpg', 40, $pdf->cp->cy(80), 60); $pdf->text(100, $pdf->top(25), 'INSTITUTO NACIONAL DE EDUCACION BASICA', 8, 'center', $pdf->page_width(125)); $pdf->text(100, $pdf->top(11), 'ESCUELA NORMAL RURAL No. 5', 8, 'center', $pdf->page_width(125)); $pdf->text(100, $pdf->top(11), '"Prof. Julio Edmundo Rosado Pinelo"', 8, 'center', $pdf->page_width(125)); $pdf->text(100, $pdf->top(11), 'Santa Elena, Flores, Petén. Tel. 79262393', 8, 'center', $pdf->page_width(125)); $pdf->text(100, $pdf->top(11), '"SIMIENTE DE CULTURA EN PETÉN"', 8, 'center', $pdf->page_width(125)); $pdf->text(100, $pdf->top(20), 'FICHA DE RENDIMIENTO ESCOLAR', 11, 'center', $pdf->page_width(125)); $datos = array(array(array('text' => 'Carné:', 'align' => 'right'), array('text' => $arreglo['carne'], 'align' => 'left'), array('text' => 'Fecha:', 'align' => 'right'), array('text' => $arreglo['fecha'], 'align' => 'left')), array(array('text' => 'Nombres y Apellidos:', 'align' => 'right'), array('text' => $arreglo['nombre_alumno'] . ', ' . $arreglo['apellido'], 'align' => 'left'), array('text' => 'Telefono:', 'align' => 'right'), array('text' => $arreglo['telefono1'], 'align' => 'left')), array(array('text' => 'Email:', 'align' => 'right'), array('text' => $arreglo['email'], 'align' => 'left'), array('text' => 'Código:', 'align' => 'right'), array('text' => $arreglo['codigo_alumno'], 'align' => 'left')), array(array('text' => 'Grado:', 'align' => 'right'), array('text' => $arreglo['nombre'] . ' ' . $arreglo['nombre_seccion'], 'align' => 'left'), array('text' => '', 'align' => 'right'), array('text' => '', 'align' => 'left')), array(array('text' => 'Encargado:', 'align' => 'right'), array('text' => $arreglo['encargado_reinscripcion'], 'align' => 'left'), array('text' => '', 'align' => 'right'), array('text' => '', 'align' => 'left'))); $pdf->multitable($datos, 35, $pdf->top(15), 5, 9, 0); $infot = array(array(array('text' => 'Curso', 'align' => 'center'))); $sql = 'SELECT * FROM examenes WHERE examen NOT LIKE \'%Recup%\' ORDER BY id_examen'; $ejecutar2 = mysql_query($sql); while ($row = mysql_fetch_array($ejecutar2)) { $infot[0][] = array('text' => $row['examen'], 'align' => 'center', 'width' => 75); } $infot[0][] = array('text' => 'Prom', 'align' => 'center', 'width' => '50'); $sql = "SELECT *\r\n\t\tFROM cursos c, reinscripcion r\r\n\t\tWHERE r.id_grado = " . $secciones['id_grado'] . ' AND r.id_seccion = ' . $secciones['id_seccion'] . ' AND r.anio = ' . $anio . ' AND r.id_grado = c.id_grado AND r.id_alumno = ' . (int) $arreglo['id_alumno'];
while ($arreglo = mysql_fetch_assoc($ejecutar)) { $alumno = array(array('text' => $arreglo['carne'], 'align' => 'left'), array('text' => $arreglo['apellido'] . ', ' . $arreglo['nombre_alumno'], 'align' => 'left')); $numeros = array(); foreach ($id_cursos as $id => $nombre) { $sql = 'SELECT * FROM notas WHERE id_alumno = ' . $arreglo['id_alumno'] . ' AND id_grado = ' . $secciones['id_grado'] . ' AND id_curso = ' . $id . ' AND id_bimestre = ' . $id_examen; $ejecutar3 = mysql_query($sql) or die($sql . mysql_error()); $notas = mysql_fetch_assoc($ejecutar3); $numeros[] = array('text' => $notas['nota'], 'align' => 'center'); } $fill = 0; $sum = 0; foreach ($numeros as $numero) { if ($numero['text']) { $fill++; $sum += $numero['text']; } } $text_numeros = $fill ? number_format(round($sum / $fill, 2), 2) : ''; $numeros[] = array('text' => $text_numeros, 'align' => 'center'); $table[] = array_merge($alumno, $numeros); } $pdf->dynamic_table($ls_cursos, 35, 30, 5, 4, 10, 0); $pdf->multitable($table, 35, 125, 5, 10, 1, array('last_height' => $pdf->top())); $pdf->cp->ezOutput(); $pdf->cp->stream(); die;
$_merge = false; if (in_array($arreglo2['nombre_area'], $_areas)) { $arreglo2['nombre_area'] = ''; $_merge = true; } $_areas[] = $arreglo2['nombre_area']; $infot[$j][] = array('text' => $arreglo2['nombre_area'], 'align' => 'center', 'merge' => $_merge); break; } $infot[$j][] = array('text' => $arreglo2['nombre_curso'], 'align' => 'left'); $infot[$j][] = array('text' => $per_sum, 'align' => 'center'); $infot[$j][] = array('text' => $lets, 'align' => 'left'); $infot[$j][] = array('text' => $resultado, 'align' => 'center'); $j++; } $pdf->multitable($infot, 65, $pdf->top(100), 5, 9, 1, array('last_height' => $pdf->top())); switch ($anio) { case 2010: $day_string = 'quince'; break; case 2011: $day_string = 'catorce'; break; case 2011: $day_string = 'quince'; break; } $text_block = 'En fe de lo anterior se extiende el presente certificado en Santa Elena de la Cruz, Flores, Petén, a los ' . $day_string . ' días del mes de octubre del ' . $cv->cv($anio) . '.'; $pdf->text_wrap($text_block, 11, $pdf->page_width() - 185, 65, $pdf->top(50), 20); $names = array(array(array('text' => $firma1, 'align' => 'center'), array('text' => 'Vo. Bo. Lic. Baldomero Fidel Ramírez Zabala', 'align' => 'center')), array(array('text' => $firma2, 'align' => 'center'), array('text' => 'Director', 'align' => 'center'))); $pdf->multitable($names, 35, $pdf->top(100), 5, 11, 0);