'.__('You are not authorized to view this section').''); } $max_print = 50; /* RECORD OPERATION */ if (isset($_POST['itemID']) AND !empty($_POST['itemID']) AND isset($_POST['itemAction'])) { if (!$can_read) { die(); } if (!is_array($_POST['itemID'])) { // make an array $_POST['itemID'] = array((integer)$_POST['itemID']); } // loop array if (isset($_SESSION['barcodes'])) { $print_count = count($_SESSION['barcodes']); } else { $print_count = 0; } // barcode size $size = 2; // create AJAX request echo ''; echo ''; // update print queue count object sleep(2); if (isset($limit_reach)) { $msg = str_replace('{max_print}', $max_print, __('Selected items NOT ADDED to print queue. Only {max_print} can be printed at once')); utility::jsAlert($msg); } else { utility::jsAlert(__('Selected items added to print queue')); } exit(); } // clean print queue if (isset($_GET['action']) AND $_GET['action'] == 'clear') { // update print queue count object echo ''; utility::jsAlert(__('Print queue cleared!')); unset($_SESSION['barcodes']); exit(); } // barcode pdf download if (isset($_GET['action']) AND $_GET['action'] == 'print') { // check if label session array is available if (!isset($_SESSION['barcodes'])) { utility::jsAlert(__('There is no data to print!')); die(); } if (count($_SESSION['barcodes']) < 1) { utility::jsAlert(__('There is no data to print!')); die(); } // concat all ID together $item_ids = ''; foreach ($_SESSION['barcodes'] as $id) { $item_ids .= '\''.$id.'\','; } // strip the last comma $item_ids = substr_replace($item_ids, '', -1); // send query to database $item_q = $dbs->query('SELECT b.title, i.item_code FROM item AS i LEFT JOIN biblio AS b ON i.biblio_id=b.biblio_id WHERE i.item_code IN('.$item_ids.')'); $item_data_array = array(); while ($item_d = $item_q->fetch_row()) { if ($item_d[0]) { $item_data_array[] = $item_d; } } // include printed settings configuration file require SB.'admin'.DS.'admin_template'.DS.'printed_settings.inc.php'; // check for custom template settings $custom_settings = SB.'admin'.DS.$sysconf['admin_template']['dir'].DS.$sysconf['template']['theme'].DS.'printed_settings.inc.php'; if (file_exists($custom_settings)) { include $custom_settings; } // load print settings from database to override value from printed_settings file loadPrintSettings($dbs, 'barcode'); // chunk barcode array $chunked_barcode_arrays = array_chunk($item_data_array, $sysconf['print']['barcode']['barcode_items_per_row']); // create html ouput $html_str = ''."\n"; $html_str .= '
';
$html_str .= ' ';
if ($sysconf['print']['barcode']['barcode_include_header_text']) { $html_str .= ' ';
$html_str .= ''.($sysconf['print']['barcode']['barcode_header_text']?$sysconf['print']['barcode']['barcode_header_text']:$sysconf['library_name']).' '; }
// document title
$html_str .= '';
if ($sysconf['print']['barcode']['barcode_cut_title'] && strlen($barcode[0]) > $sysconf['print']['barcode']['barcode_cut_title']) {
$html_str .= substr($barcode[0], 0, $sysconf['print']['barcode']['barcode_cut_title']).'...';
} else { $html_str .= $barcode[0]; }
$html_str .= ' ';
$html_str .= '';
$html_str .= ' | ';
}
$html_str .= '