<?
ob_start();
session_start();
include("../var.php");
	$con = mysqli_connect($DBHOST,$DBUSER,$DBPASS,$DBNAME) or die("Some error occurred during connection " . mysqli_error($con));
	mysqli_query($con, "SET CHARACTER SET 'utf8'");
	$SESSION = $_SESSION['admin'];
	$sessionid = $_SESSION['session'];
	$RES = mysqli_query($con, "SELECT * FROM `admin` WHERE `user`='$SESSION' AND `session`='$sessionid'");
	if(mysqli_num_rows($RES) == 0)
	{
	header("location:login.php");
	}

$path = "";
		$totalquiz = mysqli_fetch_row(mysqli_query($con, "SELECT count(*) FROM quiz where live='1'"));
		$totalquiz = $totalquiz[0];
		$totallang = mysqli_fetch_row(mysqli_query($con, "SELECT count(*) FROM lang"));
		$totallang = $totallang[0];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ادارة الموقع - الصفحة الرئيسية</title>
<style>
body{ background:#6986A4 url(img/bg.bmp) repeat-x; padding-top:100px;}
table{ font-family:Arial;}

table.links tr td { border:1px solid #006291; vertical-align:top; font-family:Arial, Helvetica, sans-serif; font-size:12px; font-weight:500; color:#333333; height:auto;}
table.links tr td a { font-weight:700; color:#0000ff; font-size:13px;text-decoration:none;}

table.links tr td a.in_link{ font-size:11px; color:#808080;}
table.links tr td a.in_link:hover{ color:#aa0000;}
</style>
<link type="text/css" href="style.css" media="all" rel="stylesheet" />
</head>

<body>
<a href="" style="position:absolute; right:10px; top:10px; text-decoration:none; font-family:Arial;"><font size="+2" color="#FFFFFF">لوحة الادارة</font></a>
<div style="position:absolute; top:0px; right:90%; font-size:12px;">
<a href="" style="text-decoration:none; font-family:Arial; color:#FFFFFF;">رئيسية الادمن</a>&nbsp;|&nbsp;
<a href="logout.php" style="text-decoration:none; font-family:Arial; color:#FFFFFF;">تسجيل الخروج (<?=$_SESSION['admin']?>)</a>
</div>
<table cellpadding="20" border="0" style="border:1px solid #006291; background:#FFFFFF;" align="center"><tr>
<td valign="top">
	<center><font size="2">اهلا <b><?=$_SESSION['admin']?></b> فى لوحة الادارة</font></center>
	<table cellpadding="10" cellspacing="25" align="center" class="links">
	<tr>
		<td width="250">
			<img src="img/game.gif" style="margin-right:15px;" border="0" align="left" /><a href="javascript:void(0)">قاعدة الاختبارات</a>
			<br /><a href="quizlist.php" class="in_link">قائمة الاختبارات</a>&nbsp;&raquo;&nbsp;<a href="add_quiz.php" class="in_link">اضف اختبار جديد</a>
                  <p>عدد الاختبارات النشطة: <b><a href="quizlist.php"><?=$totalquiz?></a></b></p>
		</td>
				<td width="250">
			<img src="img/langs.png" style="margin-right:15px;" border="0" align="left" /><a href="javascript:void(0)">اللغات</a>
			<br /><a href="langlist.php" class="in_link">قائمة اللغات</a>&nbsp;&raquo;&nbsp;<a href="lang_add.php" class="in_link">اضف لغة جديده</a>
                  <p>عدد اللغات المتوفرة: <b><a href="langlist.php"><?=$totallang?></a></b></p>
		</td>
		<td width="250">
			<img src="img/admin.png" style="margin-right:15px;" border="0" align="left" /><a href="javascript:void(0)">خلفية الموقع</a>
			<br />&raquo;&nbsp;<a href="background.php" class="in_link">تعديل الخلفية</a>
		</td>
	</tr>
	</table>
<?php	include("footer.php");?>