Example #1
0
 function create_node_attr($element = '', $attrname = '', $attrvalue = '')
 {
     if ($this->_K['charset'] != 'utf-8') {
         $attrname = kekezu::gbktoutf($attrname);
         $attrvalue = kekezu::gbktoutf($attrvalue);
     }
     $attr = new DOMAttr($attrname, $attrvalue);
     $element->appendChild($attr);
     $this->_doc->save($this->_filepath);
 }
Example #2
0
 static function show_msg($title = "", $url = "", $time = 3, $content = "", $type = 'info')
 {
     global $_K, $basic_config, $username, $uid, $nav_list, $_lang, $strWebLogo, $task_open, $shop_open, $indus_arr, $arrTopIndus, $indus_goods_arr, $indus_task_arr;
     $type == 'ok' and $type = 'success';
     if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
         !in_array($type, array('success', 'error', 'fail')) and $type = 'error';
         $json = array('status' => $type, 'data' => $title, 'url' => $url);
         strtoupper(CHARSET) == 'GBK' and $json = kekezu::gbktoutf($json);
         echo json_encode($json);
     } else {
         !in_array($type, array('success', 'warning', 'danger', 'info')) and $type = 'info';
         intval($time) or $time = 3;
         $url or $url = 'index.php';
         $strPageTitle = '页面跳转提示';
         require keke_tpl_class::template('msg');
     }
     unset($json, $_K, $basic_config, $username, $uid, $nav_list, $_lang, $strWebLogo, $task_open, $shop_open, $indus_arr, $arrTopIndus, $indus_goods_arr, $indus_task_arr);
     die;
 }
function analysis_data($path, $every_year = false)
{
    global $year_arr, $_lang;
    $detail_arr = array($_lang['total'], $_lang['witkey_task'], $_lang['witkey_shop'], $_lang['payitem_service'], $_lang['user_auth']);
    if (strtolower(CHARSET) == 'gbk') {
        $detail_arr = kekezu::gbktoutf($detail_arr);
    }
    $series = '';
    $total = $bid_ins = $service_ins = $item_ins = $auth_ins = 0;
    foreach ($year_arr as $key => $value) {
        $bid_in = db_factory::get_count(sprintf(" select sum(site_profit) as cash from %switkey_finance where (fina_action='task_bid' or fina_action='pub_task') and site_profit>0   and (fina_type='in' or fina_type='out') and YEAR(FROM_UNIXTIME(fina_time))=%d", TABLEPRE, $value['year']));
        $bid_ins += $bid_in;
        $service_in = db_factory::get_count(sprintf(" select sum(site_profit) as cash from %switkey_finance where fina_action='sale_service' and fina_type='in' and YEAR(FROM_UNIXTIME(fina_time))=%d", TABLEPRE, $value['year']));
        $service_ins += $service_in;
        $item_in = db_factory::get_count(sprintf(" select sum(site_profit) as cash from %switkey_finance where fina_action='payitem' and fina_type='out' and YEAR(FROM_UNIXTIME(fina_time))=%d", TABLEPRE, $value['year']));
        $item_ins += $item_in;
        $auth_in = db_factory::get_count(sprintf(" select sum(site_profit) as cash from %switkey_finance where INSTR(fina_action,'_auth') and fina_type='out' and YEAR(FROM_UNIXTIME(fina_time))=%d", TABLEPRE, $value['year']));
        $auth_ins += $auth_in;
        $point = '';
        $point .= '<point name="' . $detail_arr['1'] . '" y="' . $bid_in . '"/>';
        $point .= '<point name="' . $detail_arr['2'] . '" y="' . $service_in . '"/>';
        $point .= '<point name="' . $detail_arr['3'] . '" y="' . $item_in . '"/>';
        $point .= '<point name="' . $detail_arr['4'] . '" y="' . $auth_in . '"/>';
        if ($every_year == true) {
            $year_path = sprintf($path, $value['year']);
            update_xml($year_path, '<data><series name="Series 1">' . $point . '</series></data>', 'analysis');
        }
    }
    $str = '';
    $str .= '<series name="Series 1">';
    $str .= '<point name="' . $detail_arr['1'] . '" y="' . $bid_ins . '"/>';
    $str .= '<point name="' . $detail_arr['2'] . '" y="' . $service_ins . '"/>';
    $str .= '<point name="' . $detail_arr['3'] . '" y="' . $item_ins . '"/>';
    $str .= '<point name="' . $detail_arr['4'] . '" y="' . $auth_ins . '"/>';
    $str .= '</series>';
    return update_xml(sprintf($path, 'total'), '<data>' . $str . '</data>', 'analysis');
}
 public function get_service_indus($indus_pid = '', $ajax = '')
 {
     global $kekezu;
     global $_lang;
     if ($indus_pid > 0) {
         $indus_ids = kekezu::get_table_data('*', "witkey_industry", " indus_pid = {$indus_pid}", 'CASE WHEN listorder = 0 THEN 9999999 WHEN listorder > 0 THEN listorder END', '', '', 'indus_id', null);
         switch ($ajax == 'show_indus') {
             case "0":
                 return $indus_ids;
                 break;
             case "1":
                 $option .= '<option value=""> ' . $_lang['please_choose_son_industry'] . ' </option>';
                 foreach ($indus_ids as $v) {
                     $option .= '<option value=' . $v[indus_id] . '>' . $v[indus_name] . '</option>';
                 }
                 CHARSET == 'gbk' and $option = kekezu::gbktoutf($option);
                 echo $option;
                 die;
                 break;
         }
     } else {
         return false;
     }
 }
