public function __construct()
 {
     $time = time() - getLastLogin($_SESSION["user_id"]);
     $this->buildings = getBuildings($_SESSION["user_id"]);
     $this->buildingsworkers = getBuildingsWorkers($_SESSION["user_id"]);
     $this->userid = $_SESSION["user_id"];
     $this->population = getPopulation($_SESSION["user_id"]);
     $this->food = getFood($_SESSION["user_id"]) * ($this->getFoodProduction() * $time);
     $this->water = getWater($_SESSION["user_id"]) * ($this->getWaterProduction() * $time);
 }
Example #2
0
function createBuildingEntries(&$pos, &$label, &$type, &$url, &$icon, $q, $cats)
{
    $qbd = trim(str_replace(array('building', 'buildin', 'buildi', 'build', 'buil', 'bui', 'bu', 'b'), '', strtolower($q)));
    $data = getBuildings($q, $qbd);
    foreach ($data as $point) {
        $pos[$point['url']] += 100;
        if (preg_match('/' . $q . '/i', $point['name'])) {
            $label[$point['name']] += 100;
            $type[$point['name']] = "building";
            $url[$point['name']] = $point['url'];
            $icon[$point['name']] = 'http://opendatamap.ecs.soton.ac.uk/resources/numbericon.php?n=' . $point['number'];
        }
        if (preg_match('/' . $qbd . '/i', $point['number'])) {
            $label['Building ' . $point['number']] += 100;
            $type['Building ' . $point['number']] = "building";
            $url['Building ' . $point['number']] = $point['url'];
            $icon['Building ' . $point['number']] = 'http://opendatamap.ecs.soton.ac.uk/resources/numbericon.php?n=' . $point['number'];
        }
    }
}
Example #3
0
        <i class="glyph-icon icon-arrow-left"></i>
    </a>
    <a href="javascript:;" class="tooltip-button hidden" data-placement="bottom" title="Open sidebar" id="rm-close-sidebar">
        <i class="glyph-icon icon-search"></i>
    </a>
    <a href="javascript:;" class="tooltip-button hidden" title="Navigation Menu" id="responsive-open-menu">
        <i class="glyph-icon icon-search"></i>
    </a>
</div>
<div class="form-input col-md-12 search-bg-white mrg10T">
    <div class="mrg5B">Search by Name</div>
    <input type="text" placeholder="Device Name" name="txtSearchName" id="txtSearchName" value=""/>
    <br />
    <br />
    <div class="mrg5B">Search by Building</div>
    <div class="input-append-wrapper">
        <select data-placeholder="Search by building" name="selSearchBuilding" id ="selSearchBuilding" multiple class="chosen-select">
            <?php 
getBuildings("list", null);
?>
        </select>
    </div>
    <br />
    <div class="mrg5B">Search by Room</div>
    <div class="input-append-wrapper" id="searchRoomWrapper">
        <select data-placeholder="Search by Room" name="selSearchRoom" id="selSearchRoom" multiple class="chosen-select">

        </select>
    </div>
