예제 #1
0
<?php

/*
 * Author: Sarah Hall
 * Date Created: 12/08/2015
 * Summary: Created for On The Bit Sim game members, in php and mysql for leaderboards
 */
include_once 'functions.php';
$name = trim(filter_input(INPUT_GET, "name", FILTER_SANITIZE_STRING));
$results = showPerHorse($name, $dbh);
function showName($arr)
{
    return $arr['showName'];
}
$shows = array_map('showName', $results);
$points = points($results);
echo '<h1>' . $name . '</h1>';
echo "<div id='stats'>\n<b>Total Points: </b> {$points}<br/>\n</div>\n<div id='results'>";
foreach ($shows as $show) {
    echo "<h3>{$show}</h3>\n\t\t<table>\n\t\t<thead>\n\t\t<tr>\n\t\t<th>Class Name</th>\n\t\t<th>Place</th>\n\t\t</tr>\n\t\t</thead>\n\t\t<tbody>";
    foreach ($results as $result) {
        if ($result['showName'] == $show) {
            echo "\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>{$result['className']}</td>\n\t\t\t\t\t\t\t<td>{$result['place']}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t";
        }
    }
    echo "</tbody></table>";
}
echo "\n\n</div>";
예제 #2
0
파일: index.php 프로젝트: Sarh/leaderboards
echo '
		<table class="footable" data-page-size="25" data-filter="#filter">
			<thead>
				<tr colspan="2">
				<input id="filter" type="text" placeholder="Search" style="margin-right:10px;"/>
				</tr>
				<tr>
					<th>Horse Name</th>
					<th data-type="numeric" data-sort-initial="descending">Points</th>
				</tr>
			</thead>
			<tbody>';
foreach ($horses as $horse) {
    echo '<tr>
					<td><a href="display.php?name=' . $horse[horseName] . ' " >' . $horse[horseName] . '</a></td>
					<td>' . points(showPerHorse($horse['horseName'], $dbh)) . '</td>
				</tr>';
}
echo '
		</tbody>
		<tfoot class="hide-if-no-paging">
			<tr>
				<td colspan="5">
					<div class="pagination pagination-centered"></div>
				</td>
			</tr>
		</tfoot>
		</table>';
?>
<!-- Scripts --->
		<script type="text/javascript">