Пример #1
0
<?php

include_once "config.php";
header('Content-Type: application/json');
// This script should return details of the markers (and terms) that match the query (provided in $_GET['q']).
// It should only return those markers which belong to the categories specified in $_GET['ec'].
$q = $_GET['q'];
//getQueryTerm();
$cats = getEnabledCategories();
list($pos, $label, $type, $url, $icon) = getAllMatches($q, $cats);
//Begin response
echo '[';
//First array, IDs of matched markers
echo '[';
foreach (array_keys($pos) as $x) {
    //Each entry in the first array is a string (the ID of a matched marker)
    echo '"' . $x . '",';
}
//End of first array, empty element for convenience (required)
echo '[]],';
//Second array, matched entries for search drop-down box
echo '[';
foreach (array_keys($label) as $x) {
    //Each entry in the second array is an array containing the following data:
    // * String of matched entry
    // * Type of matched entry
    //If the entry has a related marker, the array can also contain:
    // * ID of marker (may be null)
    // * URL to marker icon (optional)
    echo '["' . $x . '","' . $type[$x] . '"';
    if ($type[$x] == 'building' || $type[$x] == 'site' || $type[$x] == 'bus-stop' || $type[$x] == 'point-of-service' || $type[$x] == 'workstation' || $type[$x] == 'postcode') {
Пример #2
0
<?php

/**
 * Created by PhpStorm.
 * User: Steve
 * Date: 9/27/14
 * Time: 12:41 PM
 */
include_once "utility.php";
include_once "db.php";
$db = new DbHandler();
CommonVariables::set($db);
include_once "header.php";
if (!CommonVariables::$scorecardEnabled) {
    echo "<div class=\"container m-container\"><h5 class=\"text-center\">\n            Your administrator has disabled the scorecard for this week until all forms are submitted.</h5></div>";
    include_once "footer.php";
    die;
}
$scorecard = true;
$week = CommonVariables::$currentTimePeriod;
$allMatches = getAllMatches($week, $db);
$currentMatchesArray = $allMatches[$week];
$scores = determineTotalScores($allMatches, $week - 1);
include_once "results-html.php";
include_once "footer.php";
Пример #3
0
<?php

include_once "utility.php";
include_once "db.php";
$db = new DbHandler();
CommonVariables::set($db);
include_once "header.php";
$maxWeek = 12;
$allMatchesArray = getAllMatches($maxWeek, $db);
include_once "schedule-html.php";
include_once "footer.php";