<?php
session_start();
if (empty($_SESSION['namauser']) AND empty($_SESSION['passuser'])){
	header('location:404.php');
}else{
$table1 = new PoTable('post');
$total1 = $table1->numRow();
$table2 = new PoTable('category');
$total2 = $table2->numRow();
$table3 = new PoTable('tag');
$total3 = $table3->numRow();
$table4 = new PoTable('media');
$total4 = $table4->numRow();
$table5 = new PoTable('pages');
$total5 = $table5->numRow();
$table6 = new PoTable('component');
$total6 = $table6->numRow();
$table7 = new PoTable('users');
$total7 = $table7->numRow();
	echo "<div class='page-header'>
		<div class='icon'>
			<span class='ico-arrow-right'></span>
		</div>
		<h1>$langhome1<small><span class='text-info'>$langhome2</span></small></h1>
	</div>

	<div class='row-fluid'>
		<div class='span12'>
			<div class='block'>
				<div class='head'>
					<div class='icon'><i class='ico-chart-4'></i></div>
					<h2>$langhome3</h2>
				</div>
				<div class='widgets'>
					<a href='#' class='swidget purple clean'>
						<div class='value'>$total1</div>
						<div class='bottom'>
							<div class='text'>$langhome4</div>
						</div>
					</a>
					<a href='#' class='swidget green clean'>
						<div class='value'>$total2</div>
						<div class='bottom'>
							<div class='text'>$langhome5</div>
						</div>
					</a>
					<a href='#' class='swidget dblue clean'>
						<div class='value'>$total3</div>
						<div class='bottom'>
							<div class='text'>$langhome6</div>
						</div>
					</a>
					<a href='#' class='swidget blue clean'>
						<div class='value'>$total4</div>
						<div class='bottom'>
							<div class='text'>$langhome7</div>
						</div>
					</a>
					<a href='#' class='swidget orange clean'>
						<div class='value'>$total5</div>
						<div class='bottom'>
							<div class='text'>$langhome8</div>
						</div>
					</a>
					<a href='#' class='swidget red clean'>
						<div class='value'>$total6</div>
						<div class='bottom'>
							<div class='text'>$langhome9</div>
						</div>
					</a>
					<a href='#' class='swidget blue clean'>
						<div class='value'>$total7</div>
						<div class='bottom'>
							<div class='text'>$langhome10</div>
						</div>
					</a>                                                
				</div>
			</div>
		</div>
	</div>

	<div class='row-fluid'>
		<div class='span12'>
			<div class='block'>
				<div class='head'>
					<div class='icon'><span class='ico-chart-4'></span></div>
					<h2>$langhome11</h2>
				</div>
				<div class='data'>
					<div id='main_chart' style='height: 300px;'>";
						include "po-component/po-home/traffic.php";
						$visitorc = $currentStat3 + $currentStat4 + $currentStat5 + $currentStat6;
						$hitsc = $sql_hits3 + $sql_hits4 + $sql_hits5 + $sql_hits6;
					echo "</div>
				</div>
				<div class='row-fluid'>
					<div class='span4'>
						<div class='stat'>
							<span class='cdblue'>$visitorc</span> $langhome12<br/> $langhome13
						</div>
					</div>
					<div class='span4'>
						<div class='stat'>
							<span class='cblue'>$hitsc</span> $langhome14<br/> $langhome15
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	
    <div class='row-fluid typography'>
		<div class='block'>
			<div class='data'>
				<p>&nbsp;</p><p>&nbsp;</p>
				<blockquote class='pull-right'>
					<p><b>PopojiCMS &copy 2013. All Right Reserved. Buat Sendiri Rasa Webmu dengan PopojiCMS.</b></p>
					<small>Dwira Survivor (owner)</small>
				</blockquote>
			</div>
		</div>
	</div>";
}
?>