<?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();} 
?>
 <div class="row">
            <div class="col-md-12">
                <h1 class="page-header">
                    <img src="../themes/img/register.png" alt="register" class="header-icon" width="30">
                    Register
                </h1>
            </div>
        </div>

<?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{
?>

  
                                      
<div class="row">
            	
                
                
                
                             <div class="col-md-4">
                
                
				  <div class="panel panel-inverse">
                        <div class="panel-heading bg-grey">
                            <h4 class="text-white">Register</h4>
                        </div>
                        <div class="panel-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{
?>         
               
               <?
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["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 = anti_injection($_POST['upline']);
$posisi = anti_injection($_POST['posisi']);
$sttss="";
}
$level = anti_injection($_POST['level']);


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(!$numc) {
	header("location: index.php?go=register&result=no_pin$sttss");
	exit;
} else {
if(!$pincods || $pincods <> $pin) {
	header("location: index.php?go=register&result=wrong_pin$sttss");
	exit;
} else {
if($lock == 1) {
	header("location: index.php?go=register&result=pin_lock$sttss");
exit;
	} else {
if($sts == 0) {
	header("location: index.php?go=register&result=pin_off$sttss");
	exit;
} else {	



$usernamed = str_replace(' ', '', strtolower($_POST['username']));	
$username = anti_injection($usernamed);	
if(!ctype_alnum($usernamed)){
header('location: index.php?go=register&result=alnum$sttss');	
	exit;
}else{ 


$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, 7);
$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{	





$produk = anti_injection($_POST['produk']);


if(!$produk){
header("location: index.php?go=register&result=nopackage");
exit;
}else{	

if($produk == 1){
$biaya = $biaya1;
$biayax = $biayax1;
$myproduk = $jenis1;
$profite = $invest_profits1;
$priode = $inv_kontrak1;
$siklus = $invest_priod1;
}else if($produk == 2){
$biaya = $biaya2;
$biayax = $biayax2;
$myproduk = $jenis2;
$profite = $invest_profits2;
$priode = $inv_kontrak2;
$siklus = $invest_priod2;
}else if($produk == 3){
$biaya = $biaya3;
$biayax = $biayax3;
$myproduk = $jenis3;
$profite = $invest_profits3;
$priode = $inv_kontrak3;
$siklus = $invest_priod3;
}else if($produk == 4){
$biaya = $biaya4;
$biayax = $biayax4;
$myproduk = $jenis4;
$profite = $invest_profits4;
$priode = $inv_kontrak4;
$siklus = $invest_priod4;
}else if($produk == 5){
$biaya = $biaya5;
$biayax = $biayax5;
$myproduk = $jenis5;
$profite = $invest_profits5;
$priode = $inv_kontrak5;
$siklus = $invest_priod5;
}else if($produk == 6){
$biaya = $biaya6;
$biayax = $biayax6;
$myproduk = $jenis6;
$profite = $invest_profits6;
$priode = $inv_kontrak6;
$siklus = $invest_priod6;
}else if($produk == 7){
$biaya = $biaya7;
$biayax = $biayax7;
$myproduk = $jenis7;
$profite = $invest_profits7;
$priode = $inv_kontrak7;
$siklus = $invest_priod7;
}else if($produk == 8){
$biaya = $biaya8;
$biayax = $biayax8;
$myproduk = $jenis8;
$profite = $invest_profits8;
$priode = $inv_kontrak8;
$siklus = $invest_priod8;
}else if($produk == 9){
$biaya = $biaya9;
$biayax = $biayax9;
$myproduk = $jenis9;
$profite = $invest_profits9;
$priode = $inv_kontrak9;
$siklus = $invest_priod9;
}else if($produk == 10){
$biaya = $biaya10;
$biayax = $biayax10;
$myproduk = $jenis10;
$profite = $invest_profits10;
$priode = $inv_kontrak10;
$siklus = $invest_priod10;
}else{
}


$pringkate=$myproduk;
$amount = $biaya;


$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;
}



//$activebalance = (50/100)*$biaya;
//$mregbalance = (50/100)*$biaya;

//$saldoawalete = $db->myawalet($user_session);
		//	 $pendingawalete = $db->myawaletpending($user_session);
		//	 $totalawalete = $saldoawalete-$pendingawalete; 
			 
  $saldorwalete = $db->myewalet($user_session);
			 $pendingrwalete = $db->myewaletpending($user_session);
			 $totalrwalete = $saldorwalete-$pendingrwalete; 
	

if($totalrwalete < $amount){
header("location: ?go=registration&result=insufficient_walet&biy=$biaya$sttss");
exit;
}else{	

//if($totalawalete < $activebalance){
//header("location: ?go=registration&result=insufficient_awalet&min=$activebalance&biy=$biaya$sttss");
//exit;
//}else{	


$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','','','','',''");
	
//	$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', '$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)."'");
	}	

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


//$db->insert("dataawalet", "", "'', '$stmpkodene', '$user_session', '$activebalance', '70% Register $myproduk user $username', 'administrator', '$clientdate', 1, '$clientdate'");
$accidxx=$db->dataku("accid", $user_session);
$db->insert("dataewalet", "", "'', '$stmpkodene', '$user_session', '$amount', 'Register $myproduk user $username', 'administrator', '$clientdate', 1, '$clientdate', '$accidxx', 'administrator'");
//$db->insert("dataawalet", "", "'', '$stmpkodene', '$user_session', '$activebalance', '50% Register $myproduk user $username', 'administrator', '$clientdate', 1, '$clientdate'");


//$expired = date('Y-m-d H:i:s', strtotime("+".$batastransfere." hour"));			
$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'");




$ttlkontrak = $priode;


$expired = date('Y-m-d H:i:s', strtotime("+".$ttlkontrak." ".$siklus.""));
$pakete="Package ".$planpaket."";
$harine2 = date("N");

$db->insert("deposit", "", "'', '$username', '$stmpkodene', '$amount', '1', '$clientdate', '$expired', '$produk', '$pringkate', '$profite', '$priode', '$harine2', '$siklus', '', ''"); 

            $db->update("member", "act='1'", "username='$username'");			


			$jumlahe=$biaya;
			$jumlah=$biaya;
			$users=$username;
			$usere=$username;
			$trans_code=$stmpkodene;
			$kode=$stmpkodene;
				
		
				$jsp=$db->jumlahsp($sponsore);
					$db->update("upline", "sp='$jsp'", "username='$sponsore'");
				
	
	
	
	$sponsore = $db->dataku("sponsor", $username);
			$sponsorelev2 = $db->dataku("sponsor", $sponsore);
			$sponsorelev3 = $db->dataku("sponsor", $sponsorelev2);
			$sponsorelev4 = $db->dataku("sponsor", $sponsorelev3);
			$sponsorelev5 = $db->dataku("sponsor", $sponsorelev4);
			$sponsorelev6 = $db->dataku("sponsor", $sponsorelev5);
			$sponsorelev7 = $db->dataku("sponsor", $sponsorelev6);
			$sponsorelev8 = $db->dataku("sponsor", $sponsorelev7);
			$sponsorelev9 = $db->dataku("sponsor", $sponsorelev8);
			$sponsorelev10 = $db->dataku("sponsor", $sponsorelev9);		
							
				$kmspons = explode("|", $db->config("komisi_sponsor"));	
			$komsponx = ($kmspons[0]/100)*$jumlah;
			$komsponx2 = ($kmspons[1]/100)*$jumlah;
			$komsponx3 = ($kmspons[2]/100)*$jumlah;
			$komsponx4 = ($kmspons[3]/100)*$jumlah;
			$komsponx5 = ($kmspons[4]/100)*$jumlah;
			$komsponx6 = ($kmspons[5]/100)*$jumlah;
			$komsponx7 = ($kmspons[6]/100)*$jumlah;
			$komsponx8 = ($kmspons[7]/100)*$jumlah;
			$komsponx9 = ($kmspons[8]/100)*$jumlah;
			$komsponx10 = ($kmspons[9]/100)*$jumlah;			
							
							
							
				if($sponsore && $komsponx > 0) {  
					$db->insert("komisi", "", "'', '$sponsore', '$komsponx', '$clientdate', '0', '', 'komsponsor', '$username', '".$trans_code."sp', ''");
				}
			   
			    if($sponsorelev2 && $komsponx2 > 0) {
					$db->insert("komisi", "", "'', '$sponsorelev2', '$komsponx2', '$clientdate', '0', '', 'komsponsor2', '$username', '".$trans_code."sp2', ''");
				}
				if($sponsorelev3 && $komsponx3 > 0) {
					$db->insert("komisi", "", "'', '$sponsorelev3', '$komsponx3', '$clientdate', '0', '', 'komsponsor3', '$username', '".$trans_code."sp3', ''");
				}
				if($sponsorelev4 && $komsponx4 > 0) {
					$db->insert("komisi", "", "'', '$sponsorelev4', '$komsponx4', '$clientdate', '0', '', 'komsponsor4', '$username', '".$trans_code."sp4', ''");
				}	
				if($sponsorelev5 && $komsponx5 > 0) {
					$db->insert("komisi", "", "'', '$sponsorelev5', '$komsponx5', '$clientdate', '0', '', 'komsponsor5', '$username', '".$trans_code."sp5', ''");
				}
				if($sponsorelev6 && $komsponx6 > 0) {
					$db->insert("komisi", "", "'', '$sponsorelev6', '$komsponx6', '$clientdate', '0', '', 'komsponsor6', '$username', '".$trans_code."sp6', ''");
				}
				if($sponsorelev7 && $komsponx7 > 0) {
					$db->insert("komisi", "", "'', '$sponsorelev7', '$komsponx7', '$clientdate', '0', '', 'komsponsor7', '$username', '".$trans_code."sp7', ''");
				}
				if($sponsorelev8 && $komsponx8 > 0) {
					$db->insert("komisi", "", "'', '$sponsorelev8', '$komsponx8', '$clientdate', '0', '', 'komsponsor8', '$username', '".$trans_code."sp8', ''");
				}
				if($sponsorelev9 && $komsponx9 > 0) {
					$db->insert("komisi", "", "'', '$sponsorelev9', '$komsponx9', '$clientdate', '0', '', 'komsponsor9', '$username', '".$trans_code."sp9', ''");
				}
				if($sponsorelev10 && $komsponx10 > 0) {
					$db->insert("komisi", "", "'', '$sponsorelev10', '$komsponx10', '$clientdate', '0', '', 'komsponsor10', '$username', '".$trans_code."sp10', ''");
				}			
								
				
				


$jumlahdepone = rupiah($biaya);
$prodd="".$myproduk."";
	
$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'");   


$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 = "Helo ".$nama.", Your investment package has been active, ".$prodd.", Amount ".rupiah($amount).".";
	//mysql_query("insert into outbox values('', '', '$usere', '$hp', '$isipesan', '$clientdate', '1')") or die(mysql_error());
	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{}
}


$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>
<strong>Package:</strong><br>
Package : ".$myproduk."<br>
Amount : ".$jumlahdepone."<br>
Payment : Wallet ID ".$accid."
</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>
<strong>Package:</strong><br>
Package : ".$myproduk."<br>
Amount : ".$jumlahdepone."<br>
Payment : Wallet ID ".$accid."
</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
$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><h4> Error!</h4><p>>Your R-POINT balance is insufficient, For Register this package min balance is ".rupiah($mine)." (50% from ".rupiah($byye).")</p></div>";
}
?>
<?php
$results = $_GET['result'];
$mine = $_GET['min'];
$byye = $_GET['biy'];
if($results == "insufficient_walet") { 
echo "<div class='alert alert-danger'><button type='button' class='close' data-dismiss='alert'><i class='icon-remove'></i></button><h4> Error!</h4><p>>Your BTC PIN balance is insufficient, For Register this package min balance is ".rupiah($byye)."</p></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><h4> Error!</h4><p>>Your Z-POINT balance is insufficient, For Register this package min balance is ".rupiah($mine)." (50% from ".rupiah($byye).")</p></div>";
}
?>
<?php
$results = $_GET['result'];
$minr = $_GET['minr'];
$minea = $_GET['mina'];
$byye = $_GET['biy'];
if($results == "insufficient_walet") { 
echo "<div class='alert alert-danger'><button type='button' class='close' data-dismiss='alert'><i class='icon-remove'></i></button><h4> Error!</h4><p>>Your E-POINT and REGISTER POINT balance is insufficient, For Register this package min E-POINT balance is ".rupiah($minea)." (70% from ".rupiah($byye).") and min REGISTER POINT balance is ".rupiah($minr)." (30% from ".rupiah($byye).").</p></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
 if(isset($_GET['result'])&&$_GET['result']=="max_email"){
if(isset($_GET['p'])) { $p = $_GET['p']; } 
if(isset($_GET['e'])) { $emaile = base64_decode($_GET['e']); } 
$notif_max_email_reg = LANG_REGISTER_MAX_EMAIL;
$notif_max_email_reg = preg_replace("/{email}/", $emaile, $notif_max_email_reg);
$notif_max_email_reg = preg_replace("/{p}/", $p, $notif_max_email_reg);	
$notif_max_email_reg = preg_replace("/{batas}/", MAX_EMAIL_REG, $notif_max_email_reg);	
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>".$notif_max_email_reg."</div>";
}
?>  
  <?php
 if(isset($_GET['result'])&&$_GET['result']=="max_hp"){
if(isset($_GET['p'])) { $p = $_GET['p']; } 
if(isset($_GET['e'])) { $hpne = base64_decode($_GET['e']); } 
$notif_max_hp_reg = LANG_REGISTER_MAX_HP;
$notif_max_hp_reg = preg_replace("/{hp}/", $hpne, $notif_max_hp_reg);
$notif_max_hp_reg = preg_replace("/{p}/", $p, $notif_max_hp_reg);	
$notif_max_hp_reg = preg_replace("/{batas}/", MAX_MOBILE_REG, $notif_max_hp_reg);	
echo "<div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'></button>".$notif_max_hp_reg."</div>";
}
?>
        <?php
if(isset($_GET['result'])&&$_GET['result']=="success"){
if(isset($_GET['e'])) { $emaile = base64_decode($_GET['e']); } 
if(isset($_GET['n'])) { $namae = base64_decode($_GET['n']); } 
$notif_register_success = LANG_REGISTER_SUCCESS_MEMBER;
$notif_register_success = preg_replace("/{email}/", $emaile, $notif_register_success);
$notif_register_success = preg_replace("/{nama}/", $db->dataku("nama", $user_session), $notif_register_success);	
echo "<div class='alert alert-block alert-success fade in'><button type='button' class='close' data-dismiss='alert'></button>".$notif_register_success."</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));
		
		
$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;				
		
	
	
		
		
		
			
?>
<?php
if($posisix == "L1"){ $pssi = "LEFT"; }else { $pssi = "RIGHT"; }
?>
         
 <?php
				 
  $saldocwalete = $db->myewalet($user_session);
			 $pendingcwalete = $db->myewaletpending($user_session);
			 $totalcwalete = $saldocwalete-$pendingcwalete; 
	
	//$byrewlt =	$jumlah/2;	
	
	
	
	if($totalcwalete > 0){
	$styler="style='background-color:#00753A; color:#FFF;' disabled='disabled'";
	$saldor=rupiah($totalcwalete);
	$diser="";
}else{
	$styler="style='background-color:#B50404; color:#FFF;' disabled='disabled'";
	$saldor=rupiah($totalcwalete);
	$diser=" disabled='disabled'";
}		
	 
	?>                
<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"/>
			                              
                                            
                            
                                             <div class="controls-row">

            <label>Wallet Balance</label>

           <input type="text" class="form-control" <?php echo $styler;?> value="<?php echo $saldor;?>">                                               

          </div>
                                                
                                   
                    <?php if($sp && $up && $pos && $dt) { ?>
                
               <div class="controls-row" style=" margin-top:10px;">
													<label>Sponsor ID</label>
												
															<input type="text" class="form-control" value="<?php echo $sponsorex; ?>" readonly="readonly" name="sponsore">
                                                            <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 class="controls-row" style=" margin-top:10px;">
													<label>Upline</label>
													
															
															<input type="text" class="form-control" value="<?php echo $uplix; ?>" readonly="readonly">
                                                      
												</div>
                 <div class="controls-row" style=" margin-top:10px;">
													<label>Position</label>
													
															<input type="text" class="form-control" value="<?php echo $pssi; ?>" readonly="readonly">
                                                          
												</div>
                
	<?php } else { ?>
 <div class="controls-row" style=" margin-top:10px;">
													<label>Sponsor ID</label>
												
															<input type="text" class="form-control" name="sponsore" required='required' value="<?php echo $sponsorex; ?>" readonly="readonly">
                                                            <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>
  
	<?php } ?>
			 
                                           
                                    <div class="controls-row" style=" margin-top:10px;">
													<label>Package</label>
													
														
														 <select name="produk" id="produk" class="form-control" required='required'>
                         <option value="">-- Select --</option>
               <?php
	
	for($i=0;$i<$batas_paket;$i++) {	
	 $ic = $i;
	 $icc = $i+1;
	 $produke = $lead[$ic];
	 $byay = $by[$ic];
	 $byay2 = $byx[$ic];
	
	 if($totalcwalete < $byay) {
	 $dss = "style='background-color:#B50404; color:#FFF;' disabled='disabled'";
	 }
	 
	 echo"<option value='".$icc."' ".$dss.">$produke - ".rupiah($byay)."</option>";
	 }
	 ?> 	  
			 
          </select>
														</div>
      
                                           
									
                                                <div class="controls-row" style=" margin-top:10px;">
													<label>Full Name</label>
														
															<input type="text" class="form-control" placeholder="Name" name="nama" required='required' value="<?php echo $_SESSION["namae"]; ?>">
												</div>
                                              
                                         <div class="controls-row" style=" margin-top:10px;">
													<label>Email</label>
													
															<input type="text" class="form-control" placeholder="Email" name="email" required='required' value="<?php echo $_SESSION["emaile"]; ?>">
													
												</div>
                                                
                                              <div class="controls-row" style=" margin-top:10px;">
													<label>Phone</label>
														
															<input id="mobile-number" class="form-control" placeholder="Phone" type="tel" name="hp" required='required' value="<?php echo $_SESSION["hpne"]; ?>">
                                                            
                                                                                                                 

												</div>
                                                
                                               
                                              <div class="controls-row" style=" margin-top:10px;">
													<label>USDT Address</label>
															
															<input id="bank" class="form-control" placeholder="USDT Address" type="text" name="bank" value="<?php echo $_SESSION["banke"]; ?>">
                                                            
                                                      
												</div>
                                               
                                              <div class="controls-row" style=" margin-top:10px;">
													<label>Username</label>
																
															<input type="text" class="form-control" placeholder="Username" name="username" id="username" required='required'>
                                                       
												</div>
                                               <div class="controls-row" style=" margin-top:10px;">
													<label>Password</label>
															
															<input type="password" class="form-control" placeholder="Password" name="password1" required='required' value="<?php echo $_SESSION["passworde"]; ?>">
                                                          
                                                        
												</div>
                                                
                                                
                                                <div class="controls-row" style=" margin-top:10px;">

            <label> &nbsp;</label>

                    <hr />                                      

          </div>
                                                
                                                
                                                 <div class="controls-row" style=" margin-top:10px;">

            <label>PIN</label>

           <input type="password" class="form-control" placeholder="Enter Your PIN" name="pincode" required='required'>
                                                          

          </div>

                                           
                                              
                                               <div>

           &nbsp;

          </div>
          <div>
        
           <button type="submit" class="btn btn-primary" 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="panel panel-inverse">
                        <div class="panel-heading bg-grey">
                            <h4 class="text-white">Register History</h4>
                        </div>
                        
                        <div class="panel-body">
                        
                        
                        
                        
                        
                                                          
                                    <table id="data-table" class="table table-bordered" cellspacing="0" width="100%">
                    
                    
              <thead>
                <tr>
                 <th>Username</th>
<th><?php echo $LANG["name"]?></th>
<th><?php echo $LANG["email"]?></th>
<th><?php echo $LANG["cellphone"]?></th>
<th>Referral</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", "regid='$user_session'", "id desc");
	
		while($row=$db->fetch_row()) {
		
		if($row[5] > 0) {
		$sts = "<span class='badge badge-success'>Active</span>";
	} else {
		$sts = "<span class='badge badge-important'>Inactive</span>";
	
	}	
if($row[4] == "0000-00-00 00:00:00"){
$dtdepo = "----";
}else{
$dtdepo = formatgl($row[4]);
}

?>				
				
				<tr> 
<td align="center"><?php echo $nom; ?></td>
<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 $row[7]; ?></td>
<td align="center"><?php echo $row[3]; ?></td>
<td align="center"><?php echo $dtdepo; ?></td>
<td align="center"><?php echo $sts; ?></td>
</tr>
             
                        <?php } ?>
              </tbody>
            </table>
                        </div>
                    </div>
                </div>
			</div>
			<!-- END PAGE CONTENT -->        
                     
<?php }  ?>