<?
require("config.php");
$cs_map_server_group = "0";
$castle_siege_schedule = "<font color='#DDA943'>Every one week</font>";
$cs = $db->Execute("Select SIEGE_START_DATE,SIEGE_END_DATE,SIEGE_ENDED,CASTLE_OCCUPY,OWNER_GUILD,MONEY,TAX_RATE_CHAOS,TAX_RATE_STORE,TAX_HUNT_ZONE,MAP_SVR_GROUP from MuCastle_DATA where MAP_SVR_GROUP='$cs_map_server_group'");
$cs = $cs->fetchrow();
$cs_g = $db->Execute("Select GUILD_NAME from MuCastle_SIEGE_GUILDLIST where MAP_SVR_GROUP='$cs[9]'");
if($cs){
if($cs[2] == '1'){
echo("<font color='#ff6600'>Castle Siege: <font color='red'>Ended</font>"); } else { echo("<font color='#ff6600'>Castle Siege Status: </font><font color='#DDA943'>On</font>"); }
echo("<br><font color='#ff6600'>Castle Siege Schedule: <span class='text'>$castle_siege_schedule</span>");
if($cs[3] != NULL){
$cs[4] = htmlspecialchars($cs[4]);
echo("<br>Castle Owner: <font color='#DDA943'>$cs[4]</font>");}
else{echo("<br>Castle Owner: <font color='#DDA943'>No Owner</font>");}
for($i=0;$i < $cs_g->numrows();++$i)
{
$cs_guilds = $cs_g->fetchrow();
$rank = $i+1;
$cs_guilds[0] = str_replace(">",">",$cs_guilds[0]);
$cs_guilds[0] = str_replace("<","<",$cs_guilds[0]);
echo "<tbody><tr>
<td align=left>$rank</td>
<td align=left>$cs_guilds[0]</a></td>
</tr></tbody>
";
}
echo("");
}else {echo("Castle Siege Is Not Installed On This Server");}
?>