<?php
/*********************/
/*                   */
/*  Version : 5.1.0  */
/*  Author  : RM     */
/*  Comment : 071223 */
/*                   */
/*********************/

echo "<title>Pagina de Informa&ccedil;oes</title>\r\n";
include( "config.php" );
$query_conta = array(
    mssql_query( "SELECT count(*) FROM MEMB_INFO" ),
    mssql_query( "SELECT count(*) FROM MEMB_STAT WHERE ConnectStat = 1" ),
    mssql_query( "SELECT count(*) FROM MEMB_INFO WHERE bloc_code=1" )
);
$query_online = array(
    mssql_query( "SELECT count(*) FROM MEMB_STAT WHERE ConnectStat = 1 AND ServerName='Mu Crazy'" ),
    mssql_query( "SELECT count(*) FROM MEMB_STAT WHERE ConnectStat = 1 AND ServerName='Mu Crazy2'" ),
    mssql_query( "SELECT count(*) FROM MEMB_STAT WHERE ConnectStat = 1 AND ServerName='Mu Crazy3'" ),
    mssql_query( "SELECT count(*) FROM MEMB_STAT WHERE ConnectStat = 1 AND ServerName='Mu Crazy4'" )
);
$query_char = array(
    mssql_query( "SELECT count(*) FROM Character" ),
    mssql_query( "SELECT count(*) FROM Character WHERE CtlCode=1" ),
    mssql_query( "SELECT count(*) FROM Character WHERE CtlCode=8" ),
    mssql_query( "SELECT count(*) FROM Character WHERE CtlCode=24" ),
    mssql_query( "SELECT count(*) FROM MEMB_STAT, Character, AccountCharacter WHERE memb___id=accountid AND accountid=id AND gameidc=name AND ctlcode=8 AND connectstat=1" ),
    mssql_query( "SELECT count(*) FROM MEMB_STAT, Character, AccountCharacter WHERE memb___id=accountid AND accountid=id AND gameidc=name AND ctlcode=24 AND connectstat=1" )
);
$numero_guild = @mssql_result( @mssql_query( "SELECT count(*) FROM Guild" ), 0, 0 );
$recorde_on = @mssql_result( @mssql_query( "Select Top 1 quanto from MEMB_RECORD order by quanto desc" ), 0, 0 );
$checkstatus1 = @fsockopen( "127.0.0.1", 55903, $errno, $errstr, 1 );
$checkstatus2 = @fsockopen( "127.0.0.1", 45902, $errno, $errstr, 1 );
$checkstatus3 = @fsockopen( "127.0.0.1", 45901, $errno, $errstr, 1 );
$checkstatus4 = @fsockopen( "127.0.0.1", 45904, $errno, $errstr, 1 );
if ( 1 <= $checkstatus1 )
{
    $status1 = "<font color='#00FF00'>".mssql_result( $query_online[0], 0, 0 )."</font>";
}
else
{
    $status1 = "<font color='red'>Offline</font>";
}
if ( 1 <= $checkstatus2 )
{
    $status2 = "<font color='#00FF00'>".mssql_result( $query_online[1], 0, 0 )."</font>";
}
else
{
    $status2 = "<font color='red'>Offline</font>";
}
if ( 1 <= $checkstatus3 )
{
    $status3 = "<font color='#00FF00'>".mssql_result( $query_online[2], 0, 0 )."</font>";
}
else
{
    $status3 = "<font color='red'>Offline</font>";
}
if ( 1 <= $checkstatus4 )
{
    $status4 = "<font color='#00FF00'>".mssql_result( $query_online[3], 0, 0 )."</font>";
}
else
{
    $status4 = "<font color='red'>Offline</font>";
}
?>
