<html>
<body bgcolor=#00ffee>

<?php
$n=12;
$m=10;
$matricula=$_POST["matricula"];
$periodo=$_POST["periodo"];
if($periodo==17.2):
$ponteiro=fopen("algebralinear.csv","r");
else:
  if($periodo==04.2):
  $ponteiro=fopen("calcvet200manha.csv","r");
  else:
  $ponteiro=fopen("calculo i 2004 tarde.csv","r");
  endif;endif;
$conteudo=fgets($ponteiro,1500);
$conteudo2=fgets($ponteiro,1600);
$conteudo3=fgets($ponteiro,1400);
$conteudo4=fgets($ponteiro,1600);
$conteudo5=fgets($ponteiro,1600);
echo "<font color=#1111222>". str_replace(";;;;;;;;;;;","         
","$conteudo")."<br>";
echo str_replace(";"," ","$conteudo2")."<br>";
echo str_replace(";"," ", "$conteudo3")."<br>";
echo str_replace(";"," ","$conteudo4")."<br>";
echo str_replace(";"," ","$conteudo5")."<br>";
echo "<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" 
align=\"center\" width=\"50%\" heigth=\"50%\">"; 
$conteudo6=fgets($ponteiro,160);
$conteudo6a=split(";",$conteudo6);


for($i=0; $i<1; $i++)
{
echo "<tr bgcolor=#bbff00>";
for ($k=0;$k<=$n;$k++)
{
       echo "<td>"." $conteudo6a[$k]"." </td>";
}
echo "</tr>";
}

for ($i=1;$i<=$m;$i++)
{
$conteuda[$i]=fgets($ponteiro,1000);
$conteudaa[$i]=split(";",$conteuda[$i]);
echo "<tr>";
for ($j=1;$j<=$n;$j++)
 {
if($matricula==$conteudaa[$i][1]):
/* echo "<td><font color=blue>". $conteudaa[$i][$j]."</td>";*/

if($conteudaa[$i][$j]<1):
 echo "<td>". $conteudaa[$i][$j]." </td>";
elseif($conteudaa[$i][$j]<7):
 echo "<td><font color=red>". $conteudaa[$i][$j]."</td>";
else:
 echo "<td><font color=blue>". $conteudaa[$i][$j]."</td>";
endif;
endif;
 }
echo "</tr>";
}
 echo "</table><br>";
fclose($ponteiro);
?>
</body>
</html>
