<?php
if (!defined("root")) {
	define("root", $_SERVER['DOCUMENT_ROOT']);
}
require(root."/___simple_config.php");
session_start();
require(root."/".memberFolder."/_common.php");
require(root."/".memberFolder."/_lib/db.php");
require(root."/".memberFolder."/_lib/main.php");
if (!isset($_SESSION["member"])) {
	cout('<script type="text/javascript">parent.window.location="/'.memberFolder.'/login";</script>');
	exit;
}
require(root."/".memberFolder."/_lib/bootstraps.php");
$a = cekpost(cleanQuery(isset($_REQUEST["a"])?$_REQUEST["a"]:""), "");
$b = cekpost(cleanQuery(isset($_REQUEST["b"])?$_REQUEST["b"]:""), "");
$c = cekpost(cleanQuery(isset($_REQUEST["c"])?$_REQUEST["c"]:""), "");
$ajax = cekpost(cleanQuery(isset($_REQUEST["useajax"])?$_REQUEST["useajax"]:""), "");
$action = cekpost(cleanQuery(isset($_REQUEST["action"])?$_REQUEST["action"]:""), "");
$cstr = '';
#printR($_REQUEST);
#echo "a=$a";
#echo "b=$b";
#echo "c=$c";
if ($action==1) {
	if (($a=="index" || $a=="account") && $b=="edit" && $c=="account") {
		$currpass = cekpost(cleanQuery(isset($_REQUEST["currpass"])?$_REQUEST["currpass"]:""), "");
		$newpass = cekpost(cleanQuery(isset($_REQUEST["newpass"])?$_REQUEST["newpass"]:""), "");
		$repass = cekpost(cleanQuery(isset($_REQUEST["repass"])?$_REQUEST["repass"]:""), "");
		if ($currpass!="" && $newpass!="" && $repass!="") {
			$currpass = saltEncoding($currpass);
			$newpass = saltEncoding($newpass);
			$repass = saltEncoding($repass);
			$rsc=array();$qc="SELECT * FROM members WHERE kdmember='".$_SESSION["member"]["kdmember"]."' AND pass='$currpass'";
			callRS($rsc, $qc);
			if (count($rsc)!=0) {
				if ($newpass==$repass) {
					$qu="UPDATE members SET pass='$newpass' WHERE kdmember='".$_SESSION["member"]["kdmember"]."'";
					execRS($qu);
					cout('<script type="text/javascript">parent.window.location="/'.memberFolder.'/a/'.$a.'";</script>');
					exit;
				} else {
					exit;
					#err retype pass ga sama
				}
			} else {
				exit;
				#err current pass ga sama
			}
		}
	}
	if (($a=="index" || $a=="profile") && $b=="edit" && $c=="bank") {
		$kdbank = cekpost(cleanQuery(isset($_REQUEST["kdbank"])?$_REQUEST["kdbank"]:"0"), "0");
		$namarek = cekpost(cleanQuery(isset($_REQUEST["namarek"])?$_REQUEST["namarek"]:""), "");
		$norek = cekpost(cleanQuery(isset($_REQUEST["norek"])?$_REQUEST["norek"]:""), "");
		$qu="UPDATE members SET kdbank='$kdbank', norek='$norek', namarek='$namarek' WHERE kdmember='".$_SESSION["member"]["kdmember"]."'";
		execRS($qu);
		cout('<script type="text/javascript">parent.window.location="/'.memberFolder.'/a/'.$a.'";</script>');
		exit;
	}
	if (($a=="index" || $a=="profile") && $b=="edit" && $c=="info") {
		$nama = cekpost(cleanQuery(isset($_REQUEST["nama"])?$_REQUEST["nama"]:""), "");
		$sex = cekpost(cleanQuery(isset($_REQUEST["sex"])?$_REQUEST["sex"]:"0"), "0");
		$tanggal = cekpost(cleanQuery(isset($_REQUEST["tanggal"])?$_REQUEST["tanggal"]:""), "");
		$email = cekpost(cleanQuery(isset($_REQUEST["email"])?$_REQUEST["email"]:""), "");
		$telp = cekpost(cleanQuery(isset($_REQUEST["telp"])?$_REQUEST["telp"]:""), "");
		$qu="UPDATE members SET nama='$nama', sex='$sex', lahiran='".strtotime($tanggal)."', email='$email', telp='$telp' WHERE kdmember='".$_SESSION["member"]["kdmember"]."'";
		execRS($qu);
		cout('<script type="text/javascript">parent.window.location="/'.memberFolder.'/a/'.$a.'";</script>');
		exit;
	}
	if (($a=="deposit" || $a=="withdrawal") && $b=="add") {
		$jumlah = cekpost(cleanQuery(isset($_REQUEST["jumlah"])?$_REQUEST["jumlah"]:"0"), "0");
		$ival = cekpost(cleanQuery(isset($_REQUEST["ival"])?$_REQUEST["ival"]:""), "");
		$jumlah = str_replace(",", "", $jumlah);
		if ($jumlah<50000) {
			if ($a=="deposit") {
				$err["jumlah"] = cleanQuery(BSErrorMessage('Minimum of deposit amounts are IDR 50,000'));
			}
			if ($a=="withdrawal") {
				$err["jumlah"] = cleanQuery(BSErrorMessage('Minimum of withdrawal amounts are IDR 50,000'));
			}
			cout('<script type="text/javascript">parent.showErrorDashboardForm(\''.json_encode($err).'\');</script>');
			exit;
		} else {
			$err = array();
			$rsm=array();$qm="SELECT a.*, b.username FROM members a LEFT JOIN accounts b ON b.kdaccount=a.kdaccount WHERE a.kdmember='".$_SESSION["member"]["kdmember"]."'";
			callRS($rsm, $qm);
			$rsc=array();
			$qc="SELECT a.*, username FROM members a 
				LEFT JOIN accounts b ON b.kdaccount=a.kdaccount 
				WHERE a.isactive=1 AND username='".$rsm[0]["username"]."' AND a.kdgame='".$rsm[0]["kdgame"]."' AND a.kdbank='".$rsm[0]["kdbank"]."' AND a.norek='".$rsm[0]["norek"]."'";
			callRS($rsc, $qc);
			#echo $qc."<br/>";
			if (count($rsc)<=0 && $rsm[0]["username"]!="") { $err["username"] = cleanQuery(BSErrorMessage('Username tidak ditemukan! Pastikan Username sudah sesuai dengan nomor rekening terdaftar.')); }
			
			if ($a=="deposit") {
				$rsc2 = array();
				$qc2 = "SELECT * FROM deposits WHERE kdgame='".$rsm[0]["kdgame"]."' AND username='".$rsm[0]["username"]."' AND kdbank='".$rsm[0]["kdbank"]."' AND norek='".$rsm[0]["norek"]."' AND ispending=1 AND isclear=0";
				callRS($rsc2, $qc2);
				if (count($rsc2)!=0) { $err["pending"] = cleanQuery(BSErrorMessage('Tidak dapat melakukan deposit, Anda masih memiliki 1 deposit yang sedang diproses')); }
			}
			if ($a=="withdrawal") {
				$rsc2 = array();
				$qc2 = "SELECT * FROM withdraws WHERE kdgame='".$rsm[0]["kdgame"]."' AND username='".$rsm[0]["username"]."' AND kdbank='".$rsm[0]["kdbank"]."' AND norek='".$rsm[0]["norek"]."' AND ispending=1 AND isclear=0";
				callRS($rsc2, $qc2);
				if (count($rsc2)!=0) { $err["pending"] = cleanQuery(BSErrorMessage('Tidak dapat melakukan withdraw, Anda masih memiliki 1 withdtaw yang sedang diproses')); }
			}
			if ($ival=="") { $err["ival"] = cleanQuery(BSErrorMessage('Kode Validasi harus diisi!')); }
			if ($ival!=$_SESSION["code"] && $ival!="") { $err["ival"] = cleanQuery(BSErrorMessage('Kode Validasi tidak cocok!')); }
			#printR($err);
			if (empty($err)) {
				$isactive = 1;
				$creby = "VISITOR";
				$cretime = time();
				if ($a=="deposit") {
					$kddeposit = getID("deposits", "kddeposit");
				}
				if ($a=="withdrawal") {
					$kdwithdraw = getID("withdraws", "kdwithdraw");
				}
				$rsu=array();$qu="SELECT a.*, username FROM members a 
					LEFT JOIN accounts b ON b.kdaccount=a.kdaccount
					WHERE a.isactive=1 AND username='".$rsm[0]["username"]."' AND a.kdbank='".$rsm[0]["kdbank"]."' AND a.kdgame='".$rsm[0]["kdgame"]."' AND a.norek='".$rsm[0]["norek"]."'";
				#$rsu = callRS($qu);
				callRS($rsu, $qu);
				$username = $rsu[0]["username"];
				$kdmember = $rsu[0]["kdmember"];
				$ispending = 1;
				$dari = "WEBSITE - Dashboard";
				$dari_ip1 = get_client_ip();
				$dari_ip2 = get_client_ip2();
				$tanggal = time();
				$kodetransaksi = generateRandomString(15);
				do {
					if ($a=="deposit") {
						$rscek = array(); $qcek = "SELECT kddeposit FROM deposits WHERE kodetransaksi = '$kodetransaksi'";
						callRS($rscek, $qcek);
					}
					if ($a=="withdrawal") {
						$rscek = array(); $qcek = "SELECT kdwithdraw FROM withdraws WHERE kodetransaksi = '$kodetransaksi'";
						callRS($rscek, $qcek);
					}
					if (count($rscek)!=0) {
						$flag = 0;
						$kodetransaksi = generateRandomString(15);
					} else {
						$flag = 1;
					}
				} while($flag==0);
				$kdgame = $rsm[0]["kdgame"];
				$kdbank = $rsm[0]["kdbank"];
				$norek = $rsm[0]["norek"];
				$namarek = $rsm[0]["namarek"];
				if ($a=="deposit") {
					$q = "INSERT INTO deposits (kddeposit, kdgame, username, kdmember, kdbank, norek, namarek, jumlah, tanggal, kodetransaksi, dari, dari_ip1, dari_ip2, ispending, isactive, creby, cretime) 
						VALUES ('$kddeposit', '$kdgame', '".$rsm[0]["username"]."', '".$_SESSION["member"]["kdmember"]."', '$kdbank', '$norek', '$namarek', '$jumlah', '$tanggal', '$kodetransaksi', '$dari', '$dari_ip1', '$dari_ip2', '$ispending', '$isactive', '$creby', '$cretime')";
					execRS($q);
				}
				if ($a=="withdrawal") {
					$q = "INSERT INTO withdraws (kdwithdraw, kdgame, username, kdmember, kdbank, norek, namarek, jumlah, tanggal, kodetransaksi, dari, dari_ip1, dari_ip2, ispending, isactive, creby, cretime) 
						VALUES ('$kdwithdraw', '$kdgame', '".$rsm[0]["username"]."', '".$_SESSION["member"]["kdmember"]."', '$kdbank', '$norek', '$namarek', '$jumlah', '$tanggal', '$kodetransaksi', '$dari', '$dari_ip1', '$dari_ip2', '$ispending', '$isactive', '$creby', '$cretime')";
					execRS($q);
				}
				
				exit;
				#$q = "INSERT INTO deposits (kddeposit, kdgame, username, kdmember, kdbank, norek, namarek, jumlah, tanggal, kodetransaksi, dari, dari_ip1, dari_ip2, ispending, isactive, creby, cretime) 
				#	VALUES ('?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?')";
				#$q = "INSERT INTO deposits (kddeposit, kdgame, username, kdmember, kdbank, norek, namarek, jumlah, tanggal, kodetransaksi, dari, dari_ip1, dari_ip2, ispending, isactive, creby, cretime) 
				#	VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
				#$param = array($kddeposit, $igame, $username, $kdmember, $kdbank, $norek, $namarek, $jumlah, $tanggal, $kodetransaksi, $dari, $dari_ip1, $dari_ip2, $ispending, $isactive, $creby, $cretime);
				#$rs = callRS($q, $param);
				cout('<script type="text/javascript">parent.window.location="/'.memberFolder.'/a/'.$a.'";</script>');
				exit;
			} else {
				cout('<script type="text/javascript">parent.showErrorDashboardForm(\''.json_encode($err).'\');</script>');
				exit;
			}
		}
		exit;
	}
	exit;
}
$cstr .= '<div class="container-fluid">';
	$cstr .= '<div class="container-custom-fluid">';
