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_id member_name member_image member_type_id member_address member_mail_address member_email postal_code inst_name member_phone member_since_date register_date expire_date input_date */ $member_q = $dbs->query('SELECT m.member_name, m.member_id, m.member_image, m.member_address, m.member_email, m.inst_name, m.postal_code, m.pin, m.member_phone, m.expire_date, m.register_date, 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; } // load print settings from database to override value from printed_settings file loadPrintSettings($dbs, 'membercard'); // chunk cards array $chunked_card_arrays = array_chunk($member_datas, $sysconf['print']['membercard']['items_per_row']); // create html ouput $html_str = ''."\n"; $html_str .= '
';
$html_str .= ' ';
$html_str .= '';
$html_str .= '';
$html_str .= ' ';
$html_str .= ' ';
$html_str .= ''.$sysconf['print']['membercard']['front_header1_text'].''; $html_str .= ''.$sysconf['print']['membercard']['front_header2_text'].'';
$html_str .= ''.( $sysconf['print']['membercard']['include_id_label']?'':'').'';
$html_str .= ''.( $sysconf['print']['membercard']['include_name_label']?'':'').'';
$html_str .= ''.( $sysconf['print']['membercard']['include_pin_label']?'':'').'';
$html_str .= ''.( $sysconf['print']['membercard']['include_inst_label']?'':'').'';
$html_str .= ''.( $sysconf['print']['membercard']['include_inst_label']?'':'').'';
$html_str .= ''.( $sysconf['print']['membercard']['include_email_label']?'':'').'';
$html_str .= ''.( $sysconf['print']['membercard']['include_address_label']?'':'').'';
$html_str .= ''.( $sysconf['print']['membercard']['include_address_label']?'':'').'';
$html_str .= ' ';
$html_str .= 'Photo size: '.$sysconf['print']['membercard']['photo_width'].' X '.$sysconf['print']['membercard']['photo_height'].' cm ';
$html_str .= '';
$html_str .= '';
$html_str .= ' '.$sysconf['print']['membercard']['city'].', '.$card['register_date'].' '.$sysconf['print']['membercard']['title'].' '; $html_str .= ' '.$sysconf['print']['membercard']['officials'].' | ';
$html_str .= '';
$html_str .= ' ';
$html_str .= '';
$html_str .= '';
$html_str .= ' ';
$html_str .= '';
$html_str .= ' ';
$html_str .= ''.$sysconf['print']['membercard']['back_header1_text'].''; $html_str .= ''.$sysconf['print']['membercard']['back_header2_text'].''.$sysconf['print']['membercard']['rules'].' ';
$html_str .= ''.$sysconf['print']['membercard']['address'].' | ';
}
$html_str .= '