本文整理汇总了PHP中write_to_log函数的典型用法代码示例。如果您正苦于以下问题:PHP write_to_log函数的具体用法?PHP write_to_log怎么用?PHP write_to_log使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了write_to_log函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete_course
function delete_course($course, $material)
{
global $db, $moduleFactory;
$delete_groups = FALSE;
// whether or not to delete the groups as well
$groups = array();
//unset s_cid var
if ($material === TRUE) {
unset($_SESSION['s_cid']);
$delete_groups = TRUE;
// get a list of groups in an array to send to module::delete()
// get groups
$sql = "SELECT G.group_id FROM %sgroups G INNER JOIN %sgroups_types T USING (type_id) WHERE T.course_id=%d";
$group_rows = queryDB($sql, array(TABLE_PREFIX, TABLE_PREFIX, $course));
foreach ($group_rows as $group_row) {
$groups[] = $group_row['group_id'];
}
}
$module_list = $moduleFactory->getModules(AT_MODULE_STATUS_ENABLED | AT_MODULE_STATUS_DISABLED);
$keys = array_keys($module_list);
//loop through mods and call delete function
foreach ($keys as $module_name) {
if ($module_name == '_core/groups') {
continue;
}
if ($module_name == '_core/enrolment') {
continue;
}
$module = $module_list[$module_name];
if ($material === TRUE || isset($material[$module_name])) {
$module->delete($course, $groups);
////// Breaks here
}
}
// groups and enrollment must be deleted last because that info is used by other modules
if ($material === TRUE || isset($material['_core/groups'])) {
$module =& $moduleFactory->getModule('_core/groups');
$module->delete($course, $groups);
}
if ($material === TRUE || isset($material['_core/enrolment'])) {
$module =& $moduleFactory->getModule('_core/enrolment');
$module->delete($course, $groups);
}
if ($material === TRUE) {
// delete actual course
$sql = "DELETE FROM %scourses WHERE course_id=%d";
$result = queryDB($sql, array(TABLE_PREFIX, $course));
global $sqlout;
write_to_log(AT_ADMIN_LOG_DELETE, 'courses', $result, $sqlout);
}
}
示例2: query
function query($querystring)
{
// log the query
global $config;
if ($config['keep_log']) {
write_to_log($querystring);
}
// run the query
$result = $this->handle->query(stripslashes(trim($querystring)));
if ($result) {
$result->setFetchMode(PDO::FETCH_ASSOC);
}
return $result;
}
示例3: header
$msg->addFeedback('CANCELLED');
header('Location: ' . AT_BASE_HREF . 'mods/_standard/basiclti/index_admin.php');
exit;
} else {
if (isset($_POST['form_basiclti'], $tool)) {
if (at_form_validate($blti_admin_form, $msg)) {
$sql = "SELECT count(*) cnt FROM " . TABLE_PREFIX . "basiclti_tools WHERE toolid = '" . mysql_real_escape_string($_POST['toolid']) . "' AND id != {$tool};";
$result = mysql_query($sql, $db) or die(mysql_error());
$row = mysql_fetch_assoc($result);
if ($row["cnt"] != 0) {
$msg->addFeedback('NEED_UNIQUE_TOOLID');
} else {
$sql = at_form_update($_POST, $blti_admin_form);
$sql = 'UPDATE ' . TABLE_PREFIX . "basiclti_tools SET " . $sql . " WHERE id = {$tool};";
$result = mysql_query($sql, $db) or die(mysql_error());
write_to_log(AT_ADMIN_LOG_INSERT, 'basiclti_create', mysql_affected_rows($db), $sql);
$msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
header('Location: ' . AT_BASE_HREF . 'mods/_standard/basiclti/index_admin.php');
exit;
}
}
}
}
$sql = "SELECT * FROM " . TABLE_PREFIX . "basiclti_tools WHERE id = " . $tool . ";";
$result = mysql_query($sql, $db) or die(mysql_error());
$toolrow = mysql_fetch_assoc($result);
if ($toolrow['id'] != $tool) {
$msg->addFeedback('COULD_NOT_LOAD_TOOL');
header('Location: ' . AT_BASE_HREF . 'mods/_standard/basiclti/index_admin.php');
exit;
}
示例4: _AT
$msg->addError(array('EMPTY_FIELDS', _AT('title')));
}
$cat_name = validate_length($cat_name, 100);
if ($_POST['theme_parent']) {
$sql = "SELECT theme FROM %scourse_cats WHERE cat_id=%d";
$rows_cats = queryDB($sql, array(TABLE_PREFIX, $cat_parent_id));
if (count($rows_cats) > 0) {
$cat_theme = $row['theme'];
}
}
if (!$msg->containsErrors()) {
$sql = "INSERT INTO %scourse_cats VALUES (NULL, '%s', %d, '%s')";
$rows_cats = queryDB($sql, array(TABLE_PREFIX, $cat_name, $cat_parent_id, $cat_theme));
$cat_id = at_insert_id($db);
$msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
write_to_log(AT_ADMIN_LOG_INSERT, 'course_cats', count($rows_cats), $sqlout);
header('Location: course_categories.php');
exit;
}
} else {
if (isset($_POST['cancel'])) {
$msg->addFeedback('CANCELLED');
header('Location: course_categories.php');
exit;
}
}
/* $categories[category_id] = array(cat_name, cat_parent, num_courses, [array(children)]) */
$categories = get_categories();
require AT_INCLUDE_PATH . 'header.inc.php';
$msg->printAll();
?>
示例5: ajax_batch_status
function ajax_batch_status()
{
if (!isset($_REQUEST['items']) || empty($_REQUEST['items'])) {
$this->ajaxReturn(0, '更新出错,未传入商品ID');
}
$type = $_REQUEST['type'];
if (!isset($_REQUEST['type']) || !in_array($_REQUEST['type'], array('status', 'desc'))) {
$type = 'status';
}
$ids = mysql_escape_string($_REQUEST['items']);
$items = $this->_mod->where(array('id' => array('in', $ids)))->field('num_iid')->select();
if (!is_array($items)) {
$this->ajaxReturn(1);
}
array_walk($items, create_function('&$v,$k', '$v=$v["num_iid"];'));
$items = array_chunk($items, 10);
$top = $this->_get_tb_top();
$res = $top->load_api('TaobaokeItemsDetailGetRequest');
switch ($type) {
case 'status':
$fields = 'num_iid,approve_status';
$res->setFields($fields);
$delete_items = '';
foreach ($items as $group) {
$res->setNumIids(implode(',', $group));
$resp1 = $top->execute($res);
$resp = get_object_vars($resp1->taobaoke_item_details);
if (!is_array($resp['taobaoke_item_detail'])) {
write_to_log('接口调用失败,淘宝返回:' . var_export($resp1, true));
continue;
}
foreach ((array) $resp['taobaoke_item_detail'] as $item) {
$item = get_object_vars($item->item);
if ($item['approve_status'] == 'instock') {
$delete_items .= $item['num_iid'] . ',';
}
}
}
$delete_items = substr($delete_items, 0, -1);
$condition['_logic'] = 'OR';
if ($delete_items) {
$condition['num_iid'] = array('in', $delete_items);
}
$condition['coupon_end_time'] = array('elt', time());
$this->_mod->where($condition)->delete();
break;
case 'desc':
$fields = 'num_iid,desc';
$res->setFields($fields);
foreach ($items as $group) {
$res->setNumIids(implode(',', $group));
$resp1 = $top->execute($res);
$resp = get_object_vars($resp1->taobaoke_item_details);
if (!is_array($resp['taobaoke_item_detail'])) {
write_to_log('接口调用失败,淘宝返回:' . var_export($resp1, true));
continue;
}
foreach ((array) $resp['taobaoke_item_detail'] as $item) {
$item = get_object_vars($item->item);
$this->_mod->where(array('num_iid' => $item['num_iid']))->save(array('desc' => $item['desc']));
}
}
break;
}
$this->ajaxReturn(1);
}
示例6: header
header('Location: auto_enroll.php');
exit;
}
}
} else {
if (isset($_POST['delete'])) {
if (!$_POST['delete_ids']) {
$msg->addError('NO_ITEM_SELECTED');
}
if (!$msg->containsErrors()) {
foreach ($_POST['delete_ids'] as $elem) {
$sql = "DELETE FROM %sauto_enroll_courses WHERE auto_enroll_courses_id = %d";
$rows_deleted = queryDB($sql, array(TABLE_PREFIX, $elem));
}
$msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
write_to_log(AT_ADMIN_LOG_DELETE, 'auto_enroll_courses', $rows_deleted, $sqlout);
}
} else {
if (isset($_POST['cancel'])) {
$msg->addFeedback('CANCELLED');
header('Location: auto_enroll.php');
exit;
}
}
}
/* $categories[category_id] = array(cat_name, cat_parent, num_courses, [array(children)]) */
require AT_INCLUDE_PATH . 'header.inc.php';
$msg->printAll();
// existing auto enrollment
if ($auto_enroll_id > 0) {
$sql = "SELECT * FROM %sauto_enroll\n\t WHERE auto_enroll_id = %d";
示例7: header
header('Location: bounce.php?course=' . $_POST['form_course_id']);
exit;
}
} else {
// check if it's an admin login.
$rows = queryDB("SELECT login, `privileges`, language FROM %sadmins WHERE login='%s' AND SHA1(CONCAT(password, '%s'))='%s' AND `privileges`>0", array(TABLE_PREFIX, $this_login, $_SESSION['token'], $this_password));
if ($row = $rows[0]) {
$sql = "UPDATE %sadmins SET last_login=NOW() WHERE login='%s'";
$num_login = queryDB($sql, array(TABLE_PREFIX, $this_login));
$_SESSION['login'] = $row['login'];
$_SESSION['valid_user'] = true;
$_SESSION['course_id'] = -1;
$_SESSION['privileges'] = intval($row['privileges']);
$_SESSION['lang'] = $row['language'];
$sql = "UPDATE " . TABLE_PREFIX . "admins SET last_login=NOW() WHERE login='{$this_login}'";
write_to_log(AT_ADMIN_LOG_UPDATE, 'admins', $num_login, $sql);
//clear login attempt on successful login
queryDB("DELETE FROM %smember_login_attempt WHERE login='%s'", array(TABLE_PREFIX, $this_login));
$msg->addFeedback('LOGIN_SUCCESS');
header('Location: admin/index.php');
exit;
} else {
$expiry_stmt = '';
$attempt_login++;
if ($attempt_expiry == 0) {
$expiry = time() + LOGIN_ATTEMPT_LOCKED_TIME * 60;
//an hour from now
} else {
$expiry = $attempt_expiry;
}
queryDB("REPLACE INTO %smember_login_attempt SET attempt='%s', expiry='%s', login='%s'", array(TABLE_PREFIX, $attempt_login, $expiry, $this_login));
示例8: admin_authenticate
admin_authenticate(AT_ADMIN_PRIV_CATEGORIES);
if (isset($_POST['submit_no'])) {
$msg->addFeedback('CANCELLED');
header('Location: course_categories.php');
exit;
} else {
if (isset($_POST['submit_yes'])) {
/* delete has been confirmed, delete this category */
$cat_id = intval($_POST['cat_id']);
if (!is_array($categories[$cat_id]['children'])) {
$sql = "DELETE FROM " . TABLE_PREFIX . "course_cats WHERE cat_id={$cat_id}";
$result = mysql_query($sql, $db);
write_to_log(AT_ADMIN_LOG_DELETE, 'course_cats', mysql_affected_rows($db), $sql);
$sql = "UPDATE " . TABLE_PREFIX . "courses SET cat_id=0 WHERE cat_id={$cat_id}";
$result = mysql_query($sql, $db);
write_to_log(AT_ADMIN_LOG_DELETE, 'courses', mysql_affected_rows($db), $sql);
$msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
header('Location: course_categories.php');
exit;
}
}
}
require AT_INCLUDE_PATH . 'header.inc.php';
$_GET['cat_id'] = intval($_GET['cat_id']);
$sql = "SELECT * FROM " . TABLE_PREFIX . "course_cats WHERE cat_id={$_GET['cat_id']}";
$result = mysql_query($sql, $db);
if (mysql_num_rows($result) == 0) {
$msg->printErrors('ITEM_NOT_FOUND');
} else {
$row = mysql_fetch_assoc($result);
$hidden_vars['cat_name'] = $row['cat_name'];
示例9: mysql_query
echo '<div style="padding-left: 30px;"><pre>';
echo "cpID\torder\t cID";
$sql = "SELECT content_id, content_parent_id, ordering, course_id FROM " . TABLE_PREFIX . "content ORDER BY course_id, content_parent_id, ordering";
$result = mysql_query($sql, $db);
while ($row = mysql_fetch_assoc($result)) {
if ($current_course_id != $row['course_id']) {
echo "\n\n-- course id {$row['course_id']}\n\n";
$current_course_id = $row['course_id'];
unset($current_parent_id);
unset($ordering);
}
echo $row['content_parent_id'] . "\t" . $row['ordering'] . "\t" . $row['content_id'];
if ($current_parent_id != $row['content_parent_id']) {
$current_parent_id = $row['content_parent_id'];
$ordering = 1;
}
if ($row['ordering'] != $ordering) {
echo "\t mismatch : expecting {$ordering} [fixed]";
$sql = "UPDATE " . TABLE_PREFIX . "content SET ordering={$ordering} WHERE content_id={$row['content_id']}";
mysql_query($sql, $db);
write_to_log(AT_ADMIN_LOG_UPDATE, 'content', mysql_affected_rows($db), $sql);
}
echo "\n";
$ordering++;
}
$savant->assign('ordering', $ordering);
$savant->assign('content_id', $content_id);
$savant->assign('content_parent_id', $content_parent_id);
echo ' </pre></div>';
$savant->display('admin/fix_content.tmpl.php');
require AT_INCLUDE_PATH . 'footer.inc.php';
示例10: intval
} else {
if (isset($_POST['submit_yes'])) {
/* delete has been confirmed, delete this category */
$myown_patch_id = intval($_POST['myown_patch_id']);
$sql = "DELETE FROM %smyown_patches WHERE myown_patch_id=%d";
$result = queryDB($sql, array(TABLE_PREFIX, $myown_patch_id));
global $sqlout;
write_to_log(AT_ADMIN_LOG_DELETE, 'myown_patches', $result, $sqlout);
$sql = "DELETE FROM %smyown_patches_dependent WHERE myown_patch_id=%d";
$result = queryDB($sql, array(TABLE_PREFIX, $myown_patch_id));
global $sqlout;
write_to_log(AT_ADMIN_LOG_DELETE, 'myown_patches_dependent', $result, $sqlout);
$sql = "DELETE FROM %smyown_patches_files WHERE myown_patch_id=%d";
$result = queryDB($sql, array(TABLE_PREFIX, $myown_patch_id));
global $sqlout;
write_to_log(AT_ADMIN_LOG_DELETE, 'myown_patches_files', $result, $sqlout);
$msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
header('Location: myown_patches.php');
exit;
}
}
require AT_INCLUDE_PATH . 'header.inc.php';
$_GET['myown_patch_id'] = intval($_GET['myown_patch_id']);
$sql = "SELECT myown_patch_id, atutor_patch_id FROM %smyown_patches m WHERE m.myown_patch_id=%d";
$row = queryDB($sql, array(TABLE_PREFIX, $_GET['myown_patch_id']), TRUE);
if (count($row) == 0) {
$msg->printErrors('ITEM_NOT_FOUND');
} else {
$hidden_vars['atutor_patch_id'] = $row['atutor_patch_id'];
$hidden_vars['myown_patch_id'] = $row['myown_patch_id'];
$confirm = array('DELETE_MYOWN_PATCH', $row['atutor_patch_id']);
示例11: delete_user
function delete_user($id)
{
global $db, $msg;
//make sure not instructor of a course
$sql = "SELECT course_id FROM %scourses WHERE member_id=%d";
$row_instructor = queryDB($sql, array(TABLE_PREFIX, $id), TRUE);
// WHAT'S THE PURPOSE OF THIS CONDITION?
if (count($row_instructor) > 0) {
/*$msg->addError('NODELETE_USER');
header('Location: '.AT_BASE_HREF.'users.php');
exit;*/
return;
}
$sql = "DELETE FROM %scourse_enrollment WHERE member_id=%d";
$result = queryDB($sql, array(TABLE_PREFIX, $id));
global $sqlout;
write_to_log(AT_ADMIN_LOG_DELETE, 'course_enrollment', $result, $sqlout);
$sql = "DELETE FROM %sforums_accessed WHERE member_id=%d";
$result = queryDB($sql, array(TABLE_PREFIX, $id));
global $sqlout;
write_to_log(AT_ADMIN_LOG_DELETE, 'forums_accessed', $result, $sqlout);
$sql = "DELETE FROM %sforums_subscriptions WHERE member_id=%d";
$result = queryDB($sql, array(TABLE_PREFIX, $id));
global $sqlout;
write_to_log(AT_ADMIN_LOG_DELETE, 'forums_subscriptions', $result, $sqlout);
/****/
/* delete forum threads block: */
/* delete the thread replies: */
$sql = "SELECT COUNT(*) AS cnt, parent_id, forum_id FROM %sforums_threads WHERE member_id=%d AND parent_id<>0 GROUP BY parent_id";
$rows_threads = queryDB($sql, array(TABLE_PREFIX, $id));
foreach ($rows_threads as $row) {
/* update the forum posts counter */
$sql = "UPDATE %sforums SET num_posts=num_posts - %d, last_post=last_post WHERE forum_id=%d";
$result = queryDB($sql, array(TABLE_PREFIX, $row['cnt'], $row['forum_id']));
global $sqlout;
write_to_log(AT_ADMIN_LOG_UPDATE, 'forums', $result, $sqlout);
/* update the topics reply counter */
$sql = "UPDATE %sforums_threads SET num_comments=num_comments-%d, last_comment=last_comment, date=date WHERE post_id=%d";
$result = queryDB($sql, array(TABLE_PREFIX, $row['cnt'], $row['parent_id']));
global $sqlout;
write_to_log(AT_ADMIN_LOG_UPDATE, 'forums_threads', $result, $sqlout);
}
/* delete threads this member started: */
$sql = "SELECT post_id, forum_id, num_comments FROM %sforums_threads WHERE member_id=%d AND parent_id=0";
$rows_posts = queryDB($sql, array(TABLE_PREFIX, $id));
foreach ($rows_posts as $row) {
/* update the forum posts and topics counters */
$num_posts = $row['num_comments'] + 1;
$sql = "UPDATE %sforums SET num_topics=num_topics-1, num_posts=num_posts - %d, last_post=last_post WHERE forum_id=%d";
$result = queryDB($sql, array(TABLE_PREFIX, $num_posts, $row['forum_id']));
global $sqlout;
write_to_log(AT_ADMIN_LOG_UPDATE, 'forums', $result, $sqlout);
/* delete the replies */
$sql = "DELETE FROM %sforums_threads WHERE parent_id=%d";
$result = queryDB($sql, array(TABLE_PREFIX, $row['post_id']));
global $sqlout;
write_to_log(AT_ADMIN_LOG_DELETE, 'forums_threads', $result, $sqlout);
}
/* delete the actual threads */
$sql = "DELETE FROM %sforums_threads WHERE member_id=%d";
$result = queryDB($sql, array(TABLE_PREFIX, $id));
global $sqlout;
write_to_log(AT_ADMIN_LOG_DELETE, 'forums_threads', $result, $sqlout);
/* end delete forum threads block. */
/****/
$sql = "DELETE FROM %sinstructor_approvals WHERE member_id=%d";
$result = queryDB($sql, array(TABLE_PREFIX, $id));
global $sqlout;
write_to_log(AT_ADMIN_LOG_DELETE, 'instructor_approvals', $result, $sqlout);
$sql = "DELETE FROM %smessages WHERE from_member_id=%d OR to_member_id=%d";
$result = queryDB($sql, array(TABLE_PREFIX, $id, $id));
global $sqlout;
write_to_log(AT_ADMIN_LOG_DELETE, 'messages', $result, $sqlout);
$sql = "DELETE FROM %spolls_members WHERE member_id=%d";
$result = queryDB($sql, array(TABLE_PREFIX, $id));
global $sqlout;
write_to_log(AT_ADMIN_LOG_DELETE, 'polls_members', $result, $sqlout);
$sql = "DELETE FROM %stests_answers WHERE member_id=%d";
$result = queryDB($sql, array(TABLE_PREFIX, $id));
global $sqlout;
write_to_log(AT_ADMIN_LOG_DELETE, 'tests_answers', $result, $sqlout);
$sql = "DELETE FROM %stests_results WHERE member_id=%d";
$result = queryDB($sql, array(TABLE_PREFIX, $id));
global $sqlout;
write_to_log(AT_ADMIN_LOG_DELETE, 'tests_results', $result, $sqlout);
$sql = "DELETE FROM %susers_online WHERE member_id=%d";
$result = queryDB($sql, array(TABLE_PREFIX, $id));
global $sqlout;
write_to_log(AT_ADMIN_LOG_DELETE, 'users_online', $result, $sqlout);
$sql = "DELETE FROM %smembers WHERE member_id=%d";
$result = queryDB($sql, array(TABLE_PREFIX, $id));
global $sqlout;
write_to_log(AT_ADMIN_LOG_DELETE, 'members', $result, $sqlout);
$sql = "DELETE FROM %smember_track WHERE member_id=%d";
$result = queryDB($sql, array(TABLE_PREFIX, $id));
global $sqlout;
write_to_log(AT_ADMIN_LOG_DELETE, 'member_track', $result, $sqlout);
// delete personal files from file storage
fs_delete_workspace(WORKSPACE_PERSONAL, $id);
return;
//.........这里部分代码省略.........
示例12: header
$msg->addFeedback('CANCELLED');
header('Location: ' . AT_BASE_HREF . 'mods/_standard/basiclti/index_admin.php');
exit;
} else {
if (isset($_POST['form_basiclti'])) {
if (at_form_validate($blti_admin_form, $msg)) {
$sql = "SELECT count(*) cnt FROM %sbasiclti_tools WHERE toolid = '%s'";
$row = queryDB($sql, array(TABLE_PREFIX, $_POST['toolid']), TRUE);
if ($row["cnt"] != 0) {
$msg->addError('NEED_UNIQUE_TOOLID');
} else {
$sql = at_form_insert($_POST, $blti_admin_form);
$sql = 'INSERT INTO %sbasiclti_tools ' . $sql;
$result = queryDB($sql, array(TABLE_PREFIX));
global $sqlout;
write_to_log(AT_ADMIN_LOG_INSERT, 'basiclti_create', $result, $sqlout);
$msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
header('Location: ' . AT_BASE_HREF . 'mods/_standard/basiclti/index_admin.php');
exit;
}
}
}
}
include AT_INCLUDE_PATH . 'header.inc.php';
$msg->printAll();
?>
<form method="post" action="<?php
echo $_SERVER['PHP_SELF'];
?>
" name="basiclti_form" enctype="multipart/form-data">
<input type="hidden" name="form_basiclti" value="true" />
示例13: define
/* This program is free software. You can redistribute it and/or*/
/* modify it under the terms of the GNU General Public License */
/* as published by the Free Software Foundation. */
/****************************************************************/
// $Id$
define('AT_INCLUDE_PATH', '../../../../include/');
require AT_INCLUDE_PATH . 'vitals.inc.php';
admin_authenticate(AT_ADMIN_PRIV_ADMIN);
if (isset($_POST['submit_no'])) {
$msg->addFeedback('CANCELLED');
header('Location: ./log.php');
exit;
} else {
if (isset($_POST['submit_yes'])) {
//clean up the db
$sql = "DELETE FROM %sadmin_log";
$result = queryDB($sql, array(TABLE_PREFIX));
global $sqlout;
write_to_log(AT_ADMIN_LOG_DELETE, 'admin_log', $result, $sqlout);
$msg->addFeedback('ADMIN_LOG_RESET');
header('Location: ./log.php');
exit;
}
}
require AT_INCLUDE_PATH . 'header.inc.php';
//print confirmation
$hidden_vars['all'] = TRUE;
$confirm = array('RESET_ADMIN_LOG', $_SERVER['PHP_SELF']);
$msg->addConfirm($confirm, $hidden_vars);
$msg->printConfirm();
require AT_INCLUDE_PATH . 'footer.inc.php';
示例14: intval
$request_id = intval($_REQUEST['id']);
$sql = "SELECT * FROM " . TABLE_PREFIX . "members WHERE member_id=" . $request_id;
$result = mysql_query($sql, $db);
if (!($row = mysql_fetch_array($result))) {
require AT_INCLUDE_PATH . 'header.inc.php';
echo _AT('no_user_found');
require AT_INCLUDE_PATH . 'footer.inc.php';
exit;
}
// message options
$msg_options = array(_AT('leave_blank'), _AT('instructor_request_denymsg1'), _AT('instructor_request_denymsg2'), _AT('instructor_request_denymsg3'), _AT('instructor_request_denymsg4'), _AT('other'));
$other_option = count($msg_options) - 1;
if (isset($_POST['submit'])) {
$sql = 'DELETE FROM ' . TABLE_PREFIX . 'instructor_approvals WHERE member_id=' . $request_id;
$result = mysql_query($sql, $db);
write_to_log(AT_ADMIN_LOG_DELETE, 'instructor_approvals', mysql_affected_rows($db), $sql);
$msg->addFeedback('PROFILE_UPDATED_ADMIN');
/* notify the users that they have been denied: */
$sql = "SELECT email, first_name, last_name FROM " . TABLE_PREFIX . "members WHERE member_id=" . $_POST['id'];
$result = mysql_query($sql, $db);
if ($row = mysql_fetch_array($result)) {
$to_email = $row['email'];
$message = _AT('instructor_request_deny', AT_BASE_HREF) . " \n";
if ($_POST['msg_option'] == $other_option) {
$message .= addslashes($_POST['other_msg']);
} else {
if ($_POST['msg_option']) {
$message .= "\n" . $msg_options[$_POST['msg_option']];
}
}
if ($to_email != '') {
示例15: str_replace
$extra_info = $xml_parser->theme_rows['extra_info'];
}
if ($title == '') {
$title = str_replace('_', ' ', $theme);
}
$last_updated = date('Y-m-d');
$status = '1';
//if version number is not compatible with current Atutor version, set theme as disabled
if ($version != VERSION) {
$status = '0';
}
//save information in database
$sql = "INSERT INTO %sthemes (title, version, dir_name, type, last_updated, extra_info, status, customized) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', %d, 1)";
$result = queryDB($sql, array(TABLE_PREFIX, $title, $version, $theme, $type, $last_updated, $extra_info, $status));
global $sqlout;
write_to_log(AT_ADMIN_LOG_INSERT, 'themes', $result, $sqlout);
}
if (!$result) {
clr_dir("../../themes/" . $theme);
if ($_GET['permission_granted'] == 1) {
header('Location: ' . AT_BASE_HREF . 'mods/_core/themes/theme_install_step_3.php?error=1');
} else {
$msg->addError('IMPORT_FAILED');
header('Location: ' . AT_BASE_HREF . 'mods/_core/themes/install_themes.php');
}
} else {
if ($_GET['permission_granted'] == 1) {
header('Location: ' . AT_BASE_HREF . 'mods/_core/themes/theme_install_step_3.php?installed=1');
} else {
$msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
header('Location: ' . AT_BASE_HREF . 'mods/_core/themes/index.php');