You dont have enough privileges to view this section'); } // local settings $max_print = 10; // clean print queue if (isset($_GET['action']) AND $_GET['action'] == 'clear') { // update print queue count object echo ''; utility::jsAlert(__('Print queue cleared!')); unset($_SESSION['card']); exit(); } 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($_POST['itemID']); } // loop array if (isset($_SESSION['card'])) { $print_count = count($_SESSION['card']); } else { $print_count = 0; } // card size $size = 2; // create AJAX request echo ''; echo ''; 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')); //mfc utility::jsAlert($msg); } else { // update print queue count object echo ''; utility::jsAlert(__('Selected items added to print queue')); } exit(); } // card pdf download if (isset($_GET['action']) AND $_GET['action'] == 'print') { // check if label session array is available if (!isset($_SESSION['card'])) { utility::jsAlert(__('There is no data to print!')); die(); } if (count($_SESSION['card']) < 1) { utility::jsAlert(__('There is no data to print!')); die(); } // concat all ID together $member_ids = ''; foreach ($_SESSION['card'] as $id) { $member_ids .= '\''.$id.'\','; } // strip the last comma $member_ids = substr_replace($member_ids, '', -1); // send query to database $member_q = $dbs->query('SELECT m.member_name, m.member_id, m.member_image, mt.member_type_name FROM member AS m LEFT JOIN mst_member_type AS mt ON m.member_type_id=mt.member_type_id WHERE m.member_id IN('.$member_ids.')'); $member_datas = array(); while ($member_d = $member_q->fetch_assoc()) { if ($member_d['member_id']) { $member_datas[] = $member_d; } } // include printed settings configuration file include 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; } // chunk cards array $chunked_card_arrays = array_chunk($member_datas, $card_items_per_row); // create html ouput $html_str = ''."\n"; $html_str .= '
';
$html_str .= ' ';
if (trim($card_header_text) != '') { $html_str .= ' ';
$html_str .= ''.$card_header_text.' '; }
$html_str .= '';
$html_str .= '';
$html_str .= ' ';
$html_str .= '';
$html_str .= ' ';
$html_str .= ''.( $card_include_field_label?__('Member ID').' : ':'' ).''.$card['member_id'].' ';
$html_str .= ''.( $card_include_field_label?__('Member Name').' : ':'' ).''.$card['member_name'].' ';
$html_str .= ''.( $card_include_field_label?__('Membership Type').' : ':'' ).''.$card['member_type_name'].' ';
$html_str .= '';
$html_str .= ' | ';
}
$html_str .= '