<?php
include_once("embedded/functions/site_functions.php");
if ((isset($_SESSION) && !empty($_SESSION)))
{
$script='<script type="text/javascript" src="scripts/formfunctions_admin.js"></script>';
$title="Admin";
$css='<link href = "css/index_admin.css" rel = "stylesheet" type = "text/css" />';
heder_js($title,$script,$css);
main_things_admin();
db_open();
echo"<div id ='main_window'>";
echo<<<a
<div id="menu">
<table id="p_i" id="margin1">
<tr>
<td class="p_i_title" onclick="statistics(1);">Statistics</td>
<td class="p_i_title" onclick="users(1);">Users</td>
<td class="p_i_title" onclick="troubleshoots(1,0,0);">Troubleshoots</td>
<td class="p_i_title" onclick="messages(1,0,0);">Messages</td>
</tr>
</table>
</div>
<div id="1">
a;
$a=number_of_visitors();
echo<<<a
<div id="marginn">
<div id="data_message">
</div>
<table id="p_i" class="statistics">
<tr class="hover">
<td class="td_title_stats">Total Visits</td><td class="data_stats">$a</td>
</tr>
a;

$time=time();
$sql1="SELECT * FROM users WHERE userlevel='1'";
@ $result=mysql_query($sql1);
$na=mysql_numrows($result);
db_close();
echo<<<a
<tr class="hover">
<td class="td_title_stats">Members</td><td class="data_stats">$na</td>
</tr>
<tr class="hover">
a;
db_open();
$time=time();
$sql="SELECT * FROM users WHERE userlevel='1' AND live_login>='$time'";
@ $result=mysql_query($sql);
$n=mysql_numrows($result);
db_close();
echo<<<a
<td class="td_title_stats">Members Online</td><td class="data_stats">$n</td>
</tr>
</table>
</div>
a;

echo<<<a
</div>
<div id="2"></div>
<div id="3"></div>
<div id="4"></div>
a;
echo"</div></body></html>";
}
else
{
require("index.php");
die();
}
?>