Example #5
0
$page = intval($page) ? $page : 1;
$pagesize = intval($pagesize) ? $pagesize : 10;
$objTask = preward_task_class::get_instance($arrTaskInfo);
$arrTaskInfo = $objTask->_task_info;
$objTask->plus_view_num();
$intFollow = db_factory::get_count(sprintf('select count(*) from %s where uid = %d and fuid = %d', TABLEPRE . 'witkey_free_follow', intval($gUid), intval($arrTaskInfo['uid'])));
$intFavorite = db_factory::get_count(sprintf('select count(*) from %s where uid = %d and obj_id = %d and keep_type = "task"', TABLEPRE . 'witkey_favorite', intval($gUid), intval($arrTaskInfo['task_id'])));
if ($arrTaskInfo['task_pic']) {
    $arrTaskPics = explode(',', $arrTaskInfo['task_pic']);
}
$arrProcess_can = $objTask->process_can();
$arrTaskFiles = $objTask->get_task_file();
$arrPayitemShow = $objTask->getPayitemShow();
$arrWorkStatus = $objTask->get_work_status();
if (strtoupper(CHARSET) == 'GBK') {
    $arrWorkStatus = kekezu::gbktoutf($arrWorkStatus);
}
$jsonWorkStatus = json_encode($arrWorkStatus);
$Exitworker = db_factory::get_one("select * from " . TABLEPRE . "witkey_task_work where task_id = " . $arrTaskInfo['task_id'] . " and uid=" . $gUid);
$arrProjectProgress = $objTask->getProjectProgressDesc();
$objTime = new preward_time_class();
$objTime->validtaskstatus();
$intBidCount = $objTask->get_work_count("work_status=6");
switch ($view) {
    case "work":
        $arrUid = db_factory::get_one("select uid from " . TABLEPRE . "witkey_task where task_id = '{$id}'");
        intval($page) and $p['page'] = intval($page) or $p['page'] = '1';
        intval($pagesize) and $p['page_size'] = intval($pagesize) or $p['page_size'] = 10;
        $p['url'] = $strUrl . "&view=work&pagesize=" . $p['page_size'] . "&page=" . $p['page'];
        $p['anchor'] = '#detail';
        if ($st) {
<?php

$tasktemid = intval($tasktemid);
$userbrowser = $_SERVER['HTTP_USER_AGENT'];
if (preg_match('/MSIE/i', $userbrowser)) {
    $template_content = kekezu::escape($template_content);
    $template_name = kekezu::escape(kekezu::gbktoutf($template_name));
    $template_title = kekezu::escape(kekezu::gbktoutf($template_title));
}
if ($ac == 'edit') {
    $task_template_obj = new Keke_witkey_task_template_class();
    $task_template_obj->setTemplate_content($template_content);
    $task_template_obj->setTemplate_name($template_name);
    $task_template_obj->setTemplate_title($template_title);
    $task_template_obj->setWhere("id={$tasktemid}");
    $task_template_obj->edit_keke_witkey_task_template();
} elseif ($ac == 'add') {
    $task_template_obj = new Keke_witkey_task_template_class();
    $task_template_obj->setTemplate_content($template_content);
    $task_template_obj->setTemplate_name($template_name);
    $task_template_obj->setTemplate_title($template_title);
    $task_template_obj->setOn_time(time());
    $task_template_obj->create_keke_witkey_task_template();
}
$tasktemInfo = db_factory::get_one("select * from " . TABLEPRE . "witkey_task_template where id={$tasktemid}");
require $kekezu->_tpl_obj->template(ADMIN_DIRECTORY . "/tpl/admin_task_{$view}");
Example #7
0
 public function send_phone_sms($mobiles = '', $tar_content = '')
 {
     global $basic_config;
     if ($basic_config['sms_interface'] != 'open') {
         return false;
     }
     if (!SMS_ACCOUNT || !SMS_PASSWD) {
         return false;
     }
     !$mobiles and $mobiles = $this->_mobile;
     !$tar_content and $tar_content = $this->_mobile_content;
     $tar_content = strip_tags(htmlspecialchars_decode($tar_content));
     $xwSms = new XuanWuSms(SMS_ACCOUNT, SMS_PASSWD);
     if (strtoupper(CHARSET) == 'GBK') {
         $tar_content = kekezu::gbktoutf($tar_content);
     }
     return $xwSms->_postSingle($mobiles, $tar_content);
 }
Example #8
0
<?php

defined('ADMIN_KEKE') or exit('Access Denied');
kekezu::admin_check_role(41);
$nav_list = kekezu::get_table_data('*', 'witkey_nav', '', 'listorder', '', '', "nav_id");
$nav_list_json = kekezu::json_encode_k(kekezu::gbktoutf($nav_list));
$nav_obj = new keke_table_class("witkey_nav");
$url = "index.php?do={$do}&view={$view}";
if ($ac == 'edit') {
    if (!empty($nav_id)) {
        $sql = sprintf("select * from %switkey_nav where nav_id ='%d' limit 0,1", TABLEPRE, $nav_id);
        $nav_config = db_factory::get_one($sql);
        $readonly = nav_analysis($nav_config['nav_url']);
    }
    if ($fds and $sbt_edit) {
        if ($set_index) {
            $set_rs = db_factory::execute(sprintf("update %switkey_basic_config set v='%s' where k='set_index'", TABLEPRE, $fds['nav_style']));
        } else {
            $set_rs = db_factory::execute(sprintf("update %switkey_basic_config set v='index' where k='set_index'", TABLEPRE));
        }
        $res = $nav_obj->save($fds, $pk);
        $res || $set_rs and kekezu::admin_show_msg($_lang['operate_success'], $url, 2, $_lang['edit_success'], "success") or kekezu::admin_show_msg($_lang['operate_fail'], $url, 2, $_lang['edit_fail'], "error");
    }
    require $template_obj->template(ADMIN_DIRECTORY . '/tpl/admin_config_' . $view . '_edit');
    die;
}
if ($ac == 'del') {
    $nav_obj->del('nav_id', $nav_id, $url);
    kekezu::admin_show_msg($_lang['delete_nav_success'], "index.php?do=config&view=nav", 3, '', 'success');
}
if ($ac == 'set_index') {
Example #9
0
    kekezu::echojson('删除成功', 1, $data);
    die;
}
if ($op == 'basic') {
    $pk['service_id'] and $service_id = $pk['service_id'];
    $service_id or kekezu::admin_show_msg($_lang['please_choose_should_edit_goods'], 'index.php?do=model&model_id=6&view=list', 3, '', 'warning');
    $indus_p_arr = $kekezu->_indus_p_arr;
    $goods_status_arr = goods_shop_class::get_goods_status();
    unset($goods_status_arr[1]);
    if ($ajax == 'show_indus') {
        $indus_ids = kekezu::get_table_data('*', "witkey_industry", " indus_pid = {$indus_pid}", 'CASE WHEN listorder = 0 THEN 9999999 WHEN listorder > 0 THEN listorder END', '', '', 'indus_id', null);
        $option .= '<option value=""> {lang:please_choose_son_industry} </option>';
        foreach ($indus_ids as $v) {
            $option .= '<option value=' . $v['indus_id'] . '>' . $v['indus_name'] . '</option>';
        }
        CHARSET == 'gbk' and $option = kekezu::gbktoutf($option);
        echo $option;
        die;
    }
    $service_info = db_factory::get_one(sprintf("select * from %switkey_service where service_id='%d'", TABLEPRE, $service_id));
    if ($service_info['pic']) {
        $servicePics = explode(',', $service_info['pic']);
    }
    if ($service_info['file_path']) {
        $serviceFiles = explode(',', $service_info['file_path']);
    }
    $service_info['ext_fields'] = CustomClass::getExtDataList($service_info['service_id'], $service_info['model_id']);
    $service_info and extract($service_info) or $service_info = array();
    $indus_pid and $indus_arr = kekezu::get_industry($indus_pid, 0) or $indus_arr = array();
    if ($sbt_edit) {
        if ($ext_fds) {