Пример #1
0
 $MiPDF->Ln(5);
 $MiPDF->SetFont('NewsGotT', '', 12);
 // INFORMACION
 $result = mysqli_query($db_con, "SELECT curso FROM alma WHERE unidad='{$valor}' LIMIT 1");
 $row = mysqli_fetch_array($result, MYSQLI_ASSOC);
 $MiPDF->SetFont('NewsGotT', 'B', 12);
 $MiPDF->Cell(17, 5, 'Unidad: ', 0, 0, 'L', 0);
 $MiPDF->SetFont('NewsGotT', '', 12);
 $MiPDF->Cell(100, 5, $valor . ' (' . $row['curso'] . ')', 0, 1, 'L', 0);
 $MiPDF->Ln(5);
 mysqli_free_result($result);
 // INFORME
 $MiPDF->SetWidths(array(10, 80, 165));
 $MiPDF->SetFont('NewsGotT', 'B', 12);
 $MiPDF->SetTextColor(255, 255, 255);
 $MiPDF->SetFillColor(61, 61, 61);
 $MiPDF->Row(array('Nº', 'Alumno/a', 'Asignaturas'), 0, 6);
 $result = mysqli_query($db_con, "SELECT DISTINCT alma.claveal, FALUMNOS.NC, CONCAT(alma.apellidos, ', ', alma.nombre) AS alumno, matriculas FROM alma, pendientes, FALUMNOS WHERE alma.unidad='{$valor}' and alma.claveal = pendientes.claveal and FALUMNOS.claveal = pendientes.claveal ORDER BY alumno ASC");
 $MiPDF->SetTextColor(0, 0, 0);
 $MiPDF->SetFont('NewsGotT', '', 12);
 while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
     $asigpend = '';
     $result_pend = mysqli_query($db_con, "SELECT DISTINCT abrev FROM pendientes JOIN asignaturas ON pendientes.codigo = asignaturas.codigo WHERE pendientes.claveal = '" . $row['claveal'] . "' AND abrev LIKE '%\\_%' ORDER BY abrev ASC");
     while ($row_pend = mysqli_fetch_array($result_pend, MYSQLI_ASSOC)) {
         $asigpend .= $row_pend['abrev'] . ' | ';
     }
     $asigpend = rtrim($asigpend, ' | ');
     $observaciones = $row['matriculas'] > 1 ? ' (Rep.)' : '';
     $MiPDF->Row(array($row['NC'], $row['alumno'] . $observaciones, $asigpend), 1, 6);
 }
 mysqli_free_result($result);