#****************************************************************************
#*  Edit input
#****************************************************************************
if (!ctypeAlnum($barcode)) {
    $pageErrors["barcodeNmbr"] = $loc->getText("shelvingCartErr1");
    $postVars["barcodeNmbr"] = $barcode;
    $_SESSION["postVars"] = $postVars;
    $_SESSION["pageErrors"] = $pageErrors;
    header("Location: ../circ/checkin_form.php");
    exit;
}
#****************************************************************************
#*  Ready copy record
#****************************************************************************
$copyQ = new BiblioCopyQuery();
$copyQ->connect();
if ($copyQ->errorOccurred()) {
    $copyQ->close();
    displayErrorPage($copyQ);
}
if (is_bool($copy = $copyQ->queryByBarcode($barcode))) {
    $copyQ->close();
    $pageErrors["barcodeNmbr"] = $loc->getText("shelvingCartErr2");
    $_SESSION["pageErrors"] = $pageErrors;
    header("Location: ../circ/checkin_form.php");
    exit;
}
#****************************************************************************
#*  Edit results
#****************************************************************************
$foundError = FALSE;
Esempio n. 2
0
 function addCopy($bibid)
 {
     $bibid = 0 + $bibid;
     if ($bibid < 1) {
         return false;
     }
     require_once "BiblioCopyQuery.php";
     $copyQ = new BiblioCopyQuery();
     $copyQ->connect();
     if ($copyQ->errorOccurred()) {
         $copyQ->close();
     }
     // Auto generate barcode
     $CopyNmbr = $copyQ->nextCopyid($bibid);
     if ($copyQ->errorOccurred()) {
         $copyQ->close();
     }
     $nzeros = "5";
     $barcode = sprintf("%0" . $nzeros . "s", $bibid) . $CopyNmbr;
     $copy = new BiblioCopy();
     $copy->setBibid($bibid);
     $copy->setBarcodeNmbr($barcode);
     if (!$copyQ->insert($copy)) {
         $copyQ->close();
     }
     $copyQ->close();
 }
 function addCopy($bibid)
 {
     $bibid = 0 + $bibid;
     if ($bibid < 1) {
         return false;
     }
     require_once "BiblioCopyQuery.php";
     $copyQ = new BiblioCopyQuery();
     $copyQ->connect();
     if ($copyQ->errorOccurred()) {
         $copyQ->close();
     }
     // Auto generate barcode
     $CopyNmbr = $copyQ->nextCopyid($bibid);
     if ($copyQ->errorOccurred()) {
         $copyQ->close();
     }
     $nzeros = "5";
     $barcode = sprintf("%0" . $nzeros . "s", $bibid) . $CopyNmbr;
     $copy = new BiblioCopy();
     $copy->setBibid($bibid);
     $copy->setBarcodeNmbr($barcode);
     if (!$copyQ->insert($copy)) {
         $copyQ->close();
         /*
         if ($copyQ->getDbErrno() == "") {
           $pageErrors["barcodeNmbr"] = $copyQ->getError();
           $_SESSION["postVars"] = $_POST;
           $_SESSION["pageErrors"] = $pageErrors;
           header("Location: ../catalog/biblio_copy_new_form.php?bibid=".U($bibid));
           exit();
         } else {
           displayErrorPage($copyQ);
         }
         */
     }
     $copyQ->close();
 }
#****************************************************************************
if (!isset($_GET["code"])) {
    header("Location: ../admin/copy_fields_list.php");
    exit;
}
$code = $_GET["code"];
$description = $_GET["desc"];
#**************************************************************************
#*  Delete row
#**************************************************************************
$dmQ = new DmQuery();
$dmQ->connect();
$dmQ->delete("biblio_copy_fields_dm", $code);
$dmQ->close();
$biblioCopyQ = new BiblioCopyQuery();
$biblioCopyQ->connect();
$biblioCopyQ->deleteCustomField($code);
$biblioCopyQ->close();
#**************************************************************************
#*  Show success page
#**************************************************************************
require_once "../shared/header.php";
echo $loc->getText("Copy field, %desc%, has been deleted.", array('desc' => $description));
?>
<br><br>
<a href="../admin/copy_fields_list.php"><?php 
echo $loc->getText("return to copy field list");
?>
</a>

<?php 
Esempio n. 5
0
require_once "../functions/errorFuncs.php";
require_once "../classes/Localize.php";
$loc = new Localize(OBIB_LOCALE, $tab);
#****************************************************************************
#*  Checking for post vars.  Go back to form if none found.
#****************************************************************************
if (count($_POST) == 0) {
    header("Location: ../circ/loc_new_form.php");
    exit;
}
#****************************************************************************
#*  Validate data
#****************************************************************************
$location = $_POST["locationid"];
$bibCopyQ = new BiblioCopyQuery();
$bibCopyQ->connect();
$booksList = $bibCopyQ->getBooksList($location);
$my_file = '../layouts/default/LocationBooksFile.csv';
$handle = fopen($my_file, 'w') or die('Cannot open file:  ' . $my_file);
foreach ($booksList as $book) {
    $line = array($book['barcode_nmbr'], $book['title'], $book['author']);
    fputcsv($handle, $line);
}
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Length: ' . filesize($my_file));
header('Content-Disposition: attachment; filename="' . 'LocationOfBooks.csv' . '"');
readfile($my_file);
/**
* 
* Retrieval and downloading of books need to be done here