<?php
include("postget.php");
include_once("common.php");
$pagetitle = _LAST_20_CLIENTS;

checklevel(3,$_REQUEST['clientid']);
$query="SELECT clientid,clientalias,first,last,country,start FROM hd_clients WHERE active>=0 ORDER BY start DESC LIMIT 0,20";
$result=mysql_query($query,$db_link);

include("head_template.php");

echo '
<div class="container">
	<div class="row">


<table class="table table-striped">
';

print("<thead><tr>
	<th>"._CLIENT_ID."/"._ALIAS."</th> 
	<th>"._FIRST_NAME."</th> 
	<th>"._LAST_NAME."</th> 
	<th>"._COUNTRY."</th> 
	<th>"._START."</th></tr></thead><tbody>");

while($row = mysql_fetch_array($result)) {
	print("<tr><TD><a href='".$serverurl."/tickets.php?clientid=$row[clientid]'>$row[clientid]");
	if ($row[clientalias]){
		print(" / $row[clientalias]");
	}
	print("</a></TD>");
	print("<TD>$row[first]</TD>");
	print("<TD>$row[last]</TD>");
	print("<TD align='left'>"); bandera2($row[country]); print(" ".showcountry($row[country])); print("</TD>");
	print("<TD align='left'>".date($df,$row[start])." (".TimeAgo($row[start],time())." "._AGO.")</TD></TR>");
}

echo '
		</td>
		</tr></tbody>
		</table>
</div>
</div>
';

include("foot_template.php");

?>
