<?php
$errmsg='';
$sucmsg='';

include('database.php');

//GET DETAILS FROM DB
if(isset($_GET["i"])){
	$applicant_id=$_GET["i"]; 
	$q = "Select * from gder_application where id=$applicant_id limit 1";
    $qry=mysqli_query($con, $q);
    $row=mysqli_fetch_assoc($qry);
    extract($row);
	//print_r($row);
	$myAppID = $id;
	$applicant_id = $id;
	$applicant_no = $memberNo;
	
	$q = "update gder_application set status='Submitted' where id=$applicant_id limit 1";
    $qry=mysqli_query($con, $q);
    
	if($qry){ echo '<script>alert("Form Submitted Successfully"); window.location = "index.php?page=preview"; </script>';}else{echo '<script>alert("Invalid Token"); history.back(); </script>';}
	
}else{
	echo '<script>alert("Invalid Token"); history.back(); </script>';
}
    
?>