/utenti.php
PHP | 78 lines | 50 code | 17 blank | 11 comment | 4 complexity | 193ade16872fa89c7067b0c3aa906a78 MD5 | raw file
- <?php
- session_start();
- include 'CSS/templateTop.html';
-
- require_once 'login.php';
-
- if(!isset($_SESSION['changeover_IDutente'])){
- header("location: index.php");
- }
- else
- {
- /*
- /* per far accedere alla pagina solo un amministratore
- if($_SESSION['nonconf_DBA']=='Y')
- {
- */
-
- include 'barramenu.php';
-
- $query = "SELECT ID, cognome, nome FROM utenti ORDER BY cognome";
- $result = mysql_query($query);
- if (!$result) die ("Database access failed: " . mysql_error());
- $righe = mysql_num_rows($result);
-
- echo <<<_END
- UTENTI:
- <table border="5" bordercolor= "#6FD1D2" rules="rows" >
- <tr bgcolor="#6FD1D2" >
- <td>Cognome</td>
- <td>Nome</td>
- <td></td>
- <td></td>
- </tr>
- _END;
-
-
- for ($j = 0 ; $j < $righe ; ++$j)
- {
- $row = mysql_fetch_row($result);
- $ID = $row[0];
- $cognome = $row[1];
- $nome = $row[2];
- echo <<<_END
-
- <tr>
- <td>$cognome</td>
- <td>$nome</td>
- <td><form action="modificautente.php" method="post"><pre></td>
- <td><input type="hidden" name="ID" value="$ID">
- <input type="submit" name="modifica" value="MODIFICA" /></td>
- </pre></form>
- </tr>
- _END;
-
- }
-
- echo <<<_END
-
- </table>
-
- <form action="nuovoutente.php" method="post"><pre>
- <input type="submit" name="nuovo" value="CREA NUOVO UTENTE" />
- </pre></form>
- _END;
-
-
- /*
- } else
- {
- echo "protezione pagina - no diritti di amministrazine";
- }
- */
- }
-
- include 'CSS/templateEnd.html';
-
-
- ?>