Location: PHPKode > projects > Kebec - Virtual University > sis/conft.php
<?
require("lib/pgsql.php");
require("lib/libs.php");

if(!pa_auth_user($user,$pass))
{
require("conf/header.php");

 echo "You Must Authenticate";
 exit;
};

require("lib/forms.php");
require("conf/header.php");
if($submitt=="VIEW") {
  pa_view_conf_turma($turma,&$tipo,&$data,&$peso,&$naval);
  }elseif($submitt=="DOIT"){
	$chec=1;
     for($i=0;$i<$naval;$i++)
	{
	$chec=$tipo[$i]*$data[$i]*$peso[$i]*$chec/1000;
	}
     if($chec!=0)
      {
     pa_conf_turma($turma,$tipo,$data,$peso,$naval);
	$msg=pa_lang("Done!");
	}else{
	$msg=pa_lang("Plese check the form");
	};
  };

?>
<script>
function pa_submit(ACT)
{
	var ACT;
	document.form1.submitt.value = ACT ;
	document.form1.submit();
}
</script>
<center><font color="red" size="4"><?=$msg;?></font></center>
<form name="form1" action="<?=$PHP_SELF;?>" method="post">
<?
formhidden("submitt","");
?>
<center>
<table>
<tr><td><?=pa_lang("Class:");?></td><td>
<?
$prof=pa_get_prof($user);
pa_html_select_turmas("turma",$turma,"OnChange='pa_submit(\"VIEW\");'","where tur_curso=cur_curso and tur_professor='$prof'");
?>
</td></tr>
<?
if($submitt=="VIEW" || $submitt=="DOIT" || $submitt=="VIEW1")
{
formtext(pa_lang("Number of Tests:"),"naval",$naval,5,5,0,1,0,"OnBlur='pa_submit(\"VIEW1\");'");
formbutton("submit_button",pa_lang("OK"),0,1,"right","OnClick='pa_submit(\"VIEW1\");'");
?>
</table><table>
<?
for($i=0;$i<$naval;$i++)
{
echo '<tr><td>'.pa_lang("Type:").'</td><td>';
pa_html_select("tipo[$i]","tava_id","tava_descr","tipo_avaliacoes",$tipo[$i]);
echo '</td>';
formtext(pa_lang("Date (DDMMYY):"),"data[$i]",$data[$i],6,6,0,0,0,  "");
formtext(pa_lang("Weight:"),"peso[$i]",$peso[$i],5,5,0,0,0,"");
echo '</tr>';
$set_but=1;
};
if($set_but)
{
formbutton("submit_button",pa_lang("OK"),0,1,"right","OnClick='pa_submit(\"DOIT\");'");
};
}; // fim do if($submitt=="VIEW")

?>
</table>
</center>
</form>
</body>
</html>
Return current item: Kebec - Virtual University