<?php defined('ADMIN_KEKE') or exit('Access Denied'); kekezu::admin_check_role('m612'); $goods_config = kekezu::get_task_config($model_id); is_array($goods_config) and extract($goods_config) or $goods_config = array(); $model_obj = keke_table_class::get_instance('witkey_model'); $ops = array('config', 'control', 'rule'); in_array($op, $ops) or $op = 'config'; $url = "index.php?do=model&model_id={$model_id}&view=config&op={$op}"; kekezu::empty_cache(); $indus_arr = $kekezu->_indus_arr; $indus_index = kekezu::get_indus_by_index(); if (isset($sbt_edit)) { $log_op_arr = array("config" => $_lang['goods_basic_config'], "control" => $_lang['goods_flow_config'], "rule" => $_lang['goods_permissions_config']); $log_msg = $_lang['has_update'] . $log_op_arr[$op]; kekezu::admin_system_log($log_msg); switch ($op) { case 'config': !empty($fds['indus_bid']) and $fds['indus_bid'] = implode(",", $fds['indus_bid']) or $fds['indus_bid'] = ''; $fds['on_time'] = time(); $fds = kekezu::escape($fds); $res = $model_obj->save($fds, $pk); kekezu::admin_show_msg($_lang['goods_basic_config_update_success'], $url, 3, '', 'success'); break; case 'control': if ($filepath) { copy("../" . $filepath, "../tpl/default/img/shop/shop_default_big.png"); } is_array($cont) and $res = keke_task_config::set_task_ext_config($model_id, $cont); kekezu::admin_show_msg($_lang['goods_flow_config_update_success'], $url, 3, '', 'success');
$indus_arr = kekezu::get_table_data("*", "witkey_industry", $where, "", "", "", "", 0); sort($indus_arr); if (!$w) { $t_arr = array(); kekezu::get_tree($indus_arr, $t_arr, 'cat', NULL, 'indus_id', 'indus_pid', 'indus_name'); $indus_show_arr = $t_arr; unset($t_arr); } else { $indus_show_arr = $indus_arr; } $temp_arr = array(); $indus_option_arr = kekezu::get_industry(); kekezu::get_tree($indus_option_arr, $temp_arr, "option", $w[indus_pid]); $indus_option_arr = $temp_arr; unset($temp_arr); $indus_index_arr = kekezu::get_indus_by_index(); } function sortTree($nodeid, $arTree) { $res = array(); for ($i = 0; $i < sizeof($arTree); $i++) { if ($arTree[$i]["indus_pid"] == $nodeid) { array_push($res, $arTree[$i]); $subres = sortTree($arTree[$i]["indus_id"], $arTree); for ($j = 0; $j < sizeof($subres); $j++) { array_push($res, $subres[$j]); } } } return $res; }