if (0 + $_GET['hits'] > 1) {
    $i = 0;
    do {
        insertCopy();
        $copy->setBarcodeNmbr(generateBarcode());
        $i++;
    } while ($i < 0 + $_GET['hits']);
    require_once "../classes/BulkLookup.php";
    $bl = new BulkLookupQuery();
    $bl->clearManualItem($_GET['isbn'], $_GET['hits']);
} else {
    insertCopy();
    if (isset($_GET['isbn'], $_GET['hits'])) {
        require_once "../classes/BulkLookup.php";
        $bl = new BulkLookupQuery();
        $bl->clearManualItem($_GET['isbn'], $_GET['hits']);
    }
}
$copyQ->close();
#**************************************************************************
#*  Destroy form values and errors
#**************************************************************************
unset($_SESSION["postVars"]);
unset($_SESSION["pageErrors"]);
$msg = $loc->getText("biblioCopyNewSuccess");
header("Location: ../shared/biblio_view.php?bibid=" . U($bibid) . "&msg=" . U($msg));
exit;
function generateBarcode()
{
    global $copyQ;
    $nzeros = "5";