<?php ob_start(); 
error_reporting(0);
(@include ('./dt_page/common.php')) or die("<p style='font-family:Arial, Helvetica, sans-serif; margin-top:80px; font-size:16px; line-height:180%; letter-spacing:2px;' align='center'><img src='https://primadesain.com/images/block.png' width='90' height='90' /></br></br>Database failed, you can not access this script.<br>Please contact us to fix this error.<br><strong><a href='http://www.primadesain.com'>www.primadesain.com</a></strong></p><br><p style='font-family:Arial, Helvetica, sans-serif; margin-top:30px; font-size:12px; line-height:180%; letter-spacing:2px;' align='center'>&copy; 2009 - ".date("Y")." www.primadesain.com</p>");
(@include ('./dt_page/classMySQL.php')) or die("<p style='font-family:Arial, Helvetica, sans-serif; margin-top:80px; font-size:16px; line-height:180%; letter-spacing:2px;' align='center'><img src='https://primadesain.com/images/block.png' width='90' height='90' /></br></br>System failed, you can not access this script.<br>Please contact us to fix this error.<br><strong><a href='http://www.primadesain.com'>www.primadesain.com</a></strong></p><br><p style='font-family:Arial, Helvetica, sans-serif; margin-top:30px; font-size:12px; line-height:180%; letter-spacing:2px;' align='center'>&copy; 2009 - ".date("Y")." www.primadesain.com</p>");
$db = new db_mysql($server_name, $userdb, $passdb, $databasename,"");
(@include ('./dt_page/function.php')) or die("<p style='font-family:Arial, Helvetica, sans-serif; margin-top:80px; font-size:16px; line-height:180%; letter-spacing:2px;' align='center'><img src='https://primadesain.com/images/block.png' width='90' height='90' /></br></br>Function failed, you can not access this script.<br>Please contact us to fix this error.<br><strong><a href='http://www.primadesain.com'>www.primadesain.com</a></strong></p><br><p style='font-family:Arial, Helvetica, sans-serif; margin-top:30px; font-size:12px; line-height:180%; letter-spacing:2px;' align='center'>&copy; 2009 - ".date("Y")." www.primadesain.com</p>");
(@include ('./dt_page/affiliate.php')) or die("<p style='font-family:Arial, Helvetica, sans-serif; margin-top:80px; font-size:16px; line-height:180%; letter-spacing:2px;' align='center'><img src='https://primadesain.com/images/block.png' width='90' height='90' /></br></br>Refferal system failed, you can not access this script.<br>Please contact us to fix this error.<br><strong><a href='http://www.primadesain.com'>www.primadesain.com</a></strong></p><br><p style='font-family:Arial, Helvetica, sans-serif; margin-top:30px; font-size:12px; line-height:180%; letter-spacing:2px;' align='center'>&copy; 2009 - ".date("Y")." www.primadesain.com</p>");


