<?php
/*===================================================+
|| # HoloCMS - Website and Content Management System
|+===================================================+
|| # Copyright © 2008 Meth0d. All rights reserved.
|| # http://www.meth0d.org
|+===================================================+
|| # HoloCMS is provided "as is" and comes without
|| # warrenty of any kind. HoloCMS is free software!
|+===================================================*/

require_once('../core.php');
if($hkzone !== true){ header("Location: index.php?throwBack=true"); exit; }
if(!session_is_registered(acp)){ header("Location: index.php?p=login"); exit; }

$pagename = " Benvenuto in Housekeeping !";

if(isset($_POST['notes'])){
	$notes = addslashes($_POST['notes']);
	mysql_query("UPDATE cms_system SET admin_notes = '".$notes."' LIMIT 1") or die(mysql_error());
}

$tmp = mysql_query("SELECT * FROM cms_system LIMIT 1") or die(mysql_error());
$system = mysql_fetch_assoc($tmp);

$onlineCutOff = (time() - 601);
$onlineUsers = mysql_evaluate("SELECT COUNT(*) FROM users WHERE online > " . $onlineCutOff);

@include('subheader.php');
@include('header.php');
?>
<table cellpadding='0' cellspacing='8' width='100%' id='tablewrap'>
<tr>	<td width='100%' valign='top' id='rightblock'>
	 <div><!-- RIGHT CONTENT BLOCK -->
	 
	 
	 <div style='font-size:30px; padding-left:7px; letter-spacing:-2px; border-bottom:1px solid #EDEDED'>
<img src="http://i54.tinypic.com/2rq20ps.png" border="0" alt="Image and video hosting by TinyPic"></a>
</div>
<br />
<div id='ipb-get-Membri' style='border:1px solid #000; background:#FFF; padding:2px;position:absolute;width:120px;display:none;z-index:100'></div>
<!--in_dev_notes-->
<!--in_dev_check-->
<table border='0' width='100%' cellpadding='0' cellspacing='4'>
<tr>
 <td valign='top' width='75%'>
	<table border='0' width='100%' cellpadding='0' cellspacing='0'>
	<tr>
	 <td>
		<div class='homepage_pane_border'>
		 <div class='homepage_section'>Statistiche & Info:</div>
		 <table width='100%' cellspacing='0' cellpadding='4'>
			 <tr>
			  <td width='50%' valign='top'>
			  	<div class='homepage_border'>
 <div class='homepage_sub_header'>Informazioni sull' hotel</div>
 <table width='100%' cellpadding='4' cellspacing='0'>

 <tr>
  <td class='homepage_sub_row'><strong>Totale utenti</strong></td>
  <td class='homepage_sub_row'>
  	<?php echo mysql_evaluate("SELECT COUNT(*) FROM users") . " (<a href='index.php?p=onlinelist'>" . $onlineUsers . "</a> online)"; ?>
  </td>
 </tr>
 <tr>
  <td class='homepage_sub_row'><strong>Totale stanze</strong></td>
  <td class='homepage_sub_row'>
  	<?php echo mysql_evaluate("SELECT COUNT(*) FROM rooms"); ?>

  </td>
 </tr>
 <tr>
  <td class='homepage_sub_row'><strong>Totale furni</strong></td>
  <td class='homepage_sub_row'>
  	<?php echo mysql_evaluate("SELECT COUNT(*) FROM user_items"); ?>
  </td>
 </tr>
 <tr>
  <td class='homepage_sub_row'><strong>Totale gruppi</strong></td>
  <td class='homepage_sub_row'>
  	<?php echo mysql_evaluate("SELECT COUNT(*) FROM groups"); ?>
  </td>
 </tr>
 <tr>
  <td class='homepage_sub_row'><strong>Totale login dello Staff</strong></td>
  <td class='homepage_sub_row'>
  	<?php echo mysql_evaluate("SELECT COUNT(*) FROM system_stafflog"); ?>
  </td>
 </tr>
  <tr>
  <td class='homepage_sub_row'><strong>Totale utenti bannati</strong></td>
  <td class='homepage_sub_row'>
  	<a href='index.php?p=banlist'><?php echo mysql_evaluate("SELECT COUNT(*) FROM bans"); ?></a>
  </td>
 </tr>

 </table>
