A simple php website which displays quotes on pictures of pandas.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

120 lines
3.1 KiB

  1. <?php
  2. echo '<div class="w3-row w3-padding-32">';
  3. echo '<h1 class="w3-text-teal w3-center">Quotes</h1>';
  4. $q_people = "select * from people order by name asc";
  5. $r_people = mysqli_query($dbc, $q_people);
  6. $i = 1;
  7. $row_count = $r_people->num_rows;
  8. //echo $row_count;
  9. //$people_array = mysqli_fetch_array($r_people);
  10. echo '<div class="w3-half w3-container">';
  11. while($row = mysqli_fetch_array($r_people))
  12. {
  13. if($i <= $row_count/2)
  14. {
  15. //printPerson($row['person_id']);
  16. //echo $row['name'];
  17. $q_quotes = "select * from quote where person_id='" . $row['person_id'] . "' and visibility=true";
  18. //echo $q_quotes;
  19. $r = mysqli_query($dbc, $q_quotes);
  20. if($r->num_rows == 0)
  21. {
  22. //echo 'nada';
  23. }
  24. else
  25. {
  26. echo '<div class="w3-pannel w3-leftbar w3-light-grey">';
  27. echo '<p class="w3-xlarge w3-serif">';
  28. while($row_quote = mysqli_fetch_array($r))
  29. {
  30. echo '<i>"' . $row_quote['quote'] . '"</i><br>';
  31. }
  32. echo '</p>';
  33. $q_name = "select name from people where person_id='" . $row['person_id'] . "' limit 1";
  34. //echo $q_name;
  35. $r_name = mysqli_query($dbc, $q_name);
  36. while($row_name = mysqli_fetch_array($r_name))
  37. {
  38. echo '<p>' . $row_name['name'] . '</p>';
  39. }
  40. echo '</div>';
  41. }
  42. }
  43. $i++;
  44. }
  45. echo '</div>';
  46. echo '<div class="w3-half w3-container">';
  47. $i = 1;
  48. $r_people = mysqli_query($dbc, $q_people);
  49. while($row = mysqli_fetch_array($r_people))
  50. {
  51. if($i <= $row_count && $i > $row_count/2)
  52. {
  53. //printPerson($row['person_id']);
  54. //echo $row['name'];
  55. $q_quotes = "select * from quote where person_id='" . $row['person_id'] . "' and visibility=true";
  56. //echo $q_quotes;
  57. $r = mysqli_query($dbc, $q_quotes);
  58. if($r->num_rows == 0)
  59. {
  60. //echo 'nada';
  61. }
  62. else
  63. {
  64. echo '<div class="w3-pannel w3-leftbar w3-light-grey">';
  65. echo '<p class="w3-xlarge w3-serif">';
  66. while($row_quote = mysqli_fetch_array($r))
  67. {
  68. echo '<i>"' . $row_quote['quote'] . '"</i><br>';
  69. }
  70. echo '</p>';
  71. $q_name = "select name from people where person_id='" . $row['person_id'] . "' limit 1";
  72. //echo $q_name;
  73. $r_name = mysqli_query($dbc, $q_name);
  74. while($row_name = mysqli_fetch_array($r_name))
  75. {
  76. echo '<p>' . $row_name['name'] . '</p>';
  77. }
  78. echo '</div>';
  79. }
  80. }
  81. $i ++;
  82. }
  83. echo '</div>';
  84. echo '</div>';
  85. ?>