<?php
if (!defined("root")) {
	define("root", $_SERVER['DOCUMENT_ROOT']);
}
require(root."/___simple_config.php");
session_start();

$pageName = "index";
$pageTitle = "Member Dashboard";
$coutSpecs = array('nl'=>"n");
$act_ket = "Main Page of Index";
require(root."/".memberFolder."/_common.php");
/*
if (!isset($_SESSION["member"])) {
	header("Location: /".memberFolder."/login");
	exit;
}
*/
require(root."/".memberFolder."/_lib/db.php");
require(root."/".memberFolder."/_lib/main.php");
require(root."/".memberFolder."/_lib/bootstraps.php");
$a = cekpost(cleanQuery(isset($_REQUEST["a"])?$_REQUEST["a"]:""), "");
require(root."/_tpl/html_begin.php");
require(root."/".memberFolder."/_tpl/tag_head.php");
/*
 * begin
 * additional style
 * */
cout('<style type="text/css">');
cout('');
cout('</style>');
/*
 * end
 * additional style
 * 
 * v
 * v
 * closing tag head
 * 
 * */
require(root."/_tpl/body_open.php");
cout('<div class="container-fluid common-dash">');
	cout('<div class="container-custom-fluid">');
		if (!isset($_SESSION["member"])) {
			cout('<div class="row">');
				cout('<div class="col-md-6">');
					cout('<div class="col-md-8 col-md-offset-2">');
						cout('<div class="box-border border-box">');
							cout('<h3 class="text-center">Doesn\'t have an account yet?</h3>');
							cout('<div class="text-center"><a href="/'.memberFolder.'/register" class="btn btn-primary">Register</a></div>');
							cout('<hr/>');
						cout('</div><!--/.border-box-->');
					cout('</div class="col-md-8 col-md-offset-2">');
				cout('</div><!--/.col-md-6-->');
				
				cout('<div class="col-md-6">');
					cout('<div class="col-md-8 col-md-offset-2">');
						cout('<div class="box-border border-box">');
							cout('<h3 class="text-center">Already have an account?</h3>');
							cout('<div class="text-center"><a href="/'.memberFolder.'/login" class="btn btn-primary">Login</a></div>');
							cout('<hr/>');
						cout('</div><!--/.border-box-->');
					cout('</div class="col-md-8 col-md-offset-2">');
					
				cout('</div><!--/.col-md-6-->');
			cout('</div><!--/.row-->');
		} else {
			#cout($_SERVER['QUERY_STRING']);
			#printR($_SERVER);
			cout('<ul class="nav nav-tabs tabs-up">');
				cout('<li class="'.($a=="index"?'active':'').'"><a href="/'.memberFolder.'/a/index" data-target="#home" class="media_node active span" id="contacts_tab" data-toggle="tabajax" rel="tooltip">Home</a></li>');
				cout('<li class="'.($a=="profile"?'active':'').'"><a href="/'.memberFolder.'/a/profile" data-target="#profile" class="media_node span" id="contacts_tab" data-toggle="tabajax" rel="tooltip">Profile</a></li>');
				cout('<li class="'.($a=="account"?'active':'').'"><a href="/'.memberFolder.'/a/account" data-target="#account" class="media_node span" id="contacts_tab" data-toggle="tabajax" rel="tooltip">Account</a></li>');
				cout('<li class="'.($a=="deposit"?'active':'').'"><a href="/'.memberFolder.'/a/deposit" data-target="#deposit" class="media_node span" id="contacts_tab" data-toggle="tabajax" rel="tooltip">Deposit</a></li>');
				#cout('<li class="'.($a=="transfer"?'active':'').'"><a href="/'.memberFolder.'/a/transfer" data-target="#transfer" class="media_node span" id="contacts_tab" data-toggle="tabajax" rel="tooltip">Transfer</a></li>');
				cout('<li class="'.($a=="withdrawal"?'active':'').'"><a href="/'.memberFolder.'/a/withdrawal" data-target="#withdrawal" class="media_node span" id="contacts_tab" data-toggle="tabajax" rel="tooltip">Withdrawal</a></li>');
				#cout('<li class="'.($a=="history"?'active':'').'"><a href="/'.memberFolder.'/a/history" data-target="#history" class="media_node span" id="contacts_tab" 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"></div>');
				cout('<div class="tab-pane '.($a=="profile"?'active':'').'" id="profile"></div>');
				cout('<div class="tab-pane '.($a=="account"?'active':'').'" id="account"></div>');
				cout('<div class="tab-pane '.($a=="deposit"?'active':'').'" id="deposit"></div>');
				#cout('<div class="tab-pane '.($a=="transfer"?'active':'').'" id="transfer"></div>');
				cout('<div class="tab-pane '.($a=="withdrawal"?'active':'').'" id="withdrawal"></div>');
				#cout('<div class="tab-pane '.($a=="history"?'active':'').'" id="history"></div>');
			cout('</div>');
			cout('<script>');
				
				cout('$(\'[data-toggle="tabajax"]\').click(function(e) { e.preventDefault;memberClick($(this));return false; });');
				cout('memberClick($(\'[data-target="#home"]\'));');
			cout('</script>');
			#printR($_SESSION);
		}
	cout('</div><!--/.container-custom-fluid-->');
cout('</div><!--/.container-fluid common-page-->');
#cout('<a href="/members/logout">Logout</a>');
$act_ket = "Index: Members: Dashboard";
updateMemberActivities($act_ket);
require(root."/".memberFolder."/_tpl/body_close.php");
?>