Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include ('function.php');
- session_start();
- $conn = pg_connect('host=localhost user=postgres password=nerone4life dbname=wannaPlay');
- $lista = listaGiochi($conn);
- ?>
- <div class = "content">
- <?php
- echo "<table bgcolor = #41545F bordercolor = pink cellpadding = 2 border = 1>";
- echo "<tr><td>Nome</td><td>Numero Giocatori (max)</td><td>Eta consigliata</td><td>Tipologia</td><td>Modifica</td><td>Elimina</td>";
- while($row = pg_fetch_row($lista)){
- echo "<tr>";
- $i = 0;
- foreach($row as $dato) {
- if($i == 3){
- if($dato == "videogioco") $dato = "Videogioco";
- else if($dato == "gioco_di_carte") $dato = "Gioco di carte";
- else $dato = "Gioco da tavola";
- }
- $i++;
- echo "<td><center>$dato</center></td>";
- }
- ?>
- <td><center><a href= "./?id=31&nome=<?php echo urlencode($row[0]); ?>"><img src = "edit.png"></a></center></td>
- <td><center><a href= "cancellaGiocoDaSocialNetwork.php?nome=<?php echo urlencode($row[0]); ?>"><img src = "deleteG.png"></a></center></td>
- <?php
- echo "</tr>";
- }
- echo "</table>";
- ?>
- <p>Aggiungi gioco alla lista di un utente:</p>
- <form method="POST" action="addGame_admin.php">
- <table>
- <tr><td>Utente:</td><td><input type="text" name="utente"></td></tr>
- <tr><td>Nome Gioco:</td><td><input type="text" name="gioco"></td></tr>
- </table>
- <input type="submit" value="Vai" class="submit">
- </form>
- <?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>";
- $_SESSION['cannot_add'] = 0;
- ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement