Advertisement
Guest User

Untitled

a guest
May 25th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.80 KB | None | 0 0
  1. <html>
  2.     <head>
  3.     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
  4.     </head>
  5.     <body>
  6.         <button><a href="elimina.php">ELIMINA VISITE</a></button><br>
  7.         <button><a href="logout.php">LOGOUT</a></button><br>
  8.     </body>
  9. </html>
  10. <?php
  11.  session_start();
  12.     echo "Pagina dell'admin<br>";
  13.     echo "Qui puoi inserire le visite<br>";
  14.     $hostname="localhost";
  15.     $username="root";
  16.     $password="";
  17.     $db="sitomedico";
  18.     $connessione=mysqli_connect($hostname, $username, $password, $db) or die("Errore di connessione<br>");
  19.    
  20.     $strSQL="SELECT * FROM visite";
  21.     $query=mysqli_query($connessione, $strSQL);
  22.     if(!$query){
  23.         echo "Errore nella query";
  24.         exit();
  25.     }
  26.     echo"Queste sono le visite già presenti";
  27.     $riga= mysqli_fetch_array($query);
  28.     echo('<table border=1>');
  29.     echo('<tr>
  30.           <th>N. Visita</th>
  31.           <th>Data</th>
  32.           <th>Ora</th>
  33.            <th>Note</th>
  34.            <th>Effettuata</th>
  35.            <th>Id Paziente</th>
  36.            <th>Id Medico</th>
  37.            <th>Id Prestazione</th>
  38.         </tr>');
  39.    
  40.     while($riga){
  41.         echo("<tr>");
  42.         echo("<td>".$riga["num_vis"]."</td>");
  43.         echo("<td>".$riga["data"]."</td>");
  44.         echo("<td>".$riga["ora"]."</td>");
  45.         echo("<td>".$riga["note"]."</td>");
  46.         echo("<td>".$riga["effettuata"]."</td>");
  47.         echo("<td>".$riga["id_paz"]."</td>");
  48.         echo("<td>".$riga["id_med"]."</td>");
  49.         echo("<td>".$riga["id_pre"]."</td>");
  50.         echo("</tr>");
  51.         $riga=mysqli_fetch_array($query);
  52.     }
  53.    
  54.     $pazienti="Select id_paz from pazienti";
  55.     while($row=mysqli_fetch_assoc($query))
  56.     echo("ciao <select name='paziente' action='post'>
  57.             <option value=".$pazienti['id_paz']."></option>
  58.         </select>");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement