示例#1
0
<?php

include 'header.php';
require_once 'dbConnection.php';
$connection = new dbConnection();
$result = $connection->Select("SELECT A.WishID, A.WisherID, A.PerformerID, A.WisherComplain, A.PerformerComplain, C.FirstName WisherFName, C.LastName WisherLName, C.Rank WisherRank, D.FirstName PerformerFName, D.LastName PerformerLName, D.Rank PerformerRank\nFROM `courts` AS A\nJOIN `Wishes` AS B \n\tON A.WishID=B.WishID \nJOIN Users AS C \n\tON A.WisherID=C.UserID\nJOIN Users AS D \n\tON A.PerformerID=D.UserID\n");
echo <<<HTML
<div class="center-block">
<div id="centerCourtz">
\t<div class="overflowOuter">
\t<div class="centerCourtzRaws">
HTML;
$count = 1;
while ($row = $result->fetch_assoc()) {
    if (!file_exists("images/profiles/{$row['WisherID']}.jpg")) {
        $wisherProfileImage = 'not-found.png';
    } else {
        $wisherProfileImage = $row['WisherID'] . '.jpg' . '?' . time();
    }
    if (!file_exists("images/profiles/{$row['PerformerID']}.jpg")) {
        $performerProfileImage = 'not-found.png';
    } else {
        $performerProfileImage = $row['PerformerID'] . '.jpg' . '?' . time();
    }
    echo <<<HTML
    \t<div class="courtz-row">
    \t\t<div class="buttons">
\t\t\t\t<div class="button" onclick="buttonsBackground(id,{$row['WishID']})" id="plus{$count}"><img src="buttons/ButtonPLUS1.png"/></div>
\t\t\t\t<div class="button" onclick="buttonsBackground(id,{$row['WishID']})" id="favo{$count}"><img src="buttons/ButtonFAVO1.png"/></div>
\t\t\t\t<div class="button" onclick="buttonsBackground(id,{$row['WishID']})" id="minus{$count}"><img src="buttons/ButtonMINUS1.png"/></div>
\t\t\t</div>