function visitOnLoan($member_id) { global $dbs; $now = date('Y-m-d'); // check if already checkin $query = $dbs->query('SELECT visitor_id FROM visitor_count WHERE member_id=\'' . $member_id . '\' AND checkin_date LIKE \'' . $now . '%\''); if ($query->num_rows < 1) { // get data $mquery = $dbs->query('SELECT member_name, inst_name FROM member WHERE member_id=\'' . $member_id . '\''); $mdata = $mquery->fetch_row(); $member_name = $mdata[0]; $institution = $mdata[1]; // insert visit $checkin_date = date('Y-m-d H:i:s'); $insert = $dbs->query("INSERT INTO visitor_count (member_id, member_name, institution, checkin_date) VALUES ('{$member_id}', '{$member_name}', '{$institution}', '{$checkin_date}')"); if (!$insert) { utility::jsAlert(__('ERROR! Can\'t insert visitor counter data')); return false; } } return true; }
// biblio author save proccess if (isset($_POST['save']) and (isset($_POST['biblioID']) or trim($_POST['search_str']))) { $author_name = trim($dbs->escape_string(strip_tags($_POST['search_str']))); // create new sql op object $sql_op = new simbio_dbop($dbs); // check if biblioID POST var exists if (isset($_POST['biblioID']) and !empty($_POST['biblioID'])) { $data['rel_biblio_id'] = intval($_POST['relBiblioID']); $data['biblio_id'] = intval($_POST['biblioID']); if ($sql_op->insert('biblio_relation', $data)) { echo '<script type="text/javascript">'; echo 'alert(\'' . __('Biblio relation succesfully updated!') . '\');'; echo 'parent.setIframeContent(\'biblioIframe\', \'' . MWB . 'bibliography/iframe_biblio_rel.php?biblioID=' . $data['biblio_id'] . '\');'; echo '</script>'; } else { utility::jsAlert(__('Biblio relation FAILED to Add. Please Contact System Administrator') . "\n" . $sql_op->error); } } else { if (isset($_POST['relBiblioID']) and !empty($_POST['relBiblioID'])) { // add to current session $_SESSION['biblioToBiblio'][$_POST['relBiblioID']] = array($_POST['relBiblioID']); echo '<script type="text/javascript">'; echo 'alert(\'' . __('Biblio relation added!') . '\');'; echo 'parent.setIframeContent(\'biblioIframe\', \'' . MWB . 'bibliography/iframe_biblio_rel.php\');'; echo '</script>'; } } } ?> <div class="popUpForm">
} $html_str .= '</table>' . "\n"; $html_str .= '<script type="text/javascript">self.print();</script>' . "\n"; $html_str .= '</body></html>' . "\n"; // unset the session unset($_SESSION['barcodes']); // write to file $print_file_name = 'item_barcode_gen_print_result_' . strtolower(str_replace(' ', '_', $_SESSION['uname'])) . '.html'; $file_write = @file_put_contents(FILES_UPLOAD_DIR . $print_file_name, $html_str); if ($file_write) { // update print queue count object echo '<script type="text/javascript">parent.$(\'#queueCount\').html(\'0\');</script>'; // open result in window echo '<script type="text/javascript">top.openHTMLpop(\'' . SENAYAN_WEB_ROOT_DIR . FILES_DIR . '/' . $print_file_name . '\', 800, 500, \'' . __('Item Barcodes Printing') . '\')</script>'; } else { utility::jsAlert('ERROR! Item barcodes failed to generate, possibly because ' . SENAYAN_BASE_DIR . FILES_DIR . ' directory is not writable'); } exit; } ?> <fieldset class="menuBox"> <div class="menuBoxInner printIcon"> <?php echo __('Item Barcodes Printing'); ?> - <a target="blindSubmit" href="<?php echo MODULES_WEB_ROOT_DIR; ?> bibliography/item_barcode_generator.php?action=print" class="notAJAX headerText2"><?php echo __('Print Barcodes for Selected Data'); ?>
$subject_type = strtolower(substr($subject['term_type'], 0, 1)); } } } $subject_id = getSubjectID($subject['term'], $subject_type, $subject_cache); @$dbs->query("INSERT IGNORE INTO biblio_topic (biblio_id, topic_id, level) VALUES ({$biblio_id}, {$subject_id}, 1)"); } } if ($biblio_id) { // write to logs utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'bibliography', $_SESSION['realname'] . ' insert bibliographic data from P2P service (server:' . $p2pserver . ') with (' . $biblio['title'] . ') and biblio_id (' . $biblio_id . ')'); $r++; } } } utility::jsAlert($r . ' records inserted to database.'); echo '<script type="text/javascript">parent.$(\'#mainContent\').simbioAJAX(\'' . $_SERVER['PHP_SELF'] . '\');</script>'; exit; } /* RECORD OPERATION END */ /* SEARCH OPERATION */ if (isset($_GET['keywords']) && $can_read && isset($_GET['p2pserver'])) { $max_fetch = 20; # get server information $serverid = (int) $_GET['p2pserver']; $p2pserver = $sysconf['p2pserver'][$serverid]['uri']; $p2pserver_name = $sysconf['p2pserver'][$serverid]['name']; # get keywords $keywords = urlencode($_GET['keywords']); # $p2pquery = $p2pserver.'index.php?resultXML=true&keywords='.$_GET['keywords']; $data = modsXMLsenayan($p2pserver . "/index.php?resultXML=true&search=Search&keywords=" . $keywords, 'uri');
// make an array $_POST['itemID'] = array((int) $_POST['itemID']); } // loop array foreach ($_POST['itemID'] as $itemID) { $itemID = (int) $itemID; if (!$sql_op->delete('mst_author', 'author_id=' . $itemID)) { $error_num++; } } // error alerting if ($error_num == 0) { utility::jsAlert(lang_mod_masterfile_author_alert_all_delete_ok); echo '<script type="text/javascript">parent.setContent(\'mainContent\', \'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\', \'post\');</script>'; } else { utility::jsAlert(lang_mod_masterfile_author_alert_all_delete_fail); echo '<script type="text/javascript">parent.setContent(\'mainContent\', \'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\', \'post\');</script>'; } exit; } } /* RECORD OPERATION END */ /* search form */ ?> <fieldset class="menuBox"> <div class="menuBoxInner masterFileIcon"> <?php echo strtoupper(lang_mod_masterfile_author); ?> - <a href="#" onclick="setContent('mainContent', '<?php echo MODULES_WEB_ROOT_DIR;
require SIMBIO . 'simbio_GUI/form_maker/simbio_form_table_AJAX.inc.php'; require SIMBIO . 'simbio_GUI/table/simbio_table.inc.php'; require SIMBIO . 'simbio_DB/simbio_dbop.inc.php'; // privileges checking $can_write = utility::havePrivilege('bibliography', 'w'); if (!$can_write) { die('<div class="errorBox">' . __('You are not authorized to view this section') . '</div>'); } $succces_msg = 'Pattern Saved!'; $failed_msg = 'Pattern Saved Failed!'; if (isset($_POST['saveData'])) { $prefix = trim($dbs->escape_string(strip_tags($_POST['prefix']))); $suffix = trim($dbs->escape_string(strip_tags($_POST['suffix']))); $length_serial = trim($dbs->escape_string(strip_tags($_POST['length_serial']))); if ($length_serial <= 2) { utility::jsAlert('Please, fill length serial number more than 2'); } else { // get database setting $patterns = array(); $zeros = ''; for ($i = 0; $i < $length_serial; $i++) { $zeros .= '0'; } $patterns[] = $prefix . $zeros . $suffix; // get pattern from database $pattern_q = $dbs->query('SELECT setting_value FROM setting WHERE setting_name = \'batch_item_code_pattern\''); if (!$dbs->errno) { $pattern_d = $pattern_q->fetch_row(); $val = @unserialize($pattern_d[0]); if (!empty($val)) { foreach ($val as $v) {
echo '<tr>'; echo '<td class="' . $cellClass . '">' . $error_log_d[0] . '</td><td class="' . $cellClass . '">' . $error_log_d[1] . '</td>'; echo '</tr>'; } echo '</table>'; unset($error_log_q); } echo '</html>'; $html_str = ob_get_clean(); // put html to file $file_write = @file_put_contents(REPORT_FILE_BASE_DIR . $stk_take_report_filename, $html_str); if ($file_write) { // open result in new window echo '<script type="text/javascript">parent.openWin(\'' . SENAYAN_WEB_ROOT_DIR . '/' . FILES_DIR . '/' . REPORT_DIR . '/' . $stk_take_report_filename . '\', \'popMemberReport\', 800, 500, true)</script>'; } else { utility::jsAlert('ERROR! Stock take report failed to generate, possibly because ' . REPORT_FILE_BASE_DIR . ' directory is not writable'); } // update $update_st_q = $dbs->query("UPDATE stock_take SET report_file='{$stk_take_report_filename}' WHERE is_active=1"); // set currently active stock take process to unactive $inactive_q = $dbs->query('UPDATE stock_take SET is_active=0'); // clean all current stock take error log $error_log_q = $dbs->query('DELETE FROM system_log WHERE log_location=\'stock_take\' AND log_msg LIKE \'Stock Take ERROR%\''); // write log utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'stock_take', $_SESSION['realname'] . ' finish stock take (' . $stk_take_d[0] . ') from address ' . $_SERVER['REMOTE_ADDR']); // send an alert echo '<script type="text/javascript">'; echo 'alert(\'' . __('Stock Take Proccess Finished!') . '\');'; echo 'parent.location.href = \'' . SENAYAN_WEB_ROOT_DIR . 'admin/index.php?mod=stock_take\';'; echo '</script>'; }
// set PHP time limit set_time_limit(7200); // set ob implicit flush ob_implicit_flush(); // create upload object $upload = new simbio_file_upload(); // get system temporary directory location $temp_dir = sys_get_temp_dir(); // set max size $max_size = $sysconf['max_upload'] * 1024; $upload->setAllowableFormat(array('.csv')); $upload->setMaxSize($max_size); $upload->setUploadDir($temp_dir); $upload_status = $upload->doUpload('importFile'); if ($upload_status != UPLOAD_SUCCESS) { utility::jsAlert(__('Upload failed! File type not allowed or the size is more than') . ' ' . $sysconf['max_upload'] / 1024 . ' MB'); //mfc exit; } // uploaded file path $uploaded_file = $temp_dir . DIRECTORY_SEPARATOR . $_FILES['importFile']['name']; $row_count = 0; // check for import setting $record_num = intval($_POST['recordNum']); $field_enc = trim($_POST['fieldEnc']); $field_sep = trim($_POST['fieldSep']); $record_offset = intval($_POST['recordOffset']); $record_offset = $record_offset - 1; // get current datetime $curr_datetime = date('Y-m-d H:i:s'); $curr_datetime = '\'' . $curr_datetime . '\'';
// update data for item being loan $update_q = $dbs->query("UPDATE stock_take_item SET status='l' WHERE item_code IN (SELECT item_code FROM loan AS l WHERE is_lent=1 AND is_return=0)"); // total rows inserted $total_rows_q = $dbs->query("SELECT COUNT(item_code) FROM stock_take_item WHERE status='m'"); $total_rows_d = $total_rows_q->fetch_row(); if ($total_rows_d[0] > 0) { // update total_lost_item field value in stock_take table $update_total_q = $dbs->query('UPDATE stock_take SET total_item_stock_taked=' . $total_rows_d[0] . ', total_item_loan=' . $item_loan_d[0] . ', total_item_lost=' . $total_rows_d[0] . ", stock_take_users='" . $_SESSION['realname'] . "\n' WHERE stock_take_id={$stock_take_id}"); // write log utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'stock_take', $_SESSION['realname'] . ' initialize stock take (' . $data['stock_take_name'] . ') from address ' . $_SERVER['REMOTE_ADDR']); utility::jsAlert(__('Stock Taking Initialized')); echo '<script type="text/javascript">parent.location.href = \'' . SENAYAN_WEB_ROOT_DIR . 'admin/index.php?mod=stock_take\';</script>'; } else { // delete stock take data $dbs->query('DELETE FROM stock_take WHERE stock_take_id=' . $stock_take_id); utility::jsAlert(__('Stock Taking FAILED to Initialized.\\nNo item to stock take!')); } exit; } } } // create new instance $form = new simbio_form_table('mainForm', $_SERVER['PHP_SELF'] . '?action=new', 'post'); $form->submit_button_attr = 'name="saveData" value="' . __('Initialize Stock Take') . '" class="button"'; // form table attributes $form->table_attr = 'align="center" class="dataList" cellpadding="5" cellspacing="0"'; $form->table_header_attr = 'class="alterCell" style="font-weight: bold;"'; $form->table_content_attr = 'class="alterCell2"'; /* Form Element(s) */ // stock take name $form->addTextField('text', 'name', __('Stock Take Name') . '*', '', 'style="width: 60%;"');
} if ($still_on_loan) { $items = ''; foreach ($still_on_loan as $item) { $items .= $item . "\n"; } utility::jsAlert(__('Item data can not be deleted because still on hold by members') . " : \n" . $items); echo '<script type="text/javascript">parent.$(\'#mainContent\').simbioAJAX(\'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\');</script>'; exit; } // error alerting if ($error_num == 0) { utility::jsAlert(__('Item succesfully removed!')); echo '<script type="text/javascript">parent.$(\'#mainContent\').simbioAJAX(\'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\');</script>'; } else { utility::jsAlert(__('Item FAILED to removed!')); echo '<script type="text/javascript">parent.$(\'#mainContent\').simbioAJAX(\'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\');</script>'; } exit; } } /* RECORD OPERATION END */ if (!$in_pop_up) { /* search form */ ?> <fieldset class="menuBox"> <div class="menuBoxInner itemIcon"> <?php echo strtoupper(__('Items')); ?> <hr />
$html_str .= '.alterCell2 {border-bottom: 1px solid #666666; background-color: #FFFFFF;}' . "\n"; $html_str .= '</style>' . "\n"; $html_str .= '</head>'; $html_str .= '<body>' . "\n"; $html_str .= '<h3>' . $sysconf['library_name'] . ' - ' . __('Collection Statistic Report') . '</h3>'; $html_str .= '<hr size="1" />'; $html_str .= $table->printTable(); $html_str .= '<script type="text/javascript">self.print();</script>' . "\n"; $html_str .= '</body></html>'; // write to file $file_write = @file_put_contents(REPBS . 'biblio_stat_print_result.html', $html_str); if ($file_write) { // open result in new window echo '<script type="text/javascript">top.$.colorbox({href: "' . SWB . FLS . '/' . REP . '/biblio_stat_print_result.html", height: 800, width: 500})</script>'; } else { utility::jsAlert('ERROR! Loan statistic report failed to generate, possibly because ' . REPBS . ' directory is not writable'); } exit; } ?> <fieldset class="menuBox"> <div class="menuBoxInner statisticIcon"> <div class="per_title"> <h2><?php echo __('Collection Statistic'); ?> </h2> </div> <div class="infoBox"> <form name="printForm" action="<?php echo $_SERVER['PHP_SELF'];
$biblioID = $biblio_d[0]; // loop array foreach ($_POST['itemID'] as $itemID) { $itemID = (int) $itemID; if (!$sql_op->delete('serial', 'serial_id=' . $itemID)) { $error_num++; } else { // also delete kardex data $sql_op->delete('kardex', 'serial_id=' . $itemID); } } // error alerting if ($error_num == 0) { utility::jsAlert(__('Subscription data successfully deleted')); } else { utility::jsAlert(__('Subscription data FAILED to deleted!')); } } } /* RECORD OPERATION END */ // start the output buffering ob_start(); /* main content */ if ($can_write and (isset($_POST['detail']) or isset($_GET['action']) and $_GET['action'] == 'detail')) { /* RECORD FORM */ $itemID = (int) isset($_POST['itemID']) ? $_POST['itemID'] : 0; $rec_q = $dbs->query('SELECT * FROM serial WHERE serial_id=' . $itemID); $rec_d = $rec_q->fetch_assoc(); // create new instance $form = new simbio_form_table('mainForm', $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'], 'post'); $form->submit_button_attr = 'name="saveData" value="' . __('Save') . '" class="button"';
// set PHP time limit set_time_limit(7200); // set ob implicit flush ob_implicit_flush(); // create upload object $upload = new simbio_file_upload(); // get system temporary directory location $temp_dir = sys_get_temp_dir(); // set max size $max_size = $sysconf['max_upload'] * 1024; $upload->setAllowableFormat(array('.csv')); $upload->setMaxSize($max_size); $upload->setUploadDir($temp_dir); $upload_status = $upload->doUpload('importFile'); if ($upload_status != UPLOAD_SUCCESS) { utility::jsAlert(lang_mod_member_import_alert_fail . ' ' . $sysconf['max_upload'] / 1024 . ' MB'); exit; } // uploaded file path $uploaded_file = $temp_dir . DIRECTORY_SEPARATOR . $_FILES['importFile']['name']; $row_count = 0; // check for import setting $record_num = intval($_POST['recordNum']); $field_enc = trim($_POST['fieldEnc']); $field_sep = trim($_POST['fieldSep']); $record_offset = intval($_POST['recordOffset']); $record_offset = $record_offset - 1; // get current datetime $curr_datetime = date('Y-m-d H:i:s'); $curr_datetime = '\'' . $curr_datetime . '\''; // foreign key id cache
} } $subject_id = getSubjectID($subject['term'], $subject_type, $subject_cache); @$dbs->query("INSERT IGNORE INTO biblio_topic (biblio_id, topic_id, level) VALUES ({$biblio_id}, {$subject_id}, 1)"); } } if ($biblio_id) { // write to logs utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'bibliography', $_SESSION['realname'] . ' insert bibliographic data from P2P service (server:' . $p2pserver . ') with (' . $biblio['title'] . ') and biblio_id (' . $biblio_id . ')'); $r++; } } } // destroy result Z3950 session unset($_SESSION['z3950result']); utility::jsAlert(str_replace('{recordCount}', $r, __('{recordCount} records inserted into the database.'))); echo '<script type="text/javascript">parent.$(\'#mainContent\').simbioAJAX(\'' . $_SERVER['PHP_SELF'] . '\');</script>'; exit; } /* RECORD OPERATION END */ /* SEARCH OPERATION */ if (isset($_GET['keywords']) and $can_read) { require LIB . 'modsxmlslims.inc.php'; $_SESSION['z3950result'] = array(); if ($_GET['index'] != 0) { $index = trim($_GET['index']) . ' any '; $keywords = urlencode($index . '"' . trim($_GET['keywords'] . '"')); } else { $keywords = urlencode('"' . trim($_GET['keywords']) . '"'); } $query = '';
$xml_result = $_POST['enable_xml_result'] == '1' ? true : false; $dbs->query('UPDATE setting SET setting_value=\'' . $dbs->escape_string(serialize($xml_result)) . '\' WHERE setting_name=\'enable_xml_result\''); // file download $file_download = $_POST['allow_file_download'] == '1' ? true : false; $dbs->query('UPDATE setting SET setting_value=\'' . $dbs->escape_string(serialize($file_download)) . '\' WHERE setting_name=\'allow_file_download\''); // session timeout $session_timeout = intval($_POST['session_timeout']) >= 1800 ? $_POST['session_timeout'] : 1800; $dbs->query('UPDATE setting SET setting_value=\'' . $dbs->escape_string(serialize($session_timeout)) . '\' WHERE setting_name=\'session_timeout\''); // barcode encoding $dbs->query('UPDATE setting SET setting_value=\'' . $dbs->escape_string(serialize($_POST['barcode_encoding'])) . '\' WHERE setting_name=\'barcode_encoding\''); // spellchecker $spellchecker_enabled = $_POST['spellchecker_enabled'] == '1' ? true : false; $dbs->query('REPLACE INTO setting (setting_value, setting_name) VALUES (\'' . serialize($spellchecker_enabled) . '\', \'spellchecker_enabled\')'); // write log utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'system', $_SESSION['realname'] . ' change application global configuration'); utility::jsAlert(__('Settings saved. Refreshing page')); echo '<script type="text/javascript">top.location.href = \'' . AWB . 'index.php?mod=system\';</script>'; exit; } /* Config Vars update process end */ // create new instance $form = new simbio_form_table_AJAX('mainForm', $_SERVER['PHP_SELF'], 'post'); $form->submit_button_attr = 'name="updateData" value="' . __('Save Settings') . '" class="btn btn-default"'; // form table attributes $form->table_attr = 'align="center" id="dataList" cellpadding="5" cellspacing="0"'; $form->table_header_attr = 'class="alterCell" style="font-weight: bold;"'; $form->table_content_attr = 'class="alterCell2"'; // load settings from database utility::loadSettings($dbs); // version status $form->addAnything('Senayan Version', '<strong>' . SENAYAN_VERSION . '</strong>');
// insert $save = $sql_op->insert('mst_voc_ctrl', $data); } if (isset($_POST['delete'])) { # create new sql op object $save = $sql_op->delete('mst_voc_ctrl', 'vocabolary_id=' . $_POST['vocabolary_id']); } if ($save) { $alert_save = '<script type="text/javascript">'; $alert_save .= 'alert(\'' . __('Data saved!') . '\');'; $alert_save .= 'parent.setIframeContent(\'itemIframe\', \'' . MWB . 'master_file/iframe_vocabolary_control.php?itemID=' . $data['topic_id'] . '\');'; $alert_save .= 'top.jQuery.colorbox.close();'; $alert_save .= '</script>'; echo $alert_save; } else { utility::jsAlert('Failed save data!'); } } // start buffer ob_start(); // query scope $scope_q = $dbs->query('SELECT scope, vocabolary_id FROM mst_voc_ctrl WHERE topic_id=' . $itemID . ' AND scope IS NOT NULL'); $scope_d = $scope_q->fetch_row(); $page_title = 'Scope Note Vocabulary'; ?> <h1><?php echo $page_title; ?> </h1> <form name="scopeForm" action="<?php echo $_SERVER['PHP_SELF'];
if (!is_array($_POST['itemID'])) { // make an array $_POST['itemID'] = array((int) $_POST['itemID']); } // loop array foreach ($_POST['itemID'] as $itemID) { $itemID = (int) $itemID; if (!$sql_op->delete('fines', 'fines_id=' . $itemID)) { $error_num++; } } // error alerting if ($error_num == 0) { utility::jsAlert('Fines data succesfully deleted!'); } else { utility::jsAlert('Fines data FAILED to delete!'); } } } /* RECORD OPERATION END */ /* header */ ?> <div class="sub_section"> <div class="btn-group"> <a href="fines_list.php?action=detail" class="btn btn-default" style="color: #FF0000;"><i class="glyphicon glyphicon-plus"></i> <?php echo __('Add New Fines'); ?> </a> <a href="fines_list.php" class="btn btn-default"><i class="glyphicon glyphicon-list-alt"></i> <?php echo __('Fines List'); ?>
// make an array $_POST['itemID'] = array((int) $_POST['itemID']); } // loop array foreach ($_POST['itemID'] as $itemID) { $itemID = (int) $itemID; if (!$sql_op->delete('mst_frequency', 'frequency_id=' . $itemID)) { $error_num++; } } // error alerting if ($error_num == 0) { utility::jsAlert(lang_mod_masterfile_frequency_alert_all_delete_ok); echo '<script type="text/javascript">parent.setContent(\'mainContent\', \'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\', \'post\');</script>'; } else { utility::jsAlert(lang_mod_masterfile_frequency_alert_all_delete_fail); echo '<script type="text/javascript">parent.setContent(\'mainContent\', \'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\', \'post\');</script>'; } exit; } } /* RECORD OPERATION END */ /* search form */ ?> <fieldset class="menuBox"> <div class="menuBoxInner masterFileIcon"> <?php echo strtoupper(lang_mod_masterfile_frequency); ?> - <a href="#" onclick="setContent('mainContent', '<?php echo MODULES_WEB_ROOT_DIR;
header('Content-Disposition: attachment; filename="senayan_item_export.csv"'); while ($item_d = $all_data_q->fetch_row()) { $buffer = null; foreach ($item_d as $idx => $fld_d) { $fld_d = $dbs->escape_string($fld_d); // data $buffer .= stripslashes($encloser . $fld_d . $encloser); // field separator $buffer .= $sep; } echo substr_replace($buffer, '', -1); echo $rec_sep; } exit; } else { utility::jsAlert(__('There is no record in item database yet, Export FAILED!')); } } } exit; } ?> <fieldset class="menuBox"> <div class="menuBoxInner exportIcon"> <div class="per_title"> <h2><?php echo __('Item Export Tool'); ?> </h2> </div> <div class="infoBox">
$buffer = null; foreach ($member_data as $fld_data) { $fld_data = $dbs->escape_string($fld_data); // data $buffer .= $encloser . $fld_data . $encloser; // field separator $buffer .= $sep; } // remove the last field separator $buffer = substr_replace($buffer, '', -1); echo $buffer; echo $rec_sep; } exit; } else { utility::jsAlert(__('There is no record in membership database yet, Export FAILED!')); } } } exit; } ?> <fieldset class="menuBox"> <div class="menuBoxInner exportIcon"> <?php echo strtoupper(__('Export Data')) . '<hr />' . __('Export member(s) data to CSV file'); ?> </div> </fieldset> <?php // create new instance
// topics $topics = getValues($dbs, 'SELECT t.topic FROM biblio_topic AS bt LEFT JOIN mst_topic AS t ON bt.topic_id=t.topic_id WHERE bt.biblio_id=' . $biblio_d[0]); $buffer .= $encloser . $topics . $encloser; $buffer .= $sep; // item code $items = getValues($dbs, 'SELECT item_code FROM item AS i WHERE i.biblio_id=' . $biblio_d[0]); $buffer .= $encloser . $items . $encloser; echo $buffer; echo $rec_sep; } exit; } else { utility::jsAlert(__('There is no record in bibliographic database yet, Export FAILED!')); } } } exit; } ?> <fieldset class="menuBox"> <div class="menuBoxInner exportIcon"> <?php echo __('EXPORT TOOL'); ?> <hr /> <?php echo __('Export bibliographics data to CSV file'); ?>
} $html_str .= '</table>' . "\n"; $html_str .= '<script type="text/javascript">self.print();</script>' . "\n"; $html_str .= '</body></html>' . "\n"; // unset the session unset($_SESSION['card']); // write to file $print_file_name = 'member_card_gen_print_result_' . strtolower(str_replace(' ', '_', $_SESSION['uname'])) . '.html'; $file_write = @file_put_contents(UPLOAD . $print_file_name, $html_str); if ($file_write) { // update print queue count object echo '<script type="text/javascript">parent.$(\'#queueCount\').html(\'0\');</script>'; // open result in window echo '<script type="text/javascript">top.jQuery.colorbox({href: "' . SWB . FLS . '/' . $print_file_name . '", iframe: true, width: 800, height: 500, title: "' . __('Member Card Printing') . '"})</script>'; } else { utility::jsAlert('ERROR! Cards failed to generate, possibly because ' . SB . FLS . ' directory is not writable'); } exit; } ?> <fieldset class="menuBox"> <div class="menuBoxInner printIcon"> <div class="per_title"> <h2><?php echo __('Member Card Printing'); ?> </h2> </div> <div class="sub_section"> <div class="btn-group"> <a target="blindSubmit" href="<?php
$html_str .= '.alterCell2 {border-bottom: 1px solid #666666; background-color: #FFFFFF;}' . "\n"; $html_str .= '</style>' . "\n"; $html_str .= '</head>'; $html_str .= '<body>' . "\n"; $html_str .= '<h3>' . $sysconf['library_name'] . ' - ' . __('Membership Report') . '</h3>'; $html_str .= '<hr size="1" />' . "\n"; $html_str .= $table->printTable(); $html_str .= '<script type="text/javascript">self.print();</script>' . "\n"; $html_str .= '</body></html>' . "\n"; // write to file $file_write = @file_put_contents(REPORT_FILE_BASE_DIR . 'member_stat_print_result.html', $html_str); if ($file_write) { // open result in new window echo '<script type="text/javascript">parent.openWin(\'' . SENAYAN_WEB_ROOT_DIR . '/' . FILES_DIR . '/' . REPORT_DIR . '/member_stat_print_result.html\', \'popMemberReport\', 800, 500, true)</script>'; } else { utility::jsAlert('ERROR! Membership statistic report failed to generate, possibly because ' . REPORT_FILE_BASE_DIR . ' directory is not writable'); } exit; } ?> <fieldset class="menuBox"> <div class="menuBoxInner statisticIcon"> <?php echo strtoupper(__('Membership Report')); ?> <hr /> <form name="printForm" action="<?php echo $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING']; ?> " target="submitPrint" id="printForm" method="get" style="display: inline;"> <input type="hidden" name="print" value="true" /><input type="submit" value="<?php
$author_data['input_date'] = date('Y-m-d'); $author_data['last_update'] = date('Y-m-d'); // insert new author to author master table @$sql_op->insert('mst_author', $author_data); $data['author_id'] = $sql_op->insert_id; } } } $data['level'] = intval($_POST['level']); if ($sql_op->insert('biblio_author', $data)) { echo '<script type="text/javascript">'; echo 'alert(\'' . __('Author succesfully updated!') . '\');'; echo 'parent.setIframeContent(\'authorIframe\', \'' . MODULES_WEB_ROOT_DIR . 'bibliography/iframe_author.php?biblioID=' . $data['biblio_id'] . '\');'; echo '</script>'; } else { utility::jsAlert(__('Author FAILED to Add. Please Contact System Administrator') . "\n" . $sql_op->error); } } else { if (isset($_POST['authorID']) and !empty($_POST['authorID'])) { // add to current session $_SESSION['biblioAuthor'][$_POST['authorID']] = array($_POST['authorID'], intval($_POST['level'])); } else { if ($author_name and empty($_POST['authorID'])) { // check author $author_id = checkAuthor($author_name); if ($author_id !== false) { $last_id = $author_id; } else { // adding new author $data['author_name'] = $author_name; $data['authority_type'] = $_POST['type'];
if ($update1) { echo '<script type="text/javascript">'; echo 'alert(\'' . __('File Attachment data updated!') . '\');'; echo 'parent.setIframeContent(\'attachIframe\', \'' . MODULES_WEB_ROOT_DIR . 'bibliography/iframe_attach.php?biblioID=' . $updateBiblioID . '\');'; echo '</script>'; } else { utility::jsAlert('' . __('File Attachment data FAILED to update!') . '' . "\n" . $sql_op->error); } } else { if ($sql_op->insert('biblio_attachment', $data)) { echo '<script type="text/javascript">'; echo 'alert(\'' . __('File Attachment uploaded succesfully!') . '\');'; echo 'parent.setIframeContent(\'attachIframe\', \'' . MODULES_WEB_ROOT_DIR . 'bibliography/iframe_attach.php?biblioID=' . $data['biblio_id'] . '\');'; echo '</script>'; } else { utility::jsAlert('' . __('File Attachment data FAILED to save!') . '' . "\n" . $sql_op->error); } } utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'bibliography', $_SESSION['realname'] . ' updating file attachment data'); } else { if ($uploaded_file_id) { // add to session array $fdata['file_id'] = $uploaded_file_id; $fdata['access_type'] = trim($_POST['accessType']); $_SESSION['biblioAttach'][$uploaded_file_id] = $fdata; echo '<script type="text/javascript">'; echo 'alert(\'' . __('File Attachment uploaded succesfully!') . '\');'; echo 'parent.setIframeContent(\'attachIframe\', \'' . MODULES_WEB_ROOT_DIR . 'bibliography/iframe_attach.php\');'; echo '</script>'; } }
} // log data save action if (isset($_POST['saveLogs']) and $can_write and $_SESSION['uid'] == 1) { $logs = $dbs->query('SELECT log_date, log_location, log_msg FROM system_log ORDER BY log_date DESC'); header('Content-Type: text/plain'); header('Content-Disposition: attachment; filename="system_logs_' . date('Ymd') . '.log"'); echo 'SENAYAN system logs record' . "\n"; while ($logs_d = $logs->fetch_row()) { echo '[' . $logs_d[0] . ']---' . $logs_d[1] . '---' . $logs_d[2] . "\n"; } exit; } // log data clearance action if (isset($_POST['clearLogs']) and $can_write and $_SESSION['uid'] == 1) { $dbs->query('TRUNCATE TABLE system_log'); utility::jsAlert(__('System Log data completely cleared!')); echo '<script type="text/javascript">parent.$(\'#mainContent\').simbioAJAX(\'' . MWB . 'system/sys_log.php\');</script>'; exit; } /* search form */ ?> <fieldset class="menuBox"> <div class="menuBoxInner syslogIcon"> <div class="per_title"> <h2><?php echo __('System Log'); ?> </h2> </div> <div class="sub_section"> <?php
$serialID = 0; if (isset($_GET['serialID'])) { $serialID = (int) $_GET['serialID']; } if (isset($_POST['serialID'])) { $serialID = (int) $_POST['serialID']; } // start content buffering ob_start(); $serial = new serial($dbs, $serialID); if (isset($_POST['saveKardexes'])) { // save kardexes $serial->saveKardexes(); utility::jsAlert(__('Kardex data updated!')); } else { if (isset($_POST['remove'])) { // remove kardex $removeID = (int) $_POST['remove']; $removed = $serial->deleteKardex($removeID); if ($removed) { utility::jsAlert(__('Kardex data deleted!')); } } } // view kardexes list echo $serial->viewKardexes(); $content = ob_get_clean(); // js include $js = '<script type="text/javascript" src="' . JS_WEB_ROOT_DIR . 'calendar.js"></script>'; // include the page template require SENAYAN_BASE_DIR . '/admin/' . $sysconf['admin_template']['dir'] . '/notemplate_page_tpl.php';
$topic_data['last_update'] = date('Y-m-d'); // insert new topic to topic master table $sql_op->insert('mst_topic', $topic_data); // put last inserted ID $data['topic_id'] = $sql_op->insert_id; } } } $data['level'] = intval($_POST['level']); if ($sql_op->insert('biblio_topic', $data)) { echo '<script type="text/javascript">'; echo 'alert(\'Topic succesfully updated!\');'; echo 'opener.setIframeContent(\'topicIframe\', \'' . MODULES_WEB_ROOT_DIR . 'bibliography/iframe_topic.php?biblioID=' . $data['biblio_id'] . '\');'; echo '</script>'; } else { utility::jsAlert(lang_mod_biblio_topic_added_fail . "\n" . $sql_op->error); } } else { if (!empty($_POST['topicID'])) { // add to current session $_SESSION['biblioTopic'][$_POST['topicID']] = array($_POST['topicID'], intval($_POST['level'])); } else { if ($subject and empty($_POST['topicID'])) { // check subject $subject_id = checkSubject($subject); if ($subject_id !== false) { $last_id = $subject_id; } else { // adding new topic $topic_data['topic'] = $subject; $topic_data['topic_type'] = $_POST['type'];
// make an array $_POST['itemID'] = array((int) $_POST['itemID']); } // loop array foreach ($_POST['itemID'] as $itemID) { $itemID = (int) $itemID; if (!$sql_op->delete('mst_gmd', 'gmd_id=' . $itemID)) { $error_num++; } } // error alerting if ($error_num == 0) { utility::jsAlert(__('All Data Successfully Deleted')); echo '<script type="text/javascript">parent.jQuery(\'#mainContent\').simbioAJAX(\'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\');</script>'; } else { utility::jsAlert(__('Some or All Data NOT deleted successfully!\\nPlease contact system administrator')); echo '<script type="text/javascript">parent.jQuery(\'#mainContent\').simbioAJAX(\'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\');</script>'; } exit; } } /* RECORD OPERATION END */ /* search form */ ?> <fieldset class="menuBox"> <div class="menuBoxInner masterFileIcon"> <?php echo strtoupper(__('GMD')); ?> - <a href="<?php echo MODULES_WEB_ROOT_DIR;
// get content data $content_q = $dbs->query('SELECT content_title FROM content WHERE content_id=' . $itemID); $content_d = $content_q->fetch_row(); if (!$sql_op->delete('content', "content_id='{$itemID}'")) { $error_num++; } else { // write log utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'system', $_SESSION['realname'] . ' DELETE content (' . $content_d[0] . ')'); } } // error alerting if ($error_num == 0) { utility::jsAlert(lang_sys_conf_module_common_alert_delete_success); echo '<script type="text/javascript">parent.setContent(\'mainContent\', \'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\', \'post\');</script>'; } else { utility::jsAlert(lang_sys_conf_module_common_alert_delete_fail); echo '<script type="text/javascript">parent.setContent(\'mainContent\', \'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\', \'post\');</script>'; } exit; } } /* RECORD OPERATION END */ /* search form */ ?> <fieldset class="menuBox"> <div class="menuBoxInner systemIcon"> <?php echo strtoupper(lang_sys_content); ?> - <a href="#" onclick="setContent('mainContent', '<?php echo MODULES_WEB_ROOT_DIR;