      <?php

  $operacao=$_POST["operacao"];
  include "conecta_mysql.php";
  include "function_cpf.inc";
  $nome=$_POST["nome"];
  $matricula=$_POST["matricula"];
  $Nota1=$_POST["Nota1"];
  $Nota2=$_POST["Nota2"];
  $Nota3=$_POST["Nota3"];
  $PFinal=$_POST["PFinal"];
  //$Falta=$_POST["Falta"];
  //$MediaF=$_POST["MediaF"];
  $Falta=$_POST["Falta"];
 
  $sqlinf="INSERT INTO seriesedom2009 (nome, matricula, Falta)   VALUES";
  $sqlinf .="('$nome','$matricula','$Falta')";
  $resinf=mysql_query($sqlinf);
  
  if(!empty($Nota1))
  {
  $sqlinf="update seriesedom2009 set Nota1=$Nota1 where matricula=$matricula";
  $resinf=mysql_query($sqlinf);
  }
  if(!empty($Nota2))
  {
  $sqlinf="update seriesedom2009 set Nota2=$Nota2 where matricula=$matricula";
  $resinf=mysql_query($sqlinf);
  }
  if(!empty($Nota3))
  {
   $sqlinf="update seriesedom2009 set Nota3=$Nota3 where matricula=$matricula";
  $resinf=mysql_query($sqlinf);
  }
  
  if(!empty($PFinal))
  {
  $sqlinf="update seriesedom2009 set PFinal=$PFinal where matricula=$matricula";
  $resinf=mysql_query($sqlinf);
  }
   if(!empty($Falta))
  {
  $sqlinf="update seriesedom2009 set Falta=$Falta where matricula=$matricula";
  $resinf=mysql_query($sqlinf);
  }
//echo "Nota2=$Nota2";
echo "Inscri&ccedil&atildeo feita com sucesso!";
  
  mysql_close($conexao);
?>
  