<?php
include_once ("../core/config.php");
$UTENTE = login();
$DIRITTI = diritti('Admin');
view_top();

$tabella = new html (0,"90%", array (5,5,5,2,10,2,13,2,12,2,12,2,10,0));
?>
	<tr>
		<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
		<td class="spazioh"><a href="users_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(ultimo, '%d.%m.%Y %H:%i:%s') AS data,
			DATE_FORMAT(modifica, '%d.%m.%Y %H:%i:%s') AS modifica,
			ip
		FROM
			proxy_utenti
		WHERE
			guest = 0
		ORDER BY
			user
	";

$res = mysql_query( $query, $DB_ID );
$tabella->intestazione (array ("","","","","Utente","","Nome Completo","","Ultimo Accesso","","Ultima Modifica","","IP Associato",""));
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['data'] ?></td>

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

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