Esempio n. 1
0
 public static function convertToLocationObject($result)
 {
     $ret = new Location();
     $ret->setRoad(static::getElement($result['address'], 'road'));
     $ret->setHouseNumber(static::getElement($result['address'], 'house_number'));
     $ret->setSubUrb(static::getElement($result['address'], 'suburb'));
     $ret->setCity(static::getElement($result['address'], 'city'));
     $ret->setPostCode(static::getElement($result['address'], 'postcode'));
     $ret->setStateDistrict(static::getElement($result['address'], 'state_district'));
     $ret->setState(static::getElement($result['address'], 'state'));
     $ret->setCountry(static::getElement($result['address'], 'country'));
     $ret->setCountryCode(static::getElement($result['address'], 'country_code'));
     $ret->setLatitude($result['lat']);
     $ret->setLongitude($result['lon']);
     return $ret;
 }
Esempio n. 2
0
$location->setLastChangeUserid($_SESSION["userid"]);
$location->setCity($_POST["city"]);
$_POST["city"] = $location->getCity();
$location->setState($_POST["state"]);
$_POST["state"] = $location->getState();
$location->setStaffid($_POST["staffid"]);
$_POST["staffid"] = $location->getStaffid();
$location->setPincode($_POST["pincode"]);
$_POST["pincode"] = $location->getPincode();
$location->setDays($_POST["days"]);
$_POST["days"] = $location->getDays();
$location->setTime($_POST["time"]);
$_POST["time"] = $location->getTime();
$location->setLatitude($_POST["latitude"]);
$_POST["latitude"] = $location->getLatitude();
$location->setLongitude($_POST["longitude"]);
$_POST["longitude"] = $location->getLongitude();
$locQ = new LocationQuery();
$locQ->connect();
#**************************************************************************
#*  Insert new library member
#**************************************************************************
$locationid = $locQ->insert($location);
$locQ->close();
#**************************************************************************
#*  Destroy form values and errors
#**************************************************************************
unset($_SESSION["postVars"]);
unset($_SESSION["pageErrors"]);
$msg = $loc->getText("locNewSuccess");
header("Location: ../circ/loc_view.php?locationid=" . U($locationid) . "&reset=Y&msg=" . U($msg));
Esempio n. 3
0
 public function parseLocation($locationObject)
 {
     $location = new Location();
     $location->setLongitude($locationObject->longitude);
     $location->setLatitude($locationObject->latitude);
     return $location;
 }
Esempio n. 4
0
 function _mkObj($array)
 {
     $location = new Location();
     $location->setLocationid($array["locationid"]);
     $location->setAddressOne($array["loc_address_one"]);
     $location->setAddressTwo($array["loc_address_two"]);
     $location->setLastChangeDt($array["last_change_dt"]);
     $location->setStaffid($array["staffid"]);
     $location->setLastChangeUserid($array["last_change_userid"]);
     if (isset($array["username"])) {
         $location->setLastChangeUsername($array["username"]);
     }
     $location->setPincode($array["loc_pincode"]);
     $location->setCity($array["loc_city"]);
     $location->setState($array["loc_state"]);
     $location->setDays($array["loc_days"]);
     $location->setTime($array["loc_time"]);
     $location->setLatitude($array["loc_latitude"]);
     $location->setLongitude($array["loc_longitude"]);
     return $location;
 }
Esempio n. 5
0
    $Plant->setPlantName($_GET['PlantName']);
} else {
    $php_errormsg = $php_errormsg . "Missing Plant Name.<br> ";
}
if (isset($_GET['OnSite'])) {
    $Plant->setPlantEnteredOnSite($_GET['OnSite']);
} else {
    $php_errormsg = $php_errormsg . "Missing On Site.<br> ";
}
if (isset($_GET['PlantNotes'])) {
    $Plant->setPlantNote($_GET['PlantNotes']);
}
$LocationCount = 0;
if (isset($_GET['Longitude'])) {
    $LocationCount++;
    $Location->setLongitude($_GET['Longitude']);
}
if (isset($_GET['Latitude'])) {
    $LocationCount++;
    $Location->setLatitude($_GET['Latitude']);
}
if (isset($_GET['GPS'])) {
    $LocationCount++;
    $Location->setGPS($_GET['GPS']);
}
$locationError = false;
if (!$Location->getGPS() && !$Location->getLatitude() && !$Location->getLongitude()) {
    $LocationError = true;
}
if (isset($_GET['Note'])) {
    $LocationCount++;