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

<?php
if($loggedIn)
{
echo '<div class="w3-row w3-padding-32">';
echo '<h1 class="w3-text-teal w3-center">Private Quotes</h1>';
$q_people = "select * from people order by name asc";
$r_people = mysqli_query($dbc, $q_people);
$i = 1;
$row_count = $r_people->num_rows;
echo '<div class="w3-half w3-container">';
while($row = mysqli_fetch_array($r_people))
{
if($i <= $row_count/2)
{
$q_quotes = "select * from quote where person_id='" . $row['person_id'] . "' and visibility=false";
$r = mysqli_query($dbc, $q_quotes);
if($r->num_rows != 0)
{
echo '<div class="w3-pannel w3-leftbar w3-light-grey">';
echo '<p class="w3-xlarge w3-serif">';
while($row_quote = mysqli_fetch_array($r))
echo '<i>"' . $row_quote['quote'] . '"</i><br>';
echo '</p>';
$q_name = "select name from people where person_id='" .
$row['person_id'] . "' limit 1";
$r_name = mysqli_query($dbc, $q_name);
while($row_name = mysqli_fetch_array($r_name))
{
echo '<p>' . $row_name['name'] . '</p>';
}
echo '</div>';
}
}
$i++;
}
echo '</div>';
echo '<div class="w3-half w3-container">';
$i = 1;
$r_people = mysqli_query($dbc, $q_people);
while($row = mysqli_fetch_array($r_people))
{
if($i <= $row_count && $i > $row_count/2)
{
$q_quotes = "select * from quote where person_id='" .
$row['person_id'] . "' and visibility=false";
$r = mysqli_query($dbc, $q_quotes);
if($r->num_rows != 0)
{
echo '<div class="w3-pannel w3-leftbar w3-light-grey">';
echo '<p class="w3-xlarge w3-serif">';
while($row_quote = mysqli_fetch_array($r))
echo '<i>"' . $row_quote['quote'] . '"</i><br>';
echo '</p>';
$q_name = "select name from people where person_id='" .
$row['person_id'] . "' limit 1";
$r_name = mysqli_query($dbc, $q_name);
while($row_name = mysqli_fetch_array($r_name))
echo '<p>' . $row_name['name'] . '</p>';
echo '</div>';
}
}
$i ++;
}
echo '</div></div>';
}