if ($a=="index") {
	$rsm = array();
	$qm="SELECT a.*, namabank, b.kdnegara AS kdnegara FROM members a 
		LEFT JOIN banks b ON b.kdbank=a.kdbank
		WHERE a.kdmember='".$_SESSION["member"]["kdmember"]."'";
	callRS($rsm, $qm);
	if ($b=="edit") {
		if ($c=="info") {
			$cstr .= '<div class="col-xs-12 col-md-5 box-border">';
				$cstr .= '<form method="post" target="quick_iframe" action="/'.memberFolder.'/a/'.$a.'/'.$b.'/'.$c.'/action" role="form">';
					$cstr .= '<h3 class="text-center">Member Information</h3>';
					$cstr .= '<dl class="dl-horizontal dldata">';
						$cstr .= '<dt>Full Name</dt>';
						$cstr .= '<dd><input type="text" name="nama" id="nama" class="form-control" value="'.$rsm[0]["nama"].'"/></dd>';
						
						$gender = '';
						switch($rsm[0]["sex"]) {
							case 1: { $gender='Male';break; }
							case 2: { $gender='Female';break; }
							case 3: { $gender='Other';break; }
						}
						$cstr .= '<dt>Gender</dt>';
						$cstr .= '<dd>';
							$cstr .= '<select name="sex" id="sex" class="form-control">';
								$cstr .= '<option value="">-Select your gender-</option>';
								$cstr .= '<option value="1" '.(intval($rsm[0]["sex"])==1?'selected="selected"':'').'>Male</option>';
								$cstr .= '<option value="2" '.(intval($rsm[0]["sex"])==2?'selected="selected"':'').'>Female</option>';
							$cstr .= '</select>';
						$cstr .= '</dd>';
						
						$lahiran = isset($rsm[0]["lahiran"]) && $rsm[0]["lahiran"]!=""?date('d M Y', $rsm[0]["lahiran"]):'';
						$cstr .= '<dt><label for="tanggal">Date</label></dt>';
						$cstr .= '<dd>';
							$cstr .= '<div class="form-group">';
								$cstr .= '<div class="controls">';
									$cstr .= '<div class="input-group">';
										$cstr .= '<input id="tanggal" name="tanggal" type="text" class="tanggal form-control" placeholder="Date" value="'.date('d-m-Y', time()).'" />';
										$cstr .= '<label for="tanggal" class="input-group-addon btn">';
											$cstr .= '<span class="glyphicon glyphicon-calendar"></span>';
										$cstr .= '</label>';
									$cstr .= '</div>';
								$cstr .= '</div>';
							$cstr .= '</div>';
						$cstr .= '</dd>';
						
						$cstr .= '<dt>Email</dt>';
						$cstr .= '<dd><input type="email" name="email" id="email" class="form-control" value="'.$rsm[0]["email"].'"/></dd>';
						
						$cstr .= '<dt>Phone</dt>';
						$cstr .= '<dd><input type="number" name="telp" id="telp" class="form-control" value="'.$rsm[0]["telp"].'"/></dd>';
						
						
						$cstr .= '<dt></dt>';
						$cstr .= '<dd>';
							$cstr .= '<a type="button" class="btn btn-danger to-ajax" data-target="#home" href="/'.memberFolder.'/a/'.$a.'">Cancel</a> ';
							$cstr .= '<input type="submit" class="btn btn-primary" value="Save" />';
						$cstr .= '</dd>';
					$cstr .= '</dl>';
				$cstr .= '</form>';
			$cstr .= '</div><!--/.box-border-->';
			$viewFrame = 0;
			if ($viewFrame==1) {
				$cstr .= '<iframe name="quick_iframe" id="quick_iframe" src="/'.memberFolder.'/a/none" width="100%" height="100" style="overflow:;color:#000;background:#fff;border:1px red solid;" visibility="" scrolling="yes" frameborder="1"></iframe>';
			} else {
				$cstr .= '<iframe name="quick_iframe" id="quick_iframe" src="/'.memberFolder.'/a/none" width="300" height="11" style="overflow:hidden;" visibility="hidden" scrolling="no" frameborder="0"></iframe>';
			}
		} # end if ($c=="info")
		
		if ($c=="bank") {
			$cstr .= '<div class="col-xs-12 col-md-5 box-border">';
				$cstr .= '<form method="post" target="quick_iframe" action="/'.memberFolder.'/a/'.$a.'/'.$b.'/'.$c.'/action" role="form">';
					$cstr .= '<h3 class="text-center">Bank Details</h3>';
					$cstr .= '<dl class="dl-horizontal dldata">';
						$cstr .= '<dt>Bank</dt>';
						$cstr .= '<dd>';
							$cstr .= '<select name="kdbank" id="kdbank" class="form-control">';
								$cstr .= '<option value="">-Select your banks-</option>';
								$rsb=array(); $qb="SELECT a.* FROM banks a LEFT JOIN negara b ON b.kdnegara=a.kdnegara WHERE a.isactive=1 AND b.kdlang='".$_SESSION["lang_id"]."'";
								callRS($rsb, $qb);
								for ($i=0;$i<count($rsb);$i++) {
									$cstr .= '<option value="'.$rsb[$i]["kdbank"].'" '.(intval($rsb[$i]["kdbank"])==intval($rsm[0]["kdbank"])?'selected="selected"':'').'>'.$rsb[$i]["namabank"].'</option>';
								}
							$cstr .= '</select>';
						$cstr .= '</dd>';
						
						$cstr .= '<dt>Account Holder</dt>';
						$cstr .= '<dd><input type="text" name="namarek" id="namarek" class="form-control" value="'.$rsm[0]["namarek"].'"/></dd>';
						
						$cstr .= '<dt>Account Number</dt>';
						$cstr .= '<dd><input type="number" name="norek" id="norek" class="form-control" value="'.$rsm[0]["norek"].'"/></dd>';
						
						$cstr .= '<dt></dt>';
						$cstr .= '<dd>';
							$cstr .= '<a type="button" class="btn btn-danger to-ajax" data-target="#home" href="/'.memberFolder.'/a/'.$a.'">Cancel</a> ';
							$cstr .= '<input type="submit" class="btn btn-primary" value="Save" />';
						$cstr .= '</dd>';
					$cstr .= '</dl>';
				$cstr .= '</form>';
			$cstr .= '</div><!--/.box-border-->';
			$viewFrame = 0;
			if ($viewFrame==1) {
				$cstr .= '<iframe name="quick_iframe" id="quick_iframe" src="/'.memberFolder.'/a/none" width="100%" height="100" style="overflow:;color:#000;background:#fff;border:1px red solid;" visibility="" scrolling="yes" frameborder="1"></iframe>';
			} else {
				$cstr .= '<iframe name="quick_iframe" id="quick_iframe" src="/'.memberFolder.'/a/none" width="300" height="11" style="overflow:hidden;" visibility="hidden" scrolling="no" frameborder="0"></iframe>';
			}
		} # end if ($c=="bank")
			
		if ($c=="account") {
			$cstr .= '<div class="col-xs-12 col-md-5 box-border">';
				$cstr .= '<form method="post" target="quick_iframe" action="/'.memberFolder.'/a/'.$a.'/'.$b.'/'.$c.'/action" role="form">';
					$cstr .= '<h3 class="text-center">Account Information</h3>';
					$cstr .= '<dl class="dl-horizontal dldata">';
						$cstr .= '<dt>Current Password</dt>';
						$cstr .= '<dd><input type="password" name="currpass" id="currpass" class="form-control" /></dd>';
						
						$cstr .= '<dt>New Password</dt>';
						$cstr .= '<dd><input type="password" name="newpass" id="newpass" class="form-control" /></dd>';
						
						$cstr .= '<dt>Re-type Password</dt>';
						$cstr .= '<dd><input type="password" name="repass" id="repass" class="form-control" /></dd>';
						
						$cstr .= '<dt></dt>';
						$cstr .= '<dd><a type="button" class="btn btn-danger to-ajax" data-target="#home" href="/'.memberFolder.'/a/'.$a.'">Cancel</a> <input type="submit" class="btn btn-primary" value="Save" /></dd>';
					$cstr .= '</dl>';
				$cstr .= '</form>';
			$cstr .= '</div><!--/.box-border-->';
			$viewFrame = 0;
			if ($viewFrame==1) {
				$cstr .= '<iframe name="quick_iframe" id="quick_iframe" src="/'.memberFolder.'/a/none" width="100%" height="100" style="overflow:;color:#000;background:#fff;border:1px red solid;" visibility="" scrolling="yes" frameborder="1"></iframe>';
			} else {
				$cstr .= '<iframe name="quick_iframe" id="quick_iframe" src="/'.memberFolder.'/a/none" width="300" height="11" style="overflow:hidden;" visibility="hidden" scrolling="no" frameborder="0"></iframe>';
			}
		} # end if ($c=="account")
	} # end if ($b=="edit")
	if ($b=="") {
		$cstr .= '<div class="row">';
			$cstr .= '<div class="col-md-4">';
				$cstr .= '<h3>Member Information</h3>';
				$cstr .= '<div class="col-md-10 box-border">';
					$cstr .= '<dl class="dl-horizontal dldata">';
						$cstr .= '<dt>Full Name</dt>';
						$cstr .= '<dd>'.$rsm[0]["nama"].'</dd>';
						
						$gender = '';
						switch($rsm[0]["sex"]) {
							case 1: { $gender='Male';break; }
							case 2: { $gender='Female';break; }
							case 3: { $gender='Other';break; }
						}
						$cstr .= '<dt>Gender</dt>';
						$cstr .= '<dd>'.$gender.'</dd>';
						
						$lahiran = isset($rsm[0]["lahiran"]) && $rsm[0]["lahiran"]!=""?date('d M Y', $rsm[0]["lahiran"]):'';
						$cstr .= '<dt>Date of Birth</dt>';
						$cstr .= '<dd>'.$lahiran.'</dd>';
						
						$cstr .= '<dt></dt>';
						$cstr .= '<dd><a class="btn btn-primary to-ajax" data-target="#home" href="/'.memberFolder.'/a/'.$a.'/edit/info">Edit</a></dd>';
					$cstr .= '</dl>';
				$cstr .= '</div><!--/.col-md-10 box-border-->';
			$cstr .= '</div><!--/.col-md-4-->';
			$cstr .= '<div class="col-md-4">';
				$cstr .= '<h3>Bank Details</h3>';
				$cstr .= '<div class="col-md-10 box-border">';
					$cstr .= '<dl class="dl-horizontal dldata">';
						$cstr .= '<dt>Bank</dt>';
						$cstr .= '<dd>'.$rsm[0]["namabank"].'</dd>';
						
						$cstr .= '<dt>Account Number</dt>';
						$cstr .= '<dd>'.$rsm[0]["norek"].'</dd>';
						
						$cstr .= '<dt>Account Holder</dt>';
						$cstr .= '<dd>'.$rsm[0]["namarek"].'</dd>';
						
						$cstr .= '<dt></dt>';
						$cstr .= '<dd><a class="btn btn-primary to-ajax" data-target="#home" href="/'.memberFolder.'/a/'.$a.'/edit/bank">Edit</a></dd>';
					$cstr .= '</dl>';
				$cstr .= '</div><!--/.col-md-10 box-border-->';
			$cstr .= '</div><!--/.col-md-4-->';
			$cstr .= '<div class="col-md-4">';
				$cstr .= '<h3>Account Information</h3>';
				$cstr .= '<div class="col-md-10 box-border">';
					$cstr .= '<dl class="dl-horizontal dldata">';
						$cstr .= '<dt>Change Password</dt>';
						$cstr .= '<dd>Change your current Member Dashboard password</dd>';
						$cstr .= '<dt></dt>';
						$cstr .= '<dd><a class="btn btn-primary to-ajax" data-target="#home" href="/'.memberFolder.'/a/'.$a.'/edit/account">Change</a></dd>';
					$cstr .= '</dl>';
				$cstr .= '</div><!--/.col-md-10 box-border-->';
			$cstr .= '</div><!--/.col-md-4-->';
		$cstr .= '</div><!--/.row-->';
	
	} # end if ($b=="")
		
} # end if ($a=="index")
#################### INDEX END