if ($regpublic == 1){

if($lang == 1){
include("./dt_page/langid.php");
}else{
include("./dt_page/langen.php");
}
require_once('./dt_page/class.phpmailer.php');
include("./dt_page/class.smtp.php");

if ($blockie == 1 && preg_match("/MSIE/",getenv("HTTP_USER_AGENT")) ||
preg_match("/Internet Explorer/",getenv("HTTP_USER_AGENT"))) {
include ('./block_ie.php');
exit;
}   
?>
<!DOCTYPE html>
<!--[if IE 8]>
<html lang="en" class="ie8"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<head>
    <meta charset="utf-8"/>
    <meta name="author" content="<?php echo WEB_DOMAIN; ?>"/>
    <meta name="description" content="<?php echo WEB_DESC; ?>" />
    <meta name="keywords" content="<?php echo WEB_KEYWORDS; ?>" />
	<title>Signup - <?php echo WEB_TITLE; ?></title>
    <link href="images/banner/<?php echo WEB_FAVCONS; ?>" rel="SHORTCUT ICON" /><!--favicon-->
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"/>

    <!-- ================== BEGIN BASE CSS STYLE ================== -->
    <link href="themes/assets/plugins/jquery-ui/themes/base/minified/jquery-ui.min.css" rel="stylesheet"/>
    <link href="themes/assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
    <link href="themes/assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet"/>
    <link href="themes/assets/css/animate.min.css" rel="stylesheet"/>
    <link href="themes/assets/css/style.min.css" rel="stylesheet"/>
    <link href="themes/assets/css/style-responsive.min.css" rel="stylesheet"/>
    <link href="themes/assets/css/theme/default.css" rel="stylesheet" id="theme"/>
    <!-- ================== END BASE CSS STYLE ================== -->

    <!-- ================== BEGIN PAGE LEVEL STYLE ================== -->
	<link rel="stylesheet" href="themes/assets/build/css/intlTelInput.css"> 
    <!-- ================== END PAGE LEVEL STYLE ================== -->

    <!-- ================== BEGIN BASE JS ================== -->
    <script src="themes/assets/plugins/pace/pace.min.js"></script>
	<script src='https://www.google.com/recaptcha/api.js'></script>
    <!-- ================== END BASE JS ================== -->
</head>
<body class="pace-top bg-white">
<!-- begin #page-loader -->
<div id="page-loader" class="fade in"><span class="spinner"></span></div>
<!-- end #page-loader -->

<!-- begin #page-container -->
<div id="page-container" class="">
    <!-- begin register -->
    <div class="register register-with-news-feed">
        <!-- begin news-feed -->
        <div class="news-feed">
            <div class="news-image">
                <img src="themes/assets/img/login-bg/lg_bg.jpg" alt="">
            </div>
        </div>
        <!-- end news-feed -->
        <!-- begin right-content -->
        <div class="right-content">
            <!-- begin register-header -->
            <h1 class="register-header" style="font-size:24px;">
                Sign Up
                <small>Create your <?php echo WEB_NAME; ?> Account.</small>
            </h1>
            <!-- end register-header -->
            <!-- begin register-content -->
            <div class="register-content">
            
            
            
            
            
             <?php

if(isset($_POST['submitreg'])){	
	
 
	
$sponsore = anti_injection($_POST['sponsore']);
$usernamed = str_replace(' ', '', $_POST['username']);	
$username = anti_injection($usernamed);	


 
$_SESSION["namae"] = anti_injection($_POST["name"]);
$_SESSION["passworde"] = $_POST["password"];
$_SESSION["passworde2"] = $_POST["password_confirmation"];
$_SESSION["emaile"] = anti_injection($_POST["email"]);
$_SESSION["username"] = anti_injection($_POST["username"]);	
$_SESSION["phone"] = anti_injection($_POST["phone"]);
$_SESSION["country"] = anti_injection($_POST["country"]);


if(!ctype_alnum($usernamed)){
header('location: signup.php?result=alnum');	
	exit;
}else{ 


$country = anti_injection($_POST['country']);	
$phone = anti_injection($_POST['phone-full']);	
$phonex = anti_injection($_POST['phone']);	
$negara=codeToCountryName($country);
$hp = $phone;
$_SESSION["countrynya"] = $negara;

$nama = anti_injection($_POST['name']);
$email = anti_injection($_POST['email']);
$phone = anti_injection($_POST['phone']);
$password1 = anti_injection($_POST['password']);
$password2 = anti_injection($_POST['password_confirmation']);
$cid = anti_injection($_POST['cid']);

if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
header("location: signup.php?result=email_not_valid");
	exit;
} else {
	

if($password1 <> $password2){
header("location: signup.php?result=pass_err");
exit;
} else {	

$pin = substr(str_shuffle(str_repeat("44531411190667642037112717497783625536342396411241472162223777", 64)), 0, 5);


$sql_sp3 = mysql_query("select username from member where username='".mysql_real_escape_string($sponsore)."' and status=1");
$ada_sp3 = mysql_num_rows($sql_sp3);
if(!$ada_sp3){
header("location: signup.php?result=wrong_sponsor");
exit;
} else {	

$sql_sp32 = mysql_query("select accid from member where accid='".mysql_real_escape_string($cid)."'");
$ada_sp32 = mysql_num_rows($sql_sp32);
if($ada_sp32 > 0){
$sqlckid=mysql_query("select accid from member where accid like '".$cptidne."%' order by id desc");
		if(mysql_num_rows($sqlckid) > 0) {
		$mbrckid = mysql_fetch_row($sqlckid);
		$lastck_id = substr($mbrckid[0], -6);
		} else {
		$lastck_id = $lastidne;
		}		
		$kodecid = $cptidne;
		$newc_id = ($lastck_id + 1);
		$newc_id2 = $kodecid.$newc_id;
		$ccidne = $newc_id2;		
}else{
$ccidne = $cid;
}





$upline = spillover("random", $sponsore);
$posisi = spillover("pos", $sponsore);
$level = $db->dataupline("level", $upline);


 $upline0= $db->dataupline("upline0", $upline);
		$upline1= $db->dataupline("upline1", $upline);
		$upline2= $db->dataupline("upline2", $upline);
		$upline3= $db->dataupline("upline3", $upline);
		$upline4= $db->dataupline("upline4", $upline);
		$upline5= $db->dataupline("upline5", $upline);
		$upline6= $db->dataupline("upline6", $upline);
		$upline7= $db->dataupline("upline7", $upline);
		$upline8= $db->dataupline("upline8", $upline);
		$upline9= $db->dataupline("upline9", $upline);
		$upline10= $db->dataupline("upline10", $upline);
		$upline11= $db->dataupline("upline11", $upline);
		$upline12= $db->dataupline("upline12", $upline);
		$upline13= $db->dataupline("upline13", $upline);
		$upline14= $db->dataupline("upline14", $upline);
		$upline15= $db->dataupline("upline15", $upline);
		$upline16= $db->dataupline("upline16", $upline);
		$upline17= $db->dataupline("upline17", $upline);
		$upline18= $db->dataupline("upline18", $upline);
		$upline19= $db->dataupline("upline19", $upline);
		$upline20= $db->dataupline("upline20", $upline);
		$upline21= $db->dataupline("upline21", $upline);
		$upline22= $db->dataupline("upline22", $upline);
		$upline23= $db->dataupline("upline23", $upline);
		$upline24= $db->dataupline("upline24", $upline);
		$upline25= $db->dataupline("upline25", $upline);
		$upline26= $db->dataupline("upline26", $upline);
		$upline27= $db->dataupline("upline27", $upline);
		$upline28= $db->dataupline("upline28", $upline);
		$upline29= $db->dataupline("upline29", $upline);
		$upline30= $db->dataupline("upline30", $upline);
		$upline31= $db->dataupline("upline31", $upline);
		$upline32= $db->dataupline("upline32", $upline);
		$upline33= $db->dataupline("upline33", $upline);
		$upline34= $db->dataupline("upline34", $upline);
		$upline35= $db->dataupline("upline35", $upline);
		$upline36= $db->dataupline("upline36", $upline);
		$upline37= $db->dataupline("upline37", $upline);
		$upline38= $db->dataupline("upline38", $upline);
		$upline39= $db->dataupline("upline39", $upline);
		$upline40= $db->dataupline("upline40", $upline);
		$upline41= $db->dataupline("upline41", $upline);
		$upline42= $db->dataupline("upline42", $upline);
		$upline43= $db->dataupline("upline43", $upline);
		$upline44= $db->dataupline("upline44", $upline);
		$upline45= $db->dataupline("upline45", $upline);
		$upline46= $db->dataupline("upline46", $upline);
		$upline47= $db->dataupline("upline47", $upline);
		$upline48= $db->dataupline("upline48", $upline);
		$upline49= $db->dataupline("upline49", $upline);
		$upline50= $db->dataupline("upline50", $upline);
		$upline51= $db->dataupline("upline51", $upline);
		$upline52= $db->dataupline("upline52", $upline);
		$upline53= $db->dataupline("upline53", $upline);
		$upline54= $db->dataupline("upline54", $upline);
		$upline55= $db->dataupline("upline55", $upline);
		$upline56= $db->dataupline("upline56", $upline);
		$upline57= $db->dataupline("upline57", $upline);
		$upline58= $db->dataupline("upline58", $upline);
		$upline59= $db->dataupline("upline59", $upline);
		$upline60= $db->dataupline("upline60", $upline);
	    $upline61= $db->dataupline("upline61", $upline);
		$upline62= $db->dataupline("upline62", $upline);
		$upline63= $db->dataupline("upline63", $upline);
		$upline64= $db->dataupline("upline64", $upline);
		$upline65= $db->dataupline("upline65", $upline);
		$upline66= $db->dataupline("upline66", $upline);
		$upline67= $db->dataupline("upline67", $upline);
		$upline68= $db->dataupline("upline68", $upline);
		$upline69= $db->dataupline("upline69", $upline);
		$upline70= $db->dataupline("upline70", $upline);
		$upline71= $db->dataupline("upline71", $upline);
		$upline72= $db->dataupline("upline72", $upline);
		$upline73= $db->dataupline("upline73", $upline);
		$upline74= $db->dataupline("upline74", $upline);
		$upline75= $db->dataupline("upline75", $upline);
		$upline76= $db->dataupline("upline76", $upline);
		$upline77= $db->dataupline("upline77", $upline);
		$upline78= $db->dataupline("upline78", $upline);
		$upline79= $db->dataupline("upline79", $upline);
		$upline80= $db->dataupline("upline80", $upline);
	    $upline81= $db->dataupline("upline81", $upline);
		$upline82= $db->dataupline("upline82", $upline);
		$upline83= $db->dataupline("upline83", $upline);
		$upline84= $db->dataupline("upline84", $upline);
		$upline85= $db->dataupline("upline85", $upline);
		$upline86= $db->dataupline("upline86", $upline);
		$upline87= $db->dataupline("upline87", $upline);
		$upline88= $db->dataupline("upline88", $upline);
		$upline89= $db->dataupline("upline89", $upline);
		$upline90= $db->dataupline("upline90", $upline);
		$upline91= $db->dataupline("upline91", $upline);
		$upline92= $db->dataupline("upline92", $upline);
		$upline93= $db->dataupline("upline93", $upline);
		$upline94= $db->dataupline("upline94", $upline);
		$upline95= $db->dataupline("upline95", $upline);
		$upline96= $db->dataupline("upline96", $upline);
		$upline97= $db->dataupline("upline97", $upline);
		$upline98= $db->dataupline("upline98", $upline);
		$upline99= $db->dataupline("upline99", $upline);
		$upline100= $db->dataupline("upline100", $upline);


	$db->select("username", "member", "username='$username'");
	$chkd_user = $db->num_rows();
	
if ($chkd_user!= "") {
	 	header("location: signup.php?result=wrong_user");
exit;
} else {
	
	$usernames = strtolower($username);
if ($usernames== "admin" || $usernames== "administrator" || $usernames== "pengelola") {
	 	header("location: signup.php?result=restrict_user");
exit;
} else {	
	
	
$cekhpmaile = mysql_query("select email from member where email='".mysql_real_escape_string($email)."'");
$ada_maile = mysql_num_rows($cekhpmaile); //---flush out hari ini
if ($mail_batase > 0 && $ada_maile >= $mail_batase) {
header("location: signup.php?result=wrong_email");
exit;
}else{
$cekhpmaile2 = mysql_query("select hp from member where hp='".mysql_real_escape_string($hp)."'");
$ada_maile2 = mysql_num_rows($cekhpmaile2); //---flush out hari ini
if ($hp_batase > 0 && $ada_maile2 >= $hp_batase) {
header("location: signup.php?result=wrong_hp");
exit;
}else{
$cekbanke = mysql_query("select bnkcek from member where bnkcek='".mysql_real_escape_string($bankcek)."'");
$ada_banke = mysql_num_rows($cekbanke); //---flush out hari ini
if ($bank_batase > 0 && $ada_banke >= $bank_batase) {
header("location: signup.php?result=wrong_bank");	
exit;
}else{	
	
//---------masukkan data new member ke dalam database---------------
	//$db->select("id", "tree", "username='$sponsore'");
		$pass=md5($password1);
        $pins=md5($pin);
		$levele = $level + 1;
		if($levele > 100){
		$levele = "100";
		}
		
		

$stmpkodene = substr(str_shuffle(str_repeat("4453B141119A06676420371LPMBTEFWX112D8717497783C6255363423ABCYWTGEHDLPMBTEFWXVU96411241472162223777", 64)), 0, 12);
$stkodexx = substr(str_shuffle(str_repeat("4453B141119A06676420371112D8717497783C6255363423ABCYWTGEHDLPMBTEFWXVU96411241472162223777", 64)), 0, 10);

$db->insert("member", "", "'', '".mysql_real_escape_string($username)."', '$pass', '$nama', '$sponsore', '$upline', '".mysql_real_escape_string($email)."', '', '', '', '', '".mysql_real_escape_string($phone)."', '', '', '".$_SERVER['REMOTE_ADDR']."', '', '', '$clientdate', '$clientdate', '1', '', '0', '0','','','','','".mysql_real_escape_string($negara)."','','$sponsore','$stmpkodene','','$country','', '', '$ccidne','','','','', ''");


$db->insert("acc", "", "'', '$username', '$password1', '$pin'");
$db->insert("pincode", "", "'', '$username', '$pins', '1', '$clientdate', '', ''");
$db->insert("ewalet", "", "'', '$username', '$pass', '$clientdate', '1', '', '$ccidne'");

		
		$db->insert("upline", "", "'', '".mysql_real_escape_string($username)."', '$sponsore', '$posisi', '$L1', '$L2', '', '', '', '', '', '', '', '', '$upline', '$upline0', '$upline1', '$upline2', '$upline3', '$upline4', '$upline5', '$upline6', '$upline7', '$upline8', '$upline9', '$upline10', '$upline11', '$upline12', '$upline13', '$upline14', '$upline15', '$upline16', '$upline17', '$upline18', '$upline19', '$upline20', '$upline21', '$upline22', '$upline23', '$upline24', '$upline25', '$upline26', '$upline27', '$upline28', '$upline29', '$upline30', '$upline31', '$upline32', '$upline33', '$upline34', '$upline35', '$upline36', '$upline37', '$upline38', '$upline39', '$upline40', '$upline41', '$upline42', '$upline43', '$upline44', '$upline45', '$upline46', '$upline47', '$upline48', '$upline49', '$upline50', '$upline51', '$upline52', '$upline53', '$upline54', '$upline55', '$upline56', '$upline57', '$upline58', '$upline59', '$upline60', '$upline61', '$upline62', '$upline63', '$upline64', '$upline65', '$upline66', '$upline67', '$upline68', '$upline69', '$upline70', '$upline71', '$upline72', '$upline73', '$upline74', '$upline75', '$upline76', '$upline77', '$upline78', '$upline79', '$upline80', '$upline81', '$upline82', '$upline83', '$upline84', '$upline85', '$upline86', '$upline87', '$upline88', '$upline89', '$upline90', '$upline91', '$upline92', '$upline93', '$upline94', '$upline95', '$upline96', '$upline97', '$upline98', '$upline99', '$levele', '0', '0', '0', '1'");
	if($posisi == "L1") {
			$db->update("upline", "L1='".mysql_real_escape_string($username)."'", "username='".mysql_real_escape_string($upline)."'");
		} elseif($posisi == "L2") {
			$db->update("upline", "L2='".mysql_real_escape_string($username)."'", "username='".mysql_real_escape_string($upline)."'");
			
		}	
		
//$angkaunik = substr(str_shuffle(str_repeat("12365478985823641257846982357418965", 24)), 0, 3);
//$expired = date('Y-m-d H:i:s', strtotime("+".$batastransfere." minutes"));	
	
//$db->insert("dataewalet3", "", "'', '$stmpkodene', '$username', '$biaya', '', '$clientdate', '$expired', '0', '$produk', '$myproduk', '$profite', '$angkaunik', '$priode', '$siklus'");

	
//$db->insert("notifikasi", "", "'', '$username', 'Registrasi', '', '', 'Make deposit payment package you choose, amount ".rupiah($amount)."', '$clientdate', 'label label-sm label-icon label-info', 'fa fa-info', '0', '$stmpkodene'");



$db->aktivasi($username);
$tgl = formatgl($clientdate);

$spnsnama = $db->dataku("nama", $sponsore);
$spnsmail = $db->dataku("email", $sponsore);

if($hp){
$isipesan = "Hello ".$nama.", Your login details, Username: ".$username.", Password: ".$password1.", PIN: ".$pin.".";
	mysql_query("insert into outbox values('', '', '$username', '$hp', '$isipesan', '$clientdate', '1')");
	if($smsgtw == 1 && $jsms == 1){
	$hpne = preg_replace('/\D+/', '', $hp);
	$sms = new smsreguler();
	$sms->username = $userkey;
		$sms->password = $passkey;
		$sms->apikey   = $apikey;
		$sms->setTo($hpne);
		$sms->setText($isipesan);
		$sms->smssend();
	}else if($smsgtw == 1 && $jsms == 2){
	$hpne = preg_replace('/\D+/', '', $hp);
	$sms = new smsmasking();
	$sms->username = $userkey;
		$sms->password = $passkey;
		$sms->apikey   = $apikey;
		$sms->setTo($hpne);
		$sms->setText($isipesan);
		$sms->smssend();
	}else if($smsgtw == 2){
	sendsms($hp, $isipesan) ;
	}else{}
}


$tt = date('d-m-Y', strtotime($clientdate));
$jame = date('H:i', strtotime($clientdate));

$tkk = date('d-m-Y-H-i-s', strtotime($clientdate));
$tokens = md5(md5(date("Y-m-d H:i:s")));
$stmpkode = strtotime(date("Y-m-d H:i:s"));
	
$isimail1="<a href='http://".$domain."'><img src='".$logoinvoice."' style='display:inline;outline-style:none;text-decoration:none;' /></a><br><br><br>
<p>Hello ".$nama_bisnis.",</p>
<p>Someone has signed up at ".$bisnisname.".</p>

<p>
Username : ".$username."<br>
Name : ".$nama."<br>
Phone : ".$phone."<br>
Email : ".$email."<br>
Password : ".$password1."<br>
PIN : ".$pin."<br>
Wallet ID : ".$ccidne."
</p>
<p>
<strong>Network:</strong><br>
Sponsor : ".$sponsore."<br>
Upline : ".$upline."
</p>

<p>
Date Register : ".$tgl."
</p>

<p><br><br><br>
Regards,<br>
<b>".$bisnisname."</b><br>
".$domain."<br>".$emailadmin."<br>".$hpadmin."</p>";
	   
	    $mail1 = new PHPMailer;
		if($smaile == 1){	
//$mail1->IsSMTP(); // telling the class to use SMTP
$mail1->Host       = $smtphost; // SMTP server
$mail1->SMTPAuth   = true;                  // enable SMTP authentication
$mail1->Host       = $smtphost; // sets the SMTP server
$mail1->Port       = $smtport;                    // set the SMTP port for the GMAIL server
$mail1->Username   = $smtpuser; // SMTP account username
$mail1->Password   = $smtpass;        // SMTP account password
}
        $mail1->setFrom($email, $nama);
        $mail1->addAddress($emailadmin, $nama_bisnis);
	    $mail1->IsHTML(true);       
        $mail1->Subject = ''.$nama_bisnis.', New signup at '.$bisnisname.'';
        $mail1->msgHTML($isimail1);
        $mail1->send();	
	
	
	
	$isimail2="<a href='http://".$domain."'><img src='".$logoinvoice."' style='display:inline;outline-style:none;text-decoration:none;' /></a><br><br><br>
<p>Hello ".$nama.",</p>
<p>Thank you for signed up at ".$bisnisname.".</p>

<p>
Username : ".$username."<br>
Name : ".$nama."<br>
Phone : ".$phone."<br>
Email : ".$email."<br>
Password : ".$password1."<br>
PIN : ".$pin."<br>
Wallet ID : ".$ccidne."
</p>
<p>
<strong>Network:</strong><br>
Sponsor : ".$sponsore."<br>
Upline : ".$upline."
</p>

<p>
Date Register : ".$tgl."
</p>

<p><br><br><br>
Regards,<br>
<b>".$bisnisname."</b><br>
".$domain."<br>".$emailadmin."<br>".$hpadmin."</p>";
	   
	    $mail2 = new PHPMailer;
		if($smaile == 1){	
//$mail2->IsSMTP(); // telling the class to use SMTP
$mail2->Host       = $smtphost; // SMTP server
$mail2->SMTPAuth   = true;                  // enable SMTP authentication
$mail2->Host       = $smtphost; // sets the SMTP server
$mail2->Port       = $smtport;                    // set the SMTP port for the GMAIL server
$mail2->Username   = $smtpuser; // SMTP account username
$mail2->Password   = $smtpass;        // SMTP account password
}
        $mail2->setFrom($emailadmin, $nama_bisnis);
        $mail2->addAddress($email, $nama);
	    $mail2->IsHTML(true);       
        $mail2->Subject = ''.$nama.', your signup at '.$bisnisname.'';
        $mail2->msgHTML($isimail2);
        $mail2->send();	
	
	
unset($_SESSION['namae']);
unset($_SESSION['emaile']);
unset($_SESSION["phone"]);
unset($_SESSION["username"]);
unset($_SESSION["passworde"]);
unset($_SESSION["passworde2"]);


header("location: login.php?result=successreg&n=".$nama."&u=".$username."&p=".$password1."");

exit;

}
}
}
}
}
}
}
}
}



} else {
?>
  
    <?php
$results = $_GET['result'];
if($results == "pass_err") { 
echo "<div class='alert alert-danger'>Password not match!</div>";
}
?>   
    <?php
$results = $_GET['result'];
if($results == "alnum") { 
echo "<div class='alert alert-danger'>Use username only leters and numbers!</div>";
}
?>      
<?php
$results = $_GET['result'];
if($results == "restrict_user") { 
echo "<div class='alert alert-danger'>Use another username!</div>";
}
?>

<?php
$results = $_GET['result'];
if($results == "wrong_email") { 
echo "<div class='alert alert-danger'>Email already registered!</div>";
}
?>
<?php
$results = $_GET['result'];
if($results == "wrong_hp") { 
echo "<div class='alert alert-danger'>Mobile Number already registered!</div>";
}
?>
<?php
$results = $_GET['result'];
if($results == "wrong_sponsor") { 
echo "<div class='alert alert-danger'>Sponsor Not Found!</div>";
}
?>
<?php
$results = $_GET['result'];
if($results == "wrong_user") { 
echo "<div class='alert alert-danger'>Username already registered!</div>";
}
?>
    <?php
$results = $_GET['result'];
if($results == "email_not_valid") { 
echo "<div class='alert alert-danger'>Email not valid!</div>";
}
?> 
    <?php
$results = $_GET['result'];
if($results == "err_phone") { 
echo "<div class='alert alert-danger'>Phone number not valid!</div>";
}
?> 
		<?php
if(isset($_GET['result'])&&$_GET['result']=="wrong_captcha"){
echo "<div class='alert alert-danger'>Wrong Captcha!</div>";
}
?>	
<?php $session_sponsore = $_SESSION["sponsor"];
		
		$sql_sp3xx = mysql_query("select username from member where username='".$session_sponsore."' and status=1");
$ada_sp3xx = mysql_num_rows($sql_sp3xx);
if(!$ada_sp3xx){
		$session_sponsor = "member";
}else{
	$session_sponsor = $session_sponsore;
}

 $namasspne = $db->dataku("nama", $session_sponsor);
		 $hpsspne = $db->dataku("hp", $session_sponsor);
		 $emailsspne = $db->dataku("email", $session_sponsor);
		
		
		
$sqlckid=mysql_query("select accid from member where accid like '".$cptidne."%' order by id desc");
		if(mysql_num_rows($sqlckid) > 0) {
		$mbrckid = mysql_fetch_row($sqlckid);
		$lastck_id = substr($mbrckid[0], -6);
		} else {
		$lastck_id = $lastidne;
		}		
		$kodecid = $cptidne;
		$newc_id = ($lastck_id + 1);
		$newc_id2 = $kodecid.$newc_id;
		$cidne = $newc_id2;		
		
		  ?> 
                    
            
            
            
            
            
            
            
            
            
            
            
            
               <form method="POST" action="" accept-charset="UTF-8" class="margin-bottom-0">
            <input name="sponsore" id="sponsore" type="hidden" value="<?php echo $session_sponsor;?>" readonly="readonly"/>
            <input name="cid" id="sponsore" type="hidden" value="<?php echo $cidne;?>" readonly="readonly"/>
            
            
            
                        <label class="control-label">Your Name</label>
            
            <div class="row m-b-15">
                    <div class="col-md-12">
                        <input class="form-control" required name="name" type="text" value="<?php echo $_SESSION["namae"]; ?>">
                    </div> </div>
                     
            
            
                                                <label class="control-label">Username</label>
                <div class="row m-b-15">
                    <div class="col-md-12">
                        <input class="form-control" required name="username" type="text" value="<?php echo $_SESSION["username"]; ?>">
                    </div>
                </div>
                <label class="control-label">Email</label>
                <div class="row m-b-15">
                    <div class="col-md-12">
                        <input class="form-control" required name="email" type="email" value="<?php echo $_SESSION["emaile"]; ?>">
                    </div>
                </div>
                  
                     
                     <div class="row row-space-10">
                    <div class="col-md-6 m-b-15">
                        <label class="control-label">Country</label>
                       <select id="country" name="country" class="form-control" required>
                                                        

                                                        <?php if($_SESSION["country"]){ ?>
<option value="<?php echo $_SESSION["country"]; ?>" selected="selected"><?php echo $_SESSION["countrynya"]; ?></option> 
<?php } ?>                                            
                                                        
                                                       <option value="AF">Afghanistan</option>
<option value="AL">Albania</option>
<option value="DZ">Algeria</option>
<option value="AS">American Samoa</option>
<option value="AD">Andorra</option>
<option value="AG">Angola</option>
<option value="AI">Anguilla</option>
<option value="AG">Antigua &amp; Barbuda</option>
<option value="AR">Argentina</option>
<option value="AA">Armenia</option>
<option value="AW">Aruba</option>
<option value="AU">Australia</option>
<option value="AT">Austria</option>
<option value="AZ">Azerbaijan</option>
<option value="BS">Bahamas</option>
<option value="BH">Bahrain</option>
<option value="BD">Bangladesh</option>
<option value="BB">Barbados</option>
<option value="BY">Belarus</option>
<option value="BE">Belgium</option>
<option value="BZ">Belize</option>
<option value="BJ">Benin</option>
<option value="BM">Bermuda</option>
<option value="BT">Bhutan</option>
<option value="BO">Bolivia</option>
<option value="BL">Bonaire</option>
<option value="BA">Bosnia &amp; Herzegovina</option>
<option value="BW">Botswana</option>
<option value="BR">Brazil</option>
<option value="BC">British Indian Ocean Ter</option>
<option value="BN">Brunei</option>
<option value="BG">Bulgaria</option>
<option value="BF">Burkina Faso</option>
<option value="BI">Burundi</option>
<option value="KH">Cambodia</option>
<option value="CM">Cameroon</option>
<option value="CA">Canada</option>
<option value="IC">Canary Islands</option>
<option value="CV">Cape Verde</option>
<option value="KY">Cayman Islands</option>
<option value="CF">Central African Republic</option>
<option value="TD">Chad</option>
<option value="CD">Channel Islands</option>
<option value="CL">Chile</option>
<option value="CN">China</option>
<option value="CI">Christmas Island</option>
<option value="CS">Cocos Island</option>
<option value="CO">Colombia</option>
<option value="CC">Comoros</option>
<option value="CG">Congo</option>
<option value="CK">Cook Islands</option>
<option value="CR">Costa Rica</option>
<option value="CT">Cote D'Ivoire</option>
<option value="HR">Croatia</option>
<option value="CU">Cuba</option>
<option value="CB">Curacao</option>
<option value="CY">Cyprus</option>
<option value="CZ">Czech Republic</option>
<option value="DK">Denmark</option>
<option value="DJ">Djibouti</option>
<option value="DM">Dominica</option>
<option value="DO">Dominican Republic</option>
<option value="TM">East Timor</option>
<option value="EC">Ecuador</option>
<option value="EG">Egypt</option>
<option value="SV">El Salvador</option>
<option value="GQ">Equatorial Guinea</option>
<option value="ER">Eritrea</option>
<option value="EE">Estonia</option>
<option value="ET">Ethiopia</option>
<option value="FA">Falkland Islands</option>
<option value="FO">Faroe Islands</option>
<option value="FJ">Fiji</option>
<option value="FI">Finland</option>
<option value="FR" Selected>France</option>
<option value="GF">French Guiana</option>
<option value="PF">French Polynesia</option>
<option value="FS">French Southern Ter</option>
<option value="GA">Gabon</option>
<option value="GM">Gambia</option>
<option value="GE">Georgia</option>
<option value="DE">Germany</option>
<option value="GH">Ghana</option>
<option value="GI">Gibraltar</option>
<option value="GB">Great Britain</option>
<option value="GR">Greece</option>
<option value="GL">Greenland</option>
<option value="GD">Grenada</option>
<option value="GP">Guadeloupe</option>
<option value="GU">Guam</option>
<option value="GT">Guatemala</option>
<option value="GN">Guinea</option>
<option value="GY">Guyana</option>
<option value="HT">Haiti</option>
<option value="HW">Hawaii</option>
<option value="HN">Honduras</option>
<option value="HK">Hong Kong</option>
<option value="HU">Hungary</option>
<option value="IS">Iceland</option>
<option value="IN">India</option>
<option value="ID">Indonesia</option>
<option value="IA">Iran</option>
<option value="IQ">Iraq</option>
<option value="IR">Ireland</option>
<option value="IM">Isle of Man</option>
<option value="IL">Israel</option>
<option value="IT">Italy</option>
<option value="JM">Jamaica</option>
<option value="JP">Japan</option>
<option value="JO">Jordan</option>
<option value="KZ">Kazakhstan</option>
<option value="KE">Kenya</option>
<option value="KI">Kiribati</option>
<option value="NK">Korea North</option>
<option value="KS">Korea South</option>
<option value="KW">Kuwait</option>
<option value="KG">Kyrgyzstan</option>
<option value="LA">Laos</option>
<option value="LV">Latvia</option>
<option value="LB">Lebanon</option>
<option value="LS">Lesotho</option>
<option value="LR">Liberia</option>
<option value="LY">Libya</option>
<option value="LI">Liechtenstein</option>
<option value="LT">Lithuania</option>
<option value="LU">Luxembourg</option>
<option value="MO">Macau</option>
<option value="MK">Macedonia</option>
<option value="MG">Madagascar</option>
<option value="MY">Malaysia</option>
<option value="MW">Malawi</option>
<option value="MV">Maldives</option>
<option value="ML">Mali</option>
<option value="MT">Malta</option>
<option value="MH">Marshall Islands</option>
<option value="MQ">Martinique</option>
<option value="MR">Mauritania</option>
<option value="MU">Mauritius</option>
<option value="ME">Mayotte</option>
<option value="MX">Mexico</option>
<option value="MI">Midway Islands</option>
<option value="MD">Moldova</option>
<option value="MC">Monaco</option>
<option value="MN">Mongolia</option>
<option value="MS">Montserrat</option>
<option value="MA">Morocco</option>
<option value="MZ">Mozambique</option>
<option value="MM">Myanmar</option>
<option value="NA">Nambia</option>
<option value="NU">Nauru</option>
<option value="NP">Nepal</option>
<option value="AN">Netherland Antilles</option>
<option value="NL">Netherlands (Holland, Europe)</option>
<option value="NV">Nevis</option>
<option value="NC">New Caledonia</option>
<option value="NZ">New Zealand</option>
<option value="NI">Nicaragua</option>
<option value="NE">Niger</option>
<option value="NG">Nigeria</option>
<option value="NW">Niue</option>
<option value="NF">Norfolk Island</option>
<option value="NO">Norway</option>
<option value="OM">Oman</option>
<option value="PK">Pakistan</option>
<option value="PW">Palau Island</option>
<option value="PS">Palestine</option>
<option value="PA">Panama</option>
<option value="PG">Papua New Guinea</option>
<option value="PY">Paraguay</option>
<option value="PE">Peru</option>
<option value="PH">Philippines</option>
<option value="PO">Pitcairn Island</option>
<option value="PL">Poland</option>
<option value="PT">Portugal</option>
<option value="PR">Puerto Rico</option>
<option value="QA">Qatar</option>
<option value="ME">Republic of Montenegro</option>
<option value="RS">Republic of Serbia</option>
<option value="RE">Reunion</option>
<option value="RO">Romania</option>
<option value="RU">Russia</option>
<option value="RW">Rwanda</option>
<option value="NT">St Barthelemy</option>
<option value="EU">St Eustatius</option>
<option value="HE">St Helena</option>
<option value="KN">St Kitts-Nevis</option>
<option value="LC">St Lucia</option>
<option value="MB">St Maarten</option>
<option value="PM">St Pierre &amp; Miquelon</option>
<option value="VC">St Vincent &amp; Grenadines</option>
<option value="SP">Saipan</option>
<option value="SO">Samoa</option>
<option value="AS">Samoa American</option>
<option value="SM">San Marino</option>
<option value="ST">Sao Tome &amp; Principe</option>
<option value="SA">Saudi Arabia</option>
<option value="SN">Senegal</option>
<option value="RS">Serbia</option>
<option value="SC">Seychelles</option>
<option value="SL">Sierra Leone</option>
<option value="SG">Singapore</option>
<option value="SK">Slovakia</option>
<option value="SI">Slovenia</option>
<option value="SB">Solomon Islands</option>
<option value="OI">Somalia</option>
<option value="ZA">South Africa</option>
<option value="ES">Spain</option>
<option value="LK">Sri Lanka</option>
<option value="SD">Sudan</option>
<option value="SR">Suriname</option>
<option value="SZ">Swaziland</option>
<option value="SE">Sweden</option>
<option value="CH">Switzerland</option>
<option value="SY">Syria</option>
<option value="TA">Tahiti</option>
<option value="TW">Taiwan</option>
<option value="TJ">Tajikistan</option>
<option value="TZ">Tanzania</option>
<option value="TH">Thailand</option>
<option value="TG">Togo</option>
<option value="TK">Tokelau</option>
<option value="TO">Tonga</option>
<option value="TT">Trinidad &amp; Tobago</option>
<option value="TN">Tunisia</option>
<option value="TR">Turkey</option>
<option value="TU">Turkmenistan</option>
<option value="TC">Turks &amp; Caicos Is</option>
<option value="TV">Tuvalu</option>
<option value="UG">Uganda</option>
<option value="UA">Ukraine</option>
<option value="AE">United Arab Emirates</option>
<option value="GB">United Kingdom</option>
<option value="US">United States of America</option>
<option value="UY">Uruguay</option>
<option value="UZ">Uzbekistan</option>
<option value="VU">Vanuatu</option>
<option value="VS">Vatican City State</option>
<option value="VE">Venezuela</option>
<option value="VN">Vietnam</option>
<option value="VB">Virgin Islands (Brit)</option>
<option value="VA">Virgin Islands (USA)</option>
<option value="WK">Wake Island</option>
<option value="WF">Wallis &amp; Futana Is</option>
<option value="YE">Yemen</option>
<option value="ZR">Zaire</option>
<option value="ZM">Zambia</option>
<option value="ZW">Zimbabwe</option>                                        </select>

                    </div>
                    <div class="col-md-6 m-b-15">
                        <label class="control-label">Phone</label>
                        <input id="phone" class="form-control" required name="phone" type="text" value="<?php echo $_SESSION["phone"]; ?>" autocomplete="off">
                        <input id="hidden" type="hidden" name="phone-full">
                    </div>
                </div>
                <div class="row row-space-10">
                    <div class="col-md-6 m-b-15">
                        <label for="password">Password</label>
                        <input class="form-control" required name="password" type="password" value="<?php echo $_SESSION["passworde"]; ?>" id="password">
                    </div>
                    <div class="col-md-6 m-b-15">
                        <label for="password_confirmation">Confirm Password</label>
                        <input class="form-control" required name="password_confirmation" type="password" value="<?php echo $_SESSION["passworde2"]; ?>" id="password_confirmation">
                    </div>
                      
                                    </div>
                       

                                  
                <div class="form-check">
    <label class="form-check-label">
      <input type="checkbox" name="checkbox" class="form-check-input">
     &nbsp;&nbsp;I Accept <a href="#" onClick="window.open('./get.php?go=terms','popup','width=700,height=500,scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=50,top=0'); return false" style="color:#E3D90B; font-weight:bold;">Terms and Conditions</a>
    </label>
  </div>
                <br>
                <div class="register-buttons">
                    <button type="submit" name="submitreg" onclick="if(!this.form.checkbox.checked){alert('You must accept our Terms and Conditions <?php echo $bisnisname; ?>.');return false}" class="btn btn-primary btn-block btn-lg">Sign Up</button>
                </div>
                <div class="m-t-20 m-b-40 p-b-40 text-inverse">
                    Already a member? Click <a href="login.php">Here</a> to login.<br>
                    
                </div>
                <hr/>
                <p class="text-center">
                   Copyright &copy;  <?php echo WEB_FOOTER; ?>
                </p>
                </form>
                
                <?php 
				unset($_SESSION['namae']);
unset($_SESSION['emaile']);
unset($_SESSION["phone"]);
unset($_SESSION["username"]);
unset($_SESSION["passworde"]);
unset($_SESSION["passworde2"]);
				
				} ?>
            </div>
            <!-- end register-content -->
        </div>
        <!-- end right-content -->
    </div>
    <!-- end register -->
