PageRenderTime 57ms CodeModel.GetById 28ms RepoModel.GetById 0ms app.codeStats 0ms

/utenti.php

https://bitbucket.org/amorello/changeover
PHP | 78 lines | 50 code | 17 blank | 11 comment | 4 complexity | 193ade16872fa89c7067b0c3aa906a78 MD5 | raw file
  1. <?php
  2. session_start();
  3. include 'CSS/templateTop.html';
  4. require_once 'login.php';
  5. if(!isset($_SESSION['changeover_IDutente'])){
  6. header("location: index.php");
  7. }
  8. else
  9. {
  10. /*
  11. /* per far accedere alla pagina solo un amministratore
  12. if($_SESSION['nonconf_DBA']=='Y')
  13. {
  14. */
  15. include 'barramenu.php';
  16. $query = "SELECT ID, cognome, nome FROM utenti ORDER BY cognome";
  17. $result = mysql_query($query);
  18. if (!$result) die ("Database access failed: " . mysql_error());
  19. $righe = mysql_num_rows($result);
  20. echo <<<_END
  21. UTENTI:
  22. <table border="5" bordercolor= "#6FD1D2" rules="rows" >
  23. <tr bgcolor="#6FD1D2" >
  24. <td>Cognome</td>
  25. <td>Nome</td>
  26. <td></td>
  27. <td></td>
  28. </tr>
  29. _END;
  30. for ($j = 0 ; $j < $righe ; ++$j)
  31. {
  32. $row = mysql_fetch_row($result);
  33. $ID = $row[0];
  34. $cognome = $row[1];
  35. $nome = $row[2];
  36. echo <<<_END
  37. <tr>
  38. <td>$cognome</td>
  39. <td>$nome</td>
  40. <td><form action="modificautente.php" method="post"><pre></td>
  41. <td><input type="hidden" name="ID" value="$ID">
  42. <input type="submit" name="modifica" value="MODIFICA" /></td>
  43. </pre></form>
  44. </tr>
  45. _END;
  46. }
  47. echo <<<_END
  48. </table>
  49. <form action="nuovoutente.php" method="post"><pre>
  50. <input type="submit" name="nuovo" value="CREA NUOVO UTENTE" />
  51. </pre></form>
  52. _END;
  53. /*
  54. } else
  55. {
  56. echo "protezione pagina - no diritti di amministrazine";
  57. }
  58. */
  59. }
  60. include 'CSS/templateEnd.html';
  61. ?>