#################### PROFILE
if ($a=="profile") {
	$rsm = array();
	$qm="SELECT a.*, namabank, b.kdnegara AS kdnegara FROM members a 
		LEFT JOIN banks b ON b.kdbank=a.kdbank
		WHERE a.kdmember='".$_SESSION["member"]["kdmember"]."'";
	callRS($rsm, $qm);
	if ($b=="") {
		$cstr .= '<div class="row">';
			$cstr .= '<div class="col-md-6">';
				$cstr .= '<h3>Member Information</h3>';
				$cstr .= '<div class="col-md-10 box-border">';
					$cstr .= '<dl class="dl-horizontal dldata">';
						$cstr .= '<dt>Full Name</dt>';
						$cstr .= '<dd>'.$rsm[0]["nama"].'</dd>';
						
						$gender = '';
						switch($rsm[0]["sex"]) {
							case 1: { $gender='Male';break; }
							case 2: { $gender='Female';break; }
							case 3: { $gender='Other';break; }
						}
						$cstr .= '<dt>Gender</dt>';
						$cstr .= '<dd>'.$gender.'</dd>';
						
						$lahiran = isset($rsm[0]["lahiran"]) && $rsm[0]["lahiran"]!=""?date('d M Y', $rsm[0]["lahiran"]):'';
						$cstr .= '<dt>Date of Birth</dt>';
						$cstr .= '<dd>'.$lahiran.'</dd>';
						
						$cstr .= '<dt>Email</dt>';
						$cstr .= '<dd>'.$rsm[0]["email"].'</dd>';
						
						$cstr .= '<dt>Phone</dt>';
						$cstr .= '<dd>'.$rsm[0]["telp"].'</dd>';
						
						$cstr .= '<dt></dt>';
						$cstr .= '<dd><a class="btn btn-primary to-ajax" data-target="#'.$a.'" href="/'.memberFolder.'/a/'.$a.'/edit/info">Edit</a></dd>';
					$cstr .= '</dl>';
				$cstr .= '</div><!--/.col-md-10 box-border-->';
			$cstr .= '</div><!--/.col-md-6-->';
			$cstr .= '<div class="col-md-6">';
				$cstr .= '<h3>Bank Details</h3>';
				$cstr .= '<div class="col-md-10 box-border">';
					$cstr .= '<dl class="dl-horizontal dldata">';
						$cstr .= '<dt>Bank</dt>';
						$cstr .= '<dd>'.$rsm[0]["namabank"].'</dd>';
						
						$cstr .= '<dt>Account Number</dt>';
						$cstr .= '<dd>'.$rsm[0]["norek"].'</dd>';
						
						$cstr .= '<dt>Account Holder</dt>';
						$cstr .= '<dd>'.$rsm[0]["namarek"].'</dd>';
						
						$cstr .= '<dt></dt>';
						$cstr .= '<dd><a class="btn btn-primary to-ajax" data-target="#'.$a.'" href="/'.memberFolder.'/a/'.$a.'/edit/bank">Edit</a></dd>';
					$cstr .= '</dl>';
				$cstr .= '</div><!--/.col-md-10 box-border-->';
			$cstr .= '</div><!--/.col-md-6-->';
		$cstr .= '</div><!--/.row-->';
	
	} # end if ($b=="")
	
	if ($b=="edit") {
		if ($c=="info") {
			$cstr .= '<div class="col-xs-12 col-md-5 box-border">';
				$cstr .= '<form method="post" target="quick_iframe" action="/'.memberFolder.'/a/'.$a.'/'.$b.'/'.$c.'/action" role="form">';
					$cstr .= '<h3 class="text-center">Member Information</h3>';
					$cstr .= '<dl class="dl-horizontal dldata">';
						$cstr .= '<dt>Full Name</dt>';
						$cstr .= '<dd><input type="text" name="nama" id="nama" class="form-control" value="'.$rsm[0]["nama"].'"/></dd>';
						
						$gender = '';
						switch($rsm[0]["sex"]) {
							case 1: { $gender='Male';break; }
							case 2: { $gender='Female';break; }
							case 3: { $gender='Other';break; }
						}
						$cstr .= '<dt>Gender</dt>';
						$cstr .= '<dd>';
							$cstr .= '<select name="sex" id="sex" class="form-control">';
								$cstr .= '<option value="">-Select your gender-</option>';
								$cstr .= '<option value="1" '.(intval($rsm[0]["sex"])==1?'selected="selected"':'').'>Male</option>';
								$cstr .= '<option value="2" '.(intval($rsm[0]["sex"])==2?'selected="selected"':'').'>Female</option>';
							$cstr .= '</select>';
						$cstr .= '</dd>';
						
						$lahiran = isset($rsm[0]["lahiran"]) && $rsm[0]["lahiran"]!=""?date('d M Y', $rsm[0]["lahiran"]):'';
						$cstr .= '<dt><label for="tanggal">Date</label></dt>';
						$cstr .= '<dd>';
							$cstr .= '<div class="form-group">';
								$cstr .= '<div class="controls">';
									$cstr .= '<div class="input-group">';
										$cstr .= '<input id="tanggal" name="tanggal" type="text" class="tanggal form-control" placeholder="Date" value="'.date('d-m-Y', time()).'" />';
										$cstr .= '<label for="tanggal" class="input-group-addon btn">';
											$cstr .= '<span class="glyphicon glyphicon-calendar"></span>';
										$cstr .= '</label>';
									$cstr .= '</div>';
								$cstr .= '</div>';
							$cstr .= '</div>';
						$cstr .= '</dd>';
						
						$cstr .= '<dt>Email</dt>';
						$cstr .= '<dd><input type="email" name="email" id="email" class="form-control" value="'.$rsm[0]["email"].'"/></dd>';
						
						$cstr .= '<dt>Phone</dt>';
						$cstr .= '<dd><input type="number" name="telp" id="telp" class="form-control" value="'.$rsm[0]["telp"].'"/></dd>';
						
						
						$cstr .= '<dt></dt>';
						$cstr .= '<dd><a type="button" class="btn btn-danger to-ajax" data-target="#'.$a.'" href="/'.memberFolder.'/a/'.$a.'">Cancel</a> <input type="submit" class="btn btn-primary" value="Save" /></dd>';
					$cstr .= '</dl>';
				$cstr .= '</form>';
			$cstr .= '</div><!--/.box-border-->';
			$viewFrame = 0;
			if ($viewFrame==1) {
				$cstr .= '<iframe name="quick_iframe" id="quick_iframe" src="/'.memberFolder.'/a/none" width="100%" height="100" style="overflow:;color:#000;background:#fff;border:1px red solid;" visibility="" scrolling="yes" frameborder="1"></iframe>';
			} else {
				$cstr .= '<iframe name="quick_iframe" id="quick_iframe" src="/'.memberFolder.'/a/none" width="300" height="11" style="overflow:hidden;" visibility="hidden" scrolling="no" frameborder="0"></iframe>';
			}
		} # end if ($c=="info")
		
		if ($c=="bank") {
			$cstr .= '<div class="col-xs-12 col-md-5 box-border">';
				$cstr .= '<form method="post" target="quick_iframe" action="/'.memberFolder.'/a/'.$a.'/'.$b.'/'.$c.'/action" role="form">';
					$cstr .= '<h3 class="text-center">Bank Details</h3>';
					$cstr .= '<dl class="dl-horizontal dldata">';
						$cstr .= '<dt>Bank</dt>';
						$cstr .= '<dd>';
							$cstr .= '<select name="kdbank" id="kdbank" class="form-control">';
								$cstr .= '<option value="">-Select your banks-</option>';
								$rsb=array(); $qb="SELECT a.* FROM banks a LEFT JOIN negara b ON b.kdnegara=a.kdnegara WHERE a.isactive=1 AND b.kdlang='".$_SESSION["lang_id"]."'";
								callRS($rsb, $qb);
								for ($i=0;$i<count($rsb);$i++) {
									$cstr .= '<option value="'.$rsb[$i]["kdbank"].'" '.(intval($rsb[$i]["kdbank"])==intval($rsm[0]["kdbank"])?'selected="selected"':'').'>'.$rsb[$i]["namabank"].'</option>';
								}
							$cstr .= '</select>';
						$cstr .= '</dd>';
						
						$cstr .= '<dt>Account Holder</dt>';
						$cstr .= '<dd><input type="text" name="namarek" id="namarek" class="form-control" value="'.$rsm[0]["namarek"].'"/></dd>';
						
						$cstr .= '<dt>Account Number</dt>';
						$cstr .= '<dd><input type="number" name="norek" id="norek" class="form-control" value="'.$rsm[0]["norek"].'"/></dd>';
						
						$cstr .= '<dt></dt>';
						$cstr .= '<dd><a type="button" class="btn btn-danger to-ajax" data-target="#'.$a.'" href="/'.memberFolder.'/a/'.$a.'">Cancel</a> <input type="submit" class="btn btn-primary" value="Save" /></dd>';
					$cstr .= '</dl>';
				$cstr .= '</form>';
			$cstr .= '</div><!--/.box-border-->';
			$viewFrame = 0;
			if ($viewFrame==1) {
				$cstr .= '<iframe name="quick_iframe" id="quick_iframe" src="/'.memberFolder.'/a/none" width="100%" height="100" style="overflow:;color:#000;background:#fff;border:1px red solid;" visibility="" scrolling="yes" frameborder="1"></iframe>';
			} else {
				$cstr .= '<iframe name="quick_iframe" id="quick_iframe" src="/'.memberFolder.'/a/none" width="300" height="11" style="overflow:hidden;" visibility="hidden" scrolling="no" frameborder="0"></iframe>';
			}
		} # end if ($c=="bank")
	} # end if ($b=="edit")
	
} # end if ($a=="profile")
#################### PROFILE END

