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.

98 lines
2.4 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 '<div class="w3-half w3-container">';
  9. while($row = mysqli_fetch_array($r_people))
  10. {
  11. if($i <= $row_count/2)
  12. {
  13. $q_quotes = "select * from quote where person_id='" . $row['person_id'] . "' and visibility=true";
  14. $r = mysqli_query($dbc, $q_quotes);
  15. if($r->num_rows != 0)
  16. {
  17. echo '<div class="w3-pannel w3-leftbar w3-light-grey">';
  18. echo '<p class="w3-xlarge w3-serif">';
  19. while($row_quote = mysqli_fetch_array($r))
  20. {
  21. echo '<i>"' . $row_quote['quote'] . '"</i><br>';
  22. }
  23. echo '</p>';
  24. $q_name = "select name from people where person_id='" . $row['person_id'] . "' limit 1";
  25. //echo $q_name;
  26. $r_name = mysqli_query($dbc, $q_name);
  27. while($row_name = mysqli_fetch_array($r_name))
  28. {
  29. echo '<p>' . $row_name['name'] . '</p>';
  30. }
  31. echo '</div>';
  32. }
  33. }
  34. $i++;
  35. }
  36. echo '</div>';
  37. echo '<div class="w3-half w3-container">';
  38. $i = 1;
  39. $r_people = mysqli_query($dbc, $q_people);
  40. while($row = mysqli_fetch_array($r_people))
  41. {
  42. if($i <= $row_count && $i > $row_count/2)
  43. {
  44. //printPerson($row['person_id']);
  45. //echo $row['name'];
  46. $q_quotes = "select * from quote where person_id='" . $row['person_id'] . "' and visibility=true";
  47. //echo $q_quotes;
  48. $r = mysqli_query($dbc, $q_quotes);
  49. if($r->num_rows != 0)
  50. {
  51. echo '<div class="w3-pannel w3-leftbar w3-light-grey">';
  52. echo '<p class="w3-xlarge w3-serif">';
  53. while($row_quote = mysqli_fetch_array($r))
  54. {
  55. echo '<i>"' . $row_quote['quote'] . '"</i><br>';
  56. }
  57. echo '</p>';
  58. $q_name = "select name from people where person_id='" . $row['person_id'] . "' limit 1";
  59. //echo $q_name;
  60. $r_name = mysqli_query($dbc, $q_name);
  61. while($row_name = mysqli_fetch_array($r_name))
  62. {
  63. echo '<p>' . $row_name['name'] . '</p>';
  64. }
  65. echo '</div>';
  66. }
  67. }
  68. $i ++;
  69. }
  70. echo '</div></div>';