<?php

 include('include/headscript.php'); ?>

<?php 

// pickup the get variable





if (isset($_GET["idtrf"])) {

	$idtrf=$_GET["idtrf"]; }

?>

<?php



$trfnumberfinal = new WA_MySQLi_RS("trfnumberfinal",$cmctrfdb,1);

$trfnumberfinal->setQuery("SELECT * FROM `trf-details` WHERE `trf-details`.idtrfdetails='$idtrf'");

$trfnumberfinal->execute();

	$idcertn=$trfnumberfinal->getColumnVal("idcertification");



?>

<?php

if (true) {

  $UpdateQuery = new WA_MySQLi_Query($cmctrfdb);

  $UpdateQuery->Action = "update";

  $UpdateQuery->Table = "`trf-details`";

  $UpdateQuery->bindColumn("idcertification", "i", "$idcertificate", "WA_DEFAULT");

  $UpdateQuery->addFilter("idtrfdetails", "=", "i", "".($idtrf)  ."");

  $UpdateQuery->execute();

  $UpdateGoTo = "";

  if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo?rel2abs($UpdateGoTo,dirname(__FILE__)):"";

  $UpdateQuery->redirect($UpdateGoTo);

}

?>

<?php //redirect based on certificate

if ($idcertificate==1) { header("location: typeofcertificate1.php?idcertificate=$idcertificate&idtrf=$idtrf"); } 

if ($idcertificate==2) { header("location: typeofcertificate2.php?idcertificate=$idcertificate&idtrf=$idtrf"); } 

if ($idcertificate==3) { header("location: typeofcertificate3.php?idcertificate=$idcertificate&idtrf=$idtrf"); } 

if ($idcertificate==4) { header("location: typeofcertificate4.php?idcertificate=$idcertificate&idtrf=$idtrf"); } 

if ($idcertificate==5) { header("location: typeofcertificate5.php?idcertificate=$idcertificate&idtrf=$idtrf"); } 

if ($idcertificate==6) { header("location: typeofcertificate6.php?idcertificate=$idcertificate&idtrf=$idtrf"); } 

if ($idcertificate==7) { header("location: typeofcertificate7.php?idcertificate=$idcertificate&idtrf=$idtrf"); } 



?>