#################### ACCOUNT
if ($a=="account") {
	$rsm = array();
	$qm="SELECT a.*, namabank, b.kdnegara AS kdnegara, c.nama AS namagame, d.username AS username FROM members a 
		LEFT JOIN banks b ON b.kdbank=a.kdbank
		LEFT JOIN games c ON c.kdgame=a.kdgame
		LEFT JOIN accounts d ON d.kdaccount=a.kdaccount
		WHERE a.kdmember='".$_SESSION["member"]["kdmember"]."'";
	callRS($rsm, $qm);
	if ($b=="") {
		$cstr .= '<div class="row">';
			$cstr .= '<div class="col-md-6">';
				$cstr .= '<h3>Game ID Information</h3>';
				$cstr .= '<div class="col-md-10 box-border">';
					$cstr .= '<dl class="dl-horizontal dldata">';
						$cstr .= '<dt>Game:</dt>';
						$cstr .= '<dd>'.$rsm[0]["namagame"].'</dd>';
						$cstr .= '<dt>UserID:</dt>';
						$cstr .= '<dd>'.(isset($rsm[0]["username"]) && $rsm[0]["username"]!=""?$rsm[0]["username"]:'<em>Please confirm with our Customer Service for Game ID Information</em>').'</dd>';
					$cstr .= '</dl>';
				$cstr .= '</div><!--/.col-md-10 box-border-->';
			$cstr .= '</div><!--/.col-md-6-->';
			$cstr .= '<div class="col-md-6">';
				$cstr .= '<h3>Account Information</h3>';
				$cstr .= '<div class="col-md-10 box-border">';
					$cstr .= '<dl class="dl-horizontal dldata">';
						$cstr .= '<dt>Change Password</dt>';
						$cstr .= '<dd>Change your current Member Dashboard password</dd>';
						$cstr .= '<dt></dt>';
						$cstr .= '<dd><a class="btn btn-primary to-ajax" data-target="#account" href="/'.memberFolder.'/a/'.$a.'/edit/account">Change</a></dd>';
					$cstr .= '</dl>';
				$cstr .= '</div><!--/.col-md-10 box-border-->';
				
			$cstr .= '</div><!--/.col-md-6-->';
		$cstr .= '</div><!--/.row-->';
	} # end if ($b=="")
	
	if ($b=="edit") {
		if ($c=="account") {
			$cstr .= '<div class="col-xs-12 col-md-5 box-border">';
				$cstr .= '<form method="post" target="quick_iframe" action="/'.memberFolder.'/a/'.$a.'/'.$b.'/'.$c.'/action" role="form">';
					$cstr .= '<h3 class="text-center">Account Information</h3>';
					$cstr .= '<dl class="dl-horizontal dldata">';
						$cstr .= '<dt>Current Password</dt>';
						$cstr .= '<dd><input type="password" name="currpass" id="currpass" class="form-control" /></dd>';
						
						$cstr .= '<dt>New Password</dt>';
						$cstr .= '<dd><input type="password" name="newpass" id="newpass" class="form-control" /></dd>';
						
						$cstr .= '<dt>Re-type Password</dt>';
						$cstr .= '<dd><input type="password" name="repass" id="repass" class="form-control" /></dd>';
						
						$cstr .= '<dt></dt>';
						$cstr .= '<dd><a type="button" class="btn btn-danger to-ajax" data-target="#account" href="/'.memberFolder.'/a/'.$a.'">Cancel</a> <input type="submit" class="btn btn-primary" value="Save" /></dd>';
					$cstr .= '</dl>';
				$cstr .= '</form>';
			$cstr .= '</div><!--/.box-border-->';
			$viewFrame = 0;
			if ($viewFrame==1) {
				$cstr .= '<iframe name="quick_iframe" id="quick_iframe" src="/'.memberFolder.'/a/none" width="100%" height="100" style="overflow:;color:#000;background:#fff;border:1px red solid;" visibility="" scrolling="yes" frameborder="1"></iframe>';
			} else {
				$cstr .= '<iframe name="quick_iframe" id="quick_iframe" src="/'.memberFolder.'/a/none" width="300" height="11" style="overflow:hidden;" visibility="hidden" scrolling="no" frameborder="0"></iframe>';
			}
		} # end if ($c=="account")
	} # end if ($b=="edit")
	
} # end if ($a=="account")
#################### ACCOUNT END

