Advertisement
Guest User

Untitled

a guest
Dec 20th, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. <?php
  2.  
  3. include_once 'config.php';
  4.  
  5. $query = mysql_query("SELECT * FROM `nauczyciele`");
  6. $licznik = 0;
  7.  
  8. echo '
  9. <aside>
  10. <table class="table">
  11. <tr>
  12. <th>Lp.</th>
  13. <th>Imie i nazwisko <br> nauczyciela nieobecnego</th>
  14. <th>Godzina lekcyjna</th>
  15. <th>Klasa</th>
  16. <th>Imie i nazwisko <br> nauczyciela zastępującego</th>
  17. </tr>
  18.  
  19. ';
  20.  
  21. while ($row = mysql_fetch_array($query)) {
  22.  
  23. $query = mysql_query("SELECT * FROM `zastepstwa` WHERE `id_nauczyciela` = ".$row['id']."");
  24.  
  25. while($zast = mysql_fetch_array($query)) {
  26.  
  27. // echo $row['imie'].' '.$row['nazwisko'].': '. $zast['klasa'].', zastępuje go: '.$zast['nauczyciel_zast'].''.'<br>';
  28.  
  29. $il = count($zast);
  30.  
  31. if($licznik == 0){
  32.  
  33. echo '
  34.  
  35. <tr>
  36. <td rowspan="'.$il.'">1</td>
  37. <td rowspan="'.$il.'">'.$row['imie'].' '.$row['nazwisko'].'</td>
  38. <td>'.$zast['lekcja'].'</td>
  39. <td>'.$zast['klasa'].'</td>
  40. <td>'.$zast['nauczyciel_zast'].'</td>
  41. </tr>
  42.  
  43. ';
  44.  
  45. $licznik++;
  46.  
  47. }else {
  48.  
  49. echo '
  50.  
  51. <tr>
  52. <td>'.$zast['lekcja'].'</td>
  53. <td>'.$zast['klasa'].'</td>
  54. <td>'.$zast['nauczyciel_zast'].'</td>
  55. </tr>
  56.  
  57. ';
  58.  
  59. }
  60.  
  61. }
  62.  
  63. }
  64.  
  65.  
  66. echo '
  67. </table>
  68. </aside>
  69.  
  70. ';
  71.  
  72. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement