本文整理汇总了PHP中utility::writeLogs方法的典型用法代码示例。如果您正苦于以下问题:PHP utility::writeLogs方法的具体用法?PHP utility::writeLogs怎么用?PHP utility::writeLogs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utility
的用法示例。
在下文中一共展示了utility::writeLogs方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: substr_replace
}
// remove last comma
$item_sql = substr_replace($item_sql, '', -1);
// execute query
$dbs->query($item_sql);
}
} else {
$cnt_sql_error++;
}
}
}
// close file handle
fclose($file);
$end_time = time();
$import_time_sec = $end_time - $start_time;
utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'bibliography', 'Importing ' . $cnt_insert . ' bibliographic records from file : ' . $_FILES['importFile']['name']);
$msg = "";
$msg .= "<strong>" . $row_count . "</strong> " . __("record(s) in file. Start processing from record") . " <strong>" . $record_offset . " " . __("in") . " " . $import_time_sec . " " . __("second(s)") . "</strong><br>";
$msg .= "<strong>" . $cnt_record_ignore . "</strong> " . __("record(s) ignored") . ", ";
$msg .= "<strong>" . $cnt_insert . "</strong> " . __("record(s) inserted") . ", ";
$msg .= "<strong>" . $cnt_update . "</strong> " . __("record(s) updated") . " " . __("having") . " " . "<strong>" . $cnt_sql_error . "</strong> " . __("record(s) with sql error");
echo '<script type="text/javascript">' . "\n";
// echo 'parent.$(\'importInfo\').update(\'<strong>'.$cnt_insert.'</strong> records inserted or updated successfully to bibliographic database, from record <strong>'.$_POST['recordOffset'].' in '.$import_time_sec.' second(s)</strong>\');'."\n";
echo 'parent.$(\'importInfo\').update(\'' . $msg . '\');' . "\n";
echo 'parent.$(\'importInfo\').setStyle( {display: \'block\'} );' . "\n";
echo '</script>';
exit;
}
}
}
?>
示例2: array
$error_num = 0;
if (!is_array($_POST['itemID'])) {
// make an array
$_POST['itemID'] = array((int) $_POST['itemID']);
}
// loop array
foreach ($_POST['itemID'] as $itemID) {
$itemID = (int) $itemID;
// 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(__('All Data Successfully Deleted'));
echo '<script type="text/javascript">parent.setContent(\'mainContent\', \'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\', \'post\');</script>';
} else {
utility::jsAlert(__('Some or All Data NOT deleted successfully!\\nPlease contact system administrator'));
echo '<script type="text/javascript">parent.setContent(\'mainContent\', \'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\', \'post\');</script>';
}
exit;
}
}
/* RECORD OPERATION END */
/* search form */
示例3: array
$_POST['itemID'] = array((int) $_POST['itemID']);
}
// loop array
foreach ($_POST['itemID'] as $itemID) {
$itemID = (int) $itemID;
// get group data
$group_q = $dbs->query('SELECT group_name FROM user_group WHERE group_id=' . $itemID);
$group_d = $group_q->fetch_row();
if (!$sql_op->delete('user_group', 'group_id=' . $itemID)) {
$error_num++;
} else {
// also delete all records related to this data
// delete group privileges
$dbs->query('DELETE FROM group_access WHERE group_id=' . $itemID);
// write log
utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'system', $_SESSION['realname'] . ' DELETE group (' . $group_d[0] . ')');
}
}
// error alerting
if ($error_num == 0) {
utility::jsAlert(__('All Data Successfully Deleted'));
echo '<script type="text/javascript">parent.setContent(\'mainContent\', \'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\', \'post\');</script>';
} else {
utility::jsAlert(__('Some or All Data NOT deleted successfully!\\nPlease contact system administrator'));
echo '<script type="text/javascript">parent.setContent(\'mainContent\', \'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\', \'post\');</script>';
}
exit;
}
}
/* RECORD OPERATION END */
/* search form */
示例4: foreach
foreach ($data['subjects'] as $subject) {
$subject['auth_list'] = $subject['auth_list'] ? "'" . $subject['auth_list'] . "'" : 'NULL';
@$dbs->query('INSERT IGNORE INTO mst_topic (topic,topic_type,auth_list,input_date,last_update)
VALUES (\'' . $subject['name'] . '\', \'' . $subject['type'] . '\', ' . $subject['auth_list'] . ', \'' . $curr_date . '\', \'' . $curr_date . '\')');
$subject['name'] = $dbs->escape_string(trim($subject['name']));
$subject_id = utility::getID($dbs, 'mst_topic', 'topic_id', 'topic', $subject['name'], $cache_subject);
$biblio_subject_sql .= " ({$biblio_id}, {$subject_id}, " . $subject['level'] . "),";
}
// remove last comma
$biblio_subject_sql = substr_replace($biblio_subject_sql, '', -1);
// execute query
$dbs->query($biblio_subject_sql);
// echo $dbs->error;
}
}
$r++;
}
// close poll
ucs_nodes_poll::clear_poll($dbs, $node_id);
// write log
utility::writeLogs($dbs, 'nodes', $biblio['node_info']['id'], 'ucs', 'Node ' . $node_id . '(' . $sysconf['node'][$node_id]['name'] . ') upload ' . $r . ' of catalog data');
die(json_encode(array('status' => 'UPLOADED', 'message' => $r . ' catalog record uploaded succesfully to ' . $sysconf['server']['name'] . '!')));
} else {
die(json_encode(array('status' => 'NOT_AUTHORIZED', 'message' => 'You not authorized to upload data to server ' . $sysconf['server']['name'] . '! Please check your ucnode.inc.php file for correct configuration!')));
}
} else {
die(json_encode(array('status' => 'NOT_AUTHORIZED', 'message' => 'You not authorized to upload data to server ' . $sysconf['server']['name'] . '! Please check your ucnode.inc.php file for correct configuration!')));
}
} else {
die(json_encode(array('status' => 'NO_DATA', 'message' => 'Request is empty! Could be error on HTTP request')));
}
示例5: foreach
// loop array
$http_query = '';
foreach ($_POST['itemID'] as $itemID) {
$itemID = (int) $itemID;
// check if this biblio data still have an item
$_sql_biblio_item_q = sprintf('SELECT b.title, COUNT(item_id) FROM biblio AS b
LEFT JOIN item AS i ON b.biblio_id=i.biblio_id
WHERE b.biblio_id=%d GROUP BY title', $itemID);
$biblio_item_q = $dbs->query($_sql_biblio_item_q);
$biblio_item_d = $biblio_item_q->fetch_row();
if ($biblio_item_d[1] < 1) {
if (!$sql_op->delete('biblio', "biblio_id={$itemID}")) {
$error_num++;
} else {
// write log
utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'bibliography', $_SESSION['realname'] . ' DELETE bibliographic data (' . $biblio_item_d[0] . ') with biblio_id (' . $itemID . ')');
// delete related data
$sql_op->delete('biblio_topic', "biblio_id={$itemID}");
$sql_op->delete('biblio_author', "biblio_id={$itemID}");
$sql_op->delete('biblio_attachment', "biblio_id={$itemID}");
// add to http query for UCS delete
$http_query .= "itemID[]={$itemID}&";
}
} else {
$still_have_item[] = substr($biblio_item_d[0], 0, 45) . '... still have ' . $biblio_item_d[1] . ' copies';
$error_num++;
}
}
if ($still_have_item) {
$titles = '';
foreach ($still_have_item as $title) {
示例6: session_regenerate_id
session_regenerate_id(true);
// create logon class instance
$logon = new admin_logon($username, $password);
if ($logon->adminValid($dbs)) {
// set cookie admin flag
setcookie('admin_logged_in', true, time() + 14400, SENAYAN_WEB_ROOT_DIR);
// write log
utility::writeLogs($dbs, 'staff', $username, 'Login', 'Login success for user ' . $username . ' from address ' . $_SERVER['REMOTE_ADDR']);
echo '<script type="text/javascript">';
echo 'alert(\'' . __('Welcome to Library Automation, ') . $logon->real_name . '\');';
echo 'location.href = \'admin/index.php\';';
echo '</script>';
exit;
} else {
// write log
utility::writeLogs($dbs, 'staff', $username, 'Login', 'Login FAILED for user ' . $username . ' from address ' . $_SERVER['REMOTE_ADDR']);
// message
$msg = '<script type="text/javascript">';
$msg .= 'alert(\'' . __('Wrong Username or Password. ACCESS DENIED') . '\');';
$msg .= 'history.back();';
$msg .= '</script>';
simbio_security::destroySessionCookie($msg, SENAYAN_SESSION_COOKIES_NAME, SENAYAN_WEB_ROOT_DIR . 'admin', false);
exit;
}
}
}
?>
<div id="loginForm">
<noscript>
<div style="font-weight: bold; color: #FF0000;"><?php
示例7: VALUES
$sql_str = "INSERT IGNORE INTO member\r\n (member_id, member_name, gender,\r\n member_type_id, member_email, member_address, postal_code,\r\n inst_name, is_new, member_image, pin, member_phone,\r\n member_fax, member_since_date, register_date,\r\n expire_date, birth_date, member_notes,\r\n input_date, last_update)\r\n VALUES ({$member_id}, {$member_name}, {$gender},\r\n {$member_type_id}, {$member_email}, {$member_address}, {$postal_code},\r\n {$inst_name}, {$is_new},\r\n {$member_image}, {$pin}, {$member_phone},\r\n {$member_fax}, {$member_since_date}, {$register_date},\r\n {$expire_date}, {$birth_date}, {$member_notes},\r\n {$curr_datetime}, {$curr_datetime})";
// send query
@$dbs->query($sql_str);
if (!$dbs->error) {
$inserted_row++;
} else {
echo $sql_str . '<br />';
echo $dbs->error . '<hr />';
}
}
$row_count++;
}
}
// close file handle
fclose($file);
utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'membership', 'Importing ' . $inserted_row . ' members data from file : ' . $_FILES['importFile']['name']);
echo '<script type="text/javascript">' . "\n";
echo 'parent.$(\'#importInfo\').html(\'<strong>' . $inserted_row . '</strong> ' . __('records inserted successfully to members database, from record') . ' <strong>' . $_POST['recordOffset'] . '</strong>\');' . "\n";
//mfc
echo 'parent.$(\'#importInfo\').css( {\'display\': \'block\'} );' . "\n";
echo '</script>';
exit;
}
}
}
?>
<fieldset class="menuBox">
<div class="menuBoxInner importIcon">
<?php
echo strtoupper(__('Import Data')) . '<hr />' . __('Import for members data from CSV file');
?>
示例8: intval
// xml result
$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
示例9: range
}
} else {
// record to log
utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'stock_take', 'Stock Take ERROR : Item Code ' . $item_code . ' doesnt exists in stock take data. Invalid Item Code OR Maybe out of Stock Take range (from uploaded file ' . $upload->new_filename . ')');
}
}
fclose($stfile);
// message
echo '<script type="text/javascript">' . "\n";
echo 'parent.$(\'#stUploadMsg\').html(\'' . __('Succesfully upload stock take file') . $upload->new_filename . ', <b>' . $i . '</b>' . __(' item codes scanned!') . '\')';
//mfc
echo '.css( {\'display\': \'block\'} );' . "\n";
echo '</script>';
} else {
// write log
utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'stock_take', 'ERROR : ' . $_SESSION['realname'] . ' FAILED TO upload stock take file ' . $upload->new_filename . ', with error (' . $upload->error . ')');
echo '<script type="text/javascript">' . "\n";
echo 'parent.$(\'#stUploadMsg\').html(\'Failed to upload stock take file! <div>Error : ' . $upload->error . '</div>\')';
echo '.toggleClass(\'errorBox\').css( {\'display\': \'block\'} );' . "\n";
echo '</script>';
}
exit;
}
?>
<fieldset class="menuBox">
<div class="menuBoxInner stockTakeIcon">
<?php
echo __('STOCK TAKE UPLOAD - Upload a plain text file (.txt) containing list of Item Code to stock take. Each Item Code separated by line.');
?>
<hr />
<form name="uploadForm" class="notAJAX" method="post" enctype="multipart/form-data" action="<?php
示例10: __
require UCS_BASE_DIR . 'admin/default/session_check.inc.php';
if (isset($_SESSION['formID']) && isset($_POST['nodeID']) && isset($_POST['removeAll'])) {
// check form ID
if ($_SESSION['formID'] === $_POST['formID']) {
echo '<div class="errorBox">' . __('ERROR ON PROCESSING DATA REMOVAL REQUEST') . '</div>';
exit;
}
$node_ID = trim($dbs->escape_string(strip_tags($_POST['nodeID'])));
if (isset($sysconf['node'][$node_ID])) {
$node = $sysconf['node'][$node_ID];
// remove all data
$remove_q = $dbs->query('DELETE FROM biblio WHERE node_id=\'' . $node_ID . '\'');
$deleted = $dbs->affected_rows;
if ($deleted) {
// write to log
utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'bibliography', $_SESSION['realname'] . ' remove all bibliographic of ' . $node['name']);
echo '<div class="infoBox">' . sprintf(__('%d records of %s removed succesfully from database'), $deleted, $node['name']) . '</div>';
}
}
// nullify form ID
$_SESSION['formID'] = null;
exit;
}
// nullify form ID
$_SESSION['formID'] = null;
?>
<fieldset class="menuBox">
<div class="menuBoxInner trashIcon">
<?php
echo strtoupper(__('Nodes Data Removal'));
?>
示例11: error
if (function_exists('imagecopyresampled')) {
// we use phpthumb class to resize image
include LIB . 'phpthumb/ThumbLib.inc.php';
// create phpthumb object
$src = IMAGES_BASE_DIR . 'labels/' . $image_upload->new_filename;
$phpthumb = PhpThumbFactory::create($src);
$w = $h = 24;
$phpthumb->resize($w, $h);
$phpthumb->save(IMAGES_BASE_DIR . 'labels/' . $data['label_name'] . '.png', 'PNG');
}
// write log
utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'bibliography', $_SESSION['realname'] . ' upload label image file ' . $image_upload->new_filename);
utility::jsAlert('Label image file successfully uploaded');
} else {
// write log
utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'bibliography', 'ERROR : ' . $_SESSION['realname'] . ' FAILED TO upload label image file ' . $image_upload->new_filename . ', with error (' . $image_upload->error . ')');
utility::jsAlert('FAILED to upload label image! Please see System Log for more detailed information');
}
}
$data['input_date'] = date('Y-m-d');
$data['last_update'] = date('Y-m-d');
// create sql op object
$sql_op = new simbio_dbop($dbs);
if (isset($_POST['updateRecordID'])) {
/* UPDATE RECORD MODE */
// remove input date
unset($data['input_date']);
// filter update record ID
$updateRecordID = $dbs->escape_string(trim($_POST['updateRecordID']));
// update the data
$update = $sql_op->update('mst_label', $data, 'label_id=' . $updateRecordID);
示例12: sendOverdueNotice
public function sendOverdueNotice()
{
global $sysconf;
if (!class_exists('PHPMailer')) {
return false;
}
$_mail = new PHPMailer(false);
$_mail->IsSMTP();
// telling the class to use SMTP
// get message template
$_msg_tpl = @file_get_contents(SENAYAN_BASE_DIR . 'admin/admin_template/overdue-mail-tpl.html');
// date
$_curr_date = date('Y-m-d H:i:s');
// compile overdue data
$_overdue_data = '<table width="100%" border="1">' . "\n";
$_overdue_data .= '<tr><th>Title</th><th>Item Code</th><th>Loan Date</th><th>Due Date</th><th>Overdue</th></tr>' . "\n";
$_arr_overdued = self::getOverduedLoan($this->obj_db, $this->member_id);
foreach ($_arr_overdued as $_overdue) {
$_overdue_data .= '<tr>';
$_overdue_data .= '<td>' . $_overdue['title'] . '</td><td>' . $_overdue['item_code'] . '</td><td>' . $_overdue['loan_date'] . '</td><td>' . $_overdue['due_date'] . '</td><td>' . $_overdue['Overdue Days'] . ' days</td>' . "\n";
$_overdue_data .= '</tr>';
}
$_overdue_data .= '</table>';
// message
$_message = str_ireplace(array('<!--MEMBER_ID-->', '<!--MEMBER_NAME-->', '<!--OVERDUE_DATA-->', '<!--DATE-->'), array($this->member_id, $this->member_name, $_overdue_data, $_curr_date), $_msg_tpl);
// e-mail setting
// $_mail->SMTPDebug = 2;
$_mail->SMTPAuth = $sysconf['mail']['auth_enable'];
$_mail->Host = $sysconf['mail']['server'];
$_mail->Port = $sysconf['mail']['server_port'];
$_mail->Username = $sysconf['mail']['auth_username'];
$_mail->Password = $sysconf['mail']['auth_password'];
$_mail->SetFrom($sysconf['mail']['from'], $sysconf['mail']['from_name']);
$_mail->AddReplyTo($sysconf['mail']['reply_to'], $sysconf['mail']['reply_to_name']);
$_mail->AddAddress($this->member_email, $this->member_name);
$_mail->Subject = 'Overdue Notice for Member ' . $this->member_name . ' (' . $this->member_email . ')';
$_mail->AltBody = strip_tags($_message);
$_mail->MsgHTML($_message);
$_sent = $_mail->Send();
if (!$_sent) {
return array('status' => 'ERROR', 'message' => $_mail->ErrorInfo);
utility::writeLogs($this->obj_db, 'staff', isset($_SESSION['uid']) ? $_SESSION['uid'] : '1', 'membership', 'FAILED to send overdue notification e-mail to ' . $this->member_email . ' (' . $_mail->ErrorInfo . ')');
} else {
return array('status' => 'SENT', 'message' => 'Overdue notification E-Mail have been sent to ' . $this->member_email);
utility::writeLogs($this->obj_db, 'staff', isset($_SESSION['uid']) ? $_SESSION['uid'] : '1', 'membership', 'Overdue notification e-mail sent to ' . $this->member_email);
}
}
示例13: die
if ($json_error) {
die(json_encode(array('status' => 'JSON_ERROR', 'message' => $json_errors[$json_error])));
}
}
// node ID
$node_id = $op['node_info']['id'];
// authentication
if (isset($sysconf['node'][$node_id])) {
// check for password
if ($sysconf['node'][$node_id]['password'] === $op['node_info']['password']) {
$action = $op['node_data']['operation'];
$action_data = $op['node_data']['biblio'];
// update/delete catalog data
if ($action_data) {
if ($action == 'delete') {
$_del = @$dbs->query("DELETE FROM biblio WHERE orig_biblio_id IN ({$action_data}) AND node_id='{$node_id}'");
$_deleted_num = $dbs->affected_rows;
// write log
utility::writeLogs($dbs, 'nodes', $op['node_info']['id'], 'ucs', 'Node ' . $node_id . '(' . $op['node_info']['name'] . ') delete ' . $_deleted_num . ' catalog data');
die(json_encode(array('status' => 'DELETED', 'message' => $_deleted_num . ' catalog record(s) delete succesfully from ' . $sysconf['server']['name'] . '!')));
}
}
} else {
die(json_encode(array('status' => 'NOT_AUTHORIZED', 'message' => 'You not authorized to update data on server ' . $sysconf['server']['name'] . '! Please check your ucnode.inc.php file for correct configuration!')));
}
} else {
die(json_encode(array('status' => 'NOT_AUTHORIZED', 'message' => 'You not authorized to update data on server ' . $sysconf['server']['name'] . '! Please check your ucnode.inc.php file for correct configuration!')));
}
} else {
die(json_encode(array('status' => 'NO_DATA', 'message' => 'Request is empty! Could be error on HTTP request')));
}
示例14: do_checkIP
// IP based access limitation
require LIB . 'ip_based_access.inc.php';
do_checkIP('smc');
do_checkIP('smc-bibliography');
require SB . 'admin/default/session_check.inc.php';
require SIMBIO . 'simbio_FILE/simbio_directory.inc.php';
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';
if (isset($_POST['updateSettings'])) {
$setting_type = trim($_POST['settingType']);
$setting_name = $setting_type . '_print_settings';
// reset
$dbs->query(sprintf("REPLACE INTO setting (setting_name, setting_value) VALUES ('%s', '%s')", $setting_name, $dbs->escape_string(serialize($_POST[$setting_type]))));
// write log
utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'system', $_SESSION['realname'] . ' change ' . $setting_type . ' print settings');
utility::jsAlert(__('Settings saved'));
echo '<script type="text/javascript"></script>';
}
/* Config Vars update process end */
$type = 'barcode';
if (isset($_GET['type'])) {
$type = trim($_GET['type']);
}
if (!in_array($type, array('barcode', 'label', 'membercard'))) {
$type = 'barcode';
}
// 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';
示例15: array
$_POST['itemID'] = array((int) $_POST['itemID']);
}
// loop array
foreach ($_POST['itemID'] as $itemID) {
$itemID = (int) $itemID;
// get module data
$module_q = $dbs->query('SELECT module_name, module_path FROM mst_module WHERE module_id=' . $itemID);
$module_d = $module_q->fetch_row();
if (!$sql_op->delete('mst_module', "module_id={$itemID}")) {
$error_num++;
} else {
// also delete all records related to this data
// delete group privileges
$dbs->query('DELETE FROM group_access WHERE module_id=' . $itemID);
// write log
utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'system', $_SESSION['realname'] . ' DELETE module (' . $module_d[0] . ') with path (' . $module_d[1] . ')');
}
}
// error alerting
if ($error_num == 0) {
utility::jsAlert(__('All Data Successfully Deleted'));
echo '<script type="text/javascript">parent.setContent(\'mainContent\', \'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\', \'post\');</script>';
} else {
utility::jsAlert(__('Some or All Data NOT deleted successfully!\\nPlease contact system administrator'));
echo '<script type="text/javascript">parent.setContent(\'mainContent\', \'' . $_SERVER['PHP_SELF'] . '?' . $_POST['lastQueryStr'] . '\', \'post\');</script>';
}
exit;
}
}
/* RECORD OPERATION */
/* search form */