</div>
			  </td>
			  <td width='50%' valign='top'>
			  	<div class='homepage_border'>
 <div class='homepage_sub_header'>Impostazioni del server</div>
 <table width='100%' cellpadding='4' cellspacing='0'>
 <tr>
  <td class='homepage_sub_row'><strong>Porta</strong></td>
  <td class='homepage_sub_row'>
  	<?php echo FetchServerSetting('server_game_port'); ?>
  </td>
 </tr>
 <tr>
  <td class='homepage_sub_row'><strong>&nbsp;&nbsp;&nbsp;&nbsp;- Porta MUS</strong></td>
  <td class='homepage_sub_row'>
  	<?php echo FetchServerSetting('server_mus_port'); ?>
  </td>
 </tr>
 <tr>
  <td class='homepage_sub_row'><strong></strong></td>
  <td class='homepage_sub_row'>
  	<?php echo FetchServerSetting('server_game_maxconnections'); ?>
  </td>
 </tr>
 <tr>
  <td class='homepage_sub_row'><strong>Scambi</strong></td>
  <td class='homepage_sub_row'>
  	<?php echo FetchServerSetting('trading_enable', true); ?>
  </td>
 </tr>
 <tr>
  <td class='homepage_sub_row'><strong>Riciclaggio furni</strong></td>
  <td class='homepage_sub_row'>
  	<?php echo FetchServerSetting('recycler_enable', true); ?>
  </td>
 </tr>
 <tr>
  <td class='homepage_sub_row'><strong>Filtro bobba </strong></td>
  <td class='homepage_sub_row'>
  	<?php echo FetchServerSetting('wordfilter_enable', true); ?> (<?php echo FetchServerSetting('wordfilter_censor'); ?>)
  </td>
 </tr>
 </table>
</div>
			  </td>		   </tr>
	    </table>
	   </div>
	 </td>
	</tr>
	<tr>
	 <td>&nbsp;</td>
	</tr>
	<tr>
	 <td>
		<div class='homepage_pane_border'>
		 <div class='homepage_section'>Comunicazioni:</div>
		 <table width='100%' cellspacing='0' cellpadding='4'>
			 <tr>
			  <td valign='top' width='50%'>
			  	<div class='homepage_border'>
					<div class='homepage_sub_header'>Blocco Note</div>
					<br /><div align='center'>
<form action='index.php?p=dashboard&do=save' method='post'>
<textarea name='notes' style='background-color:#F9FFA2;border:1px solid #CCC;width:95%;font-family:verdana;font-size:10px' rows='8' cols='25'><?php echo stripslashes($system['admin_notes']); ?></textarea>
<div><br /><input type='submit' value='Salva' class='realbutton' /></div>
</form>
</div><br />
				</div>
			  </td>
			  <td width='50%' valign='top'>
			  	<div class='homepage_border'>
 <div class='homepage_sub_header'>Amministratori di <?php echo $sitename; ?></div>
 <table width='100%' cellpadding='4' cellspacing='0'>
<?php
$get_em = mysql_query("SELECT id,username,mail FROM users WHERE rank > 6 ORDER BY username ASC LIMIT 20") or die(mysql_error());
$get_em = mysql_query("SELECT id,username,mail FROM users WHERE rank > 7 ORDER BY username ASC LIMIT 20") or die(mysql_error());
$get_em = mysql_query("SELECT id,username,mail FROM users WHERE rank > 5 ORDER BY username ASC LIMIT 20") or die(mysql_error());

while($row = mysql_fetch_assoc($get_em)){
	printf(" <tr>
 <td class='tablerow1' align='center'>
	 <strong><div style='font-size:12px'><a href='../user_profile.php?name=%s' target='_blank'>%s</a></strong> (ID: %d)
</td>
 <td class='tablerow2'>
	<div style='margin-top:6px'><a href='mailto:%s'>%s</a></div>
</td>
</tr>", $row['username'], $row['username'], $row['id'], $row['mail'], $row['mail']);
}



?>
 </table>
</div>
			  </td>
			 </tr>
		 </table>
		</div>
	 </td>
	</tr>
	
	</table>
 </td>

	</div>
	 </div><!-- / RIGHT CONTENT BLOCK -->
	 </td></tr>
</table>
</div><!-- / OUTERDIV -->
<div align='center'><br />
<?php
$mtime = explode(' ', microtime());
$totaltime = $mtime[0] + $mtime[1] - $starttime;
printf('Time: %.3f', $totaltime);
?>
</div>