</div>
</div><!-- #page-sidebar -->
Example #4
0
function createXmlFromPersons($persons)
{
    $count = 0;
    foreach ($persons as $person) {
        $persObj = new Person();
        if (property_exists($person, "preferredName")) {
            $persObj->name = $person->preferredName;
        } else {
            continue;
        }
        $path = "collectedData/" . $persObj->name . ".xml";
        if (file_exists($path)) {
            continue;
        }
        if (property_exists($person, "variantName")) {
            $persObj->variantName = $person->variantName;
        }
        if (property_exists($person, "thumbnail")) {
            $persObj->thumbnail = $person->thumbnail;
        } else {
            continue;
        }
        if (property_exists($person, "dateOfBirth_en")) {
            $persObj->birthEN = $person->dateOfBirth_en;
        }
        if (property_exists($person, "dateOfBirth_de")) {
            $persObj->birthDE = $person->dateOfBirth_de;
        }
        if (property_exists($person, "dateOfDeath_en")) {
            $persObj->deathEN = $person->dateOfDeath_en;
        }
        if (property_exists($person, "dateOfDeath_de")) {
            $persObj->deathDE = $person->dateOfDeath_de;
        }
        if (property_exists($person, "placeOfBirth")) {
            $persObj->birthPlace = $person->placeOfBirth;
        }
        if (property_exists($person, "placeOfDeath")) {
            $persObj->deathPlace = $person->placeOfDeath;
        }
        if (property_exists($person, "professionOrOccupation")) {
            $persObj->professionOrOccupation = $person->professionOrOccupation;
        }
        $metadata = getPersonMetaData($persObj->name);
        if ($metadata == null) {
            continue;
        }
        $persObj->dbpResource = $metadata->person->value;
        $persObj->abstract = $metadata->abstract->value;
        $persObj->wikilink = $metadata->wikilink->value;
        $persObj->artworks = getArtworks($persObj->wikilink);
        $persObj->buildings = getBuildings($persObj->dbpResource);
        $persObj->books = getBooks($persObj->dbpResource);
        $xml = obj_to_xml($persObj);
        if ($xml != null) {
            $file = fopen($path, "w");
            fwrite($file, $xml);
            fclose($file);
        } else {
            continue;
        }
        $GLOBALS['personCount']++;
        $GLOBALS['artworkCount'] += count($persObj->artworks);
        $GLOBALS['buildingCount'] += count($persObj->buildings);
        $GLOBALS['bookCount'] += count($persObj->books);
    }
}
Example #5
0
                    <div class="example-box">
                        <div class="example-code">

                            <table class="table table-striped text-center">
                                <thead>
                                    <tr>
                                        <th class="text-center">Rooms</th>
                                        <th class="text-center">Actions</th>
                                        <th>Name</th>
                                        <th class="text-center">Description</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <!-- Display a list of buildings in the database -->
                                    <?php 
getBuildings("table", null);
?>
                                </tbody>
                            </table>

                        </div>
                    </div>
                	</div><!-- #page-content -->
	            </div><!-- #page-main -->
            </div><!-- #page-main-wrapper -->
        </div><!-- #page-wrapper -->

    </body>
</html>
Example #6
0
?>
</textarea>
                                            </div>
                                        </div>
                                        <div class="form-row">
                                            <!-- Building Select box -->
                                            <div class="col-md-6">
                                                <div class="form-label">
                                                    <label for class="label-description">
                                                        Building:
                                                    </label>
                                                </div>
                                                <div class="form-input">
                                                    <select id="buildingList" name="buildingList">
                                                        <?php 
getBuildings("list", $curRoom->buildingId);
?>
                                                    </select>
                                                </div>
                                            </div>

                                            <!-- Room Select box -->
                                            <div class="col-md-6">
                                                <div class="form-label">
                                                    <label for class="label-description">
                                                        Room:
                                                    </label>
                                                </div>
                                                <div class="form-input">
                                                    <select id="roomList" name="roomList">
                                                        <?php 
Example #7
0
<?php

getStats();
getUnits();
getBuildings();
?>

<div id="pageContent">
	
	
<div id="content">
	<h3>Civ Status</h3>
	
<table class="tg">
  <tr>
    <th colspan="5" class="tophead"><strong>Status</strong></th>    
  </tr>
  <tr>
  	<th>Money</th>
  	<th>Population</th>
  	<th>Science</th>
  	<th>Faith</th>
  	<th>Land</th>
  </tr>
  <tr>
  	<?php 
echo "<td>" . $_SESSION['money'] . "</td>";
echo "<td>" . $_SESSION['population'] . "</td>";
echo "<td>" . $_SESSION['science'] . "</td>";
echo "<td>" . $_SESSION['faith'] . "</td>";
echo "<td>" . $_SESSION['land'] . "</td>";
 public function buildings()
 {
     if ($this->method == 'GET') {
         $this->response['data'] = getBuildings();
     } else {
         $this->response['message'] = "endpoint does not recognize " . $this->method . " requests";
         $this->response['code'] = 405;
     }
     return $this->response;
 }