<?php
include_once ("../core/config.php");
$UTENTE = login();
$DIRITTI = diritti('Admin');
view_top();
$tabella = new html (0,"90%",array (3,3,3,2,10,2,13,2,10,2,10,0));
?>
	<tr>
		<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
		<td class="spazioh"><a href="users_group_edit.php"><img src="<?php print $CONF['base_url'] ?>/img/addresource.png"></a></td>
		<td colspan=10 class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
	</tr>
<?php
$query = "	SELECT 
			id,
			user,
			fullname,
			attivo,
			DATE_FORMAT(primo, '%d.%m.%Y %H:%i:%s') AS primo,
			DATE_FORMAT(ultimo, '%d.%m.%Y %H:%i:%s') AS ultimo
		FROM
			proxy_utenti
		WHERE
			guest = 1
		ORDER BY
			user
	";

$res = mysql_query( $query, $DB_ID );
$tabella->intestazione (array ("","","","","Utente","","Nome Completo","","Primo Accesso","","Ultimo Accesso",""));
while ($dato = mysql_fetch_array ( $res )) {
?>
	<tr>
<?php
	if ($dato['attivo']) {
?>
		<td class="spazioh"><a href="proxy_gest.php?azione=user_down&id=<?php print $dato['id']?>"><img src="<?php print $CONF['base_url'] ?>/img/attivo.gif" ALT="Utente Attivo" TITLE="Utente Attivo"></a></td>
<?php	} else { ?>
		<td class="spazioh"><a href="proxy_gest.php?azione=user_up&id=<?php print $dato['id']?>"><img src="<?php print $CONF['base_url'] ?>/img/non_attivo.gif" ALT="Utente non Attivo" TITLE="Utente non Attivo"></a></td>
<?php	} ?>
		<td class="spazioh"><a href="proxy_gest.php?azione=user_rm&id=<?php print $dato['id']?>"><img src="<?php print $CONF['base_url'] ?>/img/trash.png"></a></td>

		<td class="spazioh"><a href="users_edit.php?id=<?php print $dato['id'] ?>"><img src="<?php print $CONF['base_url'] ?>/img/modify.gif" ALT="Dettaglio" TITLE="Dettaglio"></a></td>
		<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>

		<td class="colip"><?php print $dato['user'] ?></td>

		<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
		<td class="colip"><?php print $dato['fullname'] ?></td>

		<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
		<td class="colip"><?php print $dato['primo'] ?></td>

		<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
		<td class="colip"><?php print $dato['ultimo'] ?></td>
		<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
		</td>
	</tr>
<?php
$tabella->riga();
} 
$tabella->close();
view_footer(); ?>
