$bibid = $_POST["bibid"]; $CopyNmbr = $copyQ->nextCopyid($bibid); if ($copyQ->errorOccurred()) { $copyQ->close(); displayErrorPage($copyQ); } $_POST["barcodeNmbr"] = sprintf("%0" . $nzeros . "s", $bibid) . $CopyNmbr; } #**************************************************************************** #* Validate data #**************************************************************************** $bibid = $_POST["bibid"]; $copy = new BiblioCopy(); $copy->setBibid($bibid); $copy->setCopyDesc($_POST["copyDesc"]); $_POST["copyDesc"] = $copy->getCopyDesc(); $copy->setBarcodeNmbr($_POST["barcodeNmbr"]); $_POST["barcodeNmbr"] = $copy->getBarcodeNmbr(); $copy->setLocationid($_POST["location"]); $_POST["location"] = $copy->getCopyDesc(); $dmQ = new DmQuery(); $dmQ->connect(); $customFields = $dmQ->getAssoc('biblio_copy_fields_dm'); $dmQ->close(); foreach ($customFields as $name => $title) { if (isset($_REQUEST['custom_' . $name])) { $copy->setCustom($name, $_REQUEST['custom_' . $name]); } } $validBarco = $_POST["validBarco"]; $validData = $copy->validateData($validBarco);
$bibid = $_POST["bibid"]; $CopyNmbr = $copyQ->nextCopyid($bibid); if ($copyQ->errorOccurred()) { $copyQ->close(); displayErrorPage($copyQ); } $_POST["barcodeNmbr"] = sprintf("%0" . $nzeros . "s", $bibid) . $CopyNmbr; } #**************************************************************************** #* Validate data #**************************************************************************** $bibid = $_POST["bibid"]; $copy = new BiblioCopy(); $copy->setBibid($bibid); $copy->setCopyDesc($_POST["copyDesc"]); $_POST["copyDesc"] = $copy->getCopyDesc(); $copy->setBarcodeNmbr($_POST["barcodeNmbr"]); $_POST["barcodeNmbr"] = $copy->getBarcodeNmbr(); $validData = $copy->validateData(); if (!$validData) { $pageErrors["barcodeNmbr"] = $copy->getBarcodeNmbrError(); $_SESSION["postVars"] = $_POST; $_SESSION["pageErrors"] = $pageErrors; header("Location: ../catalog/biblio_copy_new_form.php?bibid=" . U($bibid)); exit; } #************************************************************************** #* Insert new bibliography copy #************************************************************************** if (!$copyQ->insert($copy)) { $copyQ->close();