Ver Mensaje Individual
  #6 (permalink)  
Antiguo 05/11/2012, 09:32
f4b14n
 
Fecha de Ingreso: agosto-2006
Mensajes: 24
Antigüedad: 17 años, 8 meses
Puntos: 9
Respuesta: Ayudeneme a mejorar este html y php

De partida yo cambiaria el notas.html a notas.php

notas.php
Código PHP:
Ver original
  1. <html>
  2. <style type="text/css">
  3. body {
  4.     background-color: #00FF66;
  5.     font-family: Trebuchet MS, Arial, Helvetica, sans-serif;
  6. }
  7. </style>
  8. <FORM action="registro.php" method="POST">
  9. <TABLE width="60%" border="1" align="center" bgcolor="#00FF66">
  10. <TR bgcolor="#00FF66">
  11.     <TD colspan="1" align="center"><B>N'</B></TD>
  12.     <TD colspan="1" align="center"><B>NOMBRES Y APELLIDOS</B></TD>
  13.     <TD colspan="2" align="center"><B>NOTA</B></TD>
  14. </TR>
  15. <?php
  16.  
  17.     $numRegistros = 10;
  18.     $cantNotas = 20;   
  19.     for($i=1; $i<=$numRegistros; $i++)
  20.     {
  21. ?>
  22.         <TR>
  23.             <TD colspan="1"><?php echo sprintf("%02d",$i)?></TD>
  24.             <TD colspan="1"><CENTER><INPUT type="text" name="texto[]" size="90" maxlength="40"></CENTER></TD>
  25.             <TD colspan="1">
  26.                 <SELECT name="nota[]">
  27.                     <?php
  28.                         $nota = 0;
  29.                         while ($nota <= $cantNotas)
  30.                         {
  31.                             echo "<option value='".sprintf("%02d", $nota)."'>".sprintf("%02d", $nota)."</option>";
  32.                             $nota++;
  33.                         }
  34.                     ?>
  35.                     <option value="INH">INH</option>
  36.                 </SELECT>
  37.             </TD>
  38.         </TR>
  39. <?php
  40.     }
  41. ?>
  42. <TR>
  43.     <TD height="28" colspan="3" align="center">
  44.         <INPUT type="reset" name="limpiar" value="LIMPIAR">
  45.         <INPUT type="submit" name="calcular" value="REGISTRAR">
  46.     </TD>
  47. </TR>
  48. </TABLE>
  49. </FORM>
  50. </BODY>
  51. </html>

Si te fijas puse
$numRegistros = 10;
$cantNotas = 20;

Si las cambias te permite ingresar mas o menos notas y agregar o achicar el rango de notas.


Y registro.php
Código PHP:
Ver original
  1. <html>
  2. <HEAD><TITLE></TITLE>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  4. <style type="text/css">
  5. body {
  6.     background-color: #9F6;
  7.     color: #ff0000;
  8. }
  9. </style>
  10. </HEAD>
  11.  
  12. <table align="center" border="1" width="70%">
  13. <?php
  14.     $valor01=$_POST['texto'];
  15.     $valor02=$_POST['nota'];
  16.  
  17.     echo "<tr><td colspan='3' align='center'><br><br><br></td></tr>";
  18.     echo "<tr>
  19.             <td>Orden</td>
  20.             <td align='center'>Nombre y Apellidos</td>
  21.             <td>Calificacion</td>
  22.          </tr>";
  23.  
  24.     for($i=0;$i<count($valor01);$i++)
  25.     {
  26.         echo "<tr>
  27.                 <td>" . ($i+1) ."</td>
  28.                 <td>" . ($valor01[$i] ? $valor01[$i] : "&nbsp;") . "</td>
  29.                 <td>$valor02[$i]</td>
  30.             </tr>";
  31.     }
  32.  
  33. ?>
  34. </table>
  35. <br><br>
  36. <TABLE align="center" width="50%" border="1"><TR><TD align="center">
  37. <a href="formulario2.html">Ingresar Nueva Calificacionn</a>
  38. </TD></TR></TABLE>
  39. </BODY>
  40. </html>

Saludos