<?php
//admin section redirections
if (!isset($afbAccount) || $afbAccount->account['account_admin'] !== 'yes'){
	//jump to home
	header("Location: http://".trim($_SERVER['HTTP_HOST'],'/').BASEURL);
	exit();
}






//------------------------------
$thispage['title'] = getLangTerm('home');
//------------------------------





//-----------------------------
include(ADMINROOT.'_head.php');
//-----------------------------

	
	//attempt to retrieve update information from official remote site.
	$info = GetXML('http://ajaxfb.jc21.com/version_check_xml.php?install_id='.$settings['app_installation_id']);
	if ($info) {
		//check if update is required.
		//compile a version number.		
		$newver = (number_format($info['XMLRESPONSE']['VERSION']['MAJOR'],0,'.','')* 10000000);
		$newver += (number_format($info['XMLRESPONSE']['VERSION']['MINOR'],0,'.','')* 10000);
		$newver += number_format($info['XMLRESPONSE']['VERSION']['REVISION'],0,'.','');
		$thisver = (number_format($settings['app_version_major'],0,'.','')* 10000000);
		$thisver += (number_format($settings['app_version_minor'],0,'.','')* 10000);
		$thisver += number_format($settings['app_version_revision'],0,'.','');

		if ($newver > $thisver) {
			?>
			<div id="newver">
				<p class="title"><?php echo getLangTerm('new-version'); ?></p>
				<p><strong><?php echo getLangTerm('version'); ?> <?php echo trim($info['XMLRESPONSE']['VERSION']['MAJOR']); ?>.<?php echo trim($info['XMLRESPONSE']['VERSION']['MINOR']); ?>.<?php echo trim($info['XMLRESPONSE']['VERSION']['REVISION']); ?> <?php echo getLangTerm('has-released'); ?></strong></p>
				<p><a href="<?php echo str_replace('[major]',$settings['app_version_major'],str_replace('[minor]',$settings['app_version_minor'],str_replace('[revision]',$settings['app_version_revision'],trim($info['XMLRESPONSE']['UPDATE'])))); ?>"><?php echo getLangTerm('get-update'); ?></a></p>
			</div>
			<?php
		}
	}
	
	
	
	?>
	
	<dl>
		<dt><a href="index.php?admin&section=shares"><?php echo getLangTerm('shares',false); ?></a></dt>
		<dd><?php echo getLangTerm('long-shares',false); ?></dd>
		
		<dt><a href="index.php?admin&section=blacklists"><?php echo getLangTerm('blacklists',false); ?></a></dt>
		<dd><?php echo getLangTerm('long-blacklists',false); ?></dd>
		
		<dt><a href="index.php?admin&section=accounts"><?php echo getLangTerm('accounts',false); ?></a></dt>
		<dd><?php echo getLangTerm('long-accounts',false); ?></dd>
		
		<dt><a href="index.php?admin&section=reports"><?php echo getLangTerm('reports',false); ?></a></dt>
		<dd><?php echo getLangTerm('long-reports',false); ?></dd>
		
		<dt><a href="index.php?admin&section=settings"><?php echo getLangTerm('settings',false); ?></a></dt>
		<dd><?php echo getLangTerm('long-settings',false); ?></dd>
		
	</dl>
	

<?php
//-----------------------------
include(ADMINROOT.'_foot.php');
//-----------------------------
?>