trojanxem

Untitled

Jun 2nd, 2013
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.74 KB | None | 0 0
  1. <html>
  2. <body>
  3. <?php
  4. $dbh = pg_connect("dbname=dziennik user=krzklin password=franekjordan93 host=localhost");
  5. $query = "Select * from nauczyciel";
  6. $wynik = pg_query($dbh,$query);
  7. $liczba_kolumn = pg_num_fields($wynik);
  8. $liczba_wierszy = pg_num_rows($wynik);
  9. echo "<TABLE border width=1>";
  10. echo "<TABLE border width=1>";
  11. echo "<TR>";
  12. echo "<TABLE border width=1>";
  13. echo "<TR>";
  14.  for($k =0;$k<$liczba_kolumn;$k++)
  15.  {
  16.  echo "<TD>";
  17.  echo pg_field_name($wynik,$k);
  18.  echo "</TD>";
  19.  }
  20.  echo "<td>Usun</td><td>Edytuj</td><td>Awansuj</td></TR>";
  21. for($w =0;$w<$liczba_wierszy;$w++)
  22. {
  23.  echo "<TR>";
  24.  for($k =0;$k<$liczba_kolumn;$k++)
  25.  {
  26.  echo "<TD>";
  27.  echo pg_fetch_result($wynik,$w,$k);
  28.  echo "</TD>";
  29.  }
  30.   }
  31.  
  32. $idos = pg_fetch_result($wynik,$w,$liczba_kolumn-1);
  33.  
  34.  
  35. echo "<form action=delos.php method=POST>
  36. <input type=hidden name=idos value=$idos>
  37. <td> <input type=submit name=usun value=Usun></td></form>";
  38.  
  39.  
  40. echo "<form action=edos.php method=POST>
  41. <input type=hidden name=idos value=$idos>
  42. echo "<form action=edos.php method=POST>
  43.  <input type=hidden name=idos value=$idos>
  44. <td> <input type=submit name=edytuj value=Edytuj></td></form>";
  45.  
  46.  
  47. echo "<form action=awans.php method=POST>
  48.  <input type=hidden name=idos value=$idos>
  49. <td> <input type=checkbox name=Awansuj value=Awansuj> <input type=submit name=O$
  50.  <tr>
  51.  <td> <input type=checkbox name=Awansuj value=Awansuj> <input type=submit name=O$
  52.  <tr>
  53.  
  54. //table
  55. <form action=dodos.php method=POST>
  56. Dodaj nowego nauczciela do bazy: <br/>
  57. Imie: <input type=text name=imie>
  58. Nazwisko: <input type=text name=nazw>
  59. Przedmiot: <input type=text name=dzia>
  60. ID: <input type=text name=id>
  61. <input type=submit name=Dodaj value=Dodaj>
  62. </form>;
  63. pg_close($dbh);
  64.  
  65. ?>
  66. </body>
  67. </html>
Advertisement
Add Comment
Please, Sign In to add comment