<?php
$pageSubOf = '';
cout('<!-- Fixed navbar -->');
cout('<nav class="navbar navbar-inverse navbar-fixed-top">');
	cout('<div class="container">');
		cout('<div class="navbar-header">');
			cout('<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">');
				cout('<span class="sr-only">Toggle navigation</span>');
				cout('<span class="icon-bar"></span>');
				cout('<span class="icon-bar"></span>');
				cout('<span class="icon-bar"></span>');
			cout('</button>');
			cout('<a class="navbar-brand" href="'.absDom.'" target="_blank">7WynCASH</a>');
		cout('</div>');
		if (!isset($_SESSION["user"])) {
		} else {
			cout('<div id="navbar" class="navbar-collapse collapse">');
				cout('<ul class="nav navbar-nav">');
					$nav_class = $pageName=="index"?'active':'';
					cout('<li class="'.$nav_class.'"><a href="'.absDom.'/'.adminFolder.'/">Home</a></li>');
					$rsmenu=array(); $qmenu="SELECT * FROM _admin_page_cats WHERE isactive=1";
					callRS($rsmenu, $qmenu);
					for ($x=0;$x<count($rsmenu);$x++) {
						$rssub=array(); $qsub="SELECT * FROM _admin_pages WHERE kdpagecat=".$rsmenu[$x]["kdpagecat"]." AND isactive=1";
						callRS($rssub, $qsub);
						if (count($rssub)!=0) {
							$nav_class = $pageSubOf==$rsmenu[$x]["cat_name"]?'active':'';
							cout('<li class="dropdown '.$nav_class.'">');
								cout('<a href="#'.$rsmenu[$x]["cat_name"].'" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">'.$rsmenu[$x]["cat_label"].' <span class="caret"></span></a>');
								cout('<ul class="dropdown-menu">');
									#cout('<li role="separator" class="divider"></li>');
									#cout('<li class="dropdown-header">Nav header</li>');
									for ($y=0;$y<count($rssub);$y++) {
										$nav_class = $pageName==$rssub[$y]["page_name"]?'active':'';
										cout('<li class="'.$nav_class.'"><a href="'.absDom.'/'.adminFolder.'/'.$rssub[$y]["url"].'/">'.$rssub[$y]["page_label"].'</a></li>');
									}
								cout('</ul>');
							cout('</li>');
						} else {
							cout('<li><a href="#about">'.$rsmenu[$x]["cat_label"].'</a></li>');
						}
					}
					$nav_class = $pageSubOf=="profiles"?'active':'';
					cout('<li class="dropdown '.$nav_class.'">');
						cout('<a href="#User-Shortcut" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Welcome, '.$_SESSION["user"]["inisial"].' <span class="caret"></span></a>');
						cout('<ul class="dropdown-menu">');
							#cout('<li role="separator" class="divider"></li>');
							#cout('<li class="dropdown-header">Nav header</li>');
							$nav_class = $pageName=="change-password"?'active':'';
							cout('<li class="'.$nav_class.'"><a href="'.absDom.'/'.adminFolder.'/change-password/">Change Password</a></li>');
							$nav_class = '';
							cout('<li><a href="'.absDom.'/'.adminFolder.'/logout/">Logout</a></li>');
						cout('</ul>');
					cout('</li>');
					/* 
					cout('<li class="" style="width:120px;">&nbsp;<a class="btn btn-default btn-members" onclick="window.location=\''.absDom.'/'.adminFolder.'/members/\'">Members <span class="badge notif-members"></span></a>&nbsp;</li>');
					cout('<li class="" style="width:120px;">&nbsp;<a class="btn btn-default btn-deposits" onclick="window.location=\''.absDom.'/'.adminFolder.'/deposits/\'">Deposits <span class="badge notif-deposits"></span></a>&nbsp;</li>');
					cout('<li class="" style="width:120px;">&nbsp;<a class="btn btn-default btn-withdraws" onclick="window.location=\''.absDom.'/'.adminFolder.'/withdraws/\'">Withdraws <span class="badge notif-withdraws"></span></a>&nbsp;</li>');
					*/
					cout('<li class="">&nbsp;<a style="float:left;padding-left:10px;padding-right:10px;" class="btn btn-default btn-members" href="'.absDom.'/'.adminFolder.'/members/">Members <span class="badge notif-members"></span></a>&nbsp;</li>');
					cout('<li class="">&nbsp;<a style="float:left;padding-left:10px;padding-right:10px;" class="btn btn-default btn-deposits" href="'.absDom.'/'.adminFolder.'/deposits/">DPs <span class="badge notif-deposits"></span></a>&nbsp;</li>');
					cout('<li class="">&nbsp;<a style="float:left;padding-left:10px;padding-right:10px;" class="btn btn-default btn-withdraws" href="'.absDom.'/'.adminFolder.'/withdraws/">WDs <span class="badge notif-withdraws"></span></a>&nbsp;</li>');
					
					#cout('<li class="">&nbsp;<a style="float:left;padding-left:10px;padding-right:10px;" class="btn label-primary btn-sms" href="#" onclick="checkSMS();return false;">SMS Cre.: <span class="badge notif-sms"></span></a>&nbsp;</li>');
					
					#cout('<li class=""><a href="'.absDom.'/'.adminFolder.'/deposits/">Deposits <span class="badge notif-deposits"></span></a></li>');
					#cout('<li class=""><a href="'.absDom.'/'.adminFolder.'/withdraws/">Withdraws <span class="badge notif-withdraws"></span></a></li>');
				cout('</ul>');
			cout('</div><!--/.nav-collapse -->');
		}
	cout('</div>');
