El código inicial es:
Código PHP:
Ver original<?php
$id = '1';
$query = mysql_query ("SELECT * FROM calificaciones WHERE id = '$id'",$conn); $caliBio = '7';
$actBio = '+';
$obsBio = 'El alumno aprende adecuadamente.';
$caliSoc = '4';
$actSoc = 'MJR';
$obsSoc = 'Deberá recuperarla en Septiembre.';
?>
<html>
<head>
<title>Calificaciones: 3º ESO-A</title>
<link href="css/css.css" rel="stylesheet"/>
</head>
<body>
<div id="h1-div">
<font id="h1-azul">Calificaciones</font>
</div>
<table width="98%" align="center" border="0" style="border-collapse: collapse;">
<tr id="tr1-h">
<td align="center" width="50%"><b>Materias</b></td>
<td align="center" width="18%"><b>Calificación</b></td>
<td align="center" width="12%"><b>Actitud</b></td>
<td align="center" width="18%"><b>Observaciones</b></td>
</tr>
<tr id="tr1">
<td align="center" width="50%">Biología y geología</td>
<td align="center" width="18%">
<?php
if ($caliBio == '10'){
echo 'Sobresaliente';
}elseif ($caliBio == '9'){
echo 'Sobresaliente';
}elseif ($caliBio == '8'){
echo 'Notable';
}elseif ($caliBio == '7'){
echo 'Notable';
}elseif ($caliBio == '6'){
echo 'Bien';
}elseif ($caliBio == '5'){
echo 'Suficiente';
}else{
echo 'Insuficiente';
}
echo ' ';
echo $caliBio;
?>
</td>
<td align="center" width="12%">
<?php
if ($actBio == '-'){
echo 'Negativa';
}elseif ($actBio == "+"){
echo 'Positiva';
}elseif ($actBio == 'PAS'){
echo 'Pasiva';
}elseif ($actBio == 'MJR'){
echo 'Mejorable';
}elseif ($actBio == 'N'){
echo 'Normal';
}
?>
</td>
<td align="center" width="18%">
<?php
if (!$obsBio){
echo ' ';
}else{
echo $obsBio;
}
?>
</td>
</tr>
<tr id="tr1">
<td align="center" width="50%">Ciencias Sociales, geografía e historia</td>
<td align="center" width="18%">
<?php
if ($caliSoc == '10'){
echo 'Sobresaliente';
}elseif ($caliSoc == '9'){
echo 'Sobresaliente';
}elseif ($caliSoc == '8'){
echo 'Notable';
}elseif ($caliSoc == '7'){
echo 'Notable';
}elseif ($caliSoc == '6'){
echo 'Bien';
}elseif ($caliSoc == '5'){
echo 'Suficiente';
}else{
echo 'Insuficiente';
}
echo ' ';
echo $caliSoc;
?>
</td>
<td align="center" width="12%">
<?php
if ($actSoc == '-'){
echo 'Negativa';
}elseif ($actSoc == "+"){
echo 'Positiva';
}elseif ($actSoc == 'PAS'){
echo 'Pasiva';
}elseif ($actSoc == 'MJR'){
echo 'Mejorable';
}elseif ($actSoc == 'N'){
echo 'Normal';
}
?>
</td>
<td align="center" width="18%">
<?php
if (!$obsSoc){
echo ' ';
}else{
echo $obsSoc;
}
?>
</td>
</tr>
</table>
</body>
</html>
Las variables de las que hablaba las he definido manualmente de momento.