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.

91 lines
2.5 KiB

  1. <?php
  2. if($loggedIn)
  3. {
  4. echo '<div class="w3-row w3-padding-32">';
  5. echo '<h1 class="w3-text-teal w3-center">Private Quotes</h1>';
  6. $q_people = "select * from people order by name asc";
  7. $r_people = mysqli_query($dbc, $q_people);
  8. $i = 1;
  9. $row_count = $r_people->num_rows;
  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. $q_quotes = "select * from quote where person_id='" . $row['person_id'] . "' and visibility=false";
  16. $r = mysqli_query($dbc, $q_quotes);
  17. if($r->num_rows != 0)
  18. {
  19. echo '<div class="w3-pannel w3-leftbar w3-light-grey">';
  20. echo '<p class="w3-xlarge w3-serif">';
  21. while($row_quote = mysqli_fetch_array($r))
  22. echo '<i>"' . $row_quote['quote'] . '"</i><br>';
  23. echo '</p>';
  24. $q_name = "select name from people where person_id='" .
  25. $row['person_id'] . "' limit 1";
  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. $q_quotes = "select * from quote where person_id='" .
  45. $row['person_id'] . "' and visibility=false";
  46. $r = mysqli_query($dbc, $q_quotes);
  47. if($r->num_rows != 0)
  48. {
  49. echo '<div class="w3-pannel w3-leftbar w3-light-grey">';
  50. echo '<p class="w3-xlarge w3-serif">';
  51. while($row_quote = mysqli_fetch_array($r))
  52. echo '<i>"' . $row_quote['quote'] . '"</i><br>';
  53. echo '</p>';
  54. $q_name = "select name from people where person_id='" .
  55. $row['person_id'] . "' limit 1";
  56. $r_name = mysqli_query($dbc, $q_name);
  57. while($row_name = mysqli_fetch_array($r_name))
  58. echo '<p>' . $row_name['name'] . '</p>';
  59. echo '</div>';
  60. }
  61. }
  62. $i ++;
  63. }
  64. echo '</div></div>';
  65. }