cout('</nav>');
cout('<div class="container-fluid theme-showcase" role="main">');
/*
if (!isset($_SESSION["user"])) {
	cout('
	<div id="header">
		<div style="height:95px;margin:2px 5px;float:left;"><a href="/'.adminFolder.'/"><img height="95" src="/'.adminFolder.'/img/logo_90p.png" alt="AShtanga Logo" /></a></div>
	</div>
	');
} else {
	cout('
	<div id="header">
		<div style="height:95px;margin:2px 5px;float:left;"><a href="/'.adminFolder.'/"><img height="95" src="/'.adminFolder.'/img/logo_90p.png" alt="Ashtanga Logo" /></a></div>
	</div>');
	$rsmm=array(); $qmm="SELECT * FROM _admin_page_cats WHERE isactive=1 ORDER BY kdpagecat";
	callRS($rsmm, $qmm);
	cout('<div class="one-line-menu">');
		cout('<div class="helper">');
			cout('<ul id="nav">');
				cout('<li>');
					cout('<a href="/'.adminFolder.'/">Home</a>');
				cout('</li>');	
			for ($mm=0;$mm<count($rsmm);$mm++) {
				$spesial = intval($rsmm[$mm]["kdpagecat"])==6?' turney ':'';
				cout('<li class="'.$spesial.'">');
					cout('<a class="'.$spesial.'" href="#">'.$rsmm[$mm]["cat_label"].'</a>');
					$rsmm2=array();$qmm2="SELECT * FROM _admin_pages WHERE kdpagecat='".$rsmm[$mm]["kdpagecat"]."' AND isactive=1 ORDER BY kdpage";
					callRS($rsmm2, $qmm2);
					if (count($rsmm2)!=0) {
						cout('<ul>');
						for ($mm2=0;$mm2<count($rsmm2);$mm2++) {
							$specialDP = $rsmm2[$mm2]["page_name"]=="deposits" && $rsmm[$mm]["kdpagecat"]!=4?' deposits ':'';
							$specialWD = $rsmm2[$mm2]["page_name"]=="withdraws" && $rsmm[$mm]["kdpagecat"]!=4?' withdraws ':'';
							cout('<li class="'.$specialDP.' '.$specialWD.'">
								<a class="'.$specialDP.''.$specialWD.'" href="/'.adminFolder.'/'.$rsmm2[$mm2]["url"].'/">'.$rsmm2[$mm2]["page_label"].'</a>
							</li>');
						}
						cout('</ul>');
					}
				cout('</li>');
			}
				cout('<li>');
					cout('<a href="#">Welcome, '.$_SESSION["user"]["inisial"].'</a>');
					cout('<ul>');
						cout('<li><a href="/'.adminFolder.'/change-password/">Change Password</a></li>');
						cout('<li><a href="/'.adminFolder.'/logout/">Logout</a></li>');
					cout('</ul>');
				cout('</li>');	
			cout('</ul>');
		cout('</div>');
	cout('</div>');
}
*/
?>