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.

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