<?php
checkLogin('adm');
include("functions.inc.php");
include("menu.inc.php");

$p = new Page('Personale addetto');
$p->addModuleJs('script');
$p->addMenu('logged');
$p->printHeader();
?>
<div class="row">
	<div class="col-xs-9 col-sm-10">
		<h3 class="p-title">Elenco personale</h3>
    </div>
	<div class="col-xs-3 col-sm-2"><?php print_optMenu('adm_home');?></div>
</div>
<?php
//anagrafiche di questo servizio
if($list = get_personale()){

	$tableList = new TableList();
	$tableList->addHeader(
		array('Anagrafica','col-xs-12 col-sm-4'),
		array('Servizi','hidden-xs col-sm-8')
	);

	foreach($list['list'] as $v){
		
		$tableList->setRowUrl('/personale/diag/user_show/?id='.$v['user_id'],true);
		
		$tableList->addCol($v['user_cognome'].' '.$v['user_nome']);
		$tableList->addCol(implode(", ",$v['servizi']));
	}
	
	$tableList->output($list['pagination']);

}else if(isset($_GET['filter'])){
	printMsg("Nessun risultato per la ricerca","warning",false);	
}else{
	printMsg("Nessuna anagrafica inserita","info",false);	
}

$p->printFooter();
?>