#################### DEPOSIT
if ($a=="deposit") {
	$rsm = array();
	$qm="SELECT a.*, namabank, b.kdnegara AS kdnegara, c.username AS username, d.nama AS namagame FROM members a 
		LEFT JOIN banks b ON b.kdbank=a.kdbank
		LEFT JOIN accounts c ON c.kdaccount=a.kdaccount
		LEFT JOIN games d ON d.kdgame=a.kdgame
		WHERE a.kdmember='".$_SESSION["member"]["kdmember"]."'";
	callRS($rsm, $qm);
	if ($b=="") {
		$rsdp=array(); $qdp="SELECT * FROM deposits WHERE kdmember='".$_SESSION["member"]["kdmember"]."' ORDER BY tanggal DESC";
		callRS($rsdp, $qdp);
		$totaldp = 0;
		for ($j=0;$j<count($rsdp);$j++) { if ($rsdp[$j]["isclear"]) { $totaldp += $rsdp[$j]["jumlah"]; } }
		
		$cstr .= '<div class="row">';
			$cstr .= '<div class="col-md-6">';
				$cstr .= '<h3>Transaction Deposit Information</h3>';
				$cstr .= '<div class="col-md-10 box-border">';
					$cstr .= '<dl class="dl-horizontal dldata">';
						$cstr .= '<dt>Total Transaction: <span class="badge">'.count($rsdp).' deposit'.(count($rsdp)>1?'s':'').'</span></dt>';
						$cstr .= '<dd></dd>';
						if (!isset($rsm[0]["username"]) && $rsm[0]["username"]=="" && $rsm[0]["kdaccount"]==0) {
							$cstr .= '<dt>You do not have Game ID yet.</dt>';
							$cstr .= '<dd>Please confirm with our Customer Service for Game ID Information</dd>';
							#
							#$cstr .= '<dt></dt>';
							#$cstr .= '<dd><a class="btn btn-primary to-ajax" data-target="#deposit" href="/'.memberFolder.'/a/'.$a.'/add">Request Deposit</a></dd>';
						} else {
							$cstr .= '<dt>Game:</dt>';
							$cstr .= '<dd>'.$rsm[0]["namagame"].'</dd>';
							$cstr .= '<dt>UserID:</dt>';
							$cstr .= '<dd>USER001</dd>';
							$cstr .= '<dt></dt>';
							$cstr .= '<dd><a class="btn btn-primary to-ajax" data-target="#deposit" href="/'.memberFolder.'/a/'.$a.'/add">Request Deposit</a></dd>';
						}
					$cstr .= '</dl>';
					
					for ($j=0;$j<count($rsdp);$j++) {
						$cstr .= '<div class="row" style="padding:0;margin:0;border-bottom:1px #999 solid;">';
							$cstr .= '<div class="col-sm-6" style="padding:0;">'.date('d-M-y | H:i:s', $rsdp[$j]["tanggal"]).'</div>';
							$cstr .= '<div class="col-sm-4 text-right" style="padding:0;">'.number_format($rsdp[$j]["jumlah"]).'</div>';
							$cstr .= '<div class="col-sm-2 text-center" style="font-size:70%;padding:0;">'.($rsdp[$j]["isclear"]==1?'Clear':'').' '.($rsdp[$j]["ispending"]==1?'Pend.':'').' '.($rsdp[$j]["isrejected"]==1?'Rejected':'').'</div>';
						$cstr .= '</div>';
					}
					
				$cstr .= '</div><!--/.col-md-10 box-border-->';
			$cstr .= '</div><!--/.col-md-6-->';
		$cstr .= '</div><!--/.row-->';
	
	} # end if ($b=="")
	
	
	if ($b=="add") {
		$cstr .= '<div class="col-xs-12 col-md-5 box-border">';
			$cstr .= '<form method="post" target="quick_iframe" action="/'.memberFolder.'/a/'.$a.'/'.$b.'/action" role="form">';
				$cstr .= '<h3 class="text-center">Requess New Deposit</h3>';
				$cstr .= '<dl class="dl-horizontal dldata">';
					$cstr .= '<dt>Amount</dt>';
					$cstr .= '<dd>';
						$cstr .= '<input type="text" name="jumlah" id="jumlah" class="form-control" />';
						$cstr .= '<div class="jumlah-err"></div>';
					$cstr .= '</dd>';
					
					$cstr .= '<dt>Validation Code <img class="captcha-main-image" src="/gfx/captcha/'.rand(1000000000,9999999999).'.gif/captcha_order" alt="Security Code" /></dt>';
					$cstr .= '<dd>';
						$cstr .= '<input type="text" name="ival" id="ival" class="form-control" />';
						$cstr .= '<div class="ival-err"></div>';
						$cstr .= '<div class="username-err"></div>';
						$cstr .= '<div class="pending-err"></div>';
					$cstr .= '</dd>';
					
					$cstr .= '<dt></dt>';
					$cstr .= '<dd><a type="button" class="btn btn-danger to-ajax" data-target="#deposit" href="/'.memberFolder.'/a/'.$a.'">Cancel</a> <input type="submit" class="btn btn-primary" value="Request" /></dd>';
				$cstr .= '</dl>';
			$cstr .= '</form>';
		$cstr .= '</div><!--/.box-border-->';
		$viewFrame = 0;
		if ($viewFrame==1) {
			$cstr .= '<iframe name="quick_iframe" id="quick_iframe" src="/'.memberFolder.'/a/none" width="100%" height="100" style="overflow:;color:#000;background:#fff;border:1px red solid;" visibility="" scrolling="yes" frameborder="1"></iframe>';
		} else {
			$cstr .= '<iframe name="quick_iframe" id="quick_iframe" src="/'.memberFolder.'/a/none" width="300" height="11" style="overflow:hidden;" visibility="hidden" scrolling="no" frameborder="0"></iframe>';
		}
	} # end if ($b=="add")
	
} # end if ($a=="deposit")
#################### DEPOSIT END

