eventID = 0; $this->eventSectionID = 0; $this->eventName = 'Unnamed event'; $this->eventSequenceNumber = 0; $this->eventComment = 'No comments.'; $this->eventLocalityDescription = 'No locality description.'; $this->eventGeoreferenceID = 0; $this->eventTimeDescription = 'No time description.'; $this->eventStart_YYYY = 0; $this->eventStart_MM = 0; $this->eventStart_DD = 0; $this->eventStartUncertainty_DD =0; $this->eventEnd_YYYY =0; $this->eventEnd_MM =0; $this->eventEnd_DD =0; $this->eventEndUncertainty_DD =0; } // destructor function __destruct() { } // eventID functions public function setEventID($new_eventID) { $this->itineraryID = $new_eventID; } public function getEventID() { return $this->eventID; } // eventSectionID functions public function setEventSectionID($new_eventSectionID) { $this->eventSectionID = $new_eventSectionID; } public function getEventSectionID() { return $this->eventSectionID; } // eventName functions public function setEventName($new_eventName) { $this->eventName = $new_eventName; } public function getEventName() { return $this->eventName; } // eventSequenceNumber functions public function setEventSequenceNumber($new_eventSequenceNumber) { $this->eventSequenceNumber = $new_eventSequenceNumber; } public function getEventSequenceNumber() { return $this->eventSequenceNumber; } // eventComment functions public function setEventComment($new_eventComment) { $this->eventComment = $new_eventComment; } public function getEventComment() { return $this->eventComment; } // eventLocalityDescription functions public function setLocalityDescription($new_eventLocalityDescription) { $this->eventLocalityDescription = $new_eventLocalityDescription; } public function getEventLocalityDescription() { return $this->eventLocalityDescription; } // eventGeoreferenceID functions public function setEventGeoreferenceID($new_eventGeoreferenceID) { $this->eventGeoreferenceID = $new_eventGeoreferenceID; } public function getEventGeoreferenceID() { return $this->eventGeoreferenceID; } // eventTimeDescription functions public function setTimeDescription($new_eventTimeDescription) { $this->eventTimeDescription = $new_eventTimeDescription; } public function getEventTimeDescription() { return $this->eventTimeDescription; } //*********************** START date functions ************************ //eventStart (date) get-functions //get functions operate on the separate //parts of the date (YYYY or MM or DD). public function getEventStart_YYYY() { return $this-> eventStart_YYYY ; } public function getEventStart_MM() { return $this-> eventStart_MM ; } public function getEventStart_DD() { return $this-> eventStart_DD ; } //eventStart (date) set-function //operates on the date as a whole. public function setEventStart_YYYYMMDD($new_EventStart_YYYYMMDD) { //first some checks for date validity //mind the type-casts, as the checkdate() function requires integers $this->dateStringLength = strlen($new_EventStart_YYYYMMDD); $this->yearSubstring = (int) substr($new_EventStart_YYYYMMDD,0,4); $this->monthSubstring = (int) substr($new_EventStart_YYYYMMDD,4,2); $this->daySubstring = (int) substr($new_EventStart_YYYYMMDD,6,2); if ($this->dateStringLength > 8) { // string too long $this->returnString = "ERROR : given string is longer than 8 characters. Expedition start date should be given in the format YYYYMMDD, without separation characters or blanks. / Given string was : $new_EventStart_YYYYMMDD"; } elseif (checkdate($this->monthSubstring, $this->daySubstring, $this->yearSubstring) == FALSE) { //date not valid $this->returnString ="ERROR : given date is not valid. Expedition start date should be given in the format YYYYMMDD. The year should be between 1 and 32767 inclusive. Month should be between 1 and 12 inclusive. Day should be within allowed number of days for the given month. Leap years are taken into account. / Given string was : $new_EventStart_YYYYMMDD"; } else { // no problems : date is accepted $this->eventStart_YYYYMMDD = $new_EventStart_YYYYMMDD; $this->returnString = "Event start date set to $this->eventStart_YYYYMMDD"; } return ($this->returnString); } //*********************** END date functions ************************ //eventEnd (date) get-functions //get functions operate on the separate //parts of the date (YYYY or MM or DD). public function getEventEnd_YYYY() { return $this-> eventEnd_YYYY ; } public function getEventEnd_MM() { return $this-> eventEnd_MM ; } public function getEventEnd_DD() { return $this-> eventEnd_DD ; } //eventEnd (date) set-function //operates on the date as a whole. public function setEventEnd_YYYYMMDD($new_EventEnd_YYYYMMDD) { //first some checks for date validity //mind the type-casts, as the checkdate() function requires integers $this->dateStringLength = strlen($new_EventEnd_YYYYMMDD); $this->yearSubstring = (int) substr($new_EventEnd_YYYYMMDD,0,4); $this->monthSubstring = (int) substr($new_EventEnd_YYYYMMDD,4,2); $this->daySubstring = (int) substr($new_EventEnd_YYYYMMDD,6,2); if ($this->dateStringLength > 8) { // string too long $this->returnString = "ERROR : given string is longer than 8 characters. Expedition start date should be given in the format YYYYMMDD, without separation characters or blanks. / Given string was : $new_EventEnd_YYYYMMDD"; } elseif (checkdate($this->monthSubstring, $this->daySubstring, $this->yearSubstring) == FALSE) { //date not valid $this->returnString ="ERROR : given date is not valid. Expedition start date should be given in the format YYYYMMDD. The year should be between 1 and 32767 inclusive. Month should be between 1 and 12 inclusive. Day should be within allowed number of days for the given month. Leap years are taken into account. / Given string was : $new_EventEnd_YYYYMMDD"; } else { // no problems : date is accepted $this->eventEnd_YYYYMMDD = $new_EventEnd_YYYYMMDD; $this->returnString = "Event end date set to $this->eventEnd_YYYYMMDD"; } return ($this->returnString); } // eventStartUncertainty functions public function setEventStartUncertainty($new_eventStartUncertainty) { $this->eventStartUncertainty = $new_eventStartUncertainty; } public function getEventStartUncertainty() { return $this->eventStartUncertainty; } // eventEndUncertainty functions public function setEventEndUncertainty($new_eventEndUncertainty) { $this->eventEndUncertainty = $new_eventEndUncertainty; } public function getEventEndUncertainty() { return $this->eventEndUncertainty; } } ?>