Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. <?php
  2. include ('function.php');
  3. session_start();
  4. $conn = pg_connect('host=localhost user=postgres password=nerone4life dbname=wannaPlay');
  5. $lista = listaGiochi($conn);
  6. ?>
  7. <div class = "content">
  8. <?php
  9. echo "<table bgcolor = #41545F bordercolor = pink cellpadding = 2 border = 1>";
  10. echo "<tr><td>Nome</td><td>Numero Giocatori (max)</td><td>Eta consigliata</td><td>Tipologia</td><td>Modifica</td><td>Elimina</td>";
  11. while($row = pg_fetch_row($lista)){
  12. echo "<tr>";
  13. $i = 0;
  14. foreach($row as $dato) {
  15. if($i == 3){
  16. if($dato == "videogioco") $dato = "Videogioco";
  17. else if($dato == "gioco_di_carte") $dato = "Gioco di carte";
  18. else $dato = "Gioco da tavola";
  19. }
  20. $i++;
  21. echo "<td><center>$dato</center></td>";
  22. }
  23. ?>
  24. <td><center><a href= "./?id=31&nome=<?php echo urlencode($row[0]); ?>"><img src = "edit.png"></a></center></td>
  25. <td><center><a href= "cancellaGiocoDaSocialNetwork.php?nome=<?php echo urlencode($row[0]); ?>"><img src = "deleteG.png"></a></center></td>
  26. <?php
  27. echo "</tr>";
  28. }
  29. echo "</table>";
  30. ?>
  31. <p>Aggiungi gioco alla lista di un utente:</p>
  32. <form method="POST" action="addGame_admin.php">
  33. <table>
  34. <tr><td>Utente:</td><td><input type="text" name="utente"></td></tr>
  35. <tr><td>Nome Gioco:</td><td><input type="text" name="gioco"></td></tr>
  36. </table>
  37. <input type="submit" value="Vai" class="submit">
  38. </form>
  39. <?php if($_SESSION['cannot_add'] == 1) echo "<p class=error>Impossibile aggiungere (potrebbe essere gia nella sua lista, oppure controlla mail e nomi giochi)</p>";
  40. $_SESSION['cannot_add'] = 0;
  41. ?>
  42.  
  43. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement