Good morning Community. I have this student report card by subject But I have tried to make the notes go horizontally according to the subject and not vertically according to the image. I have not been able to solve this concern.
The code I occupy is
class Consultar_Materias extends Conexion{
private $consulta;
private $fetch;
function __construct($codigo){
parent::__construct();
$this->consulta = $this->conexion_db->query("SELECT * FROM materia WHERE id='$codigo'");
$this->fetch = mysqli_fetch_array($this->consulta);
}
function consultar($campo){
return $this->fetch[$campo];
}
}
this code is the one on the page:
if(!empty($_GET['cod']) and !empty($_GET['periodo'])){
$id_periodo=$_GET['periodo'];
$id_alumno=$_GET['cod'];
$oPeriodo=new Consultar_Periodo($id_periodo);
$oAlumno=new Consultar_Alumno($id_alumno);
$nombre_alumno=$oAlumno->consultar('nombre');
$oGrado= new Consultar_Grado($oAlumno->consultar('grado'));
$oSalon= new Consultar_Salon($oAlumno->consultar('salon'));
$nombre_salon=$oSalon->consultar('nombre');
$nombre_grado=$oGrado->consultar('nombre');
$oEmpresa= new Consultar_Empresa('1');
$dir='Direccion: '.$oEmpresa->consultar('direccion').'<br>'.$oEmpresa->consultar('pais').' - Viña del Mar';
$regresar=$oAlumno->consultar('salon');#5
}else{
header('Location:error.php');
}
</table>
<br />
<table width="90%" rules="all" border="1" style="font-family:Arial, Helvetica, sans-serif">
<tr>
<td>
<center><strong>Nombre del Alumno</strong><br /><?php echo $nombre_alumno; ?></center>
</td>
<td width="25%"><center><strong>Curso</strong><br /><?php echo $nombre_grado; ?></center></td>
<td width="25%"><center><strong>Sala<br /></strong><?php echo $nombre_salon; ?></center></td>
</tr>
<tr>
<td colspan="3"><br /><center><strong>Informe del Periodo <?php echo $oPeriodo->consultar('nombre'); ?> Semestre</strong></center></td>
</tr>
</table>
<bR />
<table width="90%" rules="all" border="1" style="font-family:Arial, Helvetica, sans-serif">
<tr>
<td width="50%"><strong><center>Materia</center></strong></td>
<td width="50%"><strong><center>Calificación</center></strong></td>
</tr>
<?php
$pa=mysqli_query($conexion,"SELECT * FROM notas WHERE alumno='$id_alumno' and periodo='$id_periodo' ORDER BY materia");
while($row=mysqli_fetch_array($pa)){
$oMateria=new Consultar_Materias($row['materia']);
?>
<tr>
<td><center><?php echo $oMateria->consultar('nombre'); ?></center></td>
<td><center><?php echo $row['valor']; ?></center></td>
</tr>
<?php } ?>
</table>
How can I put each grade horizontally according to each subject?
Mathematics | 40 | 50 | 60 | 70 |
Language | 55 | 60 | 60 |
Thanks