<?

include("../includes/site_config.php");
include('../session_handler.inc');
include_once('../lib/lib.Functions.php');

include_once __INCLUDE_CLASS_PATH."/class.ItemManager.php";


$option_manager = new OptionManager();
$email_confirm=$option_manager->GetValue('email_confirm');
$CONST_MAIL = $option_manager->GetValue('mail'); 


if (isset($_REQUEST['mem'])) {
	 $userid=$_REQUEST['mem'];

$result=mysql_query("SELECT * FROM members WHERE mem_userid=$userid") or die(mysql_error());
$sql_user=mysql_fetch_object($result) or die('CANT FETCH');

$confirm_url = $CONST_LINK_ROOT.($is_speeddating?"/speeddating":"")."/confirm.php?id=".md5($sql_user->mem_userid);
//$confirm_url="wazzum.com/dating_demo";
    $data['UserName'] = $sql_user->mem_username;
    $data['Password'] = $sql_user->mem_password;
    $data['ConfirmUrl'] = $confirm_url;
    $data['CompanyName'] = $CONST_COMPANY;
    $data['Url'] = $CONST_URL;
    $data['SupportEmail'] = $CONST_SUPPMAIL;
   //echo $m_template = 'Welcome_Mail_Activate';
   $m_template = ($email_confirm == 'Y') ? 'Welcome_Mail_Activate' : 'Welcome_Mail';
   
   
    list($type,$message) = getTemplateByName($m_template,$data,getDefaultLanguage($sql_user->mem_userid));



	send_mail ("$sql_user->mem_email", "$CONST_MAIL", PRGPROFILE_WELCOME." $CONST_COMPANY!", "$message", $type, "ON");
} 
?>
<html>
<head>
<meta http-equiv="Content-Language" content="en-gb">
<meta http-equiv="Content-Type" content="text/html; charset=<?=$CONST_LANG_CHARSET?>">
<title><?=RESEND_CONFIRM?></title>
<LINK REL='StyleSheet' type='text/css' href='<?echo $CONST_LINK_ROOT?>/singles.css'>
</head>
<body>
<table width=100% border=0 cellpadding="5" cellspacing="0" class="poptable">
  <tr>
		<td align=center><?=RESEND_CONFIRM_TEXT?></td>
	</tr>
	<tr>
		<td align=center><a href="#" onClick="javascript:window.close()"><?php echo GENERAL_CLOSE ?></a></td>
	</tr>
</table>
</body>

</html>
