<head>
	<title>SERVERSTATUS</title>	
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link href="https://fonts.googleapis.com/css?family=Exo+2:300,400,600,900" rel="stylesheet">
</head>
<style type="text/css">
body {
    margin: 0 auto;
    overflow: hidden;
    height: 100vh;
    position: relative; /* Necesario para que el pseudo-elemento se posicione correctamente */
    font-family: 'Exo 2';
    font-size: 11px;
    font-weight: bold;
    color: #FFFFFF;
    background: transparent url('img/fondo_patcher.jpg'); /* Imagen de fondo */
    background-repeat: no-repeat;
    background-position: center;
}

.contenedor {
	display: flex;
	flex-direction: column; /* Apilar los elementos verticalmente */
	justify-content: center;
	align-items: center;
	height: 100vh; /* Mantiene el contenedor ocupando la pantalla completa */
}

.hijo {
	display: flex; /* Activa Flexbox para centrar el contenido */
	justify-content: center; /* Centra horizontalmente */
	align-items: center; /* Centra verticalmente */
	width: 95px;
	height: auto; /* Ajusta la altura al contenido */
	text-align: center; /* Centra el texto dentro del elemento */
	letter-spacing: -1px; /* Reduce el espaciado entre letras */
}

.online {
	color: #7ca617;
}

.offline {
	color:#a40c00;
}
</style>
<?php
	$statusXML = 'https://rohispano.cl/?module=server&action=status-xml';
	// Do not touch from here
	@$fluxDir = dirname(dirname($scripturl));
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_URL, $statusXML);
	$data = curl_exec($ch);
	curl_close($ch);

	$xml = simplexml_load_string( $data );
	@$status = $xml->Group[0]->Server;
	$mapserver = (int)$status['mapServer'];
	$woeStatus = (int)$status['woeStatus'];
	$online_player = (int)$status['playersOnline'];
	$vendors = (int)$status['vendors'];
	$peakOnline = (int)$status['peakOnline'];
	$online = 'online';
	$offline = 'offline';
?>
<body oncontextmenu="return false;">
<div class="contenedor">
  <div class="hijo">JUGADORES: <span class="<?php echo ($mapserver)? $online:$offline; ?>"><?php echo $online_player; ?></span></div>
  <div class="hijo">SERVIDOR: <span class="<?php echo ($mapserver)? $online:$offline; ?>" style="text-transform: uppercase;"> <?php echo ($mapserver)? $online:$offline; ?></span></div>
</div>
</body>
