File: /home/panama/public_html_old/active.php
<?
include("include/config.php");
$db_sel = new database();
$pageid=6;
$db_sel->where("pageid=".$pageid);
$db_sel->selectstmt("cmspagemaster");
$pagetitle = $db_sel->f_pagetitle;
$pagemeta = $db_sel->f_pagemeta;
$pagemetadesc = $db_sel->f_pagemetadesc;
//$str_len=strlen($db_sel->f_pagedesc);
//if($str_len>1100)
//$description = substr($db_sel->f_pagedesc,0,1100)."...";
//else
$description = $db_sel->f_pagedesc;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="<?=$pagemetadesc?>" />
<meta name="keywords" content="<?=$pagemeta?>"/>
<title><?=SITE_TITLE."- Services - ".$pagetitle?></title>
<!-- Stylesheets -->
<link rel="stylesheet" type="text/css" href="styles.css"/>
<!-- Javascript -->
<!--[if IE 6]><script src="js/ie6.js"></script><![endif]-->
<link rel="stylesheet" href="css/dropdownmenu.css" type="text/css" />
<script type="text/javascript" src="js/dropdownmenu.js"></script>
<? include('includescript.php')?>
</head>
<body>
<? include("header.php") ?>
<div id="contentwrapper">
<div class="contentcontainer">
<div class="maincontainer">
<div class="servicesbannerwrapper"><img src="images/banner_services.jpg" width="958" height="178" alt=""/></div>
</div>
<div class="maincontainer">
<div class="servicetextwrapper">
<div class="title">
<div class="breadcrumbs">
<ul>
<li class="first"><span class="titleicons"><img src="images/icon_services.png" width="40" height="42" alt=""/></span> Services</li>
<li><?=$pagetitle?></li>
</ul>
</div>
</div>
<?php require_once ("include/ewconfig.php") ?>
<?php require_once ("include/db.php") ?>
<?php
require("include/class.phpmailer.php");
if (@$_GET["userid"] <> "")
{
$userid=@$_GET["userid"];
$afrom=@$_GET["from"];/*web Email active*/
$conn = phpmkr_db_connect(HOST, USER, PASS, DB, PORT);
MySQL_query("SET NAMES 'utf8'");
switch($afrom)
{
case "web":
$StrSel="select * From visa_user where userid=".$userid."";
$query = phpmkr_query($StrSel, $conn) or die("<font color='#FF0000'>ERROR: Failed to execute query at line " . __LINE__ . ": " . phpmkr_error($conn) . '<br>SQL: ' . $sSql."</font>");
?>
<div >
<p><font size="2">Activation Email has been sent to
your Email. Please Follow the activation Link active your
account. If you have not received the Email. Check your
Email Address or <a href='active.php?userid=<?php echo $userid ?>&from=resend'>resend it</a>.</font></p>
<p><font size="2">Thank you for apply!</font></div>
<?php
break;
case "email":
//active account
$StrUpdate="Update visa_user set active='Y' where userid=".$userid."";
$query = phpmkr_query($StrUpdate, $conn) or die("<font color='#FF0000'>ERROR: Failed to execute query at line " . __LINE__ . ": " . phpmkr_error($conn) . '<br>SQL: ' . $sSql."</font>");
?>
<div >
<p><font size="2">Your Account has been activated!
Please <a href='onlinevisa.php'>sign in</a>.</font></p>
<p><font size="2">Thank you for apply!</font></div>
<?php
break;
case "resend":
$StrSel="select * From visa_user where userid=".$userid."";
$query = phpmkr_query($StrSel, $conn) or die("<font color='#FF0000'>ERROR: Failed to execute query at line " . __LINE__ . ": " . phpmkr_error($conn) . '<br>SQL: ' . $sSql."</font>");
$rs = phpmkr_fetch_array($query);
$strEmail=$rs["username"];
$strFirstName=$rs["firstname"];
$strLastName=$rs["lastname"];
//resend Email to User Email
/*Send Email*/
$mail = new phpmailer();
$uniq_id = md5(uniqid(time()));
//$mail->SetLanguage('en', "language/");
$mail->IsSMTP();
$mail->IsHTML();
$mail->From = FROM_EMAIL;
$mail->FromName = FROM_NAME;
$mail->Host = EW_SMTPSERVER;
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = EW_SMTPSERVER_USERNAME; // SMTP username
$mail->Password = EW_SMTPSERVER_PASSWORD; // SMTP password
$mail->Subject="Panama Visa Service";
// HTML body
$body = "Hello <font size=\"4\">". $strFirstName ." ". $strLastName ."</font>, <p>";
$body .= "<i>Your</i> Account has been created.<p>";
$body .= "Please Follow Link to <a href='http://www.panamaemb.org.sg/active.php?userid=".$userid."&from=email'>active your account</a>.<br>";
$body .= "Please do not reply this Email.<br>";
$body .= "Sincerely, <br>";
$body .= "Panama Visa Service";
// Plain text body (for mail clients that cannot read HTML)
/*
$text_body = "Hello Eric Wang, \n\n";
$text_body .= "Your personal photograph to this message.\n\n";
$text_body .= "Sincerely, \n";
$text_body .= "phpmailer List manager";
*/
$mail->Body = $body;
$mail->AltBody = $text_body;
$mail->AddAddress($strEmail);
//$mail->AddStringAttachment($row["photo"], "YourPhoto.jpg");
if(!$mail->Send())
{
echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
}
// Clear all addresses and attachments for next loop
$mail->ClearAddresses();
$mail->ClearAttachments();
?>
<div >
<p><font size="2">Activation Email has been resent to
your Email. Please Follow the activation Link active your
account. If you have not received the Email. Check your
Email Address or <a href='active.php?userid=<?php echo $userid ?>&from=resend'>resend it</a>.</font></p>
<p><font size="2">Thank you for apply!</font></div>
<?php
break;
}
}
?>
</div>
<div class="servicesphotowrapper">
<div class="servicesphotocontainer">
<? include("right.php");?>
</div>
</div>
</div>
</div>
<? include('footer.php') ?>
</div>
</body>
</html>