Exemple #1
0
<?php 
/**
 * Created by PhpStorm.
 * User: Hallvard
 * Date: 26.10.2015
 * Time: 15.58
 */
//BLIR BRUKT I GUILD MEMBERS
include 'inc/dbutil.php';
$obj = new DbUtil();
$obj->priority();
$tmpVal = $obj->getTable();
echo "<table class='table'>";
foreach ($tmpVal as $row) {
    if ($row['guildmembership'] == 1) {
        if (!isset($_SESSION['user']) || $_SESSION['guildmembership'] == 0) {
            echo "<tr><th>Character name</th><th>Class</th><th>Race</th></tr>";
            echo "<tr>";
            echo "<td>" . $row['username'] . "</td>\n                        <td> " . getClass($row['class']) . "</td>\n                        <td> " . getRace($row['race']) . "</td>";
            echo "</tr>";
        } else {
            echo "<tr><th>Character name</th><th>Class</th><th>Race</th><th>Priority</th></tr>";
            echo "<tr>";
            echo "<td>" . $row['username'] . "</td>\n                        <td> " . getClass($row['class']) . "</td>\n                        <td> " . getRace($row['race']) . "</td>\n                        <td>" . round($row['priority'], 2) . "</td>";
            echo "</tr>";
        }
    }
}
echo "</table>";
function getClass($num)