</div>
<!-- end page container -->

<!-- ================== BEGIN BASE JS ================== -->
<script src="themes/assets/plugins/jquery/jquery-1.9.1.min.js"></script>
<script src="themes/assets/plugins/jquery/jquery-migrate-1.1.0.min.js"></script>
<script src="themes/assets/plugins/jquery-ui/ui/minified/jquery-ui.min.js"></script>
<script src="themes/assets/plugins/bootstrap/js/bootstrap.min.js"></script>
<!--[if lt IE 9]>
<script src="/assets/crossbrowserjs/html5shiv.js"></script>
<script src="/assets/crossbrowserjs/respond.min.js"></script>
<script src="/assets/crossbrowserjs/excanvas.min.js"></script>
<![endif]-->
<script src="themes/assets/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="themes/assets/plugins/jquery-cookie/jquery.cookie.js"></script>
<!-- ================== END BASE JS ================== -->

<!-- ================== BEGIN PAGE LEVEL JS ================== -->
<script src="themes/assets/js/apps.min.js"></script>
<!-- ================== END PAGE LEVEL JS ================== -->

 <script src="themes/assets/build/js/intlTelInput.js"></script>
   <script type="text/javascript">
            $(document).ready(function () {
    App.init()
		   
		    $("#show-animation").change(function () {
                if ( $(this).is(":checked") ) {
                    $("#header-canvas").show();
                } else {
                    $("#header-canvas").hide();
                }
            });
			
            $("#phone").intlTelInput({
              // allowDropdown: false,
              // autoHideDialCode: false,
              // autoPlaceholder: "off",
              // dropdownContainer: "body",
              // excludeCountries: ["us"],
			  
			  
			  
              // formatOnDisplay: true,
              geoIpLookup: function(callback) {
                 $.get("http://ipinfo.io", function() {}, "jsonp").always(function(resp) {
                   var countryCode = (resp && resp.country) ? resp.country : "";
                   callback(countryCode);
                 });
               },
              //hiddenInput: "full_number",
              // initialCountry: "auto",
              // nationalMode: false,
              // onlyCountries: ['us', 'gb', 'ch', 'ca', 'do'],
              // placeholderNumberType: "MOBILE",
              // preferredCountries: ['cn', 'jp'],
              // separateDialCode: true,
              utilsScript: "themes/assets/build/js/utils.js"
            });
			})
        </script>  
 <script type="text/javascript">

