<div class="postui post-title">
	<h2><span>MEMBRII ECHIPEI</span></h2>
</div>

<div class="postui post-con">
	<div class="con-wrap">     

						
<table width="100%" style="border-color:#b79647; border-style:solid; padding:10px; border-width:1px;">

			<tr>
				<td style="text-align:center; border-color:#b79647; border-style:solid; padding:10px; border-width:1px;"><a><b>Clasa</b></a></td>
				<td style="border-color:#b79647; border-style:solid; padding:10px; border-width:1px;"><a><b>Nume</b></a></td>
				<td style="text-align:center; border-color:#b79647; border-style:solid; padding:10px; border-width:1px;"><a><b>Regat</b></a></td>
				<td style="border-color:#b79647; border-style:solid; padding:10px; border-width:1px;"><a><b>Nivel</b></a></td>
				<td style="border-color:#b79647; border-style:solid; padding:10px; border-width:1px;"><a><b>EXP</b></a></td>
				<td style="border-color:#b79647; border-style:solid; padding:10px; border-width:1px;"><a><b>Status</b></a></td>
			</tr> 




<?php

$getID = replace($_GET['id']);
function generatePages($max, $page, $class)
	{
		if ($max>=10)
		{
			if (($page>4) && ($page<$max-3))
			{
				for ($i = 1; $i <= 3; $i++)
				{
					$data .= showPage($i,$page,$class);
				}
				$data .= '<span class="'. $class .'">...</span> ';
				for ($i = $page-1; $i <= $page+1; $i++)
				{
					$data .= showPage($i,$page,$class);
				}
				$data .= '<span class="'. $class .'">...</span> ';
				for ($i = $max-2; $i <= $max; $i++)
				{
					$data .= showPage($i,$page,$class);
				}
			}
			else
			{
				for ($i = 1; $i <= 5; $i++)
				{
					$data .= showPage($i,$page,$class);
				}
				$data .= '<span class="'. $class .'">...</span> ';
				for ($i = $max-5+1; $i <= $max; $i++)
				{
					$data .= showPage($i,$page,$class);
				}
			}
		}
		else
		{
		$max = (10 >= $max) ? $max : 10;
		for ($i = 1; $i <= $max; $i++)
		{
				$data .= showPage($i,$page,$class);
		}
		}
		return $data;
	}
		
	/**
	 * Page Style Generator .
	 * 
	 * @param int $i
	 * @param int $page
	 * @param string $class
	 * @param string $selected
	 */
	function showPage($i, $page, $class, $selected = 'pagination_selected')
	{
		if ($page==$i)
		{
			$data .= '<span class="'. $selected .'">'. $i .'</span> ';
		}
		else
		{
			global $name;
			$getPage = replace($_GET['page']);
			$data .= '<span  class="'. $class .'"><a href="?page='.$getPage.'&id='.$i.'" onclick="load()">'. $i .'</a></span> ';
		}
		return $data;
	}
	
if ((!isset($getID)) || (!is_numeric($getID)) || ($getID < 1)) { $pagenum = 1; }
	else { $pagenum = $getID; 
	
	}
	$page_rows = 1000;
	if (($pagenum > $last) && ($last > 0)) { $pagenum = $last; }
	$max = $pagenum * $page_rows;
	$min = $max - $page_rows;

	
	$result = mysql_query("SELECT * FROM player.player limit 0,100");
	

	$rows = mysql_num_rows($result);
	$last = ceil($rows/$page_rows);
$i = 0;
/////////////////////

$result2 = mysql_query("Select * from player.player WHERE name LIKE '[%]%' AND name NOT LIKE '[VIP]%' AND name NOT LIKE '[MISS]%' AND name NOT LIKE '[Mister]%' AND name NOT LIKE '[PVP]%' AND name NOT LIKE '[R.I.%]' ORDER BY level DESC limit ".($page_rows * ($pagenum - 1)).", ".$page_rows.""); 

//////////////////////////////////////////
if($getID == 1 || $getID == NULL)
{
	$nr=0;
}
else
{
	$nr = ($getID-1)*15+$nr;	
}
while($acs = mysql_fetch_object($result2))
{
	$nr++;
	$pid = $acs->id; 
					$query2 = mysql_query("SELECT * FROM player.player_index WHERE pid1='$pid' or pid2='$pid' or pid3='$pid' or pid4='$pid'") or die('ERROR');
				$row2 = mysql_fetch_array($query2);
				$empire = $row2['empire'];
	?>


<?php
$GMLIST = array(''.$acs->name.''); // Agregar Nombres de los Gm's
for($i=0;$i<count($GMLIST);$i++)
{
$sqlCmd = mysql_fetch_array(mysql_query("SELECT *,count(*) as total_line FROM player.player WHERE name = '".$GMLIST[$i]."' AND DATE_SUB(NOW(), INTERVAL 5 MINUTE) < last_play LIMIT 1"));
?>					  


 <tbody>

                  <td style='text-align:center; border-color:#b79647; border-style:solid; padding:10px; border-width:1px;'><img src="./resurse/imagini/caractere/<?=$acs->job?>.png"/></td>
				  <td style='border-color:#b79647; border-style:solid; padding:10px; border-width:1px;'><b><a><?=$acs->name?></a></b></td>
				  <td text-align:center; style="border-color:#b79647; border-style:solid; padding:10px; border-width:1px;"><center><?=nume_regat($empire)?></center></td>
				  <td style='border-color:#b79647; border-style:solid; padding:10px; border-width:1px;'><b><?=$acs->level?></b></td>
				  <td style='border-color:#b79647; border-style:solid; padding:10px; border-width:1px;'><b><?=$acs->exp?></b></td>
				  <td style='border-color:#b79647; border-style:solid; padding:10px; border-width:1px;'><b> 
<?php
if ($sqlCmd['total_line'] > 0){
echo "<img src='./resurse/user_online.gif'>";
}else{
echo "<img src='./resurse/user_offline.gif'>";
}
}

?> </td>
            
						
						
		 <?php
} 
echo "</table><Br>";
echo "<div align='center'>";
	echo generatePages($last, $pagenum, "pagination");
	echo "</font></div>";
?>				
	

	
		</div>           
</div>
<div class="postui post-end"></div>