<?php
include_once ("config.php");
$UTENTE = login();
isadmin();
view_top();

$tabella = new html (0,"90%", array(2,20,2,30,2,40,0));
?>
<tr>
	<td><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
	<td class="campo">Campo</td>
	<td><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
	<td class="campo">Valore</td>
	<td><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
	<td class="campo">Nota</td>
	<td><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
</tr>
<?php
$tabella->riga();

$query = "SELECT * FROM conf WHERE vis=1 ORDER BY ordine";
$res = mysql_query( $query, $DB_ID );
while ($dato = mysql_fetch_array ( $res )) {
	$riga = "";
	$visualizza = 1;	
	switch ($dato['variabile']) {
		case "POP3_Server":
			$riga = $dato['valore'];
			break;
		case "totale":
		case "permanenti":
		case "temporanei":
		case "tempo_temporanei":
			$visualizza = 0;	
			break;
		case "template_base":
			$query = "SELECT nome FROM template WHERE id = ".$dato['valore'];
			$res_templ = mysql_query( $query, $DB_ID );
			$dato_templ = mysql_fetch_array ( $res_templ );
			$riga = $dato_templ['nome'];	
			break;
		default:
			$riga = $dato['valore'];
	}


	if ($visualizza) {
?>
<tr>
	<td><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
	<td class="valoretxt"><a class="menuatt" href="modconf.php?var=<?php print $dato['variabile'] ?>"><?php print $dato['variabile']?></a></td>
	<td bgcolor="#f3f3f3"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
	<td class="valoretxt"><?php print $riga?></td>
	<td bgcolor="#f3f3f3"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
	<td class="valoretxt"><?php print $dato['Commento']?></td>
	<td><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
</tr>
<?php 	
$tabella->riga();
	} 
}
$tabella->close();
view_footer (); 
?>
