<?php
checkLogin('adm');
include("functions.inc.php");
include("menu.inc.php");
$p = new Page('Logs');
$p->addMenu('logged');
$p->printHeader();
?>
<div class="row">
	<div class="col-xs-9 col-sm-10">
		<h3 class="p-title">Logs utenti</h3>
    </div>
	<div class="col-xs-3 col-sm-2"><?php print_optMenu('adm_home');?></div>
</div>
<?php
if($list = get_logs()){

	$tableList = new TableList();
	$tableList->addHeader(
		array('Data','col-xs-3 col-sm-3 col-md-2 col-lg-2'),
		array('Utente','col-xs-3 col-sm-3 col-md-3 col-lg-3'),
		array('Azione','col-xs-6 col-sm-6 col-md-7 col-lg-7')
	);

	foreach($list['list'] as $v){
		
		if($v['anagr_id']>0)
			$tableList->setRowUrl(BASE_URL.'/anagrafiche/adm_add/?id='.$v['anagr_id']);
		
		$tableList->addCol($v['dt']);
		$tableList->addCol($v['log_username']);
		$tableList->addCol($v['log_msg']);
	}
	
	$tableList->output($list['pagination']);

}else if(isset($_GET['filter'])){
	printMsg("Nessuna azione da mostrare","warning",false);	
}else{
	printMsg("Nessuna azione da mostrare","info",false);	
}
$p->printFooter();
?>