<?php
checkLogin('adm');
checkEnteService($_GET['flt_serv_cod']);
include("functions.inc.php");
include("menu.inc.php");

$p = new Page('Iscritti');
$p->addModuleJs('script');
$p->addMenu('logged');
$p->printHeader();
?>
<div class="row">
	<div class="col-xs-9 col-sm-10">
		<h3 class="p-title">Elenco iscritti</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_users()){

	$tableList = new TableList();
	$tableList->addHeader(
		array('Nome','col-xs-7 col-sm-3'),
		array('Indirizzo','hidden-xs col-sm-5'),
		array('Comune','hidden-xs col-sm-2'),
		array('Telefono','col-xs-5 col-sm-2')
	);

	foreach($list['list'] as $v){
		
		$tableList->setRowUrl('/users/diag/user_show/?id='.$v['user_id'],true);
		
		$tableList->addCol($v['user_cognome'].' '.$v['user_nome']);
		$tableList->addCol($v['user_ind']);
		$tableList->addCol(utf8_encode($v['comune']));
		$tableList->addCol($v['user_cell']);
	}
	
	$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();
?>