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

$p = new Page('Anagrafiche');
$p->addMenu('logged');
$p->printHeader();
?>
<h3 class="p-title"><a class="btn-back" href="../adm/"><span class="glyphicon glyphicon-chevron-left"></span></a> Archivio SMS</h3>
<?php
//anagrafiche di questo servizio
if($list = get_sms()){

	$tableList = new TableList();
	$tableList->addHeader(
		array('Data','col-sx-3 col-sm-3 col-md-2'),
		array('Testo','col-xs-8 col-sm-8 col-md-9'),
		array('Inviati','hidden-xs col-sm-1 text-right')
	);

	foreach($list['list'] as $v){
		
		$tableList->setRowUrl('../adm/?id='.$v['sms_id']);
		
		$tableList->addCol($v['sms_date']);
		$tableList->addCol($v['sms_text']);
		$tableList->addCol('<span class="badge">'.$v['sms_sent'].'</span>');
	}
	
	$tableList->output($list['pagination']);

}else{
	printMsg("Nessun SMS inviato","info",false);	
}

$p->printFooter();
?>