Ejemplo n.º 1
0
    <h1 id="RegisterTitle">Entdecken</h1>

    <form method="post" action="NewEventInput.php">


        <label for="eventname" class="SettingsLabel"> Event Name </label> <br />
             <input type="text" name="eventname" class="ContentInput" id="eventname"> <br />

        <label for="NewEventTextarea" class="SettingsLabel">Beschreibung</label> <br />
            <textarea name="eventdescription" id="NewEventTextarea" class="NevEventTextarea"></textarea> <br />

        <label for="NewEventLocationSelection" class="SettingsLabel"> Ort: </label> <br />
            <select name="location" id="NewEventLocationSelection" class="NewEventDropdown">
                <?php 
$model = new LocationModel();
$temp = $model->getLocations();
while ($locations = sqlsrv_fetch_array($temp)) {
    $loc = $locations['name'];
    $locID = $locations['id'];
    echo "<option value='{$locID}' >{$loc}</option>";
}
?>
            </select>

        <a href="Event.php?action=NewPlace" id="NewLocLink">Neuer Ort</a> <br />

        <input type="submit" id="Submit" class="RegisterButton" value="Erstellen">
        <input type="reset" id="Reset" class="RegisterButton" value="Abbrechen">
    </form>

Ejemplo n.º 2
0
 /**
  * Get all tags around some location within some $radius.
  *
  * @param $lat
  * @param $lon
  * @param $radius
  * @return array
  */
 public function getTagsAroundLocation($lat, $lon, $radius)
 {
     $locationModel = new LocationModel($this->db);
     $locations = $locationModel->getLocations($lat, $lon, $radius);
     $locationsIds = array();
     foreach ($locations as $location) {
         $locationsIds[] = $location->getId();
     }
     $tagIds = array();
     $query = $this->db->prepare("SELECT tag_id FROM images WHERE location_id IN(" . implode(',', $locationsIds) . ")");
     $query->setFetchMode(PDO::FETCH_ASSOC);
     $query->execute();
     while ($row = $query->fetch()) {
         $tagId = $row['tag_id'];
         if (!in_array($tagId, $tagIds)) {
             $tagIds[] = $tagId;
         }
     }
     $tags = array();
     $tagModel = new TagModel($this->db);
     foreach ($tagIds as $id) {
         $tag = $tagModel->getTagById($id);
         if ($tag != null) {
             $tags[] = $tag;
         }
     }
     return $tags;
 }