<?php
include("postget.php");
include_once("common.php");
$pagetitle = _LAST_20_LOGINS;
checklevel(2,$_REQUEST['clientid']);
$query="SELECT hd_history.clientid, hd_history.time, hd_clients.first, hd_clients.last 
FROM hd_history 
INNER JOIN hd_clients ON hd_history.clientid = hd_clients.clientid 
WHERE hd_history.what='C' ORDER BY hd_history.time DESC LIMIT 0,20";

$result=mysql_query($query,$db_link);

include("head_template.php");

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

echo '<table class="table table-striped">';
print("<thead><tr>
	<th>"._ID."</th> 
	<th>"._CLIENT."</th> 
	<th>"._DATE."</th></tr></thead><tbody>");


while($row = mysql_fetch_array($result)) {
        print("<tr>");
	print("<TD align='center'><a href='".$serverurl."/tickets.php?clientid=$row[clientid]'>$row[0]</a></TD>");
	print("<TD align='center'>".$row[2]." ".$row[3]."</TD>");
	print("<TD align='center'>".date($df.' H:i',$row[1])." (");
	print("".TimeAgo($row[1],time())." "._AGO.")</TD></TR>");

}

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

include("foot_template.php");

?>
