<?	session_start();
require 'include/announcements.php'; // ITECHBIDS Configuration File
require 'include/itechbids.php'; // Server compatibility Patch
require 'include/calculate.php'; // Server compatibility Patch

	//$userid=$_GET['userid'];
	if($_GET['userid'])
    $userid=$_GET['userid'];
    else
    $userid=$_POST['userid'];
    
	$canValidate=$_POST['canValidate'];
	if($userid=='')
	{
	echo '<meta http-equiv="refresh" content="0;url=sorry.php">';
	exit();
	}
		?>
<?
        if($canValidate==1) 
	    { 
		$userid=$_POST['userid'];
		$vcode=trim($_POST['txtVcode']);
		$sql="select * from member_details where user_id=$userid";
		$result=mysql_query($sql);
		  if(mysql_num_rows($result) > 0) 
		     {
	     	       $row=mysql_fetch_array($result);
		           if($row['veri_code']==$vcode) 
		                {
                        if($row['verified']=='no'){
                        Referral_Registration($userid);
                        }
		                $up_query="update member_details set verified='yes' where user_id=$userid";
		                $up_result=mysql_query($up_query);
		                $status="<table align=center width='75%'><tr><td align=center>$lang_448<br><br>";
		                $status.="<font size=+1>$lang_532</font></td></tr></table>";
		                }
		            else
					    {
		                  $status="<table align=center width='75%'><tr><td align=center><font color=red>$lang_449</font></td></tr></table>";
						}
     				   }
			  
			}
	?>
	      <? require 'themes/verify.tpl';?>
  <?
	require 'templates/'.$tfold.'/footer.php';	
  ?>
   </td></tr>
   </table>