#################### WITHDRAWAL
if ($a=="withdrawal") {
	$rsm = array();
	$qm="SELECT a.*, namabank, b.kdnegara AS kdnegara, c.username AS username, d.nama AS namagame FROM members a 
		LEFT JOIN banks b ON b.kdbank=a.kdbank
		LEFT JOIN accounts c ON c.kdaccount=a.kdaccount
		LEFT JOIN games d ON d.kdgame=a.kdgame
		WHERE a.kdmember='".$_SESSION["member"]["kdmember"]."'";
	callRS($rsm, $qm);
	if ($b=="") {
		$rswd=array(); $qwd="SELECT * FROM withdraws WHERE kdmember='".$_SESSION["member"]["kdmember"]."' ORDER BY tanggal DESC";
		callRS($rswd, $qwd);
		$totaldp = 0;
		for ($j=0;$j<count($rswd);$j++) { if ($rswd[$j]["isclear"]) { $totaldp += $rswd[$j]["jumlah"]; } }
		
		$cstr .= '<div class="row">';
			$cstr .= '<div class="col-md-6">';
				$cstr .= '<h3>Transaction Withdrawal Information</h3>';
				$cstr .= '<div class="col-md-10 box-border">';
					$cstr .= '<dl class="dl-horizontal dldata">';
						$cstr .= '<dt>Total Transaction: <span class="badge">'.count($rswd).' withdrawal'.(count($rswd)>1?'s':'').'</span></dt>';
						$cstr .= '<dd></dd>';
						if (!isset($rsm[0]["username"]) && $rsm[0]["username"]=="" && $rsm[0]["kdaccount"]==0) {
							$cstr .= '<dt>You do not have Game ID yet.</dt>';
							$cstr .= '<dd>Please confirm with our Customer Service for Game ID Information</dd>';
							#
							#$cstr .= '<dt></dt>';
							#$cstr .= '<dd><a class="btn btn-primary to-ajax" data-target="#deposit" href="/'.memberFolder.'/a/'.$a.'/add">Request Deposit</a></dd>';
						} else {
							$cstr .= '<dt>Game:</dt>';
							$cstr .= '<dd>'.$rsm[0]["namagame"].'</dd>';
							$cstr .= '<dt>UserID:</dt>';
							$cstr .= '<dd>USER001</dd>';
							$cstr .= '<dt></dt>';
							$cstr .= '<dd><a class="btn btn-primary to-ajax" data-target="#deposit" href="/'.memberFolder.'/a/'.$a.'/add">Request Withdrawal</a></dd>';
						}
					$cstr .= '</dl>';
					
					for ($j=0;$j<count($rswd);$j++) {
						$cstr .= '<div class="row" style="padding:0;margin:0;border-bottom:1px #999 solid;">';
							$cstr .= '<div class="col-sm-6" style="padding:0;">'.date('d-M-y | H:i:s', $rswd[$j]["tanggal"]).'</div>';
							$cstr .= '<div class="col-sm-4 text-right" style="padding:0;">'.number_format($rswd[$j]["jumlah"]).'</div>';
							$cstr .= '<div class="col-sm-2 text-center" style="font-size:70%;padding:0;">'.($rswd[$j]["isclear"]==1?'Clear':'').' '.($rswd[$j]["ispending"]==1?'Pend.':'').' '.($rswd[$j]["isrejected"]==1?'Rejected':'').'</div>';
						$cstr .= '</div>';
					}
					
				$cstr .= '</div><!--/.col-md-10 box-border-->';
			$cstr .= '</div><!--/.col-md-6-->';
		$cstr .= '</div><!--/.row-->';
	
	} # end if ($b=="")
	
	
	if ($b=="add") {
		$cstr .= '<div class="col-xs-12 col-md-5 box-border">';
			$cstr .= '<form method="post" target="quick_iframe" action="/'.memberFolder.'/a/'.$a.'/'.$b.'/action" role="form">';
				$cstr .= '<h3 class="text-center">Requess New Deposit</h3>';
				$cstr .= '<dl class="dl-horizontal dldata">';
					$cstr .= '<dt>Amount</dt>';
					$cstr .= '<dd>';
						$cstr .= '<input type="text" name="jumlah" id="jumlah" class="form-control" />';
						$cstr .= '<div class="jumlah-err"></div>';
					$cstr .= '</dd>';
					
					$cstr .= '<dt>Validation Code <img class="captcha-main-image" src="/gfx/captcha/'.rand(1000000000,9999999999).'.gif/captcha_order" alt="Security Code" /></dt>';
					$cstr .= '<dd>';
						$cstr .= '<input type="text" name="ival" id="ival" class="form-control" />';
						$cstr .= '<div class="ival-err"></div>';
						$cstr .= '<div class="username-err"></div>';
						$cstr .= '<div class="pending-err"></div>';
					$cstr .= '</dd>';
					
					$cstr .= '<dt></dt>';
					$cstr .= '<dd><a type="button" class="btn btn-danger to-ajax" data-target="#deposit" href="/'.memberFolder.'/a/'.$a.'">Cancel</a>  <input type="submit" class="btn btn-warning" value="Request" /></dd>';
				$cstr .= '</dl>';
			$cstr .= '</form>';
		$cstr .= '</div><!--/.box-border-->';
		$viewFrame = 0;
		if ($viewFrame==1) {
			$cstr .= '<iframe name="quick_iframe" id="quick_iframe" src="/'.memberFolder.'/a/none" width="100%" height="100" style="overflow:;color:#000;background:#fff;border:1px red solid;" visibility="" scrolling="yes" frameborder="1"></iframe>';
		} else {
			$cstr .= '<iframe name="quick_iframe" id="quick_iframe" src="/'.memberFolder.'/a/none" width="300" height="11" style="overflow:hidden;" visibility="hidden" scrolling="no" frameborder="0"></iframe>';
		}
	} # end if ($b=="add")
	
} # end if ($a=="withdrawal")
#################### WITHDRAWAL END

	$cstr .= '</div><!--/.container-custom-fluid-->';
