105 lines
4.0 KiB
PHP
Executable File
105 lines
4.0 KiB
PHP
Executable File
<?php
|
|
include_once ("../core/config.php");
|
|
include_once ("funzioni.php");
|
|
$UTENTE = login();
|
|
$DIRITTI = diritti('Utente');
|
|
view_top();
|
|
|
|
$ordine = "cognome, nome";
|
|
|
|
if (!is_null($_GET[o]))
|
|
$ordine = $_GET[o];
|
|
|
|
?>
|
|
|
|
<form name="" method="post">
|
|
<?php $tabella = new html (0,"90%", array (3,5,2,15,2,15,2,10,2,10,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="iscritti_edit.php"><img src="<?php print $CONF['base_url'] ?>/img/addresource.png"></a></td>
|
|
<td colspan=13 class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
|
</tr>
|
|
<?php
|
|
$tabella->riga();
|
|
|
|
(livello_modulo($DIRITTI) == "Admin") ? $query_admin = "" : $query_admin = "
|
|
AND
|
|
wf_iscritto.attivo = 1
|
|
";
|
|
|
|
$query = " SELECT
|
|
wf_iscritto.id,
|
|
wf_iscritto.attivo,
|
|
wf_iscritto.cognome,
|
|
wf_iscritto.nome,
|
|
wf_cinture.cintura,
|
|
wf_palestra.palestra,
|
|
TIMESTAMPDIFF(DAY, wf_iscritto.certificato, NOW()) AS giorni,
|
|
DATE_FORMAT(wf_iscritto.nascita_data, '%d.%m.%Y') AS nascita_data,
|
|
DATE_FORMAT(wf_iscritto.certificato, '%d.%m.%Y') AS certificato
|
|
FROM
|
|
wf_iscritto
|
|
JOIN
|
|
wf_cinture
|
|
ON
|
|
wf_iscritto.id_cintura = wf_cinture.id
|
|
JOIN
|
|
wf_palestra
|
|
ON
|
|
wf_iscritto.id_palestra = wf_palestra.id
|
|
JOIN
|
|
wf_utenti
|
|
ON
|
|
wf_palestra.id = wf_utenti.id_palestra
|
|
WHERE
|
|
wf_utenti.id_utenti = ".$UTENTE['id']."
|
|
AND
|
|
wf_utenti.attivo = 1
|
|
$query_admin
|
|
GROUP BY
|
|
id
|
|
ORDER BY
|
|
attivo desc,
|
|
$ordine
|
|
";
|
|
|
|
$res = mysql_query( $query, $DB_ID );
|
|
$tabella->intestazione (array("", "", "", "<a class=\"descrizione\" href=\"?o=cognome,nome\">Cognome<a>", "", "<a class=\"descrizione\" href=\"?o=nome,cognome\">Nome<a>", "", "<a class=\"descrizione\" href=\"?o=id_cintura,cognome,nome\">Cintura<a>", "", "<a class=\"descrizione\" href=\"?o=wf_iscritto.nascita_data DESC,cognome,nome\">Categoria<a>", "", "<a class=\"descrizione\" href=\"?o=palestra,cognome,nome\">Palestra<a>", "", "<a class=\"descrizione\" href=\"?o=wf_iscritto.certificato,cognome,nome\">Scad. Cert.<a>", ""));
|
|
$tabella->riga();
|
|
while ($dato = mysql_fetch_array ( $res )) {
|
|
|
|
$colore = "black";
|
|
if ($dato['giorni'] > -30) $colore = "orange";
|
|
if ($dato['giorni'] > 0 || is_null ($dato['giorni'])) $colore = "red";
|
|
?>
|
|
<tr>
|
|
<?php
|
|
if ($dato['attivo']) {
|
|
?>
|
|
<td class="col3btn"><a href="wf_gest.php?azione=wf_off&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="col3btn"><a href="wf_gest.php?azione=wf_on&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="col3btn"><a href="iscritti_edit.php?id=<?php print $dato['id'] ?>"><img src="<?php print $CONF['base_url'] ?>/img/modify.gif" ALT="Modifica Utente" TITLE="Modifica Utente"></a></td>
|
|
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
|
<td class="colip"><?php print $dato['cognome'] ?></td>
|
|
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
|
<td class="colip"><?php print $dato['nome'] ?></td>
|
|
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
|
<td class="colip"><?php print $dato['cintura'] ?></td>
|
|
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
|
<td class="colip"><?php print categoria($dato['nascita_data']) ?></td>
|
|
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
|
<td class="colip"><?php print $dato['palestra'] ?></td>
|
|
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
|
<td class="colip" style="color:<?php print $colore ?>"><?php print $dato['certificato'] ?></td>
|
|
<td class="spazioh"><img src="<?php print $CONF['base_url'] ?>/img/spazio.gif"></td>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
$tabella->close();
|
|
?>
|
|
</form>
|
|
<?php view_footer(); ?>
|