| @@ -1,6 +1,6 @@ | ||
| <?php | ||
| require_once '../services/DatabaseConnection.class.php'; | ||
| require_once 'query.php'; | ||
|
|
||
| class TrailData { | ||
| /** | ||
| @@ -0,0 +1,87 @@ | ||
| <?php | ||
| require_once '../../services/DatabaseConnection.class.php'; | ||
|
|
||
| /** | ||
| */ | ||
|
|
||
| class TypeFilterData { | ||
| /** | ||
| * Retrieves the Database information needed. | ||
| * @param $returnConn : An int that designates whether to return the DB instance | ||
| * or the connection. 0 = instance, 1 = connection | ||
| * @return DatabaseConnection|null|PDO : Can return the DB instance, connection, | ||
| * or null if neither are found. | ||
| */ | ||
| private function getDBInfo($returnConn) { | ||
| try { | ||
| $instance = DatabaseConnection ::getInstance(); | ||
| $conn = $instance -> getConnection(); | ||
| if ($returnConn == 0) { | ||
| return $instance; | ||
| } else if ($returnConn == 1) { | ||
| return $conn; | ||
| } else { | ||
| return null; | ||
| } | ||
| } catch (Exception $e) { | ||
| echo $e -> getMessage(); | ||
| } | ||
| return null; | ||
| } | ||
|
|
||
| public function createTypeFilter($pinDesign, $type, $buttonColor) { | ||
| try { | ||
| //global $createTypeFilterQuery; | ||
| $stmt = $this -> getDBInfo(1) -> prepare("INSERT INTO TypeFilter (pinDesign, type, buttonColor) VALUES (:pinDesign, :type, :buttonColor)"); | ||
|
|
||
|
|
||
| $stmt -> bindParam(':pinDesign', $pinDesign, PDO::PARAM_STR); | ||
| $stmt -> bindParam(':type', $type, PDO::PARAM_STR); | ||
| $stmt -> bindParam(':buttonColor', $buttonColor, PDO::PARAM_STR); | ||
|
|
||
| $stmt -> execute(); | ||
| } catch (PDOException $e) { | ||
| echo $e -> getMessage(); | ||
| die(); | ||
| } | ||
| } | ||
|
|
||
| public function readTypeFilter() { | ||
| try { | ||
| //global $getAllTypeFilterEntriesQuery; | ||
| return $this -> getDBInfo(0) -> returnObject("", "SELECT * FROM TypeFilter"); | ||
| } catch (PDOException $e) { | ||
| echo $e -> getMessage(); | ||
| die(); | ||
| } | ||
| } | ||
|
|
||
| public function updateTypeFilter($idTypeFilter, $pinDesign, $type, $buttonColor) { | ||
| try { | ||
| //global $updateTypeFilterQuery; | ||
| $stmt = $this -> getDBInfo(1) -> prepare("UPDATE TypeFilter SET idTypeFilter = :idTypeFilter , pinDesign = :pinDesign , type = :type, buttonColor= :buttonColor WHERE idTypeFilter = :idTypeFilter"); | ||
|
|
||
| $stmt -> bindParam(':pinDesign', $pinDesign, PDO::PARAM_STR); | ||
| $stmt -> bindParam(':type', $type, PDO::PARAM_STR); | ||
| $stmt -> bindParam(':idTypeFilter', $idTypeFilter, PDO::PARAM_STR); | ||
| $stmt -> bindParam(':buttonColor', $buttonColor, PDO::PARAM_STR); | ||
|
|
||
| $stmt -> execute(); | ||
| } catch (PDOException $e) { | ||
| echo $e -> getMessage(); | ||
| die(); | ||
| } | ||
| } | ||
|
|
||
| public function deleteTypeFilter($idTypeFilter) { | ||
| try { | ||
| //global $deleteTypeFilterQuery; | ||
| $stmt = $this -> getDBInfo(1) -> prepare("DELETE FROM TypeFilter WHERE idTypeFilter = :idTypeFilter"); | ||
| $stmt -> bindParam(':idTypeFilter', $idTypeFilter, PDO::PARAM_STR); | ||
| $stmt -> execute(); | ||
| } catch (PDOException $e) { | ||
| echo $e -> getMessage(); | ||
| die(); | ||
| } | ||
| } | ||
| } |
| @@ -1,6 +1,6 @@ | ||
| <?php | ||
| require_once '../../services/DatabaseConnection.class.php'; | ||
| require_once 'query.php'; | ||
|
|
||
|
|
||
| /** | ||
| @@ -0,0 +1,100 @@ | ||
| <?php | ||
| require_once '../../services/DatabaseConnection.class.php'; | ||
|
|
||
| /** | ||
| */ | ||
|
|
||
| class WiderAreaMapData { | ||
| /** | ||
| * Retrieves the Database information needed. | ||
| * @param $returnConn : An int that designates whether to return the DB instance | ||
| * or the connection. 0 = instance, 1 = connection | ||
| * @return DatabaseConnection|null|PDO : Can return the DB instance, connection, | ||
| * or null if neither are found. | ||
| */ | ||
| private function getDBInfo($returnConn) { | ||
| try { | ||
| $instance = DatabaseConnection ::getInstance(); | ||
| $conn = $instance -> getConnection(); | ||
| if ($returnConn == 0) { | ||
| return $instance; | ||
| } else if ($returnConn == 1) { | ||
| return $conn; | ||
| } else { | ||
| return null; | ||
| } | ||
| } catch (Exception $e) { | ||
| echo $e -> getMessage(); | ||
| } | ||
| return null; | ||
| } | ||
|
|
||
| public function createWiderAreaMap($url, $name, $description, $longitude, $latitude, $address, $city, $state, $zipcode) { | ||
| try { | ||
| //global $createWiderAreaMapQuery; | ||
| $stmt = $this -> getDBInfo(1) -> prepare("INSERT INTO WiderAreaMap (url,description, name, address, city, state, zipcode, longitude, latitude) VALUES (:url, :description,:name, :address, :city, :state, :zipcode, :longitude, :latitude)"); | ||
|
|
||
|
|
||
| $stmt -> bindParam(':url', $url, PDO::PARAM_STR); | ||
| $stmt -> bindParam(':name', $name, PDO::PARAM_STR); | ||
| $stmt -> bindParam(':description', $description, PDO::PARAM_STR); | ||
| $stmt -> bindParam(':address', $address, PDO::PARAM_STR); | ||
| $stmt -> bindParam(':city', $city, PDO::PARAM_STR); | ||
| $stmt -> bindParam(':state', $state, PDO::PARAM_STR); | ||
| $stmt -> bindParam(':zipcode', $zipcode, PDO::PARAM_STR); | ||
| $stmt -> bindParam(':longitude', $longitude, PDO::PARAM_STR); | ||
| $stmt -> bindParam(':latitude', $latitude, PDO::PARAM_STR); | ||
|
|
||
| $stmt -> execute(); | ||
| } catch (PDOException $e) { | ||
| echo $e -> getMessage(); | ||
| die(); | ||
| } | ||
| } | ||
|
|
||
| public function readWiderAreaMap() { | ||
| try { | ||
| //global $getAllWiderAreaMapEntriesQuery; | ||
| return $this -> getDBInfo(0) -> returnObject("", "SELECT idWiderAreaMap, name, description, url, longitude, latitude, address, city, state, zipcode FROM WiderAreaMap"); | ||
| } catch (PDOException $e) { | ||
| echo $e -> getMessage(); | ||
| die(); | ||
| } | ||
| } | ||
|
|
||
| public function updateWiderAreaMap($idWiderAreaMap, $url, $name, $description, $longitude, $latitude, $address, $city, $state, $zipcode) { | ||
| try { | ||
| //global $updateWiderAreaMapQuery; | ||
| $stmt = $this -> getDBInfo(1) -> prepare("UPDATE WiderAreaMap SET idWiderAreaMap = :idWiderAreaMap , url = :url , description = :description , name = :name, longitude =:longitude, latitude =:latitude, city = :city, zipcode =:zipcode WHERE idWiderAreaMap = :idWiderAreaMap"); | ||
|
|
||
| $stmt -> bindParam(':url', $url, PDO::PARAM_STR); | ||
| $stmt -> bindParam(':name', $name, PDO::PARAM_STR); | ||
| $stmt -> bindParam(':description', $description, PDO::PARAM_STR); | ||
| $stmt -> bindParam(':idWiderAreaMap', $idWiderAreaMap, PDO::PARAM_STR); | ||
| $stmt -> bindParam(':address', $address, PDO::PARAM_STR); | ||
| $stmt -> bindParam(':city', $city, PDO::PARAM_STR); | ||
| $stmt -> bindParam(':state', $state, PDO::PARAM_STR); | ||
| $stmt -> bindParam(':zipcode', $zipcode, PDO::PARAM_STR); | ||
| $stmt -> bindParam(':longitude', $longitude, PDO::PARAM_STR); | ||
| $stmt -> bindParam(':latitude', $latitude, PDO::PARAM_STR); | ||
|
|
||
| $stmt -> execute(); | ||
| } catch (PDOException $e) { | ||
| echo $e -> getMessage(); | ||
| die(); | ||
| } | ||
| } | ||
|
|
||
| public function deleteWiderAreaMap($idWiderAreaMap) { | ||
| try { | ||
| //global $deleteWiderAreaMapQuery; | ||
| //TODO: will need to call the event first | ||
| $stmt = $this -> getDBInfo(1) -> prepare("DELETE FROM WiderAreaMap WHERE idWiderAreaMap = :idWiderAreaMap"); | ||
| $stmt -> bindParam(':idWiderAreaMap', $idWiderAreaMap, PDO::PARAM_STR); | ||
| $stmt -> execute(); | ||
| } catch (PDOException $e) { | ||
| echo $e -> getMessage(); | ||
| die(); | ||
| } | ||
| } | ||
| } |
| @@ -0,0 +1,116 @@ | ||
| <?php | ||
| /** | ||
| */ | ||
|
|
||
| class Contact { | ||
| private $idContact; | ||
| private $name; | ||
| private $email; | ||
| private $description; | ||
| private $phone; | ||
| private $title; | ||
|
|
||
| /** | ||
| * Contact constructor. | ||
| * @param $idContact | ||
| * @param $name | ||
| * @param $email | ||
| * @param $description | ||
| * @param $phone | ||
| * @param $title | ||
| */ | ||
| public function __construct($idContact, $name, $email, $description, $phone, $title) { | ||
| $this -> idContact = $idContact; | ||
| $this -> name = $name; | ||
| $this -> email = $email; | ||
| $this -> description = $description; | ||
| $this -> phone = $phone; | ||
| $this -> title = $title; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getIdContact() { | ||
| return $this -> idContact; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $idContact | ||
| */ | ||
| public function setIdContact($idContact) { | ||
| $this -> idContact = $idContact; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getName() { | ||
| return $this -> name; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $name | ||
| */ | ||
| public function setName($name) { | ||
| $this -> name = $name; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getEmail() { | ||
| return $this -> email; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $email | ||
| */ | ||
| public function setEmail($email) { | ||
| $this -> email = $email; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getDescription() { | ||
| return $this -> description; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $description | ||
| */ | ||
| public function setDescription($description) { | ||
| $this -> description = $description; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getPhone() { | ||
| return $this -> phone; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $phone | ||
| */ | ||
| public function setPhone($phone) { | ||
| $this -> phone = $phone; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getTitle() { | ||
| return $this -> title; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $title | ||
| */ | ||
| public function setTitle($title) { | ||
| $this -> title = $title; | ||
| } | ||
|
|
||
|
|
||
| } |
| @@ -0,0 +1,114 @@ | ||
| <?php | ||
| /** | ||
| */ | ||
|
|
||
| class Event { | ||
| private $idEvent; | ||
| private $name; | ||
| private $description; | ||
| private $startTime; | ||
| private $endTime; | ||
| private $idWiderAreaMap; | ||
|
|
||
| /** | ||
| * Event constructor. | ||
| * @param $idEvent | ||
| * @param $name | ||
| * @param $description | ||
| * @param $startTime | ||
| * @param $endTime | ||
| * @param $idWiderAreaMap | ||
| */ | ||
| public function __construct($idEvent, $name, $description, $startTime, $endTime, $idWiderAreaMap) { | ||
| $this -> idEvent = $idEvent; | ||
| $this -> name = $name; | ||
| $this -> description = $description; | ||
| $this -> startTime = $startTime; | ||
| $this -> endTime = $endTime; | ||
| $this -> idWiderAreaMap = $idWiderAreaMap; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getIdEvent() { | ||
| return $this -> idEvent; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $idEvent | ||
| */ | ||
| public function setIdEvent($idEvent) { | ||
| $this -> idEvent = $idEvent; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getName() { | ||
| return $this -> name; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $name | ||
| */ | ||
| public function setName($name) { | ||
| $this -> name = $name; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getDescription() { | ||
| return $this -> description; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $description | ||
| */ | ||
| public function setDescription($description) { | ||
| $this -> description = $description; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getStartTime() { | ||
| return $this -> startTime; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $startTime | ||
| */ | ||
| public function setStartTime($startTime) { | ||
| $this -> startTime = $startTime; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getEndTime() { | ||
| return $this -> endTime; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $endTime | ||
| */ | ||
| public function setEndTime($endTime) { | ||
| $this -> endTime = $endTime; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getIdWiderAreaMap() { | ||
| return $this -> idWiderAreaMap; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $idWiderAreaMap | ||
| */ | ||
| public function setIdWiderAreaMap($idWiderAreaMap) { | ||
| $this -> idWiderAreaMap = $idWiderAreaMap; | ||
| } | ||
| } |
| @@ -0,0 +1,66 @@ | ||
| <?php | ||
| /** | ||
| */ | ||
|
|
||
| class FAQ { | ||
| private $idFAQ; | ||
| private $question; | ||
| private $answer; | ||
|
|
||
| /** | ||
| * FAQ constructor. | ||
| * @param $idFAQ | ||
| * @param $question | ||
| * @param $answer | ||
| */ | ||
| public function __construct($idFAQ, $question, $answer) { | ||
| $this -> idFAQ = $idFAQ; | ||
| $this -> question = $question; | ||
| $this -> answer = $answer; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getIdFAQ() { | ||
| return $this -> idFAQ; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $idFAQ | ||
| */ | ||
| public function setIdFAQ($idFAQ) { | ||
| $this -> idFAQ = $idFAQ; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getQuestion() { | ||
| return $this -> question; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $question | ||
| */ | ||
| public function setQuestion($question) { | ||
| $this -> question = $question; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getAnswer() { | ||
| return $this -> answer; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $answer | ||
| */ | ||
| public function setAnswer($answer) { | ||
| $this -> answer = $answer; | ||
| } | ||
|
|
||
|
|
||
|
|
||
| } |
| @@ -0,0 +1,115 @@ | ||
| <?php | ||
| /** | ||
| */ | ||
|
|
||
| class HistoricFilter { | ||
| private $idHistoricFilter; | ||
| private $historicFilterName; | ||
| private $dateStart; | ||
| private $dateEnd; | ||
| private $description; | ||
| private $buttonColor; | ||
|
|
||
| /** | ||
| * HistoricFilter constructor. | ||
| * @param $idHistoricFilter | ||
| * @param $historicFilterName | ||
| * @param $dateStart | ||
| * @param $dateEnd | ||
| * @param $description | ||
| * @param $buttonColor | ||
| */ | ||
| public function __construct($idHistoricFilter, $historicFilterName, $dateStart, $dateEnd, $description, $buttonColor) { | ||
| $this -> idHistoricFilter = $idHistoricFilter; | ||
| $this -> historicFilterName = $historicFilterName; | ||
| $this -> dateStart = $dateStart; | ||
| $this -> dateEnd = $dateEnd; | ||
| $this -> description = $description; | ||
| $this -> buttonColor = $buttonColor; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getIdHistoricFilter() { | ||
| return $this -> idHistoricFilter; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $idHistoricFilter | ||
| */ | ||
| public function setIdHistoricFilter($idHistoricFilter) { | ||
| $this -> idHistoricFilter = $idHistoricFilter; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getHistoricFilterName() { | ||
| return $this -> historicFilterName; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $historicFilterName | ||
| */ | ||
| public function setHistoricFilterName($historicFilterName) { | ||
| $this -> historicFilterName = $historicFilterName; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getDateStart() { | ||
| return $this -> dateStart; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $dateStart | ||
| */ | ||
| public function setDateStart($dateStart) { | ||
| $this -> dateStart = $dateStart; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getDateEnd() { | ||
| return $this -> dateEnd; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $dateEnd | ||
| */ | ||
| public function setDateEnd($dateEnd) { | ||
| $this -> dateEnd = $dateEnd; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getDescription() { | ||
| return $this -> description; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $description | ||
| */ | ||
| public function setDescription($description) { | ||
| $this -> description = $description; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getButtonColor() { | ||
| return $this -> buttonColor; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $buttonColor | ||
| */ | ||
| public function setButtonColor($buttonColor) { | ||
| $this -> buttonColor = $buttonColor; | ||
| } | ||
|
|
||
| } |
| @@ -0,0 +1,80 @@ | ||
| <?php | ||
| /** | ||
| */ | ||
|
|
||
| class TypeFilter { | ||
| private $idTypeFilter; | ||
| private $type; | ||
| private $pinDesign; | ||
| private $buttonColor; | ||
|
|
||
| /** | ||
| * TypeFilter constructor. | ||
| * @param $idTypeFilter | ||
| * @param $type | ||
| * @param $pinDesign | ||
| * @param $buttonColor | ||
| */ | ||
| public function __construct($idTypeFilter, $type, $pinDesign, $buttonColor) { | ||
| $this -> idTypeFilter = $idTypeFilter; | ||
| $this -> type = $type; | ||
| $this -> pinDesign = $pinDesign; | ||
| $this -> buttonColor = $buttonColor; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getIdTypeFilter() { | ||
| return $this -> idTypeFilter; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $idTypeFilter | ||
| */ | ||
| public function setIdTypeFilter($idTypeFilter) { | ||
| $this -> idTypeFilter = $idTypeFilter; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getType() { | ||
| return $this -> type; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $type | ||
| */ | ||
| public function setType($type) { | ||
| $this -> type = $type; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getPinDesign() { | ||
| return $this -> pinDesign; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $pinDesign | ||
| */ | ||
| public function setPinDesign($pinDesign) { | ||
| $this -> pinDesign = $pinDesign; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getButtonColor() { | ||
| return $this -> buttonColor; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $buttonColor | ||
| */ | ||
| public function setButtonColor($buttonColor) { | ||
| $this -> buttonColor = $buttonColor; | ||
| } | ||
| } |
| @@ -0,0 +1,168 @@ | ||
| <?php | ||
| /** | ||
| */ | ||
|
|
||
| class WiderAreaMap { | ||
| private $idWiderAreaMap; | ||
| private $name; | ||
| private $description; | ||
| private $longitude; | ||
| private $latitude; | ||
| private $address; | ||
| private $city; | ||
| private $state; | ||
| private $zipcode; | ||
|
|
||
| /** | ||
| * WiderAreaMap constructor. | ||
| * @param $idWiderAreaMap | ||
| * @param $name | ||
| * @param $description | ||
| * @param $longitude | ||
| * @param $latitude | ||
| * @param $address | ||
| * @param $city | ||
| * @param $state | ||
| * @param $zipcode | ||
| */ | ||
| public function __construct($idWiderAreaMap, $name, $description, $longitude, $latitude, $address, $city, $state, $zipcode) { | ||
| $this -> idWiderAreaMap = $idWiderAreaMap; | ||
| $this -> name = $name; | ||
| $this -> description = $description; | ||
| $this -> longitude = $longitude; | ||
| $this -> latitude = $latitude; | ||
| $this -> address = $address; | ||
| $this -> city = $city; | ||
| $this -> state = $state; | ||
| $this -> zipcode = $zipcode; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getIdWiderAreaMap() { | ||
| return $this -> idWiderAreaMap; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $idWiderAreaMap | ||
| */ | ||
| public function setIdWiderAreaMap($idWiderAreaMap) { | ||
| $this -> idWiderAreaMap = $idWiderAreaMap; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getName() { | ||
| return $this -> name; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $name | ||
| */ | ||
| public function setName($name) { | ||
| $this -> name = $name; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getDescription() { | ||
| return $this -> description; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $description | ||
| */ | ||
| public function setDescription($description) { | ||
| $this -> description = $description; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getLongitude() { | ||
| return $this -> longitude; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $longitude | ||
| */ | ||
| public function setLongitude($longitude) { | ||
| $this -> longitude = $longitude; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getLatitude() { | ||
| return $this -> latitude; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $latitude | ||
| */ | ||
| public function setLatitude($latitude) { | ||
| $this -> latitude = $latitude; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getAddress() { | ||
| return $this -> address; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $address | ||
| */ | ||
| public function setAddress($address) { | ||
| $this -> address = $address; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getCity() { | ||
| return $this -> city; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $city | ||
| */ | ||
| public function setCity($city) { | ||
| $this -> city = $city; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getState() { | ||
| return $this -> state; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $state | ||
| */ | ||
| public function setState($state) { | ||
| $this -> state = $state; | ||
| } | ||
|
|
||
| /** | ||
| * @return mixed | ||
| */ | ||
| public function getZipcode() { | ||
| return $this -> zipcode; | ||
| } | ||
|
|
||
| /** | ||
| * @param mixed $zipcode | ||
| */ | ||
| public function setZipcode($zipcode) { | ||
| $this -> zipcode = $zipcode; | ||
| } | ||
|
|
||
|
|
||
|
|
||
| } |
| @@ -0,0 +1,57 @@ | ||
| <?php | ||
| require_once '../../data/ContactData.class.php'; | ||
| require_once '../../models/Contact.class.php'; | ||
| /** | ||
| */ | ||
|
|
||
| class ContactService { | ||
| public function __construct(){ | ||
| } | ||
|
|
||
| public function getAllContactEntries() { | ||
| $contactDataClass = new ContactData(); | ||
| $allContactDataObjects = $contactDataClass -> readContact(); | ||
| $allContactData = array(); | ||
|
|
||
| foreach ($allContactDataObjects as $contactArray) { | ||
| $contactObject = new Contact($contactArray['idContact'], $contactArray['name'], $contactArray['email'], $contactArray['description'], $contactArray['phone'], $contactArray['title']); | ||
|
|
||
| array_push($allContactData, $contactObject); | ||
| } | ||
| return $allContactDataObjects; | ||
| } | ||
|
|
||
| public function createContactEntry($name, $email, $description, $phone, $title) { | ||
| $email = filter_var($email, FILTER_SANITIZE_EMAIL); | ||
| $description = filter_var($description, FILTER_SANITIZE_STRING); | ||
| $phone = filter_var($phone, FILTER_SANITIZE_STRING); | ||
| $title = filter_var($title, FILTER_SANITIZE_STRING); | ||
| $name = filter_var($name, FILTER_SANITIZE_STRING); | ||
|
|
||
| //create Contact Object | ||
| $contactDataClass = new ContactData(); | ||
| $contactDataClass -> createContact($email, $description, $phone, $title, $name); | ||
| } | ||
|
|
||
| public function updateContactEntry($idContact, $email, $description, $phone, $title, $name, $description) { | ||
| $email = filter_var($email, FILTER_SANITIZE_EMAIL); | ||
| $description = filter_var($description, FILTER_SANITIZE_STRING); | ||
| $phone = filter_var($phone, FILTER_SANITIZE_STRING); | ||
| $title = filter_var($title, FILTER_SANITIZE_STRING); | ||
| $name = filter_var($name, FILTER_SANITIZE_STRING); | ||
|
|
||
| $contactDataClass = new ContactData(); | ||
| $contactDataClass -> updateContact($idContact, $name, $email, $description, $phone, $title); | ||
| } | ||
|
|
||
| public function deleteContactEntry($idContact) { | ||
| $idContact = filter_var($idContact, FILTER_SANITIZE_NUMBER_INT); | ||
| if (empty($idContact) || $idContact == "") { | ||
| return; | ||
| } else { | ||
| $contactDataClass = new ContactData(); | ||
| $contactDataClass -> deleteContact($idContact); | ||
| } | ||
|
|
||
| } | ||
| } |
| @@ -0,0 +1,57 @@ | ||
| <?php | ||
| require_once '../../data/EventData.class.php'; | ||
| require_once '../../models/Event.class.php'; | ||
| /** | ||
| */ | ||
|
|
||
| class EventService { | ||
| public function __construct(){ | ||
| } | ||
|
|
||
| public function getAllEventEntries() { | ||
| $eventDataClass = new EventData(); | ||
| $allEventDataObjects = $eventDataClass -> readEvent(); | ||
| $allEventData = array(); | ||
|
|
||
| foreach ($allEventDataObjects as $eventArray) { | ||
| $eventObject = new Event($eventArray['idEvent'], $eventArray['name'], $eventArray['description'], $eventArray['startTime'], $eventArray['endTime'], $eventArray['idWiderAreaMap']); | ||
|
|
||
| array_push($allEventData, $eventObject); | ||
| } | ||
| return $allEventDataObjects; | ||
| } | ||
|
|
||
| public function createEventEntry($name, $description, $startTime, $endTime, $idWiderAreaMap) { | ||
| $startTime = filter_var($startTime, FILTER_SANITIZE_EMAIL); | ||
| $description = filter_var($description, FILTER_SANITIZE_STRING); | ||
| $endTime = filter_var($endTime, FILTER_SANITIZE_STRING); | ||
| $idWiderAreaMap = filter_var($idWiderAreaMap, FILTER_SANITIZE_STRING); | ||
| $name = filter_var($name, FILTER_SANITIZE_STRING); | ||
|
|
||
| //create Event Object | ||
| $eventDataClass = new EventData(); | ||
| $eventDataClass -> createEvent($startTime, $description, $endTime, $idWiderAreaMap, $name); | ||
| } | ||
|
|
||
| public function updateEventEntry($idEvent, $name, $description, $startTime, $endTime, $idWiderAreaMap) { | ||
| $startTime = filter_var($startTime, FILTER_SANITIZE_EMAIL); | ||
| $description = filter_var($description, FILTER_SANITIZE_STRING); | ||
| $endTime = filter_var($endTime, FILTER_SANITIZE_STRING); | ||
| $idWiderAreaMap = filter_var($idWiderAreaMap, FILTER_SANITIZE_STRING); | ||
| $name = filter_var($name, FILTER_SANITIZE_STRING); | ||
|
|
||
| $eventDataClass = new EventData(); | ||
| $eventDataClass -> updateEvent($idEvent, $name, $startTime, $description, $endTime, $idWiderAreaMap); | ||
| } | ||
|
|
||
| public function deleteEventEntry($idEvent) { | ||
| $idEvent = filter_var($idEvent, FILTER_SANITIZE_NUMBER_INT); | ||
| if (empty($idEvent) || $idEvent == "") { | ||
| return; | ||
| } else { | ||
| $eventDataClass = new EventData(); | ||
| $eventDataClass -> deleteEvent($idEvent); | ||
| } | ||
|
|
||
| } | ||
| } |
| @@ -0,0 +1,51 @@ | ||
| <?php | ||
| require_once '../../data/FAQData.class.php'; | ||
| require_once '../../models/FAQ.class.php'; | ||
| /** | ||
| */ | ||
|
|
||
| class FAQService { | ||
| public function __construct(){ | ||
| } | ||
|
|
||
| public function getAllFAQEntries() { | ||
| $fAQDataClass = new FAQData(); | ||
| $allFAQDataObjects = $fAQDataClass -> readFAQ(); | ||
| $allFAQData = array(); | ||
|
|
||
| foreach ($allFAQDataObjects as $fAQArray) { | ||
| $fAQObject = new FAQ($fAQArray['idFAQ'], $fAQArray['question'], $fAQArray['answer']); | ||
|
|
||
| array_push($allFAQData, $fAQObject); | ||
| } | ||
| return $allFAQDataObjects; | ||
| } | ||
|
|
||
| public function createFAQEntry($question, $answer) { | ||
| $question = filter_var($question, FILTER_SANITIZE_EMAIL); | ||
| $answer = filter_var($answer, FILTER_SANITIZE_STRING); | ||
|
|
||
| //create FAQ Object | ||
| $fAQDataClass = new FAQData(); | ||
| $fAQDataClass -> createFAQ($question, $answer); | ||
| } | ||
|
|
||
| public function updateFAQEntry($idFAQ, $question, $answer) { | ||
| $question = filter_var($question, FILTER_SANITIZE_EMAIL); | ||
| $answer = filter_var($answer, FILTER_SANITIZE_STRING); | ||
|
|
||
| $fAQDataClass = new FAQData(); | ||
| $fAQDataClass -> updateFAQ($idFAQ, $question, $answer); | ||
| } | ||
|
|
||
| public function deleteFAQEntry($idFAQ) { | ||
| $idFAQ = filter_var($idFAQ, FILTER_SANITIZE_NUMBER_INT); | ||
| if (empty($idFAQ) || $idFAQ == "") { | ||
| return; | ||
| } else { | ||
| $fAQDataClass = new FAQData(); | ||
| $fAQDataClass -> deleteFAQ($idFAQ); | ||
| } | ||
|
|
||
| } | ||
| } |
| @@ -1,5 +1,5 @@ | ||
| <?php | ||
| require_once '../services/DatabaseConnection.class.php'; | ||
|
|
||
| /* | ||
| * Hold generic functions that are not hooked to | ||
| @@ -1,6 +1,6 @@ | ||
| <?php | ||
| require_once '../../data/GraveObjectData.class.php'; | ||
| require_once '../../models/Grave.class.php'; | ||
| require_once 'TrackableObjectService.class.php'; | ||
|
|
||
| /** | ||
| @@ -0,0 +1,61 @@ | ||
| <?php | ||
| require_once '../../data/HistoricFilterData.class.php'; | ||
| require_once '../../data/GraveObjectData.class.php'; | ||
| require_once '../../models/HistoricFilter.class.php'; | ||
| /** | ||
| */ | ||
|
|
||
| class HistoricFilterService { | ||
| public function __construct(){ | ||
| } | ||
|
|
||
| public function getAllHistoricFilterEntries() { | ||
| $historicFilterDataClass = new HistoricFilterData(); | ||
| $allHistoricFilterDataObjects = $historicFilterDataClass -> readHistoricFilter(); | ||
| $allHistoricFilterData = array(); | ||
|
|
||
| foreach ($allHistoricFilterDataObjects as $historicFilterArray) { | ||
| $historicFilterObject = new HistoricFilter($historicFilterArray['idHistoricFilter'], $historicFilterArray['historicFilterName'], $historicFilterArray['dateStart'], $historicFilterArray['dateEnd'], $historicFilterArray['description'], $historicFilterArray['buttonColor']); | ||
|
|
||
| array_push($allHistoricFilterData, $historicFilterObject); | ||
| } | ||
| return $allHistoricFilterDataObjects; | ||
| } | ||
|
|
||
| public function createHistoricFilterEntry($historicFilterName, $dateStart, $description, $dateEnd, $buttonColor) { | ||
| $dateStart = filter_var($dateStart, FILTER_SANITIZE_STRING); | ||
| $description = filter_var($description, FILTER_SANITIZE_STRING); | ||
| $dateEnd = filter_var($dateEnd, FILTER_SANITIZE_STRING); | ||
| $buttonColor = filter_var($buttonColor, FILTER_SANITIZE_STRING); | ||
| $historicFilterName = filter_var($historicFilterName, FILTER_SANITIZE_STRING); | ||
|
|
||
| //create HistoricFilter Object | ||
| $historicFilterDataClass = new HistoricFilterData(); | ||
| $historicFilterDataClass -> createHistoricFilter($historicFilterName, $dateStart, $description, $dateEnd, $buttonColor); | ||
| } | ||
|
|
||
| public function updateHistoricFilterEntry($idHistoricFilter, $historicFilterName, $dateStart, $description, $dateEnd, $buttonColor) { | ||
| $dateStart = filter_var($dateStart, FILTER_SANITIZE_STRING); | ||
| $description = filter_var($description, FILTER_SANITIZE_STRING); | ||
| $dateEnd = filter_var($dateEnd, FILTER_SANITIZE_STRING); | ||
| $buttonColor = filter_var($buttonColor, FILTER_SANITIZE_STRING); | ||
| $historicFilterName = filter_var($historicFilterName, FILTER_SANITIZE_STRING); | ||
| $idHistoricFilter = filter_var($idHistoricFilter, FILTER_SANITIZE_NUMBER_INT); | ||
|
|
||
| $historicFilterDataClass = new HistoricFilterData(); | ||
| $historicFilterDataClass -> updateHistoricFilter($idHistoricFilter, $historicFilterName, $dateStart, $description, $dateEnd, $buttonColor); | ||
| } | ||
|
|
||
| public function deleteHistoricFilterEntry($idHistoricFilter) { | ||
| $idHistoricFilter = filter_var($idHistoricFilter, FILTER_SANITIZE_NUMBER_INT); | ||
| if (empty($idHistoricFilter) || $idHistoricFilter == "") { | ||
| return; | ||
| } else { | ||
| $graveDataClass = new GraveObjectData(); | ||
| $graveDataClass -> unsetHistoricFilterId($idHistoricFilter); | ||
|
|
||
| $historicFilterDataClass = new HistoricFilterData(); | ||
| $historicFilterDataClass -> deleteHistoricFilter($idHistoricFilter); | ||
| } | ||
| } | ||
| } |
| @@ -1,5 +1,5 @@ | ||
| <?php | ||
| require_once '../../data/LoginData.class.php'; | ||
|
|
||
| /* | ||
| * | ||
| @@ -1,6 +1,6 @@ | ||
| <?php | ||
| require_once '../../data/MiscObjectData.class.php'; | ||
| require_once '../../models/MiscObject.class.php'; | ||
| require_once 'TrackableObjectService.class.php'; | ||
| /** | ||
| */ | ||
| @@ -1,6 +1,6 @@ | ||
| <?php | ||
| require_once '../../data/NaturalHistoryObjectData.class.php'; | ||
| require_once '../../models/NaturalHistory.class.php'; | ||
| require_once 'TrackableObjectService.class.php'; | ||
| /** | ||
| */ | ||
| @@ -1,5 +1,5 @@ | ||
| <?php | ||
| require_once '../../data/TrackableObjectData.class.php'; | ||
| /** | ||
| */ | ||
|
|
||
| @@ -1,6 +1,6 @@ | ||
| <?php | ||
| require_once '../data/TrailData.class.php'; | ||
| require_once '../models/TrailObject.class.php'; | ||
|
|
||
| class TrailService { | ||
|
|
||
| @@ -0,0 +1,61 @@ | ||
| <?php | ||
| require_once '../../data/TypeFilterData.class.php'; | ||
| require_once '../../models/TypeFilter.class.php'; | ||
| require_once '../../data/TrackableObjectData.class.php'; | ||
| /** | ||
| */ | ||
|
|
||
| class TypeFilterService { | ||
| public function __construct(){ | ||
| } | ||
|
|
||
| public function getAllTypeFilterEntries() { | ||
| $typeFilterDataClass = new TypeFilterData(); | ||
| $allTypeFilterDataObjects = $typeFilterDataClass -> readTypeFilter(); | ||
| $allTypeFilterData = array(); | ||
|
|
||
| foreach ($allTypeFilterDataObjects as $typeFilterArray) { | ||
| $typeFilterObject = new TypeFilter($typeFilterArray['idTypeFilter'], $typeFilterArray['type'],$typeFilterArray['pinDesign'], $typeFilterArray['buttonColor']); | ||
|
|
||
| array_push($allTypeFilterData, $typeFilterObject); | ||
| } | ||
| return $allTypeFilterDataObjects; | ||
| } | ||
|
|
||
| public function createTypeFilterEntry($type, $pinDesign, $buttonColor) { | ||
| $pinDesign = filter_var($pinDesign, FILTER_SANITIZE_STRING); | ||
| $buttonColor = filter_var($buttonColor, FILTER_SANITIZE_STRING); | ||
| $type = filter_var($type, FILTER_SANITIZE_STRING); | ||
|
|
||
| //create TypeFilter Object | ||
| $typeFilterDataClass = new TypeFilterData(); | ||
| $typeFilterDataClass -> createTypeFilter($pinDesign, $type, $buttonColor); | ||
| } | ||
|
|
||
| public function updateTypeFilterEntry($idTypeFilter, $type, $pinDesign, $buttonColor) { | ||
| $pinDesign = filter_var($pinDesign, FILTER_SANITIZE_STRING); | ||
| $buttonColor = filter_var($buttonColor, FILTER_SANITIZE_STRING); | ||
| $type = filter_var($type, FILTER_SANITIZE_STRING); | ||
|
|
||
| $typeFilterDataClass = new TypeFilterData(); | ||
| $typeFilterDataClass -> updateTypeFilter($idTypeFilter, $pinDesign, $type, $buttonColor); | ||
| } | ||
|
|
||
| public function deleteTypeFilterEntry($idTypeFilter) { | ||
| $idTypeFilter = filter_var($idTypeFilter, FILTER_SANITIZE_NUMBER_INT); | ||
| if (empty($idTypeFilter) || $idTypeFilter == "") { | ||
| return null; | ||
| } else { | ||
| $trackableObjectDataClass = new TrackableObjectData(); | ||
| $typeFilterUseAmount = $trackableObjectDataClass -> checkForInUseTypeFilters($idTypeFilter); | ||
|
|
||
| if ($typeFilterUseAmount < 0) { | ||
| $typeFilterDataClass = new TypeFilterData(); | ||
| $typeFilterDataClass -> deleteTypeFilter($idTypeFilter); | ||
| } else { | ||
| return "The Type filter is currently in use by a Grave, Natural History, or Misc Object. Unattach this filter before the filter can be deleted."; | ||
| } | ||
|
|
||
| } | ||
| } | ||
| } |
| @@ -1,5 +1,5 @@ | ||
| <?php | ||
| require_once '../services/DatabaseConnection.class.php'; | ||
|
|
||
| class WiderAreaMap { | ||
|
|
||
| @@ -0,0 +1,75 @@ | ||
| <?php | ||
| require_once '../../data/WiderAreaMapData.class.php'; | ||
| require_once '../../data/EventData.class.php'; | ||
| require_once '../../models/WiderAreaMap.class.php'; | ||
| /** | ||
| */ | ||
|
|
||
| class WiderAreaMapService { | ||
| public function __construct(){ | ||
| } | ||
|
|
||
| public function getAllWiderAreaMapEntries() { | ||
| $widerAreaMapDataClass = new WiderAreaMapData(); | ||
| $allWiderAreaMapDataObjects = $widerAreaMapDataClass -> readWiderAreaMap(); | ||
| $allWiderAreaMapData = array(); | ||
|
|
||
| foreach ($allWiderAreaMapDataObjects as $widerAreaMapArray) { | ||
| $widerAreaMapObject = new WiderAreaMap($widerAreaMapArray['idWiderAreaMap'], $widerAreaMapArray['name'], $widerAreaMapArray['latitude'], $widerAreaMapArray['longitude'], $widerAreaMapArray['description'], $widerAreaMapArray['address']); | ||
|
|
||
| array_push($allWiderAreaMapData, $widerAreaMapObject); | ||
| } | ||
| return $allWiderAreaMapDataObjects; | ||
| } | ||
|
|
||
| public function createWiderAreaMapEntry($url, $name, $description, $longitude, $latitude, $address, $city, $state, $zipcode) { | ||
| $description = filter_var($description, FILTER_SANITIZE_STRING); | ||
| $longitude = filter_var($longitude, FILTER_SANITIZE_NUMBER_FLOAT, | ||
| FILTER_FLAG_ALLOW_FRACTION); | ||
| $latitude = filter_var($latitude, FILTER_SANITIZE_NUMBER_FLOAT, | ||
| FILTER_FLAG_ALLOW_FRACTION); | ||
| $city = filter_var($city, FILTER_SANITIZE_STRING); | ||
| $name = filter_var($name, FILTER_SANITIZE_STRING); | ||
| $zipcode = filter_var($zipcode, FILTER_SANITIZE_STRING); | ||
| $state = filter_var($state, FILTER_SANITIZE_STRING); | ||
| $url = filter_var($url, FILTER_SANITIZE_EMAIL); | ||
| $address = filter_var($address, FILTER_SANITIZE_STRING); | ||
| $zipcode = filter_var($zipcode, FILTER_SANITIZE_NUMBER_INT); | ||
|
|
||
|
|
||
| //create WiderAreaMap Object | ||
| $widerAreaMapDataClass = new WiderAreaMapData(); | ||
| $widerAreaMapDataClass -> createWiderAreaMap($url, $name, $description, $longitude, $latitude, $address, $city, $state, $zipcode); | ||
| } | ||
|
|
||
| public function updateWiderAreaMapEntry($idWiderAreaMap, $url, $name, $description, $longitude, $latitude, $address, $city, $state, $zipcode) { | ||
| $description = filter_var($description, FILTER_SANITIZE_STRING); | ||
| $longitude = filter_var($longitude, FILTER_SANITIZE_NUMBER_FLOAT, | ||
| FILTER_FLAG_ALLOW_FRACTION); | ||
| $latitude = filter_var($latitude, FILTER_SANITIZE_NUMBER_FLOAT, | ||
| FILTER_FLAG_ALLOW_FRACTION); | ||
| $city = filter_var($city, FILTER_SANITIZE_STRING); | ||
| $name = filter_var($name, FILTER_SANITIZE_STRING); | ||
| $zipcode = filter_var($zipcode, FILTER_SANITIZE_STRING); | ||
| $state = filter_var($state, FILTER_SANITIZE_STRING); | ||
| $url = filter_var($url, FILTER_SANITIZE_EMAIL); | ||
| $address = filter_var($address, FILTER_SANITIZE_STRING); | ||
| $zipcode = filter_var($zipcode, FILTER_SANITIZE_NUMBER_INT); | ||
|
|
||
| $widerAreaMapDataClass = new WiderAreaMapData(); | ||
| $widerAreaMapDataClass -> updateWiderAreaMap($idWiderAreaMap, $url, $name, $description, $longitude, $latitude, $address, $city, $state, $zipcode); | ||
| } | ||
|
|
||
| public function deleteWiderAreaMapEntry($idWiderAreaMap) { | ||
| $idWiderAreaMap = filter_var($idWiderAreaMap, FILTER_SANITIZE_NUMBER_INT); | ||
| if (empty($idWiderAreaMap) || $idWiderAreaMap == "") { | ||
| return; | ||
| } else { | ||
| $eventDataClass = new EventData(); | ||
| $eventDataClass -> deleteLocationConnectedEvents($idWiderAreaMap); | ||
|
|
||
| $widerAreaMapDataClass = new WiderAreaMapData(); | ||
| $widerAreaMapDataClass -> deleteWiderAreaMap($idWiderAreaMap); | ||
| } | ||
| } | ||
| } |