} $config['item'][$key]['level_money'] = $val; $config['on'] = 1; put_affiliate($config); make_json_result(stripcslashes($val)); } elseif ($_REQUEST['act'] == 'del') { $key = trim($_GET['id']) - 1; unset($config['item'][$key]); $temp = array(); foreach ($config['item'] as $key => $val) { $temp[] = $val; } $config['item'] = $temp; $config['on'] = 1; $config['config']['separate_by'] = 0; put_affiliate($config); ecs_header("Location: affiliate.php?act=list\n"); exit; } function get_affiliate() { $config = unserialize($GLOBALS['_CFG']['affiliate']); empty($config) && ($config = array()); return $config; } function put_affiliate($config) { $temp = serialize($config); $sql = "UPDATE " . $GLOBALS['ecs']->table('shop_config') . "SET value = '{$temp}'" . "WHERE code = 'affiliate'"; $GLOBALS['db']->query($sql); clear_all_files();
$v1_percent = $_REQUEST['rank_b_1']; $sql = "INSERT INTO " . $ecs->table('split_instal') . " (v1_percent, is_line, user_rank ) " . "VALUES ( '{$v1_percent}', '2', '2')"; $db->query($sql, 'SILENT'); } $links[] = array('text' => $_LANG['affiliate'], 'href' => 'compensate_instal.php?act=list'); sys_msg("设置操作成功", 0, $links); } elseif ($_REQUEST['act'] == 'updata') { $separate_by = intval($_POST['separate_by']) == 1 ? 1 : 0; $_POST['level_money_all'] = (double) $_POST['level_money_all']; //$_POST['level_money_all'] > 100 && $_POST['level_money_all'] = 100; if (!empty($_POST['level_money_all']) && strpos($_POST['level_money_all'], '%') === false) { $_POST['level_money_all'] .= '%'; } $temp = $_POST['level_money_all']; //print_r($temp);exit; put_affiliate($temp); $links[] = array('text' => $_LANG['affiliate'], 'href' => 'compensate_instal.php?act=list'); sys_msg("设置操作成功", 0, $links); } function get_affiliate() { $sql = "SELECT value FROM " . $GLOBALS['ecs']->table('shop_config') . " WHERE code = 'compensate_instal' "; $_value1 = $GLOBALS['db']->getOne($sql); return $_value1; } function put_affiliate($temp) { $sql = "UPDATE " . $GLOBALS['ecs']->table('shop_config') . "SET value = '{$temp}'" . "WHERE code = 'compensate_instal'"; $GLOBALS['db']->query($sql); clear_all_files(); }