<?PHP

echo("
<!--- END OG THEME BLOCK --->
<FIELDSET id=standard><LEGEND>Current Active Server Status</LEGEND>
	");
if ($total_active_on_server==29)
	{ echo("
		<table width='530' cellpadding='2' cellspacing='3' style='border-style: solid; border-color: 990000; border-width: 1px' align='left' bgcolor='ffcaca'>
			<tr>
				<td align='center' bgcolor='ffffff' valign='top' style='border-style: solid; border-color: red; border-width: 1px;padding:5'><img src='".$http_images."/ap[24].gif'> <B>POSSIBLE ACTIVE SERVER CONFIGURATION ERROR</B> <img src='".$http_images."/ap[24].gif'></td> 
			</tr>
			<tr>
				<td align='left' valign='top'>The system has detected <B>29</B> accounts as your displayed active accounts on the server.  This is a signal that normally points to a <B>bad remote access key</B>, invalid <B>WHM username</B> and/or an <B>invalid IP</B> set for server named [ <B>".$current_server_name."</B> ] in server configuration.</td> 
			</tr>
		</table><BR><BR><BR><BR><BR><BR><P>
		");
	}
if ($current_server==99)
	{
	echo("
		<table width='530' border='0' cellspacing='1' cellpadding='2' style='border-left: solid; border-right: solid; border-bottom: solid; border-color: #53afe5; border-width: 1px'>
			<tr>
			  <td align='left' valign='top' BGCOLOR='#F0F0F0'><img src='".$http_images."/drop_arrow.gif'><b>No active servers defined.</b></td>
			</tr>
		</table>
		");
	}
else
	{
	@$usagedisplay=sprintf("%01.0f",(($total_active_on_server/$max_accounts)*100));
	$cleanusage=$usagedisplay;
	if($usagedisplay>100) {$usagedisplay="98";}
	if($usagedisplay<65)
	{ $gif="sa"; }
	else if($usagedisplay>65&&$usagedisplay<90)
	{ $gif="q"; }
	else if($usagedisplay>90)
	{ $gif="m"; }

	echo("
	<table width='530' border='0' cellspacing='1' cellpadding='2'>
		<tr>
		  <td width='60%' bgcolor='#dcdcdc'><b><FONT COLOR='#000000' SIZE='-2' face='Verdana'>".$current_server_name_main."</FONT></b></td>
		  <td width='40%' bgcolor='#dcdcdc'><b><FONT COLOR='#000000' SIZE='-2' face='Verdana'>Server Status</FONT></b></td>
		</tr>
		<tr>
		  <td width='60%' bgcolor='#dcdcdc'><font size='-2' face='Verdana'>Total Accounts on Server <b>[".$total_active_on_server."]</b></FONT>
		");
	if($total_active_on_server==29) { echo "<font color='red'><B> <-- possible error</font></b>"; }
	echo("
	</td> 
		  <td width='40%' bgcolor='#dcdcdc' NOWRAP>
			<table width='100%' border='0' cellspacing='0' cellpadding='1'>
			  <tr>
				<td width='94%'><font size='-2' face='Verdana'>Server Load <b>[".$server_load."]</b></FONT></td> 
				<td width='6%'><img src='".$http_images."/".$xserver_load_status."' width='10' height='10' ALIGN='bottom' border='0' naturalsizeflag='0'></td>
			  </tr>
			</table>
			</td>
		</tr>
		<tr>
			<td width='60%' bgcolor='#dcdcdc'><TABLE BORDER='0' CELLSPACING='1'
            CELLPADDING='1'>
              <TR>
                <TD WIDTH='100' ALIGN='RIGHT' BGCOLOR='#F0F0F0'><img src='".$http_images."/drop_arrow.gif'><font size='-2' face='Verdana'>".$cleanusage."% Usage:</FONT></TD>
                <TD WIDTH='190' background='".$http_images."/usage.gif'><IMG SRC='".$http_images."/".$gif."1.gif' WIDTH='2'
                  HEIGHT='10' ALIGN='BOTTOM' BORDER='0' NATURALSIZEFLAG='3'><IMG 
                  SRC='".$http_images."/".$gif."2.gif' WIDTH='$usagedisplay%' HEIGHT='10' ALIGN='BOTTOM' BORDER='0'
                  NATURALSIZEFLAG='0' title='$cleanusage%'><IMG SRC='".$http_images."/".$gif."3.gif' WIDTH='2' HEIGHT='10' 
                  ALIGN='BOTTOM' BORDER='0' NATURALSIZEFLAG='3'></TD>
              </TR>
			</table></td> 
			<td width='40%' bgcolor='#dcdcdc' NOWRAP>
			<table width='100%' border='0' cellspacing='0' cellpadding='1'>
			  <tr>
				<td width='94%'><font size='-2' face='Verdana'>".$apache." <b>[".(($apache_status==0)?"UP":"DOWN")."]</b></FONT></td> 
				<td width='6%'><img src='".$http_images."/".$xapache_status."' width='10' height='10' ALIGN='bottom' border='0' naturalsizeflag='0'></td>
			  </tr>
			</table>
			</td>
		</tr>
		<tr>
		  <td width='60%' bgcolor='#dcdcdc'><font size='-2' face='Verdana'>".$current_version."</FONT></td> 
		  <td width='40%' NOWRAP bgcolor='#dcdcdc'>
			<table width='100%' border='0' cellspacing='0' cellpadding='1'>
			  <tr>
				<td width='94%'><font size='-2' face='Verdana'>".$bind." <b>[".(($bind_status==0)?"UP":"DOWN")."]</b></FONT></td> 
				<td width='6%'><img src='".$http_images."/".$xbind_status."' width='10' height='10' ALIGN='bottom' border='0' naturalsizeflag='0'></td>
			  </tr>
			</table>
			</td>
		</tr>
	</table>
		");
	}
echo("
<BR><table width='530' border='0' cellspacing='0' cellpadding='2'>
	<tr>
	  <td width='25%' bgcolor='#C8C8C8' align='left' valign='middle'><font size='-2' face='Verdana'><A HREF='".$http_admin."/server_config.php?sid=".trim($sid)."' style='color:000000;'>Add New Server</A></FONT></td>
	  <td width='50%' bgcolor='#C8C8C8' align='center' valign='middle'><font size='-2' face='Verdana'><A HREF='".$http_admin."/server_edit.php?sid=".trim($sid)."' style='color:000000;'>Manage All Servers</A></FONT></td>
	  <td width='25%' bgcolor='#C8C8C8' align='center' valign='middle'><font size='-2' face='Verdana'><A HREF='https://".$server_ip.":2087' target='_blank' style='color:000000;'>Open WHM</A></FONT></td>
	</tr>
</table>
</fieldset>
<table width='530' border='0' cellspacing='0' cellpadding='0'>
	<tr>
	  <td width='100%'><img src='".$http_images."/space.gif' width='1' height='10' ALIGN='bottom' border='0' naturalsizeflag='0'></td> 
	</tr>
</table>
<!--- END OG THEME BLOCK --->
	");
?>