<html>
<body bgcolor=#00ffee>

<?php
$n=12;
$m=92;
$matricula=$_POST["matricula"];
$periodo=$_POST["periodo"];
$turno=$_POST["turno"];
if($periodo==2014.1 & $turno=="manha"):
$ponteiro=fopen("calculo32014.csv","r");
else:
  if($periodo==2013.2 & $turno=="noite"):
  $ponteiro=fopen("calculo320132noite.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);
//$conteudo6=fgets($ponteiro,1600);
//$conteudo7=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 str_replace(";"," ","$conteudo6")."<br>";
echo "<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" 
align=\"center\" width=\"50%\" heigth=\"50%\">"; 
$conteudo6=fgets($ponteiro,1600);
$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=0;$j<=$n;$j++)
 {
if($matricula==$conteudaa[$i][2]):
/* 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>
