if ($searchType == "location") { $sType = OBIB_SEARCH_LOCATION; } #**************************************************************************** #* Search database #**************************************************************************** $lotQ = new LocationQuery(); $lotQ->setItemsPerPage(OBIB_ITEMS_PER_PAGE); $lotQ->connect(); $lotQ->execSearch($sType, $searchText, $currentPageNmbr); #************************************************************************** #* Show location view screen if only one result from location search query #************************************************************************** if ($sType == OBIB_SEARCH_LOCATION && $lotQ->getRowCount() == 1) { $lot = $lotQ->fetchLocation(); $lotQ->close(); header("Location: ../circ/loc_view.php?locationid=" . U($lot->getLocationid()) . "&reset=Y"); exit; } #************************************************************************** #* Show search results #************************************************************************** require_once "../shared/header.php"; # Display no results message if no results returned from search. if ($lotQ->getRowCount() == 0) { $lotQ->close(); echo $loc->getText("locsearchNoResults"); require_once "../shared/footer.php"; exit; } ?>
$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)); exit;
$location->setLastChangeUserid($_SESSION["userid"]); $location->setStaffid($_POST["staffid"]); $_POST["staffid"] = $location->getStaffid(); $location->setCity($_POST["city"]); $_POST["city"] = $location->getCity(); $location->setState($_POST["state"]); $_POST["state"] = $location->getState(); $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(); #************************************************************************** #* Update library Location #************************************************************************** $locationQ = new LocationQuery(); $locationQ->update($location); $locationQ->close(); #************************************************************************** #* Destroy form values and errors #************************************************************************** unset($_SESSION["postVars"]); unset($_SESSION["pageErrors"]); $msg = $loc->getText("locEditSuccess"); header("Location: ../circ/loc_view.php?locationid=" . U($location->getLocationid()) . "&reset=Y&msg=" . U($msg)); exit;