$cstr .= '</div><!--/.container-fluid-->';
if ($ajax=="1") {
	cout($cstr);
} else {
	require(root."/".memberFolder."/_tpl/html_begin.php");
	require(root."/".memberFolder."/_tpl/tag_head.php");
	require(root."/_tpl/body_open.php");
	cout('<div class="container-fluid common-dash">');
		cout('<div class="container-custom-fluid">');
			cout('<ul class="nav nav-tabs tabs-up" id="friends">');
				cout('<li class="'.($a=="index"?'active':'').'"><a href="/'.memberFolder.'/a/index" data-target="#home" class="active" data-toggle="tabajax" rel="tooltip">Home</a></li>');
				cout('<li class="'.($a=="profile"?'active':'').'"><a href="/'.memberFolder.'/a/profile" data-target="#profile" data-toggle="tabajax" rel="tooltip">Profile</a></li>');
				cout('<li class="'.($a=="account"?'active':'').'"><a href="/'.memberFolder.'/a/account" data-target="#account" data-toggle="tabajax" rel="tooltip">Account</a></li>');
				cout('<li class="'.($a=="deposit"?'active':'').'"><a href="/'.memberFolder.'/a/deposit" data-target="#deposit" data-toggle="tabajax" rel="tooltip">Deposit</a></li>');
				#cout('<li class="'.($a=="transfer"?'active':'').'"><a href="/'.memberFolder.'/a/transfer" data-target="#transfer" data-toggle="tabajax" rel="tooltip">Transfer</a></li>');
				cout('<li class="'.($a=="withdrawal"?'active':'').'"><a href="/'.memberFolder.'/a/withdrawal" data-target="#withdrawal" data-toggle="tabajax" rel="tooltip">Withdrawal</a></li>');
				#cout('<li class="'.($a=="history"?'active':'').'"><a href="/'.memberFolder.'/a/history" data-target="#history" data-toggle="tabajax" rel="tooltip">History</a></li>');
				cout('<li><a href="/members/logout">Logout</a></li>');
			cout('</ul>');
			
			cout('<div class="tab-content">');
				cout('<div class="tab-pane '.($a=="index"?'active':'').'" id="home">');
					if ($a=="index") { cout($cstr); }
				cout('</div>');
				cout('<div class="tab-pane '.($a=="profile"?'active':'').'" id="profile">');
					if ($a=="profile") { cout($cstr); }
				cout('</div>');
				cout('<div class="tab-pane '.($a=="account"?'active':'').'" id="account">');
					if ($a=="account") { cout($cstr); }
				cout('</div>');
				cout('<div class="tab-pane '.($a=="deposit"?'active':'').'" id="deposit">');
					if ($a=="deposit") { cout($cstr); }
				cout('</div>');
				#cout('<div class="tab-pane '.($a=="transfer"?'active':'').'" id="transfer">');
				#	if ($a=="transfer") { cout($cstr); }
				#cout('</div>');
				cout('<div class="tab-pane '.($a=="withdrawal"?'active':'').'" id="withdrawal">');
					if ($a=="withdrawal") { cout($cstr); }
				cout('</div>');
				#cout('<div class="tab-pane '.($a=="history"?'active':'').'" id="history">');
				#	if ($a=="history") { cout($cstr); }
				#cout('</div>');
			cout('</div>');
			if ($a=="index" && $b=="edit" && $c=="info") {
				cout('<script>bindDatePicker(\'.tanggal\');</script>');
			}
			cout('<script>');
				cout('$(".to-ajax").each(function(){');
					cout('var targ = "#'.($a=="index"?'home':$a).'";');
					cout('$(this).bind("click", function(){');
						cout('memberClick2($(this), targ);');
						cout('return false;');
					cout('});');
				cout('});');
				cout('$(\'[data-toggle="tabajax"]\').click(function(e) { memberClick($(this));return false; });');
			cout('</script>');
		cout('</div><!--/.container-custom-fluid-->');
	cout('</div><!--/.container-fluid common-dash-->');
	#cout('<a href="/members/logout">Logout</a>');
	$act_ket = "Index: Members: Dashboard";
	updateMemberActivities($act_ket);
	require(root."/".memberFolder."/_tpl/body_close.php");
}

?>