<?php

$bgcolor1 = "#FDF1E4"; // ROSE CLAIRE
$bgcolor2 = "#f0dcd5"; // VIOLET FONCÉ
$bgcolor3 = "#efefef";
$bgcolor4 = "#FF7F00";
$bgcolor0 = "#800000"; // VIOLET FONCÉ
$textcolor1 = "#ffffff";
$textcolor2 = "#800000";
if (is_file("admin/themes/admin_hight/tables.php")) {
include_once("admin/themes/admin_hight/tables.php");
}

function themeheader() {
global $admin_file, $admin, $cookie, $prefix, $urle, $mmStyle, $menuVars, $mmMenu;

echo "<body leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">";

if ( !defined("ADMINLOG") ) {
    $sql = "SELECT `user_id` from `".TABLE_USERS."` ";
if ( !($result = $GLOBALS['db']->sql_query($sql)) )
{ query_die(GENERAL_ERROR, 'Could not obtain users admin template', '', __LINE__, __FILE__, $sql);}
$numusers = $GLOBALS['db']->sql_numrows($result);
$raw      = $GLOBALS['db']->sql_fetchrow($result);
$uid      = $GLOBALS['db']->XMFnum($raw['user_id']);

if ( is_active("Forums")) {
$sql2 = "SELECT `privmsgs_to_userid` FROM `".$prefix."_bbprivmsgs` WHERE `privmsgs_to_userid`='$uid' AND `privmsgs_type`='0'";
if ( !($result2 = $GLOBALS['db']->sql_query($sql2)) )
{ $oldpms = 0 ;} else {
$oldpms = $GLOBALS['db']->sql_numrows($result2); }
$sql1 = "SELECT `privmsgs_to_userid` FROM `".$prefix."_bbprivmsgs` WHERE `privmsgs_to_userid`='$uid' AND (`privmsgs_type`='5' OR `privmsgs_type`='1')";
if ( !($result1 = $GLOBALS['db']->sql_query($sql1)) )
{$newpms = 0; } else {
$newpms = $GLOBALS['db']->sql_numrows($result1); }
if ( $newpms == 0) { 
$newpms = " $oldpms <a href='modules.php?name=Private_Messages'><img src='admin/themes/admin_hight/images/nomail.png' border='0' alt='"._MESSAGES."' title='"._MESSAGES."' /></a>"; } else { $newpms = "( $newpms ) $oldpms <a href='modules.php?name=Private_Messages' ><img src='admin/themes/admin_hight/images/nomail.png'  alt='"._MESSAGES."' title='"._MESSAGES."' /></a>";
	 }
}
?>
<table cellspacing="0" cellpadding="0" width="99%" align="center" border="0"><tr>
<td valign="top" align="left">
<a href="admin.php"><img src="admin/themes/admin_hight/images/headerlogo.jpg" border="0" alt="Maximus Powered" title="Maximus Powered" /></a>
</td>
<td valign="top" align="right">
<img src="admin/themes/admin_hight/images/header.jpg" alt="" />
</td></tr>
</table>
<table cellspacing="0" cellpadding="0" width="99%" align="center" border="0"><tr>
<td valign="top" align="left" bgcolor="#800000">
</td></tr></table>
<table cellspacing="0" cellpadding="0" width="99%" align="center" border="0"><tr>
<td valign="top" align="left" bgcolor="#FDF1E4" width="85%">
<?php include_once("admin/themes/admin_hight/light_menu.php"); ?>
</td> <td valign="top" align="right" bgcolor="#FDF1E4"><?php echo $newpms; ?>&nbsp;<font size="3"><?php echo $numusers; ?></font>&nbsp;<img src="admin/themes/admin_hight/images/users.png" alt="" /></td></tr></table>
<table width="99%" cellpadding="0" cellspacing="0" border="0" align="center"><tr valign="top">
<td valign="top">
<?php

} else {
    $tmpl_file = "admin/themes/admin_hight/header2.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval("$thefile");
    print $r_file;
}


if ( !defined("ADMINLOG") ) {
    NavBarAdmin('home','manager','paneladmin','back','reload','next','cancel','support','tuto');
}
}

function themefooter() {
   global $total_time, $start_time, $CopyrightAdmin, $admin_file ;
    $tmpl_file = "admin/themes/admin_hight/footer.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
   }