コード例 #1
0
} else {
    $currentPageNmbr = 1;
}
$searchType = $_POST["searchType"];
$searchText = trim($_POST["searchText"]);
# remove redundant whitespace
$searchText = preg_replace('/\\s+/', " ", $searchText);
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.
コード例 #2
0
ファイル: loc_new.php プロジェクト: vishnu35/opencitylibrary
$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;
コード例 #3
0
ファイル: loc_del.php プロジェクト: vishnu35/opencitylibrary
$tab = "circulation";
$restrictToMbrAuth = TRUE;
$nav = "deletedone";
$restrictInDemo = true;
require_once "../shared/logincheck.php";
require_once "../classes/LocationQuery.php";
require_once "../functions/errorFuncs.php";
require_once "../classes/Localize.php";
$loc = new Localize(OBIB_LOCALE, $tab);
$locationid = $_GET["locationid"];
$locationName = $_GET["name"];
#**************************************************************************
#*  Delete location
#**************************************************************************
$locationQ = new LocationQuery();
$locationQ->connect();
$locationQ->delete($locationid);
$locationQ->close();
#**************************************************************************
#*  Show success page
#**************************************************************************
require_once "../shared/header.php";
echo $loc->getText("locDelSuccess", array("name" => $locationName));
?>
<br><br>
<a href="../circ/loc_index.php"><?php 
echo $loc->getText("locDelReturn");
?>
</a>
<?php 
require_once "../shared/footer.php";