<?php
(@include ('../dt_page/lic.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>You not have a license to use this script on this domain,<br>Please contact us to purchase a license.<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>");
$lic=$license;if(!$lic){echo "<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>You not have a license to use this script on this domain,<br>Please contact us to purchase a license.<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>";}$svr=$_SERVER['SERVER_NAME'];$c=curl_init();curl_setopt($c,CURLOPT_URL,"http://www.primadesain.com/verifylicenses.php");curl_setopt($c,CURLOPT_TIMEOUT,30);curl_setopt($c,CURLOPT_POST,1);curl_setopt($c,CURLOPT_RETURNTRANSFER,1);$postfields='svr='.$svr.'&lic='.$lic;curl_setopt($c,CURLOPT_POSTFIELDS,$postfields);$result=curl_exec($c);if($result=="fail"){echo "<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>You not have a license to use this script on this domain,<br>Please contact us to purchase a license.<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>";die();}
if (basename($_SERVER['SCRIPT_FILENAME']) == basename(__FILE__)){
echo "<p align=center><br><br><br><br><br><br><font size=\"6\" color=\"#FF0000\">ILLEGAL ACCESS !!";
echo "<meta http-equiv=\"refresh\" content=\"2; url=../index.php\">";
exit();} 
?>
    <section class="content-header">
      <h1>
        Register
      </h1>
      <ol class="breadcrumb">
        <li class="breadcrumb-item"><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
        <li class="breadcrumb-item active">Register</li>
      </ol>
    </section>


    <section class="content">

<?php
if($db->dataku("status", $user_session) == 0 || $db->dataku("blokir", $user_session) == 1) {
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>".$LANG["status0"]."</div>";
}else{
?>
<?php
if($db->config("styletheme") == 1){ 
$backgrnde="";
}else{
$backgrnde=" style='background-color:#111;'";
}
?>
 <div class="row">
                <div class="col-md-4">
                
                   <div class="box">
            <div class="box-header with-border">
              <h3 class="box-title">Register</h3>
            </div>
            <div class="box-body">      
               
                <?php
if($exptransfer == 0) {
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>Register New Member has been disable from administrator.</div>";
}else{
?>     

<?php if($usekyc == 1 && $db->dataku("accpt", $user_session) == 0){ 
				 echo "<div align='center'><img src='../themes/img/unverified.png' width='100' height='100' /><br><p style='font-weight:bold; font-size:20px;margin-top:5px;'>UNVERIFIED</p>Transfer balance is disable, to be able transfer your balance you must verification first. <a href='index.php?go=kyc'><button class='btn btn-danger btn-xs' type='button'>Click Here</button></a><br></div>";
				  //echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>"; 
				  }else{
				 
				  ?>        
               
               <?
if(isset($_POST['submitreg'])){
	
$_SESSION["kodepose"] = anti_injection($_POST["kodepos"]);
$_SESSION["alamate"] = anti_injection($_POST["alamat"]);
 
$_SESSION["namae"] = anti_injection($_POST["nama"]);
$_SESSION["hpne"] = anti_injection($_POST["hp"]);
$_SESSION["passworde"] = anti_injection($_POST["password1"]);
$_SESSION["pine"] = anti_injection($_POST["pin"]);
$_SESSION["emaile"] = anti_injection($_POST["email"]);
$_SESSION["kotane"] = anti_injection($_POST["kota"]);	
$_SESSION["negarane"] = anti_injection($_POST["negara"]);
$_SESSION["produke"] = anti_injection($_POST["produk"]);	
$_SESSION["amounte"] = anti_injection($_POST["amount"]);	
$_SESSION["username"] = anti_injection($_POST["username"]);	
$_SESSION["banke"] = $_POST["bank"];
$_SESSION["bankacc"] = $_POST["bankacc"];
$_SESSION["bankname"] = $_POST["bankname"];		


$sponsore = anti_injection($_POST['sponsore']);
$dtt = anti_injection($_POST['dt']);
if($dtt == 1){
$upline = anti_injection($_POST['upline']);
$posisi = anti_injection($_POST['posisi']);
$sttss="&sp=$sponsore&up=$upline&pos=$posisi&dt=1";
}else{
$upline = $sponsore;
$posisi = anti_injection($_POST['posisi']);
$sttss="";
}
$level = anti_injection($_POST['level']);


$usernamed = str_replace(' ', '', strtolower($_POST['username']));	
$username = anti_injection($usernamed);	

$sql_ckusr = mysql_query("select username from member where username='".$username."' ");
$ada_ckusr = mysql_num_rows($sql_ckusr);
if($userbysystem == 1 && $ada_ckusr){
$idregblkg = substr(str_shuffle(str_repeat("1234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567898912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678989123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789", $acakee)), 0, $idblakange);		
$username=$idregdepan.$idregblkg;
}else{
$username=$username;
}



$authgoogles=$db->dataku("authgoogle", $user_session);
$code    = anti_injection($_POST['one_time_password']);	  
$result  = $authenticator->verifyCode($secret,$code,$tolerance);
if($googleauntentic == 1 && $authgoogles == 1 && !$result){
header("location: index.php?go=register&result=wrong_auth$sttss");
exit;
} else {	


if(isset($_GET["sess"])){ $sess = anti_injection($_GET["sess"]); }
if(isset($_GET["token"])){ $token = anti_injection($_GET["token"]); }
$cek=md5(md5(date('\i\t \i\s \t\h\e jS \d\a\y g a')).md5($sess));
if(!$sess || !$token || $token<>$cek){
header("location: index.php?go=register&result=no_session$sttss");
exit;

}else{	

$pincods = md5($_POST['pincode']);	
$sqlc = mysql_query("SELECT * FROM pincode WHERE username='$user_session'");
$numc = mysql_num_rows($sqlc);
while($rowc = mysql_fetch_array($sqlc)){
$tgl = formatgl($rowc['tgl']);
$pin = $rowc['pin'];
$sts = $rowc['status'];
$lock = $rowc['locks'];
	}
	if($usepins == 1 && !$numc) {
	header("location: index.php?go=register&result=no_pin$sttss");
	exit;
} else {
if($usepins == 1 && !$pincods || $usepins == 1 && $pincods <> $pin) {
	header("location: index.php?go=register&result=wrong_pin$sttss");
	exit;
} else {
if($usepins == 1 && $lock == 1) {
	header("location: index.php?go=register&result=pin_lock$sttss");
exit;
	} else {
if($usepins == 1 && $sts == 0) {
	header("location: index.php?go=register&result=pin_off$sttss");
	exit;
} else {	


$ticket = anti_injection($_POST['ticket']);
$sql_sp9s = mysql_query("select ticket, username from ticket where ticket='".mysql_real_escape_string($ticket)."' and status='1' and username='".$user_session."'");
$ada_sp9s = mysql_num_rows($sql_sp9s);
$row35s = mysql_fetch_array($sql_sp9s);
if($usetiket == 1 && !$ada_sp9s){
header("location: index.php?go=register&result=err_ticket$sttss");
	exit;
} else {


if(!ctype_alnum($usernamed)){
header('location: index.php?go=register&result=alnum$sttss');	
	exit;
}else{ 


$country = anti_injection($_POST['country']);	
$phone = anti_injection($_POST['phone-full']);	
$phonex = anti_injection($_POST['phone']);	
$negara=codeToCountryName($country);
$hp = $phone;
$paket = "1";
$nama = anti_injection($_POST['nama']);
//$hp = anti_injection($_POST['hp']);
//$negara = anti_injection($_POST['negara']);
$kota = anti_injection($_POST['kota']);
$alamat = anti_injection($_POST['alamat']);
$kodepos = anti_injection($_POST['kodepos']);
$email = anti_injection($_POST['email']);
$password1 = anti_injection($_POST['password1']);
$pin = substr(str_shuffle(str_repeat("44531411190667642037112717497783625536342396411241472162223777", 64)), 0, 5);
$bank = anti_injection($_POST['bank']);
$bankacc = anti_injection($_POST['bankacc']);
$bankname = anti_injection($_POST['bankname']);


$banks = $bank;

$bnkcek = preg_replace('/\s+/','',$banks);
$bankcek = strtolower($bnkcek);
$pygtway = $banks;


$emails = base64_encode($email);
$hps = base64_encode($hp);
	
$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: index.php?go=register&result=no_reff$sttss");
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: index.php?go=register&result=max_email&p=$ada_maile&e=$emails$sttss");
exit;
}else{
$cekbhpmaile = mysql_query("select email from blacklist where email='".mysql_real_escape_string($email)."'");
$ada_bmaile = mysql_num_rows($cekbhpmaile); //---flush out hari ini
if ($ada_bmaile > 0) {
header("location: index.php?go=register&result=blacklist_email$sttss");
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: index.php?go=register&result=max_hp&p=$ada_hpn&e=$hps$sttss");
exit;
}else{
$cekbhpmaile2 = mysql_query("select hp from blacklist where hp='".mysql_real_escape_string($hp)."'");
$ada_bmaile2 = mysql_num_rows($cekbhpmaile2); //---flush out hari ini
if ($ada_bmaile2 > 0) {
header("location: index.php?go=register&result=blacklist_hp$sttss");
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: index.php?go=register&result=wrong_bank$sttss");	
exit;
}else{	
$cekbanke2 = mysql_query("select bank from blacklist where bank='".mysql_real_escape_string($bankcek)."'");
$ada_banke2 = mysql_num_rows($cekbanke2); //---flush out hari ini
if ($ada_banke2 > 0) {
header("location: index.php?go=register&result=blacklist_bank$sttss");
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], -8);
		} else {
		$lastck_id = $lastidne;
		}		
		$kodecid = $cptidne;
		$newc_id = ($lastck_id + 1);
		$newc_id2 = $kodecid.$newc_id;
		$ccidne = $newc_id2;		
}else{
$ccidne = $cid;
}



$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: index.php?go=register&result=user_use$sttss");
exit;
    } else {	
	$usernames = strtolower($username);
	if ($usernames== "admin" || $usernames== "administrator" || $usernames== "pengelola") {
	 	header("location: index.php?go=register&result=restrict_user$sttss");
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);
	
	$db->insert("member", "", "'', '".mysql_real_escape_string($username)."', '$pass', '$nama', '$sponsore', '$upline', '".mysql_real_escape_string($email)."', '".mysql_real_escape_string($alamat)."', '".mysql_real_escape_string($kota)."', '', '".mysql_real_escape_string($kodepos)."', '".mysql_real_escape_string($hp)."', '', '$banks', '".$_SERVER['REMOTE_ADDR']."', '', '$amount', '$clientdate', '$clientdate', '1', '$produk', '0', '0','','','','','".mysql_real_escape_string($negara)."','','$user_session','$stmpkodene','$pringkate','','', '$bankcek','$ccidne','','','','','','','','','','','','','','','','','','','','','1','0'");
	
//	$db->update("ticket", "status='0', info='Use for registration member $username'", "ticket='$ticket' and status='1' and ticket <> '9999999999'");
	$db->insert("acc", "", "'', '$username', '$password1', '$pin'");
	$db->insert("pincode", "", "'', '".mysql_real_escape_string($username)."', '".$pins."', '1', '$clientdate', '', ''");
    $db->insert("ewalet", "", "'', '".mysql_real_escape_string($username)."', '$pass', '$clientdate', '1', '', '$ccidne'");
//-------------------masukkan ke tabel upline--------------
	$db->insert("upline", "", "'', '".mysql_real_escape_string($username)."', '$sponsore', '', '', '', '', '', '', '', '', '', '', '', '$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)."'");
	//}	

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

$db->insert("dataswalet", "", "'', '$stmpkodene', 'administrator', '$freebalance', 'Free Register Balance', '$username', '$clientdate', '1', '$clientdate', '', ''");	
//$db->insert("dataawalet", "", "'', '$stmpkodene', '$user_session', '$activebalance', '70% Register $myproduk user $username', 'administrator', '$clientdate', 1, '$clientdate'");
$accidxx=$db->dataku("accid", $user_session);
if($regpaket == 1){
$db->insert("dataewalet3", "", "'', '$stmpkodene', '$username', '$amount', '', '$clientdate', '$clientdate', '1', '$produk', '$pringkate', '$profite', '$angkaunik', '$priode', '$siklus'");
}

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


if($usetiket == 1){
$db->update("ticket", "status='0', info='Registrasi username $username'", "ticket='$ticket' and status='1' and ticket <> '9999999999'");
}
     
	
	
$tkk = date('dmYHis', strtotime($clientdate));
$tokens = substr(str_shuffle(str_repeat("4453B141119A06676420371112GEHDLPD8717497783C6255363423ABCYWTGEHDLPMBTEFWXVU96411241472162223777", 64)), 0, 48);

//$invc = "REG_".strtoupper($myproduk)."_".strtoupper($username)."_".$tkk."_".$stmpkodene."_".$tokens;
//$inv = "http://".$domain."/invoice/".$invc.".pdf";
//$db->insert("invoice", "", "'', '$username', '$stmpkodene', '$invc', '$clientdate'");   

if($usepins == 1){
	$pinsesms=", Secure PIN: ".$pin."";
	$pinsemail="Secure PIN : ".$pin."";
}else{
	$pinsesms="";
	$pinsemail="";
}

	
$tgl = formatgl($clientdate);
$waktu = date("H:i:s");

$db->aktivasi($username);

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


$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"));

if($hp){
$isipesan = "Hello ".$nama.", Thank you for signed up at ".$bisnisname.", your login details, Username: ".$username.", Password: ".$password1."".$pinsesms.".";
	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{}
sendwa($hp, $isipesan, $apikeywoowa);	
}


$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>
".$pinsemail."
</p>
<p>
<strong>Network:</strong><br>
Sponsor : ".$sponsore."
</p>
<p>
Date Register : ".$tgl."<br>
PIN Register : ".$ticket."
</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>
".$pinsemail."
</p>
<p>
<strong>Network:</strong><br>
Sponsor : ".$sponsore."
</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['passworde']);
unset($_SESSION['pine']);
unset($_SESSION['kotane']);
unset($_SESSION["bankacc"]);
unset($_SESSION["banke"]);
unset($_SESSION["bankname"]);
unset($_SESSION["emaile"]);
unset($_SESSION["hpne"]);
unset($_SESSION["username"]);
unset($_SESSION["produke"]);
unset($_SESSION["amounte"]);


$em=base64_encode($email);
$nm=base64_encode($nama);
header("location: index.php?go=register&result=success&e=$em&n=$nm");

}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}


?>



<?php
}else{


?>
    <?php
$results = $_GET['result'];
if($results == "alnum") { 
echo "<div class='alert alert-danger'>Use username only leters and numbers!</div>";
}
?>     
<?php
 if(isset($_GET['result'])&&$_GET['result']=="err_ticket"){
echo "<div class='alert alert-danger'>PIN Register Salah!</div>";
}
?>

<?php
$results = $_GET['result'];
$mine = $_GET['min'];
$byye = $_GET['biy'];
if($results == "insufficient_rwalet") { 
echo "<div class='alert alert-danger'><button type='button' class='close' data-dismiss='alert'><i class='icon-remove'></i></button>Your Register Poin balance is insufficient, For Register this package min Register Poin balance is ".rupiah($mine)."</div>";
}
?>
<?php
$results = $_GET['result'];
$mine = $_GET['min'];
$byye = $_GET['biy'];
if($results == "insufficient_awalet") { 
echo "<div class='alert alert-danger'><button type='button' class='close' data-dismiss='alert'><i class='icon-remove'></i></button>Your PV Poin balance is insufficient, For Register this package min PV Poin balance is ".rupiah($mine)."</div>";
}
?>
<?php
$results = $_GET['result'];
if($results == "blacklist_email") { 
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>Email address is included in the black list! Use another email address!</div>";
}
?>
<?php
$results = $_GET['result'];
if($results == "blacklist_bank") { 
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>Payment gateway address is included in the black list! Use another Payment gateway!</div>";
}
?>
<?php
$results = $_GET['result'];
if($results == "blacklist_hp") { 
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>Phone Number address is included in the black list! Use another Phone Number!</div>";
}
?>	
<?php
$results = $_GET['result'];
if($results == "restrict_user") { 
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>Use another username!</div>";
}
?>
<?php
$results = $_GET['result'];
if($results == "nopackage") { 
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>Please select Package!</div>";
}
?>
<?php
 if(isset($_GET['result'])&&$_GET['result']=="wrong_bank"){
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>Bank Account already in use!</div>";
}
?> 
<?php
 if(isset($_GET['result'])&&$_GET['result']=="wrong_ticket"){
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>Invalid Ticket!</div>";
}
?>  
		  <?php
 if(isset($_GET['result'])&&$_GET['result']=="wrong_captcha"){
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>".LANG_NOTIF_WRONG_CAPTCHA."</div>";
}
?>  
        <?php
 if(isset($_GET['result'])&&$_GET['result']=="no_session"){
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>Session expired, please reload page.</div>";
}
?>  
          <?php
 if(isset($_GET['result'])&&$_GET['result']=="no_reff"){
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>".LANG_REGISTER_NO_REFF."</div>";
}
?> 
<?php
 if(isset($_GET['result'])&&$_GET['result']=="user_use"){
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>".LANG_REGISTER_USER_ON."</div>";
}
?>

<?php
 if(isset($_GET['result'])&&$_GET['result']=="amount"){
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>Nilai Investasi harus di isi!</div>";
}
?>
<?php
if(isset($_GET['result'])&&$_GET['result']=="min"){
$pck = base64_decode($_GET['pk']);
$min = base64_decode($_GET['mn']);	
	
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>Paket yang anda pilih ".$pck.", Minimal Nilai Investasi adalah ".rupiah($min).".</div>";
}
?>
<?php
if(isset($_GET['result'])&&$_GET['result']=="max"){
$pck = base64_decode($_GET['pk']);
$max = base64_decode($_GET['mx']);
	
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>Paket yang anda pilih ".$pck.", Maksimal Nilai Investasi adalah ".rupiah($max).".</div>";
}
?>

 <?php
 if(isset($_GET['result'])&&$_GET['result']=="no_pin"){
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>".LANG_FORGOT_NO_PIN."</div>";
}
?>  
 <?php
 if(isset($_GET['result'])&&$_GET['result']=="wrong_pin"){
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>".LANG_FORGOT_WRONG_PIN."</div>";
}
?>  
 <?php
 if(isset($_GET['result'])&&$_GET['result']=="pin_lock"){
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>".LANG_FORGOT_BLOCK_PIN."</div>";
}
?>  

 <?php
 if(isset($_GET['result'])&&$_GET['result']=="pin_off"){
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>".LANG_FORGOT_OFF_PIN."</div>";
}
?>  

   <?php
$results = $_GET['result'];
if($results == "wrong_auth") { 
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>You're enable two factor authentication at your account, Please enter your google authenticator six-digit code!</div>";
}
?> 

   <?php
$results = $_GET['result'];
if($results == "max_email") { 
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>Email already registered!</div>";
}
?> 

   <?php
$results = $_GET['result'];
if($results == "max_hp") { 
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>Phone number already registered!</div>";
}
?> 
   <?php
$results = $_GET['result'];
if($results == "success") { 
echo "<div class='alert alert-block alert-success fade in'><button type='button' class='close' data-dismiss='alert'></button><h4 class='alert-heading'><strong>Registration is successful</strong></h4><p>You have successfully registered new members.</p></div>";
}
?> 
<?php
if(isset($_GET["sp"])){ $sp = $_GET["sp"]; }
if(isset($_GET["up"])){ $up = $_GET["up"]; }
if(isset($_GET["pos"])){ $pos = $_GET["pos"]; }
if(isset($_GET["dt"])){ $dt = $_GET["dt"]; }

if($sp && $up && $pos && $dt) {
	$sponsorex = $sp;
	$uplix = $up;
	$posisix = $pos;
	$dte = $dt;
	$levelx = $db->dataupline("level", $uplix);
} else {
	$sponsorex = $user_session;
	$uplix = $user_session;
	$posisix = spillover("pos", $sponsorex);
	$dte = "0";
	$levelx = $db->dataupline("level", $uplix);
}


$sess = substr(str_shuffle(str_repeat("ABCaqDEFG345678HIJKLMNOPQ345678RSTUVWXYZ0123456789abcdefghijklmnop32q34STUVW5678rstuvwxyz", 96)), 0, 96);
$token = md5(md5(date('\i\t \i\s \t\h\e jS \d\a\y g a')).md5($sess));

if($userbysystem == 1){	
$idregblkg = substr(str_shuffle(str_repeat("1234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567891234567898912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678989123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789", $acakee)), 0, $idblakange);		
$autousere=$idregdepan.$idregblkg;
}	
		
		
$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], -8);
		} else {
		$lastck_id = $lastidne;
		}		
		$kodecid = $cptidne;
		$newc_id = ($lastck_id + 1);
		$newc_id2 = $kodecid.$newc_id;
		$cidne = $newc_id2;				
		
	
	
		
		
		
			
?>
<?php
if($posisix == "L1"){ $pssi = "LEFT"; }else { $pssi = "RIGHT"; }
?>
          
<script type="text/javascript">
 
        function isNumberKey(evt, obj) {
 
            var charCode = (evt.which) ? evt.which : event.keyCode
            var value = obj.value;
            var dotcontains = value.indexOf(".") != -1;
            if (dotcontains)
                if (charCode == 46) return false;
            if (charCode == 46) return true;
            if (charCode > 31 && (charCode < 48 || charCode > 57))
                return false;
            return true;
        }
 

 
    </script>         
               
               
               <form action="index.php?go=register&sess=<?php echo $sess;?>&token=<?php echo $token;?>" class="form-horizontal" method="post" name="regval" id="regval" onSubmit="return checkform()">
                                            <input name="paket" type="hidden" id="paket" value="1"/>
            <input name="cid" id="cid" type="hidden" value="<?php echo $cidne;?>" readonly="readonly"/>
			<input type="hidden" value="<?php echo $user_session; ?>" readonly="readonly" name="sponsore">                            
                                            
                            
          <?php if($usetiket == 1){ ?>
                                             <div class="controls-row" style=" margin-top:10px;">

            <label>PIN Register <?php if(total_ticket_member($user_session) > 0){ echo "<font color='#009900'>(".total_ticket_member($user_session)." PIN)</font>"; }else{ echo "<font color='#E60000'>(".total_ticket_member($user_session)." PIN)</font>"; } ?></label>

         <div class="input-group">
                   <span class="input-group-addon" id="basic-addon1"><i class="fa fa-ticket" aria-hidden="true"></i>
</span>
         
         
         <select name="ticket" class="form-control" required='required'>
                                    <?php
					$tanggal=date("Y-m-d");
					$sql=mysql_query("select ticket from ticket where status=1 and username='".$user_session."' and ticket <> '9999999999' order by tgl desc");
					$ada_tckt = mysql_num_rows($sql);
					if($ada_tckt > 0) {
					while($sto=mysql_fetch_row($sql)) {
						
					  if($_SESSION["tickete"] == $sto[0]){
		  $stttt = "selected='selected'";
	  }else{
		  $stttt = "";
	  }	
						
					?>
          <option value="<?php echo $sto[0]; ?>" style='background-color:#009F50; color:#FFF;' <?php echo $stttt; ?>> 
          <?php echo $sto[0]; ?></option>
          <?php
					}
					}else{ ?>
				<option value="" style='background-color:#B50404; color:#FFF;'> 
          Tidak Ada PIN</option>
			<?php		}
					
					
					?>	 
         
         </select>            

          </div></div>
                           <?php } ?>           
                                                
                                 
   <?php if($sp && $up && $pos && $dt) { ?>
                
               <div class="controls-row" style=" margin-top:10px;">
													<label>Sponsor ID</label>
												 <div class="input-group">
                   <span class="input-group-addon" id="basic-addon1"><i class="fa fa-user" aria-hidden="true"></i>
</span>
         
															<input type="text" class="form-control" value="<?php echo $sponsorex; ?>" readonly="readonly" name="sponsore"  <?php echo $backgrnde; ?>>
                                                            <input name="dt" type="hidden" id="dt" value="<?php echo $dte; ?>"/>
				<input type="hidden" name="upline" id="upline" value="<?= $uplix; ?>" style="width:200px"  readonly="readonly"/>
				<input name="posisi" type="hidden" id="posisi" value="<?php echo $posisix; ?>" />
				<input name="level" type="hidden" id="level" value="<?php echo $levelx; ?>" />
														
												</div></div>
              <div class="controls-row" style=" margin-top:10px;">
													<label>Upline</label>
													<div class="input-group">
                   <span class="input-group-addon" id="basic-addon1"><i class="fa fa-check" aria-hidden="true"></i>
</span>
															
															<input type="text" class="form-control" value="<?php echo $uplix; ?>" readonly="readonly"  <?php echo $backgrnde; ?>>
                                                      
												</div></div>
                 <div class="controls-row" style=" margin-top:10px;">
													<label>Position</label>
													<div class="input-group">
                   <span class="input-group-addon" id="basic-addon1"><i class="fa fa-check" aria-hidden="true"></i>
</span>
															<input type="text" class="form-control" value="<?php echo $pssi; ?>" readonly="readonly"  <?php echo $backgrnde; ?>>
                                                          
												</div></div>
                
	<?php } else { ?>
 <div class="controls-row" style=" margin-top:10px;">
													<label>Sponsor ID</label>
													 <div class="input-group">
                   <span class="input-group-addon" id="basic-addon1"><i class="fa fa-user" aria-hidden="true"></i>
</span>
															<input type="text" class="form-control" name="sponsore" required='required' value="<?php echo $sponsorex; ?>" readonly="readonly" style="background:#111;">
                                                            <input name="dt" type="hidden" id="dt" value="<?php echo $dte; ?>"/>
				<input type="hidden" name="upline" id="upline" value="<?= $uplix; ?>" style="width:200px"  readonly="readonly"/>
				<input name="posisi" type="hidden" id="posisi" value="<?php echo $posisix; ?>" />
				<input name="level" type="hidden" id="level" value="<?php echo $levelx; ?>" />
													
												</div></div>
  
	<?php } ?> 
                 
			 
                                           
									
                                                <div class="controls-row" style=" margin-top:10px;">
													<label>Full Name</label>
														<div class="input-group">
                   <span class="input-group-addon" id="basic-addon1"><i class="fa fa-id-badge" aria-hidden="true"></i>
</span>
															<input type="text" class="form-control" placeholder="Name" name="nama" required='required' value="<?php echo $_SESSION["namae"]; ?>">
												</div></div>
                                              
                                         <div class="controls-row" style=" margin-top:10px;">
													<label>Email</label>
													<div class="input-group">
                   <span class="input-group-addon" id="basic-addon1"><i class="fa fa-envelope" aria-hidden="true"></i>
</span>
															<input type="text" class="form-control" placeholder="Email" name="email" required='required' value="<?php echo $_SESSION["emaile"]; ?>">
													
												</div></div>
                                                
                                              <div class="controls-row" style=" margin-top:10px;">
													<label>Phone</label>
														
</span><input id="country" type="hidden" name="country" value="MY"> 
														<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 class="controls-row" style=" margin-top:10px;">
													<label>Bank</label>
															<div class="input-group">
                   <span class="input-group-addon" id="basic-addon1"><i class="fa fa-university" aria-hidden="true"></i>
</span>
															<input id="bank" class="form-control" placeholder="Bank" type="text" name="bank" required='required' value="<?php echo $_SESSION["banke"]; ?>">
                                                            
                                                      
												</div></div>
                                              <?php if($userbysystem == 1){?>
            <input name="username" id="username" type="hidden" value="<?php echo $autousere;?>" readonly="readonly"/>
            <?php } else{ ?>
                                              <div class="controls-row" style=" margin-top:10px;">
													<label>Username</label>
																<div class="input-group">
                   <span class="input-group-addon" id="basic-addon1"><i class="fa fa-user" aria-hidden="true"></i>
</span>
															<input type="text" class="form-control" placeholder="Username" name="username" id="username" value="<?php echo $_SESSION["username"]; ?>" required='required' minlength="4">
                                                       
												</div></div>
                                                <?php } ?>
                                               <div class="controls-row" style=" margin-top:10px;">
													<label>Password</label>
															<div class="input-group">
                   <span class="input-group-addon" id="basic-addon1"><i class="fa fa-lock" aria-hidden="true"></i>
</span>
															<input minlength="8" type="password" class="form-control" placeholder="Password" name="password1" required='required' value="<?php echo $_SESSION["passworde"]; ?>">
                                                          
                                                        
												</div></div>
                                                
                                                <hr />
                                          <div class="controls-row" style=" margin-top:10px;">       
                                          <label> &nbsp;</label>
                                          </div>
                                                <?php if($usepins == 1){ ?>
                                                 <div class="controls-row" style=" margin-top:10px;">

            <label>Secure PIN</label>
<div class="input-group">
                   <span class="input-group-addon" id="basic-addon1"><i class="fa fa-key" aria-hidden="true"></i>
</span>
           <input type="password" class="form-control" placeholder="Enter Your Secure PIN" name="pincode" required='required'>
                                                          

          </div></div>
          <?php } ?>
<?php if($db->dataku("authgoogle", $user_session) == 1){ ?>
         
          <div class="controls-row" style="margin-top:10px;">

            <label>2FA Code</label>
<div class="input-group">
                   <span class="input-group-addon" id="basic-addon1"><i class="fa fa-qrcode fa-lg"></i>
</span>
           <input type="text" class="form-control" placeholder="Enter 2FA Code" name="one_time_password">
                                                          

          </div> </div>
          <?php } ?>
           
                                           
                                              
                                               <div>

           &nbsp;

          </div>
          <div>
        
           <button type="submit" class="btn btn-<?php echo $buttone; ?>" name="submitreg"<?php echo $disea;?><?php echo $diser;?>><i class="fa fa-check"></i>&nbsp;Register</button>
          </div>
                                              
                                              
                                                
                                                
                                             
                     
										</form>
                                       
        <?php
		unset($_SESSION['namae']);
	unset($_SESSION['passworde']);
	unset($_SESSION['pine']);
	unset($_SESSION['kotane']);
unset($_SESSION["bankacc"]);
unset($_SESSION["banke"]);
unset($_SESSION["bankname"]);
unset($_SESSION["emaile"]);
unset($_SESSION["hpne"]);
unset($_SESSION["username"]);
unset($_SESSION["produke"]);
unset($_SESSION["amounte"]);
?>
        <?php } ?>
        
        
        
        <?php } }  ?>
        
                </div></div> </div>   
                 <div class="col-md-8">
                  <div class="box box-solid bg-dark">
            <div class="box-header with-border">
              <h3 class="box-title">Register History</h3>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
				<div class="table-responsive">
				  <table id="example" class="table table-bordered table-hover display nowrap margin-top-10 w-p100">
                                                <thead class="bg-primary-600">
                <tr>
                 <th>Username</th>
<th><?php echo $LANG["name"]?></th>
<th><?php echo $LANG["email"]?></th>
<th><?php echo $LANG["prof_date"]?></th>
<th>Status</th>
                </tr>
              </thead>
              <tbody>
    <?

	$db->select("id, username, nama, sponsor, tglaktif, status, email, hp", "member", "mngr='$user_session'", "id desc");
	
		while($row=$db->fetch_row()) {
		
		if($row[5] > 0) {
		$sts = "<span class='btn btn-success btn-xs'>Active</span>";
	} else {
		$sts = "<span class='btn btn-danger btn-xs'>Inactive</span>";
	
	}	
if($row[4] == "0000-00-00 00:00:00"){
$dtdepo = "----";
}else{
$dtdepo = formatgl($row[4]);
}

?>				
				
				<tr> 
<td align="center"><?php echo $row[1]; ?></td>
<td align="center"><?php echo $row[2]; ?></td>
<td align="center"><?php echo $row[6]; ?></td>
<td align="center"><?php echo $dtdepo; ?></td>
<td align="center"><?php echo $sts; ?></td>
</tr>
             
                        <?php } ?>
              </tbody>
            </table>
                        </div>
                    </div></div>
                </div>
			</div>
			<!-- END PAGE CONTENT -->        
                     
<?php }  ?>