function getGoods($id) { $json = file_get_contents_curl("https://hws.alicdn.com/cache/mtop.wdetail.getItemDescx/4.1/?data=%7B%22item_num_id%22%3A%22{$id}%22%7D"); $data = json_decode($json, 1); if ($data['data']['pages']) { $content = ""; foreach ($data['data']['pages'] as $p) { $content .= $p; } $content = str_replace("<img>", "<img src=", $content); $content = str_replace("</img>", ">", $content); $content = str_replace("txt", "p", $content); } if ($content) { $json = file_get_contents_curl("https://hws.alicdn.com/cache/wdetail/5.0/?id={$id}"); $data = json_decode($json, 1); $goods_name = $data['data']['itemInfoModel']['title']; $props = $data['data']['props']; if ($props) { $goods_props = ''; foreach ($props as $p) { $goods_props .= "<p>{$p['name']}:{$p['value']}</p>"; } $content = $goods_props . $content; } if ($data['data']['itemInfoModel']['picsPath']) { $imgArr = array(); foreach ($data['data']['itemInfoModel']['picsPath'] as $k => $img) { if ($k >= $num) { break; } //$imgArr[$k] = str_replace("../",ROOT_PATH,getImg($img)); $imgArr[$k] = getImg($img); } } if ($_GET['do'] == 1) { if ($istitle == 1) { $uptitle = ",goods_name='{$goods_name}'"; } $db->query("update {$ecs->table('goods')} set \n\t\t\t\tgoods_desc='{$content}',goods_thumb='{$imgArr[0]['thumb']}',goods_img='{$imgArr[0]['goods']}',original_img='{$imgArr[0]['source']}'{$uptitle} \n\t\t\t\twhere goods_id={$gid}"); foreach ($imgArr as $v) { $db->query("insert into {$ecs->table('goods_gallery')} (goods_id,img_url,thumb_url,img_original) value ({$gid},'{$v[goods]}','{$v[thumb]}','{$v[source]}')"); } } else { include_once ROOT_PATH . 'includes/fckeditor/fckeditor.php'; $smarty->assign('content', $content); $smarty->assign('img_list', $imgArr); $smarty->assign('id', $id); $smarty->assign('gid', $gid); $smarty->assign('istitle', $istitle); $smarty->assign('iscomment', $iscomment); $smarty->assign('goods_name', $goods_name); $smarty->assign('comment_list', $comment_list); $smarty->display('gettaobaoview.html'); } } else { sys_msg('提取失败', 0, $link); } }
} /* 特殊等级会员组不判断积分限制 */ if ($special_rank == 0) { /* 检查上限有无重复 */ if (!$exc->is_only('max_points', intval($_POST['max_points']))) { sys_msg(sprintf($_LANG['integral_max_exists'], intval($_POST['max_points']))); } } $sql = "INSERT INTO " . $ecs->table('user_rank') . "( " . "rank_name, min_points, max_points, discount, special_rank, show_price" . ") VALUES (" . "'{$_POST['rank_name']}', '" . intval($_POST['min_points']) . "', '" . intval($_POST['max_points']) . "', " . "'{$_POST['discount']}', '{$special_rank}', '" . intval($_POST['show_price']) . "')"; $db->query($sql); /* 管理员日志 */ admin_log(trim($_POST['rank_name']), 'add', 'user_rank'); clear_cache_files(); $lnk[] = array('text' => $_LANG['back_list'], 'href' => 'user_rank.php?act=list'); $lnk[] = array('text' => $_LANG['add_continue'], 'href' => 'user_rank.php?act=add'); sys_msg($_LANG['add_rank_success'], 0, $lnk); } elseif ($_REQUEST['act'] == 'remove') { check_authz_json('user_rank'); $rank_id = intval($_GET['id']); if ($exc->drop($rank_id)) { /* 更新会员表的等级字段 */ $exc_user->edit("user_rank = 0", $rank_id); $rank_name = $exc->get_name($rank_id); admin_log(addslashes($rank_name), 'remove', 'user_rank'); clear_cache_files(); } $url = 'user_rank.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']); ecs_header("Location: {$url}\n"); exit; } elseif ($_REQUEST['act'] == 'edit_name') { $id = intval($_REQUEST['id']);
$sql .= db_create_in($_POST['checkboxs'], 'topic_id'); } elseif (!empty($_GET['id'])) { $_GET['id'] = intval($_GET['id']); $sql .= "topic_id = '{$_GET['id']}'"; } else { exit; } $db->query($sql); clear_cache_files(); if (!empty($_REQUEST['is_ajax'])) { $url = 'topic.php?act=query&' . str_replace('act=delete', '', $_SERVER['QUERY_STRING']); ecs_header("Location: {$url}\n"); exit; } $links[] = array('href' => 'topic.php', 'text' => $_LANG['back_list']); sys_msg($_LANG['succed'], 0, $links); } elseif ($_REQUEST['act'] == 'query') { $topic_list = get_topic_list(); $smarty->assign('topic_list', $topic_list['item']); $smarty->assign('filter', $topic_list['filter']); $smarty->assign('record_count', $topic_list['record_count']); $smarty->assign('page_count', $topic_list['page_count']); $smarty->assign('use_storage', empty($_CFG['use_storage']) ? 0 : 1); /* 排序标记 */ $sort_flag = sort_flag($topic_list['filter']); $smarty->assign($sort_flag['tag'], $sort_flag['img']); $tpl = 'topic_list.htm'; make_json_result($smarty->fetch($tpl), '', array('filter' => $topic_list['filter'], 'page_count' => $topic_list['page_count'])); } /** * 获取专题列表.
} elseif ($_REQUEST['act'] == 'batch_drop') { admin_priv('tag_manage'); if (isset($_POST['checkboxes'])) { $count = 0; foreach ($_POST['checkboxes'] as $key => $id) { $sql = "DELETE FROM " . $ecs->table('tag') . " WHERE tag_id='{$id}'"; $db->query($sql); $count++; } admin_log($count, 'remove', 'tag_manage'); clear_cache_files(); $link[] = array('text' => $_LANG['back_list'], 'href' => 'tag_manage.php?act=list'); sys_msg(sprintf($_LANG['drop_success'], $count), 0, $link); } else { $link[] = array('text' => $_LANG['back_list'], 'href' => 'tag_manage.php?act=list'); sys_msg($_LANG['no_select_tag'], 0, $link); } } elseif ($_REQUEST['act'] == 'remove') { check_authz_json('tag_manage'); include_once ROOT_PATH . 'includes/cls_json.php'; $json = new JSON(); $id = intval($_GET['id']); /* 鑾峰彇鍒犻櫎鐨勬爣绛剧殑鍚嶇О */ $tag_name = $db->getOne("SELECT tag_words FROM " . $ecs->table('tag') . " WHERE tag_id = '{$id}'"); $sql = "DELETE FROM " . $ecs->table('tag') . " WHERE tag_id = '{$id}'"; $result = $GLOBALS['db']->query($sql); if ($result) { /* 绠$悊鍛樻棩蹇 */ admin_log(addslashes($tag_name), 'remove', 'tag_manage'); $url = 'tag_manage.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']); ecs_header("Location: {$url}\n");
sys_msg('操作成功', 0, $link); } elseif ($_REQUEST['act'] == 'edit') { $info = $db->GetRow("SELECT * FROM " . $ecs->table('goods_tag') . " WHERE tag_id='{$_REQUEST['id']}'"); $smarty->assign('ur_here', '编辑标签'); $smarty->assign('action_link', array('text' => '返回', 'href' => 'goods_tag.php?act=list&goods_id=' . $goods_id)); $smarty->assign('info', $info); $smarty->assign('form_action', 'updata'); assign_query_info(); $smarty->display('goods_tag_info.htm'); } elseif ($_REQUEST['act'] == 'updata') { $tag_name = trim($_POST['tag_name']); $is = $db->GetOne("SELECT tag_id FROM " . $ecs->table('goods_tag') . " WHERE goods_id = '{$goods_id}' AND tag_name='{$tag_name}' AND tag_id != '{$_POST['id']}'"); if ($is > 0) { sys_msg("标签名称已经存在,请修改!", 1, array(), false); } $db->query("UPDATE " . $ecs->table('goods_tag') . " SET tag_name = '{$tag_name}' WHERE tag_id = '{$_POST['id']}'"); $link[0]['text'] = '返回列表'; $link[0]['href'] = "goods_tag.php?act=list&goods_id={$goods_id}"; sys_msg('操作成功', 0, $link); } elseif ($_REQUEST['act'] == 'remove') { $id = intval($_GET['id']); $db->query("delete from " . $ecs->table('goods_tag') . " where tag_id = '{$id}'"); $url = 'goods_tag.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']); ecs_header("Location: {$url}\n"); exit; } elseif ($_REQUEST['act'] == 'edit_displayorder') { $id = intval($_POST['id']); $val = intval($_POST['val']); data_update("goods_tag", array('displayorder' => $val), $id, 'tag_id'); make_json_result($val); }
check_authz_json('article_manage'); if (!isset($_POST['checkboxes']) || !is_array($_POST['checkboxes'])) { sys_msg($_LANG['no_select_article'], 1); } if (!$_POST['target_cat']) { sys_msg($_LANG['no_select_act'], 1); } foreach ($_POST['checkboxes'] as $key => $id) { $exc->edit("cat_id = '" . $_POST['target_cat'] . "'", $id); } } } /* 清除缓存 */ clear_cache_files(); $lnk[] = array('text' => $_LANG['back_list'], 'href' => 'article.php?act=list'); sys_msg($_LANG['batch_handle_ok'], 0, $lnk); } /* 把商品删除关联 */ function drop_link_goods($goods_id, $article_id) { $sql = "DELETE FROM " . $GLOBALS['ecs']->table('goods_article') . " WHERE goods_id = '{$goods_id}' AND article_id = '{$article_id}' LIMIT 1"; $GLOBALS['db']->query($sql); create_result(true, '', $goods_id); } /* 取得文章关联商品 */ function get_article_goods($article_id) { $list = array(); $sql = 'SELECT g.goods_id, g.goods_name' . ' FROM ' . $GLOBALS['ecs']->table('goods_article') . ' AS ga' . ' LEFT JOIN ' . $GLOBALS['ecs']->table('goods') . ' AS g ON g.goods_id = ga.goods_id' . " WHERE ga.article_id = '{$article_id}'"; $list = $GLOBALS['db']->getAll($sql); return $list;
$filename = $_CFG[$code]; //删除文件 @unlink($filename); //更新设置 update_configure($code, ''); /* 记录日志 */ admin_log('', 'edit', 'shop_config'); /* 清除缓存 */ clear_all_files(); sys_msg($_LANG['save_success'], 0); } /** * 设置系统设置 * * @param string $key * @param string $val * * @return boolean */ function update_configure($key, $val='') { if (!empty($key)) {
if (isset($value)) { $phone .= implode(',', $value); } } $msg = isset($_POST['msg']) ? $_POST['msg'] : ''; if (EC_CHARSET != 'utf-8') { $msg = ecs_iconv(EC_CHARSET, 'utf-8', $msg); } $send_date = isset($_POST['send_date']) ? $_POST['send_date'] : ''; $result = $sms->send($phone, $msg, $send_date, $send_num = 13); $link[] = array('text' => $_LANG['back'] . $_LANG['03_sms_send'], 'href' => 'sms.php?act=display_send_ui'); if ($result === true) { sys_msg($_LANG['send_ok'], 0, $link); } else { @($error_detail = $_LANG['server_errors'][$sms->errors['server_errors']['error_no']] . $_LANG['api_errors']['send'][$sms->errors['api_errors']['error_no']]); sys_msg($_LANG['send_error'] . $error_detail, 1, $link); } break; // /* 显示发送记录的查询界面,如果尚未注册或启用短信服务则显示注册界面。 */ // case 'display_send_history_ui' : // /* 检查权限 */ // admin_priv('send_history'); // if ($sms->has_registered()) // { // $smarty->assign('ur_here', $_LANG['05_sms_send_history']); // assign_query_info(); // $smarty->display('sms_send_history_query_ui.htm'); // } // else // { // $smarty->assign('ur_here', $_LANG['register_sms']);
} } else { $result['error'] = '1'; $result['message'] = '参数为空!'; } if ($result['error'] == '1') { echo $json->encode($result); } else { if ($_REQUEST['act_from'] == 'invoice_info') { $link_text = '发票列表'; $link_href = 'order.php?act=invoice_list'; $msg_detail = '取消开票成功!'; $msg_type = '0'; $links = array(array('text' => $link_text, 'href' => $link_href)); $auto_redirect = true; sys_msg($msg_detail, $msg_type, $links, $auto_redirect); } else { $url = 'order.php?act=query&act_detail=invoice_query&' . str_replace('act=unprovide_provice', '', $_SERVER['QUERY_STRING']); ecs_header("Location: {$url}\n"); exit; } } } elseif ($_REQUEST['act'] == 'save_inv_remark') { admin_priv('invoice_manage'); include_once ROOT_PATH . 'includes/cls_json.php'; $json = new JSON(); $result = array('error' => 0, 'message' => '', 'content' => ''); $inv_remark = empty($_REUQEST['inv_remark']) ? '' : json_str_iconv(trim($_REUQEST['inv_remark'])); $order_id = empty($_REUQEST['inv_remark']) ? '' : json_str_iconv(trim($_REUQEST['inv_remark'])); if (!empty($inv_remark)) { $sql = 'UPDATE ' . $GLOBALS['ecs']->table('order_info') . ' SET `inv_remark`=\'' . $inv_remark . '\'' . ' WHERE `order_id`=\'' . $order_id . '\'';
$smarty->assign('form_action', $form_action); assign_query_info(); $smarty->display('reg_field_info.htm'); } elseif ($_REQUEST['act'] == 'update') { admin_priv('reg_fields'); /* 检查是否存在重名的会员注册项 */ if ($_POST['reg_field_name'] != $_POST['old_field_name'] && !$exc->is_only('reg_field_name', trim($_POST['reg_field_name']))) { sys_msg(sprintf($_LANG['field_name_exist'], trim($_POST['reg_field_name'])), 1); } $sql = "UPDATE " . $ecs->table('reg_fields') . " SET `reg_field_name` = '{$_POST['reg_field_name']}', `dis_order` = '{$_POST['reg_field_order']}', `display` = '{$_POST['reg_field_display']}', `is_need` = '{$_POST['reg_field_need']}' WHERE `id` = '{$_POST['id']}'"; $db->query($sql); /* 管理员日志 */ admin_log(trim($_POST['reg_field_name']), 'edit', 'reg_fields'); clear_cache_files(); $lnk[] = array('text' => $_LANG['back_list'], 'href' => 'reg_fields.php?act=list'); sys_msg($_LANG['update_field_success'], 0, $lnk); } elseif ($_REQUEST['act'] == 'remove') { check_authz_json('reg_fields'); $field_id = intval($_GET['id']); $field_name = $exc->get_name($field_id); if ($exc->drop($field_id)) { /* 删除会员扩展信息表的相应信息 */ $sql = "DELETE FROM " . $GLOBALS['ecs']->table('reg_extend_info') . " WHERE reg_field_id = '" . $field_id . "'"; @$GLOBALS['db']->query($sql); admin_log(addslashes($field_name), 'remove', 'reg_fields'); clear_cache_files(); } $url = 'reg_fields.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']); ecs_header("Location: {$url}\n"); exit; } elseif ($_REQUEST['act'] == 'edit_name') {
/** * 添加/编辑客服信息的提交 */ function action_insert_update() { $user = $GLOBALS['user']; $_CFG = $GLOBALS['_CFG']; $_LANG = $GLOBALS['_LANG']; $smarty = $GLOBALS['smarty']; $db = $GLOBALS['db']; $ecs = $GLOBALS['ecs']; $user_id = $_SESSION['user_id']; $user_id = intval($_POST['user_id']); /* 取得客服id */ $cus_id = intval($_POST['cus_id']); $customer = array('supp_id' => -1, 'user_id' => $_POST['user_id'], 'of_username' => $_POST['of_username'], 'cus_name' => $_POST['cus_name'], 'cus_password' => $_POST['cus_password'], 'cus_type' => $_POST['cus_type'], 'cus_enable' => $_POST['cus_enable'], 'cus_desc' => $_POST['cus_desc']); // 判断密码是否为空 if (empty($customer['of_username'])) { sys_msg($_LANG['error_of_username_empty']); } // 判断客服名称是否为空 if (empty($customer['cus_name'])) { sys_msg($_LANG['error_cus_name_empty']); } // 检查聊天系统用户名是否已经绑定了其他管理员账户 if (check_of_username_binding($customer['of_username'], $customer['user_id'])) { sys_msg($_LANG['error_of_username_binding']); } else { // 用户不存在则需要判断密码是否为空 if (!check_of_username_exist($customer['of_username'])) { // 判断密码是否为空 if (empty($customer['cus_password'])) { sys_msg($_LANG['error_password_empty']); } } // 创建活更新聊天系统用户 $create_success = create_of_user($customer['of_username'], $customer['cus_password'], $customer['cus_name'], null, 10, -1); if (!$create_success) { sys_msg($_LANG['error_create_of_user']); } } if (empty($_POST['cus_id'])) { // 检查管理员账户是否存在 if (check_user_id_exist($user_id)) { sys_msg($_LANG['error_user_id_exist']); } $customer['add_time'] = gmtime(); /* insert */ $db->autoExecute($ecs->table('chat_customer'), $customer, 'INSERT'); /* log */ admin_log(addslashes($customer['of_username']), 'add', 'chat_customer'); /* 提示信息 */ $links = array(array('href' => 'customer.php?act=add', 'text' => $_LANG['continue_add']), array('href' => 'customer.php?act=list', 'text' => $_LANG['back_list'])); sys_msg($_LANG['add_success'], 0, $links); } else { // 检查管理员账户是否存在 if (check_user_id_exist($user_id, $cus_id)) { sys_msg($_LANG['error_user_id_exist']); } /* update */ $db->autoExecute($ecs->table('chat_customer'), $customer, 'UPDATE', "cus_id = '{$cus_id}'"); /* log */ admin_log(addslashes($customer['of_username']) . '[' . $cus_id . ']', 'edit', 'chat_customer'); /* 提示信息 */ $links = array(array('href' => 'customer.php?act=list&' . list_link_postfix(), 'text' => $_LANG['back_list'])); sys_msg($_LANG['edit_success'], 0, $links); } /* 显示客服列表页面 */ assign_query_info(); $smarty->display('customer_info.htm'); }
sys_msg('该返佣记录不存在!'); } //入驻商资金添加日志 //writelog($rebid,1); $sql = "update " . $GLOBALS['ecs']->table('order_info') . " set store_rebate_ispay=1 where store_rebate_id=" . $rebid . " and store_rebate_ispay=2"; $links[] = array('href' => 'supplier_store_rebate.php?act=list', 'text' => '查看本期佣金列表'); if ($GLOBALS['db']->query($sql)) { $rebate_order = array('rebateid' => $rebid, 'username' => '平台方:' . $_SESSION['user_name'], 'type' => REBATE_LOG_ORDER, 'typedec' => '撤销分销商(仓库)全部佣金', 'contents' => '相关佣金结算订单全部撤销', 'addtime' => gmtime()); $db->autoExecute($ecs->table('store_rebate_log'), $rebate_order, 'INSERT'); $db->query("update " . $ecs->table('store_rebate') . " set status=0 where rebate_id=" . $rebid); //修改佣金信息状态记录 $rebate_list = array('rebateid' => $rebid, 'username' => '平台方:' . $_SESSION['user_name'], 'type' => REBATE_LOG_LIST, 'typedec' => '撤销分销商(仓库)全部佣金', 'contents' => '佣金状态由可结算变冻结', 'addtime' => gmtime()); //$db->autoExecute($ecs->table('supplier_rebate_log'), $rebate_list, 'INSERT'); sys_msg($_LANG['act_ok'], 0, $links); } else { sys_msg('操作失败', 1, $links); } } //佣金中的妥投订单 function getOkOrder() { global $ecs, $db, $rebate; $result = get_filter(); if ($result === false) { $filter['rid'] = $rid = isset($_REQUEST['rid']) && intval($_REQUEST['rid']) > 0 ? intval($_REQUEST['rid']) : 0; $filter['add_time_start'] = !empty($_REQUEST['add_time_start']) ? local_strtotime($_REQUEST['add_time_start']) : 0; $filter['add_time_end'] = !empty($_REQUEST['add_time_end']) ? local_strtotime($_REQUEST['add_time_end'] . " 23:59:59") : 0; $filter['order_sn'] = isset($_REQUEST['order_sn']) ? trim($_REQUEST['order_sn']) : ''; //$and = ' rebate_id='.$rid.' and shipping_status in ('.SS_SHIPPED.','.SS_RECEIVED.')'; $and = ' store_rebate_id=' . $rid; //$hpay_id = getPayHoudaofukuan();
/* 删除团购活动 */ $sql = "DELETE FROM " . $GLOBALS['ecs']->table('goods_activity') . " WHERE act_id = '{$id}' LIMIT 1"; $GLOBALS['db']->query($sql, 'SILENT'); admin_log(addslashes($group_buy['goods_name']) . '[' . $id . ']', 'remove', 'group_buy'); $del_count++; } } /* 如果删除了团购活动,清除缓存 */ if ($del_count > 0) { clear_cache_files(); } $links[] = array('text' => $_LANG['back_list'], 'href' => 'group_buy.php?act=list'); sys_msg(sprintf($_LANG['batch_drop_success'], $del_count), 0, $links); } else { $links[] = array('text' => $_LANG['back_list'], 'href' => 'group_buy.php?act=list'); sys_msg($_LANG['no_select_group_buy'], 0, $links); } } elseif ($_REQUEST['act'] == 'search_goods') { check_authz_json('group_by'); include_once ROOT_PATH . 'includes/cls_json.php'; $json = new JSON(); $filter = $json->decode($_GET['JSON']); $arr = get_goods_list($filter); make_json_result($arr); } elseif ($_REQUEST['act'] == 'edit_deposit') { check_authz_json('group_by'); $id = intval($_POST['id']); $val = floatval($_POST['val']); $sql = "SELECT ext_info FROM " . $ecs->table('goods_activity') . " WHERE act_id = '{$id}' AND act_type = '" . GAT_GROUP_BUY . "'"; $ext_info = unserialize($db->getOne($sql)); $ext_info['deposit'] = $val;
$smarty->display('stock_out_type_info.htm'); } elseif ($_REQUEST['act'] == 'insert') { /* 权限判断 */ admin_priv('stock_out_type'); $remarks = $_POST['remarks']; $add_time = gmtime(); $user_id = $_SESSION[admin_id]; $admin_agency_id = admin_agency_id(); $ip_addr = real_ip(); $sql = "INSERT INTO " . $ecs->table('stock_out_type') . "(remarks, add_time, user_id, if_delete, ip_addr, admin_agency_id ) " . "VALUES ('{$remarks}', '{$add_time}', '{$user_id}', '0', '{$ip_addr}', '{$admin_agency_id}')"; $db->query($sql); clear_cache_files(); // 清除相关的缓存文件 $link[0]['text'] = "操作成功"; $link[0]['href'] = 'stock_out_type.php?act=list'; sys_msg("出库类型添加操作成功", 0, $link); } elseif ($_REQUEST['act'] == 'query') { check_authz_json('stock_out_type'); $type_list = get_typelist(); /*判断代理商或管理员*/ if (if_agency()) { $smarty->assign('if_agency', if_agency()); } $smarty->assign('type_list', $type_list['arr']); $smarty->assign('filter', $type_list['filter']); $smarty->assign('record_count', $type_list['record_count']); $smarty->assign('page_count', $type_list['page_count']); make_json_result($smarty->fetch('stock_out_type_list.htm'), '', array('filter' => $type_list['filter'], 'page_count' => $type_list['page_count'])); } elseif ($_REQUEST['act'] == 'remove') { check_authz_json('stock_out_type'); $id = intval($_REQUEST['id']);
/* 提交值 */ $rebate_id = intval($_POST['id']); $rebate = array('pay_type' => trim($_POST['pay_type_input']), 'remark' => trim($_POST['remark']), 'pay_time' => $pay_time, 'is_pay_ok' => 1); /* 取得供货商信息 */ $sql = "SELECT * FROM " . $ecs->table('supplier_rebate') . " WHERE rebate_id = '" . $rebate_id . "' "; $rebate_old = $db->getRow($sql); if (empty($rebate_old['rebate_id'])) { sys_msg('该返佣信息不存在!'); } /* 保存返佣信息 */ $db->autoExecute($ecs->table('supplier_rebate'), $rebate, 'UPDATE', "rebate_id = '" . $rebate_id . "'"); /* 清除缓存 */ clear_cache_files(); /* 提示信息 */ $links[] = array('href' => 'supplier_rebate.php?act=list&is_pay_ok=0', 'text' => '返回未处理佣金列表'); sys_msg('恭喜,处理成功!', 0, $links); } /** * 获取供应商列表信息 * * @access public * @param * * @return void */ function rebate_list() { $result = get_filter(); if ($result === false) { $aiax = isset($_GET['is_ajax']) ? $_GET['is_ajax'] : 0; /* 过滤信息 */
$sql_delivery = "UPDATE " . $ecs->table('delivery_order') . "\n SET status = 1\n WHERE status IN (0, 2)\n AND order_id = " . $order['order_id']; $GLOBALS['db']->query($sql_delivery, 'SILENT'); /* 将订单的商品发货数量更新为 0 */ $sql = "UPDATE " . $GLOBALS['ecs']->table('order_goods') . "\n SET send_number = 0\n WHERE order_id = '{$order_id}'"; $GLOBALS['db']->query($sql, 'SILENT'); /* 清除缓存 */ clear_cache_files(); } elseif ('after_service' == $operation) { /* 记录log */ order_action($order['order_sn'], $order['order_status'], $order['shipping_status'], $order['pay_status'], '[' . $_LANG['op_after_service'] . '] ' . $action_note); } else { die('invalid params'); } /* 操作成功 */ $links[] = array('text' => $_LANG['order_info'], 'href' => 'order.php?act=info&order_id=' . $order_id); sys_msg($_LANG['act_ok'] . $msg, 0, $links); } elseif ($_REQUEST['act'] == 'json') { include_once ROOT_PATH . 'includes/cls_json.php'; $json = new JSON(); $func = $_REQUEST['func']; if ($func == 'get_goods_info') { /* 取得商品信息 */ $goods_id = $_REQUEST['goods_id']; $sql = "SELECT goods_id, c.cat_name, goods_sn, goods_name, b.brand_name, " . "goods_number, market_price, shop_price, promote_price, " . "promote_start_date, promote_end_date, goods_brief, goods_type, is_promote " . "FROM " . $ecs->table('goods') . " AS g " . "LEFT JOIN " . $ecs->table('brand') . " AS b ON g.brand_id = b.brand_id " . "LEFT JOIN " . $ecs->table('category') . " AS c ON g.cat_id = c.cat_id " . " WHERE goods_id = '{$goods_id}'"; $goods = $db->getRow($sql); $today = gmtime(); $goods['goods_price'] = $goods['is_promote'] == 1 && $goods['promote_start_date'] <= $today && $goods['promote_end_date'] >= $today ? $goods['promote_price'] : $goods['shop_price']; /* 取得会员价格 */ $sql = "SELECT p.user_price, r.rank_name " . "FROM " . $ecs->table('member_price') . " AS p, " . $ecs->table('user_rank') . " AS r " . "WHERE p.user_rank = r.rank_id " . "AND p.goods_id = '{$goods_id}' "; $goods['user_price'] = $db->getAll($sql); /* 取得商品属性 */
$smarty->assign('full_page', 1); $smarty->assign('timeplan', getTurn()); $smarty->display('delivery_list.htm'); } elseif ($_REQUEST['act'] == 'query') { $list = order_list(); $smarty->assign('order_list', $list['orders']); $smarty->assign('record_count', $list['record_count']); $smarty->assign('page_count', $list['page_count']); $smarty->assign('filter', $list['filter']); $smarty->assign('employees', $list['senders']); make_json_result($smarty->fetch('delivery_list.htm'), '', array('filter' => $list['filter'], 'page_count' => $list['page_count'])); } elseif ($_REQUEST['act'] == 'sender') { $order_id = $_REQUEST['order_id']; $order_id_list = explode(',', $order_id); if (empty($_REQUEST['sender'])) { sys_msg('请选择配送员!', 1); } else { $sender = intval($_REQUEST['sender']); foreach ($order_id_list as $order) { $sql = "update order_delivery set employee_id = '{$sender}' where order_id = '{$order}'"; $db_write->query($sql); } } $url = 'shipping_delivery.php?act=query&' . str_replace('act=sender', '', $_SERVER['QUERY_STRING']); los_header("Location: {$url}\n"); exit; } elseif ($_REQUEST['act'] == 'print') { $order_id = $_REQUEST['order_id']; $order_id_list = explode(',', $order_id); foreach ($order_id_list as $order) { $db_write->query("UPDATE order_delivery SET status =2,admind = '" . $_SESSION['admin_id'] . "',out_time = '" . time() . "' WHERE order_id = '{$order}'");
} /* 编辑文本类型的广告 */ if ($type == 3) { $ad_code = "ad_code = '{$_POST['ad_text']}', "; } $ad_code = str_replace('../' . DATA_DIR . '/afficheimg/', '', $ad_code); /* 更新信息 */ $sql = "UPDATE " . $ecs->table('ad') . " SET " . "position_id = '{$_POST['position_id']}', " . "ad_name = '{$_POST['ad_name']}', " . "ad_link = '{$ad_link}', " . $ad_code . "start_time = '{$start_time}', " . "end_time = '{$end_time}', " . "link_man = '{$_POST['link_man']}', " . "link_email = '{$_POST['link_email']}', " . "link_phone = '{$_POST['link_phone']}', " . "enabled = '{$_POST['enabled']}' " . "WHERE ad_id = '{$id}'"; $db->query($sql); /* 记录管理员操作 */ admin_log($_POST['ad_name'], 'edit', 'ads'); clear_cache_files(); // 清除模版缓存 /* 提示信息 */ $href[] = array('text' => $_LANG['back_ads_list'], 'href' => 'ads.php?act=list'); sys_msg($_LANG['edit'] . ' ' . $_POST['ad_name'] . ' ' . $_LANG['attradd_succed'], 0, $href); } elseif ($_REQUEST['act'] == 'add_js') { admin_priv('ad_manage'); /* 编码 */ $lang_list = array('UTF8' => $_LANG['charset']['utf8'], 'GB2312' => $_LANG['charset']['zh_cn'], 'BIG5' => $_LANG['charset']['zh_tw']); $js_code = "<script type=" . '"' . "text/javascript" . '"'; $js_code .= ' src=' . '"' . $ecs->url() . 'affiche.php?act=js&type=' . $_REQUEST['type'] . '&ad_id=' . intval($_REQUEST['id']) . '"' . '></script>'; $site_url = $ecs->url() . 'affiche.php?act=js&type=' . $_REQUEST['type'] . '&ad_id=' . intval($_REQUEST['id']); $smarty->assign('ur_here', $_LANG['add_js_code']); $smarty->assign('action_link', array('href' => 'ads.php?act=list', 'text' => $_LANG['ad_list'])); $smarty->assign('url', $site_url); $smarty->assign('js_code', $js_code); $smarty->assign('lang_list', $lang_list); assign_query_info(); $smarty->display('ads_js.htm'); } elseif ($_REQUEST['act'] == 'edit_ad_name') {
/* 处理保证金 */ $exc->edit("is_finished = 2", $id); // 修改状态 if (isset($_POST['unfreeze'])) { /* 解冻 */ log_account_change($auction['last_bid']['bid_user'], $auction['deposit'], -1 * $auction['deposit'], 0, 0, sprintf($_LANG['unfreeze_auction_deposit'], $auction['act_name'])); } else { /* 扣除 */ log_account_change($auction['last_bid']['bid_user'], 0, -1 * $auction['deposit'], 0, 0, sprintf($_LANG['deduct_auction_deposit'], $auction['act_name'])); } /* 记日志 */ admin_log($auction['act_name'], 'edit', 'auction'); /* 清除缓存 */ clear_cache_files(); /* 提示信息 */ sys_msg($_LANG['settle_deposit_ok']); } elseif ($_REQUEST['act'] == 'search_goods') { check_authz_json('auction'); include_once ROOT_PATH . 'includes/cls_json.php'; $json = new JSON(); $filter = $json->decode($_GET['JSON']); $arr['goods'] = get_goods_list($filter); if (!empty($arr['goods'][0]['goods_id'])) { $arr['products'] = get_good_products($arr['goods'][0]['goods_id']); } make_json_result($arr); } elseif ($_REQUEST['act'] == 'search_products') { include_once ROOT_PATH . 'includes/cls_json.php'; $json = new JSON(); $filters = $json->decode($_GET['JSON']); if (!empty($filters->goods_id)) {
$sm->add_item($smi); } /* 商品 */ $sql = "SELECT goods_id, goods_name FROM " . $ecs->table('goods') . " WHERE is_delete = 0"; $res = $db->query($sql); while ($row = $db->fetchRow($res)) { $smi = new google_sitemap_item($domain . build_uri('goods', array('gid' => $row['goods_id']), $row['goods_name']), $today, $_POST['content_changefreq'], $_POST['content_priority']); $sm->add_item($smi); } /* 文章 */ $sql = "SELECT article_id,title,file_url,open_type FROM " . $ecs->table('article') . " WHERE is_open=1"; $res = $db->query($sql); while ($row = $db->fetchRow($res)) { $article_url = $row['open_type'] != 1 ? build_uri('article', array('aid' => $row['article_id']), $row['title']) : trim($row['file_url']); $smi = new google_sitemap_item($domain . $article_url, $today, $_POST['content_changefreq'], $_POST['content_priority']); $sm->add_item($smi); } clear_cache_files(); // 清除缓存 $sm_file = '../sitemaps.xml'; if ($sm->build($sm_file)) { sys_msg(sprintf($_LANG['generate_success'], $ecs->url() . "sitemaps.xml")); } else { $sm_file = '../' . DATA_DIR . '/sitemaps.xml'; if ($sm->build($sm_file)) { sys_msg(sprintf($_LANG['generate_success'], $ecs->url() . DATA_DIR . '/sitemaps.xml')); } else { sys_msg(sprintf($_LANG['generate_failed'])); } } }
if (strpos($_POST['link_url'], 'http://') === false && strpos($_POST['link_url'], 'https://') === false) { $link_url = 'http://' . trim($_POST['link_url']); } else { $link_url = trim($_POST['link_url']); } /* 更新信息 */ $sql = "UPDATE " . $ecs->table('friend_link') . " SET " . "link_name = '{$link_name}', " . "link_url = '{$link_url}' " . $link_logo . ',' . "show_order = '{$show_order}' " . "WHERE link_id = '{$id}'"; $db->query($sql); /* 记录管理员操作 */ admin_log($_POST['link_name'], 'edit', 'friendlink'); /* 清除缓存 */ clear_cache_files(); /* 提示信息 */ $link[0]['text'] = $_LANG['back_list']; $link[0]['href'] = 'friend_link.php?act=list&' . list_link_postfix(); sys_msg($_LANG['edit'] . " " . stripcslashes($_POST['link_name']) . " " . $_LANG['attradd_succed'], 0, $link); } elseif ($_REQUEST['act'] == 'edit_link_name') { check_authz_json('friendlink'); $id = intval($_POST['id']); $link_name = json_str_iconv(trim($_POST['val'])); /* 检查链接名称是否重复 */ if ($exc->num("link_name", $link_name, $id) != 0) { make_json_error(sprintf($_LANG['link_name_exist'], $link_name)); } else { if ($exc->edit("link_name = '{$link_name}'", $id)) { admin_log($link_name, 'edit', 'friendlink'); clear_cache_files(); make_json_result(stripslashes($link_name)); } else { make_json_error($db->error()); }
/** * 编辑专题 */ public function edit() { $id = I('id'); if (!$id) { $this->redirect(url('index')); } if (IS_POST) { $data = I('data'); /* 数据验证 */ $msg = Check::rule(array(array(Check::must($_POST['topic_name']), L('topic_name_empty')), array(Check::must($_POST['start_time']), L('start_time_empty')), array(Check::must($_POST['end_time']), L('end_time_empty')))); /* 提示信息 */ if ($msg !== true) { $this->message($msg, NULL, 'error'); } $topic_type = empty($data['topic_type']) ? 0 : intval($data['topic_type']); switch ($topic_type) { case '0': case '1': // 主图上传 if ($_FILES['topic_img']['name'] && $_FILES['topic_img']['size'] > 0) { $result = $this->ectouchUpload('topic_img', 'topic_image'); if ($result['error'] > 0) { $this->message($result['message'], NULL, 'error'); } /* 生成logo链接 */ $topic_img = substr($result['message']['topic_img']['savepath'], 2) . $result['message']['topic_img']['savename']; } else { if (!empty($_POST['url'])) { /* 来自互联网图片 不可以是服务器地址 */ if (strstr(I('post.url'), 'http') && !strstr(I('post.url'), $_SERVER['SERVER_NAME'])) { /* 取互联网图片至本地 */ $topic_img = get_url_image(I('post.url')); } else { sys_msg(L('web_url_no')); } } } $data['topic_img'] = empty($topic_img) ? I('post.img_url') : $topic_img; $htmls = ''; break; case '2': $htmls = I('post.content'); $data['topic_img'] = ''; break; } // 标题图上传 if ($_FILES['title_pic']['name'] && $_FILES['title_pic']['size'] > 0) { $result = $this->ectouchUpload('title_pic', 'topic_image'); if ($result['error'] > 0) { $this->message($result['message'], NULL, 'error'); } /* 生成logo链接 */ $data['title_pic'] = substr($result['message']['title_pic']['savepath'], 2) . $result['message']['title_pic']['savename']; } else { if (!empty($_REQUEST['title_url'])) { /* 来自互联网图片 不可以是服务器地址 */ if (strstr(I('post.title_url'), 'http') && !strstr(I('post.title_url'), $_SERVER['SERVER_NAME'])) { /* 取互联网图片至本地 */ $data['title_pic'] = get_url_image(I('post.title_url')); } else { sys_msg(L('web_url_no')); } } } unset($target); $data['title'] = I('post.topic_name'); $title_pic = empty($data['title_pic']) ? I('post.title_img_url') : $data['title_pic']; $data['template'] = I('post.topic_template_file') ? I('post.topic_template_file') : ''; $data['start_time'] = local_strtotime(I('post.start_time')); $data['end_time'] = local_strtotime(I('post.end_time')); $json = new EcsJson(); $tmp_data = $json->decode($_POST['topic_data']); $data['data'] = serialize($tmp_data); $data['intro'] = I('post.topic_intro'); $this->model->table('touch_topic')->data($data)->where('topic_id =' . $id)->update(); $this->message(L('succed'), url('index')); } /* 模板赋值 */ $topic = $this->model->table('touch_topic')->field('*')->where('topic_id =' . $id)->find(); $topic['start_time'] = local_date('Y-m-d', $topic['start_time']); $topic['end_time'] = local_date('Y-m-d', $topic['end_time']); $topic['topic_intro'] = html_out($topic['intro']); $topic['intro'] = html_out($topic['intro']); $json = new EcsJson(); if ($topic['data']) { $topic['data'] = addcslashes($topic['data'], "'"); $topic['data'] = $json->encode(@unserialize($topic['data'])); $topic['data'] = addcslashes($topic['data'], "'"); } if (empty($topic['topic_img']) && empty($topic['htmls'])) { $topic['topic_type'] = 0; } elseif ($topic['htmls'] != '') { $topic['topic_type'] = 2; } elseif (preg_match('/.swf$/i', $topic['topic_img'])) { $topic['topic_type'] = 1; } else { $topic['topic_type'] = ''; } $this->assign('topic', $topic); $this->assign('cat_list', cat_list(0, 1)); $this->assign('brand_list', model('BrandBase')->get_brand_list()); $this->assign('template_list', $this->get_topic_temp_list()); $this->assign('ur_here', L('09_topic')); $this->display(); }
function action_post() { $user = $GLOBALS['user']; $_CFG = $GLOBALS['_CFG']; $_LANG = $GLOBALS['_LANG']; $smarty = $GLOBALS['smarty']; $db = $GLOBALS['db']; $ecs = $GLOBALS['ecs']; $user_id = $_SESSION['user_id']; $chat_keys = $GLOBALS['chat_keys']; // 检查shop_config $sql = "select * from " . $ecs->table("shop_config") . " where code = 'chat'"; $row = $db->getRow($sql, true); if ($row == false) { $sql = "select max(parent_id) from " . $ecs->table("shop_config") . ""; $parent_id = $db->getOne($sql) + 1; $chat = array("id" => $parent_id, "code" => "chat", "parent_id" => 0, "type" => "group", "value" => ""); $db->autoExecute($ecs->table('shop_config'), $chat, 'INSERT'); } else { $parent_id = $row['id']; } $chat_server_ip = empty($_POST['chat_server_ip']) ? '' : $_POST['chat_server_ip']; $chat_server_port = empty($_POST['chat_server_port']) ? '9090' : $_POST['chat_server_port']; $chat_http_bind_port = empty($_POST['chat_http_bind_port']) ? '7070' : $_POST['chat_http_bind_port']; $chat_server_admin_username = empty($_POST['chat_server_admin_username']) ? 'admin' : $_POST['chat_server_admin_username']; $chat_server_admin_password = $_POST['chat_server_admin_password']; $chat = array("chat_server_ip" => $chat_server_ip, "chat_server_port" => $chat_server_port, "chat_http_bind_port" => $chat_http_bind_port, "chat_server_admin_username" => $chat_server_admin_username); if (!empty($chat_server_admin_password)) { $chat['chat_server_admin_password'] = $chat_server_admin_password; } $sql = "select * from " . $ecs->table("shop_config") . " where parent_id = '" . $parent_id . "'"; $rows = $db->getAll($sql); $records = array(); foreach ($rows as $row) { $key = $row['code']; $value = $row['value']; $records[$key] = $row; } foreach ($chat as $key => $value) { if ($key == 'chat_server_admin_password') { $record = array("code" => $key, "value" => $value, "type" => "password", "parent_id" => $parent_id); } else { $record = array("code" => $key, "value" => $value, "type" => "text", "parent_id" => $parent_id); } if (isset($records[$key])) { $id = $records[$key]['id']; if ($value != $records[$key]['value']) { $db->autoExecute($ecs->table('shop_config'), $record, 'UPDATE', "id = '{$id}'"); } } else { $db->autoExecute($ecs->table('shop_config'), $record, 'INSERT', "parent_id = '{$parent_id}'"); } } /* 清除缓存 */ clear_all_files(); $_CFG = load_config(); /* 提示信息 */ $links = array(array('href' => 'chat_settings.php', 'text' => "返回上一页")); sys_msg("修改聊天服务设置成功!", 0, $links); }
* ---------------------------------------------------------------------------- * http://www.phpally.com * Jacklee的博客 致力于php技术 * ---------------------------------------------------------------------------- * 作者: Jacklee * 邮箱: jack349392900#gmail.com * 创建时间: 2014-05-01 * 最后修改时间: 2014-05-01 */ define('IN_ECS', true); require dirname(__FILE__) . '/includes/init.php'; /* 模板赋值 */ $smarty->assign('ur_here', $_LANG['sendmail']); if ($_REQUEST['act'] == 'sendmail') { $email = trim($_REQUEST['email']); include_once ROOT_PATH . 'includes/fckeditor/fckeditor.php'; //类文件 create_html_editor('content', ''); $smarty->assign('email', $email); $smarty->display('sendmail.htm'); } if ($_REQUEST['act'] == 'send_act') { $email = trim($_REQUEST['email']); $subject = trim($_REQUEST['subject']); $content = trim($_REQUEST['content']); if (send_mail($_CFG['shop_name'], $email, $subject, $content, 1)) { sys_msg($_LANG['send_sucess'], 0); } else { sys_msg($_LANG['send_failure'], 1); } }
sys_msg($_LANG['send_msg'] . ' ' . $_LANG['action_succeed'], 0, $link); /* 记录管理员操作 */ admin_log(addslashes($_LANG['send_msg']), 'add', 'admin_message'); } elseif ($_REQUEST['act'] == 'drop_msg') { if (isset($_POST['checkboxes'])) { $count = 0; foreach ($_POST['checkboxes'] as $key => $id) { $sql = "UPDATE " . $ecs->table('admin_message') . " SET " . "deleted = '1'" . "WHERE message_id = '{$id}' AND (sender_id='{$_SESSION['admin_id']}' OR receiver_id='{$_SESSION['admin_id']}')"; $db->query($sql); $count++; } admin_log('', 'remove', 'admin_message'); $link[] = array('text' => $_LANG['back_list'], 'href' => 'message.php?act=list'); sys_msg(sprintf($_LANG['batch_drop_success'], $count), 0, $link); } else { sys_msg($_LANG['no_select_msg'], 1); } } elseif ($_REQUEST['act'] == 'remove') { $id = intval($_GET['id']); $sql = "UPDATE " . $ecs->table('admin_message') . " SET deleted=1 " . " WHERE message_id={$id} AND (sender_id='{$_SESSION['admin_id']}' OR receiver_id='{$_SESSION['admin_id']}')"; $db->query($sql); $url = 'message.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']); ecs_header("Location: {$url}\n"); exit; } /** * 获取管理员留言列表 * * @return void */ function get_message_list()
{ $links[] = array('text' => $_LANG['u_client_upgrade'], 'href' => 'client_upgrade.php'); sys_msg($_LANG['path_empty_tips'], 0 ,$links); } if(!$app_version) { $links[] = array('text' => $_LANG['u_client_upgrade'], 'href' => 'client_upgrade.php'); sys_msg($_LANG['version_empty_tips'], 0 ,$links); } $data['iphone_name'] = $iphone_name; $data['android_name'] = $android_name; $data['app_version'] = $app_version; file_put_contents('widget.xml',serialize($data)); $links[] = array('text' => $_LANG['u_client_upgrade'], 'href' => 'client_upgrade.php'); sys_msg($_LANG['app_config_success'], 0 ,$links); } else { if(file_exists('widget.xml')) { $data = unserialize(file_get_contents('widget.xml')); $smarty->assign('iphone_name', $data['iphone_name']); $smarty->assign('android_name', $data['android_name']); $smarty->assign('app_version', $data['app_version']); } assign_query_info(); $smarty->assign('repeatCreateApp', 'false'); $smarty->assign('ur_here', $_LANG['u_client_upgrade']); $smarty->display('client_upgrade.html'); }
/* 复制一份原图 */ $pos = strpos(basename($img), '.'); $gallery_img = dirname($img) . '/' . $image->random_filename() . substr(basename($img), $pos); if (!copy('../' . $img, '../' . $gallery_img)) { sys_msg('fail to copy file: ' . realpath('../' . $img), 1, array(), false); } $gallery_thumb = ''; } } // 未上传,如果自动选择生成,且上传了商品图片,生成所略图 if (!empty($original_img)) { // 如果设置缩略图大小不为0,生成缩略图 if ($_CFG['thumb_width'] != 0 || $_CFG['thumb_height'] != 0) { $goods_thumb = $image->make_thumb('../' . $original_img, $GLOBALS['_CFG']['thumb_width'], $GLOBALS['_CFG']['thumb_height']); if ($goods_thumb === false) { sys_msg($image->error_msg(), 1, array(), false); } } else { $goods_thumb = $original_img; } } $sql = 'INSERT INTO ' . $ecs->table('goods') . "(goods_name, goods_sn, goods_number, cat_id, brand_id, goods_brief, shop_price, market_price, goods_img, goods_thumb, original_img,add_time, last_update,\r\n is_best, is_new, is_hot)" . "VALUES('{$good_name}', '{$goods_sn}', '{$good_number}', '{$cat_id}', '{$brand_id}', '{$good_brief}', '{$good_price}'," . " '{$market_price}', '{$goods_img}', '{$goods_thumb}', '{$original_img}','" . gmtime() . "', '" . gmtime() . "', '{$is_best}', '{$is_new}', '{$is_hot}')"; $db->query($sql); $good_id = $db->insert_id(); /* 如果有图片,把商品图片加入图片相册 */ if (isset($img)) { $sql = "INSERT INTO " . $ecs->table('goods_gallery') . " (goods_id, img_url, img_desc, thumb_url, img_original) " . "VALUES ('{$good_id}', '{$gallery_img}', '', '{$gallery_thumb}', '{$img}')"; $db->query($sql); } } }
$row = $db->getRow("SELECT o.parent_id, u.user_name FROM " . $GLOBALS['ecs']->table('order_info') . " o" . " LEFT JOIN" . $GLOBALS['ecs']->table('users') . " u ON o.parent_id = u.user_id" . " WHERE o.order_id = '{$oid}'"); $up_uid = $row['parent_id']; if (!empty($up_uid) && $up_uid > 0) { $info = sprintf($_LANG['separate_info'], $order_sn, $money, $point); log_account_change($up_uid, $money, 0, $point, 0, $info); write_affiliate_log($oid, $up_uid, $row['user_name'], $money, $point, $separate_by); } else { $links[] = array('text' => $_LANG['affiliate_ck'], 'href' => 'affiliate_ck.php?act=list'); sys_msg($_LANG['edit_fail'], 1, $links); } } $sql = "UPDATE " . $GLOBALS['ecs']->table('order_info') . " SET is_separate = 1" . " WHERE order_id = '{$oid}'"; $db->query($sql); } $links[] = array('text' => $_LANG['affiliate_ck'], 'href' => 'affiliate_ck.php?act=list'); sys_msg($_LANG['edit_ok'], 0, $links); } function get_affiliate_ck() { $affiliate = unserialize($GLOBALS['_CFG']['affiliate']); empty($affiliate) && ($affiliate = array()); $separate_by = $affiliate['config']['separate_by']; $sqladd = ''; if (isset($_REQUEST['status'])) { $sqladd = ' AND o.is_separate = ' . (int) $_REQUEST['status']; $filter['status'] = (int) $_REQUEST['status']; } if (isset($_REQUEST['order_sn'])) { $sqladd = ' AND o.order_sn LIKE \'%' . trim($_REQUEST['order_sn']) . '%\''; $filter['order_sn'] = $_REQUEST['order_sn']; }
admin_priv('cat_drop'); $cat_id = !empty($_POST['cat_id']) ? intval($_POST['cat_id']) : 0; $target_cat_id = !empty($_POST['target_cat_id']) ? intval($_POST['target_cat_id']) : 0; /* 商品分类不允许为空 */ if ($cat_id == 0 || $target_cat_id == 0) { $link[] = array('text' => $_LANG['go_back'], 'href' => 'category.php?act=move'); sys_msg($_LANG['cat_move_empty'], 0, $link); } /* 更新商品分类 */ $sql = "UPDATE " . $ecs->table('goods') . " SET cat_id = '{$target_cat_id}' " . "WHERE cat_id = '{$cat_id}'"; if ($db->query($sql)) { /* 清除缓存 */ clear_cache_files(); /* 提示信息 */ $link[] = array('text' => $_LANG['go_back'], 'href' => 'category.php?act=list'); sys_msg($_LANG['move_cat_success'], 0, $link); } } /*------------------------------------------------------ */ //-- 编辑排序序号 /*------------------------------------------------------ */ if ($_REQUEST['act'] == 'edit_sort_order') { check_authz_json('cat_manage'); $id = intval($_POST['id']); $val = intval($_POST['val']); if (cat_update($id, array('sort_order' => $val))) { clear_cache_files(); // 清除缓存 make_json_result($val); } else { make_json_error($db->error());
break; case 'deny': $db->query("UPDATE " . $ecs->table('feedback') . " SET msg_status = 0,msg_area =1 WHERE " . db_create_in($_POST['checkboxes'], 'msg_id')); break; default: break; } clear_cache_files(); $action = $action == 'remove' ? 'remove' : 'edit'; admin_log('', $action, 'adminlog'); $link[] = array('text' => $_LANG['back_list'], 'href' => 'user_msg.php?act=list_all'); sys_msg(sprintf($_LANG['batch_drop_success'], count($_POST['checkboxes'])), 0, $link); } else { /* 提示信息 */ $link[] = array('text' => $_LANG['back_list'], 'href' => 'user_msg.php?act=list_all'); sys_msg($_LANG['no_select_comment'], 0, $link); } } elseif ($_REQUEST['act'] == 'view') { $smarty->assign('send_fail', !empty($_REQUEST['send_ok'])); $smarty->assign('msg', get_feedback_detail(intval($_REQUEST['id']))); $smarty->assign('ur_here', $_LANG['reply']); $smarty->assign('action_link', array('text' => $_LANG['08_unreply_msg'], 'href' => 'user_msg.php?act=list_all')); assign_query_info(); $smarty->display('msg_info.htm'); } elseif ($_REQUEST['act'] == 'action') { if (empty($_REQUEST['parent_id'])) { $sql = "INSERT INTO " . $ecs->table('feedback') . " (msg_title, msg_time, user_id, user_name , " . "user_email, parent_id, msg_content) " . "VALUES ('reply', '" . gmtime() . "', '" . $_SESSION['admin_id'] . "', " . "'" . $_SESSION['admin_name'] . "', '" . $_POST['user_email'] . "', " . "'" . $_REQUEST['msg_id'] . "', '" . $_POST['msg_content'] . "') "; $db->query($sql); } else { $sql = "UPDATE " . $ecs->table('feedback') . " SET user_email = '" . $_POST['user_email'] . "', msg_content='" . $_POST['msg_content'] . "', msg_time = '" . gmtime() . "' WHERE msg_id = '" . $_REQUEST['parent_id'] . "'"; $db->query($sql);