jueves, 14 de noviembre de 2013

Codigo en HTML o XHTML PHP

CODIGO DE NOTAS

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.Estilo3 {color: #FFFFFF; font-weight: bold; }
.Estilo4 {
font-size: 24px;
color: #000099;
font-weight: bold;
}
.Estilo5 {color: #FFFFFF}
-->
</style>
</head>

<body>


<form action="guardar nota/rnotas.php" method="POST">

           <td><div align="center" class="Estilo4">
             <p>FORMULARIO DE REGISTRO DE NOTAS DE LA UPP</p>
             </div></td>
         

<td><table width="411" height="141" border="1" align="center">
              <tr>
                <td colspan="2" bgcolor="#6633FF"><div align="center" class="Estilo3">DATOS DEL ALUMNO </div></td>
              </tr>
              <tr>
               
<td width="109" height="30" bgcolor="#6633FF"><span class="Estilo5">NOMBRE</span></td>
<td width="286" bgcolor="#6633FF"><span class="Estilo5"><input type="text" name="nom"></span></td>
              </tr>
              <tr>
                <td height="29" bgcolor="#6633FF"><span class="Estilo5">APELLIDOS</span></td>
<td width="286" bgcolor="#6633FF"><span class="Estilo5"><input type="text" name="ape"></span></td>
               
              </tr>
              <tr>
                <td bgcolor="#6633FF"><span class="Estilo5">DIRECCIÓN</span></td>
                <td width="286" bgcolor="#6633FF"><span class="Estilo5"><input type="text" name="direc"></span></td>

              </tr>
 </tr>
              <tr>
                <td bgcolor="#6633FF"><span class="Estilo5">CARRERA</span></td>
                <td width="286" bgcolor="#6633FF"><span class="Estilo5"><input type="text" name="carrera"></span></td>

              </tr>
            </table>
 </td>
<TABLE width ="336" height="100" border="5"  align="center"   bgcolor="#009933">
     <tr>
       <TD colspan="2" bordercolor="#FFFFFF"><div align="center"><span class="Estilo3">REGISTRAR NOTAS </span></div></TD>
         </TR>
     <TD width="130" bordercolor="#FFFFFF"><span class="Estilo3">Intervenci&oacute;n Oral </span></TD>
       <TD width="182"><input type="text" name="numero1"> </TD>
</TR>

<TR>
<TD bordercolor="#FFFFFF"><span class="Estilo3">Practica1 </span></TD>
<TD><input type="text" name="numero2"> </TD>
</TR>
<TR>
<TD bordercolor="#FFFFFF"><span class="Estilo3">Practica2 </span></TD>
<TD><input type="text" name="numero3"> </TD>
</TR>
<TR>
<TD bordercolor="#FFFFFF"><span class="Estilo3">Examen Parcial </span></TD>
<TD><input type="text" name="numero4"> </TD>
</TR>
<TR>
<TD bordercolor="#FFFFFF"><span class="Estilo3">Examen Final </span></TD>
 <TD><input type="text" name="numero5" /></TD>
</TR>
<TR>
<TD bordercolor="#FFFFFF"><span class="Estilo3">Trabajo1</span></TD>
<TD><input type="text" name="numero6"> </TD>
</TR>
<TR>
<TD bordercolor="#FFFFFF"><span class="Estilo3">Trabajo2 </span></TD>
<TD><input type="text" name="numero7"> </TD>
</TR>
<TR>
<TD bordercolor="#FFFFFF"><span class="Estilo3">Trabajo3 </span></TD>
<TD><input type="text" name="numero8"> </TD>
</TR>

<TR>
<TD colspan="2"><div align="center">
 <input name="submit" type="submit" value="Registra datos y calcula notas" />
</TR>
</TABLE>

</form>

</body>
</html>
</html>


codigo de resultado

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
<style type="text/css">
<!--
.Estilo1 {
font-size: 18px;
font-weight: bold;
}
-->
</style>
</head>
<table width="433" height="143" border="1" align="center">
  <tr>
    <td colspan="2"><div align="center">RESULTADO DEL ESTUDIANTE: </div></td>
  </tr>
  <tr>
    <td width="136">NOMBRE</td>
    <td width="281">
<¿
echo $nom;
?>
</td>
  </tr>
  <tr>
    <td>TURNO</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>CARRERA</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>PROMEDIO</td>
    <td>&nbsp;</td>
  </tr>
</table>
<p>&nbsp;</p>


<?php
if($_POST)

{
$nom = $_POST
['nom'];
$ape = $_POST
['ape'];
$direc = $_POST
['direc'];
$Carrera = $_POST
['Carrera'];
$num1 = $_POST
['numero1'];
$num2 = $_POST
['numero2'];
$num3 = $_POST
['numero3'];
$num4 = $_POST
['numero4'];
$num5 = $_POST
['numero5'];
$num6 = $_POST
['numero6'];
$num7 = $_POST
['numero7'];
$num8 = $_POST
['numero8'];

$suma = ($num1*0.10) + (($num2 + $num3)/2*0.25) + ($num4*0.20) + ($num5*0.25) + (($num6 + $num7 + $num8)/3*0.20);

echo "SU PROMEDIO PONDERADO ES: ".$suma;    
}
?>

Codigo de LCD en Microde para hacer correr en el Proteus

CMCON=7
j var byte
i var byte
x var byte
LCDOUT $FE,1
LCDOUT $FE,2
x=16
uhh:
for i=x to x+16
lookup i,["................Hola_QUE_VIII_13................"],J
LCDOUT j
next i
if portb.7=1 then
   x=x+1
   else
   x=j+1
   x=i+1
   i=x+2
endif
if portb.6=1 then
x= x-1
endif
pause 100
LCDOUT $FE,1
goto uhh
end