<?php 
/*
##################################################################
#                       PHP 4&5 MySQL 4&5                        #
##################################################################
#           Copyright (c) 2004-2008 Armia Systems Inc            #
##################################################################
#               This file is part of Cybermatch site             #
##################################################################
#    Developed By: simi (simi@armia.com)                         #

##################################################################
#               Developed On:   03-23-2009                       #
##################################################################
#               Modified By:                                     #
##################################################################
#               Modified On:                                     #
##################################################################
# This script may not be distributed, sold, given away for free  #
# to third party, or used as a part of any internet services 	 #
# such as webdesign etc.                                         #
##################################################################
*/

require_once ("config.inc.php");
require_once ("includes/mysql.inc.php");
require_once ("classes/userside.class.php");
require_once ("classes/misc.class.php");
$message	= "";
$code		= isset($_REQUEST['code'])	?	stripslashes(trim($_REQUEST['code']))	:	"";
$mail		= "";
$script		= "";

if (!$objDB) {
	$message	= "Unable to Locate Database Server.";
} else {
	$_SESSION['triedpage']	= "";
	$objU		= new userside($objDB);
        $objM		= new misc($objDB);
	if (isset($_POST['APN'])) {
		$message	= $objU->email_approval($_POST);
		if ($message == "") {
			//$message	= "<font color='green'>You have successfully activated your account</font>. Please click <a href='login.php'>here</a> to login now.<br>";
		
                $message	= $objM->login($_POST);
		if ($message == "") {
		//echo $_SESSION['triedpage'];
			if (isset($_SESSION['triedpage']) AND $_SESSION['triedpage'] <> "")
				header("Location: ".$_SESSION['triedpage']);
			else
                        {
                            if(isset($_SESSION['searchPOST']))
                                header("Location:search_profiles.php");
                            else
                                header("Location: myprofile.php");
                            exit;
                        }
		}
                        
                        
                        
                }
	}
	$script		= $objU->get_script($message);
	$message	= $objU->remove_script($message);
}

include_once ("title.inc.php");
include_once ("tophtml.inc.php");
?>

<div class="row">
	<div class="eight columns">
		<div class="search-rslts">
			<div class="row"><div class="inenr-hd"><h2>Email Approval</h2></div></div>
			<div class="row">
				<h2 class="headings2">Please enter following details</h2>
			</div>
			<div class="row">
				<form name="frmTell" method="post" action="<?php echo $_SERVER['PHP_SELF']?>" onSubmit="return validate();">
					<div class="newdesignforinput maintext1">
						<?php if(isset($message) && trim($message)!='')
							  {
						?>
						<div class="full_row">
							<div class="maintext1 warning"><?php echo $message;?></div>
						</div>
						<?php }//end if?>
                    
											
						<div class="full_row">
							<div class="three columns">Username</div>
							<div class="five columns margin_R_200">
								<input name="user" type="text" class="textbox" size="25" maxlength="100">
							</div>
						</div>
						
						<div class="full_row">
							<div class="three columns">Password</div>
							<div class="five columns margin_R_200">
								<input name="pass" type="password" class="textbox " size="25" maxlength="100">
							</div>
						</div>
						
						<div class="full_row">
							<div class="three columns">&nbsp;</div>
							<div class="five columns margin_R_200">
								<input name="APN" type="submit" class="loginbutton" value="Approve Now"><input type="hidden" name="code" value="<?php echo $code?>">
							</div>
						</div>
						
					</div>
				</form>
				<div id="hide"><?php echo $script?></div>
			</div>
		</div>
	</div>
	<div class="four columns right search_result_R">
		<?php include_once ("left.inc.php");?>
	</div>
</div>

<?php include_once('bottomhtml.inc.php');?>