$("#phone").intlTelInput({
  utilsScript: "themes/assets/build/js/utils.js" // just for formatting/placeholders etc
});

// update the hidden input on submit
$("form").submit(function() {
  $("#hidden").val($("#phone").intlTelInput("getNumber"));
});

</script>  

   <script type="text/javascript">
     // get the country data from the plugin
var countryData = $.fn.intlTelInput.getCountryData(),
  telInput = $("#phone"),
  addressDropdown = $("#country");

// init plugin
telInput.intlTelInput({
  utilsScript: "themes/assets/build/js/utils.js" // just for formatting/placeholders etc
});

// populate the country dropdown
$.each(countryData, function(i, country) {
  addressDropdown.append($("<option></option>").attr("value", country.iso2).text(country.name));
});
// set it's initial value
var initialCountry = telInput.intlTelInput("getSelectedCountryData").iso2;
//addressDropdown.val(initialCountry);

// listen to the telephone input for changes
telInput.on("countrychange", function(e, countryData) {
  addressDropdown.val(countryData.iso2);
});

// listen to the address dropdown for changes
addressDropdown.change(function() {
  telInput.intlTelInput("setCountry", $(this).val());
});

  
   
    </script>
<?php if($stchat == 1) { echo $lchats; }?>
</body>
</html>
<?php 
}else{
	 header("location: index.php");
	exit;
}
ob_flush(); ?>