Ejemplo n.º 1
0
 public static function get_item_info($num_iid)
 {
     $taoapi = new taoapi_get('item', array('num_iid' => $num_iid));
     $data = $taoapi->send();
     $status = 1;
     $data['code'] && ($status = 0);
     kekezu::echojson('', $status, $data);
 }
Ejemplo n.º 2
0
 public function get_max_day($task_cash)
 {
     global $kekezu;
     global $_lang;
     if ($task_cash >= $this->_task_config['min_cash']) {
         $time = keke_task_release_class::get_default_max_day($task_cash, $this->_model_id, $this->_task_config['min_day']);
         kekezu::echojson($time, 1, $time);
     } else {
         kekezu::echojson($_lang['task_min_cash_limit_notice'] . $this->_task_config['min_cash'], 0);
         die;
     }
 }
 public function wap_release()
 {
     $task_obj = $this->_task_obj;
     $_D = $_REQUEST;
     $this->wap_public();
     $this->set_task_status($this->get_total_cash($_D['task_cash']), $_D['task_cash']);
     $task_id = $task_obj->create_keke_witkey_task();
     if ($task_id) {
         $t = $this->wap_update($task_id);
     }
     if ($t[0] == 'success') {
         $s = 1;
     } else {
         $msg = array('r' => $t[1]);
         $s = 0;
     }
     kekezu::echojson($msg, $s, $task_id);
     die;
 }
Ejemplo n.º 4
0
 static function run_backup()
 {
     global $_lang;
     set_time_limit(0);
     ini_set('memory_limit', '1024M');
     $output = array();
     $db_factory = new db_factory();
     $tables = $db_factory->query(" show table status from `" . DBNAME . "`");
     $temp_arr = array();
     foreach ($tables as $v) {
         if (substr($v[Name], 0, strlen(TABLEPRE)) == TABLEPRE) {
             $temp_arr[] = $v;
         }
     }
     $tables = $temp_arr;
     $sqlmsg = '';
     foreach ($tables as $tablesarr) {
         $table_name = $tablesarr['Name'];
         $table_type = $tablesarr['Type'];
         $result = $db_factory->query("show fields from " . $table_name);
         $sqlmsg .= "#" . $_lang['table_name'] . ":<" . $table_name . ">\n";
         $sqlmsg .= "DROP TABLE IF EXISTS `" . $table_name . "`;\n";
         $createtable = $db_factory->query("SHOW CREATE TABLE " . $table_name);
         $sqlmsg .= $createtable[0]['Create Table'] . " ;\n";
         $result = $db_factory->query("show fields from " . $table_name);
         foreach ($result as $fileds) {
             $fields[] = "`" . $fileds['Field'] . "`";
         }
         $field = join(",", $fields);
         $sql_insert = self::querySelect($table_name, $field, $result);
         if ($sql_insert !== false) {
             $sqlmsg .= $sql_insert;
         }
         unset($fields);
         $output[] = str_replace(TABLEPRE . 'witkey_', '**********************', $table_name);
     }
     $sqlmsg .= "\n";
     $path = S_ROOT . './data/backup/backup_' . time() . '_' . DBNAME . ".sql";
     keke_tpl_class::swritefile($path, $sqlmsg);
     kekezu::admin_system_log($_lang['backup_database'] . '' . "backup_" . time() . '_' . DBNAME . ".sql");
     file_exists($path) and kekezu::echojson('', 1, $output) or kekezu::echojson('', 0, $output);
     die;
 }
Ejemplo n.º 5
0
             CommonClass::applyEdit($arrLogInfo, $service_id);
             CommonClass::cancleEdit($service_id, 6);
             $arrServiceInfo = db_factory::get_one('select * from ' . TABLEPRE . 'witkey_service where service_id = ' . intval($service_id));
             if ($arrServiceInfo['service_status'] == '1') {
                 $time = time() - $service_arr['on_time'];
                 keke_payitem_class::update_service_payitem_time($service_arr['payitem_time'], $time, $service_id);
                 goods_shop_class::set_service_status($service_id, 2);
             }
             keke_msg_class::send_private_message('服务审核通知', '您编辑的商品信息<a href="index.php?do=goods&id=' . $service_id . '">' . $arrServiceInfo['title'] . '</a>已通过管理员审核,目前已生效!', $arrServiceInfo['uid'], $arrServiceInfo['username']);
         }
         if ($acc == 'snopass') {
             CommonClass::cancleEdit($service_id, 6);
             keke_shop_release_class::updateEditStatusBySid($service_id, 4);
             keke_msg_class::send_private_message('服务审核通知', '您编辑的商品信息<a href="index.php?do=goods&id=' . $service_id . '">' . $arrServiceInfo['title'] . '</a>未通过管理员的审核,如有疑问请联系网站管理员!', $arrServiceInfo['uid'], $arrServiceInfo['username']);
         }
         kekezu::echojson('操作成功', 1);
     } else {
         $editInfo = CommonClass::getEditLogInfoByLogTypeAndObjId($service_id, 6);
         $arrTopIndustrys = $kekezu->_indus_goods_arr;
         $arrIndustrys = CommonClass::getIndustryByPid($editInfo['log_content_data']['indus_pid']);
         $arrOldImageLists = CommonClass::getFileArrayByPath(',', $editInfo['log_content_data']['old_pic']);
         $arrImageLists = CommonClass::getFileArrayByPath(',', $editInfo['log_content_data']['pic']);
         $arrOldFileLists = CommonClass::getFileArrayByPath(',', $editInfo['log_content_data']['old_file_path']);
         $arrFileLists = CommonClass::getFileArrayByPath(',', $editInfo['log_content_data']['file_path']);
         require keke_tpl_class::template('shop/goods/admin/tpl/goods_updateinfo');
         die;
     }
     break;
 case 'off_shelf':
     if ($is_submit == "1") {
         $serviceInfo = db_factory::get_one("select * from " . TABLEPRE . "witkey_service where service_id=" . intval($service_id));
Ejemplo n.º 6
0
<?php

defined('ADMIN_KEKE') or exit('Access Denied');
$art_obj = new Keke_witkey_article_class();
$table_obj = new keke_table_class("witkey_article");
$types = array('help', 'art', 'bulletin', 'about');
$type = !empty($type) && in_array($type, $types) ? $type : 'art';
$url = "index.php?do={$do}&view={$view}&w[username]={$w['username']}&w[art_title]={$w['art_title']}&w[art_cat_id]={$w['art_cat_id']}&page_size={$page_size}&page={$page}&type={$type}&ord[0]={$ord['0']}&ord[1]={$ord['1']}";
if ($opajax == 'setorder') {
    $table_obj->save(array('listorder' => intval($ov)), array('art_id' => intval($dataid)));
    kekezu::echojson('设置成功', 1);
    die;
}
if ($ac == 'del') {
    $res = $table_obj->del('art_id', $art_id, $url);
    $res and kekezu::admin_show_msg($_lang['operate_success'], $url, 3, '', 'success') or kekezu::admin_show_msg($_lang['operate_fail'], $url, 3, '', 'warning');
} elseif (isset($sbt_action)) {
    sizeof($ckb) or kekezu::admin_show_msg($_lang['choose_operate_item'], $url, 3, '', 'warning');
    is_array($ckb) and $ids = implode(',', array_filter($ckb));
    $art_obj->setWhere("art_id in ({$ids})");
    if ($sbt_action) {
        $res = $art_obj->del_keke_witkey_article();
        kekezu::admin_system_log($_lang['mulit_recovery_articles']);
    }
    $res and kekezu::admin_show_msg($_lang['mulit_operate_success'], $url, 3, '', 'success') or kekezu::admin_show_msg($_lang['mulit_operate_fail'], $url, 3, '', 'warning');
} elseif ($op == 'listorder') {
    $art_obj = new Keke_witkey_article_class();
    $art_obj->setWhere("art_id='{$art_id}'");
    $art_obj->setListorder(intval($value));
    $art_obj->edit_keke_witkey_article();
    kekezu::admin_system_log($_lang['edit_art_order'] . $art_id);
Ejemplo n.º 7
0
    $page = 1;
}
$region_config = keke_glob_class::getRegionConfig();
$objDq = keke_table_class::get_instance('witkey_basic_config');
if ($_R['op'] == 'del') {
    $intResult = $objDistrict->del('id', $_R[id]);
    kekezu::admin_show_msg($_lang['operate_success'], "index.php?do=config&view=dq&page=" . $page, 3, '', 'success');
}
if ($_R['op'] == 'region_switch') {
    $result = keke_glob_class::updateRegionConfig('region_search_switch', $_R['val']);
    $result and kekezu::echojson('', $_R['val']) or kekezu::echojson('', $_R['val']);
}
if ($_R['op'] == 'region_checkbox') {
    if ($_R['dtype'] == 'shop') {
        keke_glob_class::updateRegionConfig('region_search_shop', $_R['val']);
    } else {
        keke_glob_class::updateRegionConfig('region_search_task', $_R['val']);
    }
    kekezu::echojson('', $_R['val']);
}
$one = $objDistrict->get_grid('upid=0', $url, $page, 10, ' order by id asc', '1', 'ajax_dom');
if ($_R['is_submit'] == 1) {
    foreach ($_R[id] as $key => $val) {
        $arrFields = array('name' => $_R[name][$key], 'displayorder' => $_R[displayorder][$key]);
        $arrWhere = array('id' => $_R[id][$key]);
        $intResult = $objDistrict->save($arrFields, $arrWhere);
    }
    kekezu::admin_show_msg("修改成功", "index.php?do=config&view=dq&page=" . $page, 2, '', 'success');
} else {
    require $template_obj->template(ADMIN_DIRECTORY . '/tpl/admin_config_' . $view);
}
Ejemplo n.º 8
0
<?php

defined('ADMIN_KEKE') or exit('Access Denied');
$ops = array('basic', 'order', 'comm', 'mark');
in_array($op, $ops) or $op = 'basic';
if ($ajax == 'delfile') {
    keke_shop_class::delServiceFiles($serviceid, $filename, $type);
    $data = array();
    $data['type'] = $type;
    $data['dataid'] = $dataid;
    kekezu::echojson('删除成功', 1, $data);
    die;
}
keke_lang_class::loadlang('public', 'shop');
keke_lang_class::loadlang('task_edit', 'task');
if ($op == 'basic') {
    $service_obj = new service_shop_class();
    $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']);
    }
    $ac_url = "index.php?do=model&model_id=7&view=edit&service_id=" . $service_id;
    $status_arr = $service_obj->get_service_status();
    unset($status_arr[1]);
    $service_info['ext_fields'] = CustomClass::getExtDataList($service_info['service_id'], $service_info['model_id']);
    if ($sbt_edit) {
        if ($ext_fds) {
            CustomClass::editExtData($service_id, $model_id, $ext_fds);
Ejemplo n.º 9
0
    $url = "index.php?do={$do}&view=list&type={$type}";
    $fields = kekezu::escape($fields);
    $res = $art_obj->save($fields, $pk);
    $log_ac = array('edit' => $_lang['edit_art'], 'add' => $_lang['add_art']);
    if ($pk['art_id']) {
        kekezu::admin_system_log($log_ac['edit'] . ":" . $fields['art_title']);
    } else {
        kekezu::admin_system_log($log_ac['add'] . ":" . $fields['art_title']);
    }
    kekezu::admin_show_msg($_lang['operate_success'], $url, 3, '', 'success');
}
if (isset($ac) && $ac == 'del') {
    if ($filepath) {
        $pk and db_factory::execute(" update " . TABLEPRE . "witkey_article set art_pic ='' where art_id = " . intval($pk));
        $file_info = db_factory::get_one(" select * from " . TABLEPRE . "witkey_file where save_name = '.{$filepath}.'");
        keke_file_class::del_att_file($file_info['file_id'], $file_info['save_name']);
        kekezu::echojson('', '1');
    }
}
$cat_arr = array();
kekezu::get_tree($art_cat_arr, $cat_arr, 'option', $art_id, 'art_cat_id', 'art_cat_pid', 'cat_name');
require $template_obj->template(ADMIN_DIRECTORY . '/tpl/admin_' . $do . "_" . $view);
function get_fid($path)
{
    if (!path) {
        return false;
    }
    $querystring = substr(strstr($path, '?'), 1);
    parse_str($querystring, $query);
    return $query['fid'];
}
Ejemplo n.º 10
0
 public static function keke_show_msg($url, $content, $type = 'success', $output = 'normal')
 {
     global $_lang;
     switch ($output) {
         case "normal":
             kekezu::show_msg($_lang['operate_notice'], $url, '3', $content, $type);
             break;
         case "json":
             $type == 'error' or $status = '1';
             $msg = $_lang['operate_notice'];
             ISWAP == 1 and $msg = array('r' => $content);
             kekezu::echojson($msg, intval($status), $content);
             die;
             break;
     }
 }
Ejemplo n.º 11
0
<?php

defined('ADMIN_KEKE') or exit('Access Denied');
kekezu::admin_check_role(154);
$case_obj = new Keke_witkey_case_class();
$task_obj = new Keke_witkey_task_class();
$case_id and $case_info = db_factory::get_one(" select * from " . TABLEPRE . "witkey_case where case_id ='{$case_id}'");
$txt_task_id and $case_info = db_factory::get_one(" select * from " . TABLEPRE . "witkey_task where task_id = '{$txt_task_id}'");
$url = "index.php?do=case&view=list";
if ($ac == 'ajax' && $id && $obj) {
    case_obj_exists($id, $obj) and kekezu::echojson($_lang['echojson_msg'], 1) or kekezu::echojson($_lang['echojosn_erreor_msg'], 0);
}
if (isset($sbt_edit)) {
    if ($hdn_case_id) {
        $case_obj->setCase_id($hdn_case_id);
    } else {
        if (case_obj_exists($fds['obj_id'], $case_type)) {
            $case_obj->setObj_id($fds['obj_id']);
        }
    }
    $case_obj->setObj_type($case_type);
    $case_obj->setCase_auther($fds['case_auther']);
    $case_obj->setCase_price($fds['case_price']);
    $case_obj->setCase_desc(kekezu::escape($fds['case_desc']));
    $case_obj->setCase_title(kekezu::escape($fds['case_title']));
    $case_obj->setOn_time(time());
    $case_img = $hdn_case_img or $case_img = keke_file_class::upload_file("fle_case_img");
    $case_obj->setCase_img($case_img);
    if ($hdn_case_id) {
        $res = $case_obj->edit_keke_witkey_case();
        kekezu::admin_system_log($_lang['edit_case'] . ':' . $hdn_case_id);
Ejemplo n.º 12
0
$oid = trim($id);
$order_info = db_factory::get_one(sprintf(" select * from %switkey_order_charge where out_trade_no='%s' and uid='%d'", TABLEPRE, $oid, $uid));
$data = array();
if ($order_info['order_status'] == 'ok') {
    list($_, $charge_type, $uid, $obj_id, $order_id, $model_id) = explode('-', $order_info['attach'], 6);
    if ($charge_type == 'user_charge') {
        $show_url = 'index.php?do=recharge&cash=' . $order_info['pay_money'] . '&status=1';
        $_SESSION['chargecash'] = $order_info['pay_money'];
    } elseif ($charge_type == 'payitem_charge') {
        if (!in_array($model_id, array(6, 7))) {
            $show_url = 'index.php?do=task&id=' . $obj_id;
        } else {
            $show_url = 'index.php?do=goods&id=' . $obj_id;
        }
    } else {
        if (!in_array($model_id, array(6, 7))) {
            $arrOrderDetail = keke_order_class::get_order_detail($order_id);
            if ($arrOrderDetail[0]['obj_type'] == 'hosted') {
                $show_url = 'index.php?do=task&id=' . $obj_id;
            } else {
                $show_url = 'index.php?do=pay&type=task&id=' . $obj_id . '&status=1';
            }
        } else {
            $show_url = 'index.php?do=pay&type=order&id=' . $order_id . '&status=1';
        }
    }
    $data['url'] = $show_url;
    kekezu::echojson('已支付成功', '0', $data);
} else {
    kekezu::echojson('未支付', '1');
}
Ejemplo n.º 13
0
         kekezu::show_msg($tips, $strUrl . '&step=step3', NULL, NULL, 'ok');
     } else {
         !$_SESSION[$stdCacheName] and kekezu::show_msg($_lang['friendly_notice'], "index.php?do=pubtask&id={$id}", 2, "任务已提交,不可再返回修改!", "warning");
         $objRelease->check_access($step, $id, $arrPubInfo);
         $strExtTypes = kekezu::get_ext_type();
     }
     $arrFileLists = CommonClass::getFileArray('|', $arrPubInfo['file_ids']);
     if ($action == 'delete_file') {
         $resText = CommonClass::delFileByFileId($fileid);
         if ($resText) {
             $array = explode('|', $arrPubInfo['file_ids']);
             $newArr = CommonClass::returnNewArr($fileid, $array);
             $_POST['file_ids'] = implode("|", $newArr);
             $arrPubInfo and $_POST = array_merge($arrPubInfo, $_POST);
             $objRelease->save_task_obj($_POST, $stdCacheName);
             kekezu::echojson('删除成功', 1, array('fileid' => $fileid, 'a' => $arrPubInfo));
             die;
         }
     }
     break;
 case 'step3':
     $intFileCount = 0;
     if ($arrPubInfo['file_ids']) {
         $intFileCount = count(explode('|', $arrPubInfo['file_ids']));
     }
     if (isset($formhash) && kekezu::submitcheck($formhash)) {
         $arrPayitems = array('urgent' => intval($txt_urgent), 'tasktop' => intval($txt_tasktop) && intval($text_tasktop) ? intval($text_tasktop) : 0, 'workhide' => intval($txt_workhide), 'seohide' => intval($txt_seohide));
         $arrPayitems = array_filter($arrPayitems);
         PayitemClass::validPayitemCount($arrPayitems, $arrPubInfo['txt_task_day']);
         $_POST['payitem'] = $arrPayitems;
         $arrPubInfo and $_POST = array_merge($arrPubInfo, $_POST);
Ejemplo n.º 14
0
<?php

if ($opajax == 'getzfpwd') {
    if (!$gUid) {
        kekezu::echojson('用户未登录', 'error');
    }
    $email = $gUserInfo['email'];
    if (!$email) {
        kekezu::echojson('请确保您的邮箱有效可用', 'error');
    }
    $strNewCode = kekezu::randomkeys(8);
    $strNewMd5Pwd = keke_user_class::get_password($strNewCode, $gUserInfo['rand_code']);
    $intRes = db_factory::updatetable(TABLEPRE . 'witkey_space', array('sec_code' => $strNewMd5Pwd), array('uid' => $gUid));
    if ($intRes) {
        $message_obj = new keke_msg_class();
        $message_obj->send_message($gUserInfo['uid'], $gUserInfo['username'], 'update_sec_code', '找回支付密码', array('支付密码' => $strNewCode), $gUserInfo['email'], $gUserInfo['mobile'], 2);
        kekezu::admin_system_log($gUserInfo['username'] . '于' . date("Y-m-d H:i:s") . '找回了支付密码');
        kekezu::echojson('支付密码已发到您的邮箱', 'success');
    } else {
        kekezu::echojson('支付密码找回失败', 'fail');
    }
    die;
}
exit('no access');
Ejemplo n.º 15
0
        ini_set('memory_limit', '1024M');
        $file_sql = file_get_contents($backup_patch . $file_arr[$restore_name][name]);
        $file_sql = htmlspecialchars_decode($file_sql);
        $sql = str_replace("\r\n", "\n", $file_sql);
        $ret = array();
        $num = 0;
        foreach (explode(";\n", trim($sql)) as $query) {
            $ret[$num] = '';
            $queries = explode("\n", trim($query));
            foreach ($queries as $query) {
                $ret[$num] .= isset($query[0]) && $query[0] == '#' || isset($query[1]) && isset($query[1]) && $query[0] . $query[1] == '--' ? '' : $query;
            }
            $num++;
        }
        foreach ($ret as $vvv) {
            empty($vvv) or $res *= db_factory::execute($vvv);
        }
        kekezu::admin_system_log($_lang['restore_database_operate_success'] . $file_arr[$restore_name][name]);
        kekezu::echojson($_lang['database_restore_success'], 1);
        break;
    case 'del':
        $res = unlink($backup_patch . $file_arr[$restore_name][name]);
        if ($res) {
            kekezu::admin_system_log($_lang['delete_database_backup_file'] . $file_arr[$restore_name][name]);
            kekezu::admin_show_msg($_lang['delete_database_backup_file_success'], 'index.php?do=' . $do . '&view=' . $view, 3, '', 'success');
        } else {
            kekezu::admin_show_msg($_lang['delete_database_backup_file_fail'], 'index.php?do=' . $do . '&view=' . $view, 3, '', 'warning');
        }
        break;
}
require $template_obj->template(ADMIN_DIRECTORY . '/tpl/admin_' . $do . '_' . $view);
Ejemplo n.º 16
0
    /*if($ajax == 'sendcode'){
    		$validCode = kekezu::randomkeys(6,true);
    		$sendtime = time();
    		$arrNotifyArr = array ('网站名称' => $kekezu->_sys_config ['website_name'],'验证码' => $validCode);
    		keke_shop_class::notify_user ( $_SESSION['retrieve']['userinfo'] ['uid'], $_SESSION['retrieve']['userinfo'] ['username'], 'get_password', '找回密码', $arrNotifyArr, 2 );
    		$encrypteuid = md5(md5($_SESSION['retrieve']['userinfo'] ['uid']));
    		$authsid = md5(md5($_SESSION['retrieve']['userinfo'] ['uid']).$http_agent.$sendtime);
    		keke_user_class::createGetPwdLog('email', $_SESSION['retrieve']['userinfo'] ['uid'], $validCode, $_SESSION['retrieve']['userinfo']['email'], $encrypteuid, $authsid);
    		$echodatas = array(
    			'encrypteuid' => $encrypteuid,	
    			'authsid' 	  => $authsid,
    			'http_agent'  => $http_agent,
    			'sendtime' 	  => $sendtime,
    		);
    		$_SESSION['retrieve']['validinfo']  =  $echodatas;
    		kekezu::echojson('发送成功',1,null);
    	}*/
} else {
    if ($ajax == 'sendcode') {
        $validCode = kekezu::randomkeys(6, true);
        $sendtime = time();
        $arrNotifyArr = array('网站名称' => $kekezu->_sys_config['website_name'], '验证码' => $validCode);
        keke_shop_class::notify_user($_SESSION['retrieve']['userinfo']['uid'], $_SESSION['retrieve']['userinfo']['username'], 'get_password', '找回密码', $arrNotifyArr, 2);
        $encrypteuid = md5(md5($_SESSION['retrieve']['userinfo']['uid']));
        $authsid = md5(md5($_SESSION['retrieve']['userinfo']['uid']) . $http_agent . $sendtime);
        keke_user_class::createGetPwdLog('email', $_SESSION['retrieve']['userinfo']['uid'], $validCode, $_SESSION['retrieve']['userinfo']['email'], $encrypteuid, $authsid);
        $echodatas = array('encrypteuid' => $encrypteuid, 'authsid' => $authsid, 'http_agent' => $http_agent, 'sendtime' => $sendtime);
        $_SESSION['retrieve']['validinfo'] = $echodatas;
        kekezu::echojson('发送成功', 1, null);
    }
}
Ejemplo n.º 17
0
$account_info = $kekezu->_sys_config;
$mobile_u = $account_info['mobile_username'];
$mobile_p = $account_info['mobile_password'];
switch ($ac) {
    case "ser":
        $type == 'uid' and $where = " uid='{$u}' " or $where = " INSTR(username,'" . kekezu::utftogbk($u) . "')>0 ";
        $user_info = db_factory::get_one(" select uid,username,phone,mobile from " . TABLEPRE . "witkey_space where {$where} ");
        if (!$user_info) {
            kekezu::echojson($_lang['he_came_from_mars'], '3');
            die;
        } else {
            if (!$user_info['mobile']) {
                kekezu::echojson($_lang['no_record_of_his_cellphone'], '2');
                die;
            } else {
                kekezu::echojson($user_info['mobile'], '1');
                die;
            }
        }
        break;
    case "send":
        $tar_content = strip_tags($tar_content);
        if ($slt_type == 'normal') {
            $tel_arr = db_factory::query(" select mobile from " . TABLEPRE . "witkey_space where mobile is not null ");
            $tel_group = array();
            foreach ($tel_arr as $v) {
                $tel_group[] = $v['mobile'];
            }
            $txt_tel = implode(",", $tel_group);
        }
        $sms = new sms_d9($txt_tel, $tar_content);
Ejemplo n.º 18
0
<?php

defined('ADMIN_KEKE') or exit('Access Denied');
kekezu::admin_check_role(20);
$file_obj = new keke_file_class();
$backup_patch = S_ROOT . './data/tpl_c/';
if (isset($sbt_edit)) {
    if ($ckb_obj_cache) {
        $res = $file_obj->delete_files(S_ROOT . "./data/data_cache/");
        $msg = $_lang['object_cache_empty'];
    }
    if ($ckb_tpl_cache) {
        $res = $file_obj->delete_files($backup_patch);
        $msg .= $_lang['template_cache_empty'];
    }
    if (CACHE_TYPE != 'file' && IS_CACHE == 1) {
        $kekezu->_cache_obj->flush();
    }
    if ($ajax && $ajax == 1) {
        kekezu::echojson('clear success', 1);
    } else {
        kekezu::admin_show_msg($msg, 'index.php?do=' . $do . '&view=' . $view, 2, '', 'success');
    }
}
require $template_obj->template(ADMIN_DIRECTORY . '/tpl/admin_' . $do . '_' . $view);
Ejemplo n.º 19
0
                    $res .= db_factory::execute(" insert into " . TABLEPRE . "witkey_basic_config values('','{$k}','{$v}','mobile','','')");
                }
            }
            $kekezu->_cache_obj->gc();
            kekezu::admin_system_log($_lang['edit_mobile_log']);
            kekezu::admin_show_msg($_lang['binding_cellphone_account_successfully'], "index.php?do={$do}&view={$view}&op=config", 3, '', 'success');
        }
        break;
    case "manage":
        if ($remain_fee) {
            if ($mobile_p && $mobile_u) {
                $msg = new sms_d9('', '');
                $m = $msg->get_userinfo();
                if (!$m) {
                    kekezu::echojson($_lang['get_user_info_fail'], "2");
                    die;
                } else {
                    kekezu::echojson($m, "1");
                    die;
                }
            } else {
                kekezu::admin_show_msg($_lang['not_bind_cellphone_account'], "index.php?do={$do}&view={$view}&op=config", 3, '', 'warning');
            }
        }
        break;
}
function check_bind($k)
{
    return db_factory::get_count(" select k from " . TABLEPRE . "witkey_basic_config where k='{$k}'");
}
require $template_obj->template(ADMIN_DIRECTORY . '/tpl/admin_' . $do . '_' . $view);
Ejemplo n.º 20
0
 static function save_cookie($cookie_arr, $website_url, $select_arr, $hid_save_cookie = null, $search_key = null, $cookie_name = 'save_cookie')
 {
     global $_lang;
     !$cookie_arr and $cookie_arr = array();
     $count = count($cookie_arr);
     $hid_save_cookie and $website_url = str_replace("&hid_save_cookie=1", "", str_replace("&ac=save_cookie", "", $website_url));
     $search_key and $save_name = $search_key;
     if ($select_arr) {
         $save_name = '';
         foreach ($select_arr as $k => $v) {
             $k == $count and $save_name .= $v['name'] or $save_name .= $v['name'] . ',';
         }
     }
     if ($count > 0) {
         foreach ($cookie_arr as $k => $v) {
             if ($v[url] == $website_url) {
                 if ($search_key && !$hid_save_cookie) {
                     return false;
                 } else {
                     kekezu::echojson($_lang['the_address_has_collection'], 2);
                     die;
                 }
             }
         }
         $count >= 5 and array_pop($cookie_arr);
         $cookie_url_arr[url] = $website_url;
         $cookie_url_arr['name'] = $save_name;
         array_unshift($cookie_arr, $cookie_url_arr);
     } else {
         $cookie_arr[0]['url'] = $website_url;
         $cookie_arr[0]['name'] = $save_name;
     }
     $save_cookie = serialize($cookie_arr);
     setcookie("{$cookie_name}", $save_cookie, time() + 3600 * 24 * 30, COOKIE_PATH, COOKIE_DOMAIN, NULL, TRUE);
     if ($hid_save_cookie) {
         kekezu::echojson('', 1, $save_name);
         die;
     }
 }
Ejemplo n.º 21
0
<?php

defined('ADMIN_KEKE') or exit('Access Denied');
kekezu::admin_check_role(11);
if ($check_uid) {
    CHARSET == 'gbk' and $check_uid = kekezu::utftogbk($check_uid);
    $info = get_info($check_uid, $t);
    if ($info) {
        $info['balance'] = floatval($info['balance']);
    }
    if ($t == 1) {
        $msg = "UID不存在";
    } else {
        $msg = "用户名不存在";
    }
    $info and kekezu::echojson('', 1, $info) or kekezu::echojson($msg, 0);
    die;
}
$config = $kekezu->_sys_config;
if ($is_submit && kekezu::submitcheck(isset($formhash))) {
    $url = "index.php?do={$do}&view={$view}";
    $user or kekezu::admin_show_msg($_lang['username_uid_can_not_null'], $url, 3, '', 'warning');
    $info = get_info($user, $user_type);
    $cash = floatval($cash);
    $cash == 0 and kekezu::admin_show_msg($_lang['cash_can_not_null'], $url, 3, '', 'warning');
    if ($cash_type == 1) {
        $res = keke_finance_class::cash_in($info['uid'], floatval($cash), 'admin_charge', '', 'admin_charge');
    } else {
        if ($cash > $info['balance']) {
            kekezu::admin_show_msg($_lang['user_deduct_limit'] . $info['balance'] . $_lang['yuan'], $url, 3, '', 'warning');
        } else {
Ejemplo n.º 22
0
<?php

if ($op == 'change') {
    $objBasicConfig = new Keke_witkey_basic_config_class();
    $objBasicConfig->setWhere("k = 'sitecss'");
    $objBasicConfig->setV(kekezu::k_input($css));
    $res = $objBasicConfig->edit_keke_witkey_basic_config();
    $_SESSION['showcolor'] = strval($color);
    if ($res) {
        kekezu::echojson('', 1, '');
    }
}
die;
Ejemplo n.º 23
0
         $o = keke_table_class::get_instance('witkey_task_bid');
         $tmp = $o->get_grid('task_id=' . $task_id, $url, $page, $limit, ' order by bid_time desc ', 1, 'ajax_dom');
         $list = $tmp['data'];
         $pages = $tmp['pages'];
         $satus_arr = tender_task_class::get_work_status();
     }
     break;
 case 'comm':
     if ($ac && $comm_id) {
         $id = intval($comm_id);
         switch ($ac) {
             case 'del':
                 $sql = ' delete from %switkey_comment where comment_id=%d';
                 $type == 1 and $sql .= ' or p_id=%d';
                 $res = db_factory::execute(sprintf($sql, TABLEPRE, $id, $id));
                 $res and kekezu::echojson('', 1) or kekezu::echojson('', 0);
                 die;
                 break;
             case 'load':
                 $list = db_factory::query(sprintf(' select * from %switkey_comment where p_id=%d', TABLEPRE, $id));
                 require keke_tpl_class::template('task/' . $model_info['model_dir'] . '/admin/tpl/task_edit_ext');
                 die;
                 break;
         }
     } else {
         $o = keke_table_class::get_instance('witkey_comment');
         $tmp = $o->get_grid('obj_id=' . $task_id . ' and p_id=0', $url, $page, $limit, ' order by on_time desc ', 1, 'ajax_dom');
         $list = $tmp['data'];
         $pages = $tmp['pages'];
     }
     break;
Ejemplo n.º 24
0
     }
     die;
     break;
 case 'workover':
     if (isset($formhash) && kekezu::submitcheck($formhash)) {
         $resText = $objTask->work_over($tarContent, $file_id, intval($modify));
         if ($resText === true) {
             kekezu::show_msg('操作成功', 'index.php?do=task&id=' . $taskId, 3, NULL, 'ok');
         } else {
             kekezu::show_msg($resText, 'index.php?do=task&id=' . $taskId, 3, NULL, 'fail');
         }
     }
     if ($action == 'deleteFile') {
         $resText = CommonClass::delFileByFileId($fileid);
         if ($resText) {
             kekezu::echojson('删除成功', 1, array('fileid' => $fileid));
             die;
         }
     }
     $arrBidInfo = $objTask->work_exists();
     $arrFileLists = CommonClass::getFileArray('|', $arrBidInfo['work_file']);
     require keke_tpl_class::template('task/match/tpl/default/complete');
     die;
     break;
 case 'taskAccept':
     $objTask->task_accept();
     break;
 case 'workcancel':
     $objTask->work_cancel();
     break;
 case "planquote":
Ejemplo n.º 25
0
        updateFilepath($arrServiceInfo['service_id'], $_POST['file_ids'], 'pic');
        kekezu::echojson('删除成功', 1, array('fileid' => $fileid, 'save_name' => $arrFileInfo['save_name']));
        die;
    }
}
if ($action == 'delete_goodsfile') {
    $fileid = intval($fileid);
    $strSql = sprintf("select file_id,file_name,save_name from %switkey_file where file_id in(%s)", TABLEPRE, $fileid);
    $arrFileInfo = db_factory::get_one($strSql);
    $resText = CommonClass::delFileByFileId($fileid);
    if ($resText) {
        $array = explode(',', $arrServiceInfo['file_path']);
        $newArr = CommonClass::returnNewArr($arrFileInfo['save_name'], $array);
        $_POST['file_path_2'] = implode(",", $newArr);
        updateFilepath($arrServiceInfo['service_id'], $_POST['file_path_2'], 'file');
        kekezu::echojson('删除成功', 1, array('fileid' => $fileid, 'save_name' => $arrFileInfo['save_name']));
        die;
    }
}
if (isset($formhash) && kekezu::submitcheck($formhash)) {
    if ($arrServiceInfo['uid'] != $gUid) {
        exit('禁止未授权访问');
    }
    $arrGoodsConfig = unserialize($kekezu->_model_list[6]['config']);
    $goodsprice = floatval($goodsprice);
    $floatMinCash = floatval($arrGoodsConfig['min_cash']);
    if ($floatMinCash && $goodsprice < $floatMinCash) {
        $tips['errors']['goodsprice'] = '最小金额不能少于' . $floatMinCash . '元';
        kekezu::show_msg($tips, null, NULL, NULL, 'error');
    }
    if (strtoupper(CHARSET) == 'GBK') {
Ejemplo n.º 26
0
 public function del_file($file_id)
 {
     $res = keke_file_class::del_att_file($file_id);
     $res and kekezu::echojson('', '1') or kekezu::echojson('', '0');
     die;
 }
Ejemplo n.º 27
0
<?php

defined('ADMIN_KEKE') or exit('Access Denied');
kekezu::admin_check_role(73);
$msg_obj = new Keke_witkey_msg_tpl_class();
$config_msg_arr = $kekezu->get_table_data("*", "witkey_msg_config", " 1 = 1 ", "config_id desc ", '', '', 'config_id');
$now_msg_arr = db_factory::get_one(" select * from " . TABLEPRE . "witkey_msg_config where k='{$slt_tpl_code}'");
$now_v = unserialize($now_msg_arr['v']);
if (isset($tpl_code)) {
    $msg_tpl = db_factory::query(" select * from " . TABLEPRE . "witkey_msg_tpl where tpl_code='{$tpl_code}'");
    if ($msg_tpl) {
        kekezu::echojson('', 1, $msg_tpl);
    } else {
        echo json_encode(array("status" => 0));
    }
}
$objMsgC = new Keke_witkey_msg_config_class();
if (isset($sbt_edit)) {
    if ($slt_tpl_code) {
        $objMsgC->setWhere("k='{$slt_tpl_code}'");
        $objMsgC->setContent($tar_msg_temp_content);
        $res = $objMsgC->edit_keke_witkey_msg_config();
    }
    if ($res) {
        kekezu::admin_system_log($_lang['edit_sms_tpl']);
        kekezu::admin_show_msg($_lang['edit_sms_tpl_success'], 'index.php?do=msg&view=intertpl&slt_tpl_code=' . $slt_tpl_code, 3, '', 'success');
    }
}
$msg_tpl = db_factory::get_one("select content from " . TABLEPRE . "witkey_msg_config where k='{$slt_tpl_code}'");
$msg_tpl = $msg_tpl['content'];
require $kekezu->_tpl_obj->template(ADMIN_DIRECTORY . '/tpl/admin_msg_' . $view);
Ejemplo n.º 28
0
 public function wap_upload($f = 'uploadedfile', $work_id = 0)
 {
     $work_id and $type = "work" or $type = "task";
     $path = keke_file_class::upload_file($f);
     $file_obj = new Keke_witkey_file_class();
     $file_obj->setFile_name($_FILES[$f][name]);
     $file_obj->setTask_id($this->_task_id);
     $file_obj->setObj_type($type);
     $file_obj->setSave_name($path);
     $file_obj->setOn_time(time());
     $file_obj->setUid($this->_uid);
     $file_obj->setUsername($this->_username);
     $file_obj->create_keke_witkey_file();
     if ($path) {
         $fid = db_factory::get_count(sprintf(" select file_id from %switkey_file where save_name='%s'", TABLEPRE, $path));
         if ($work_id) {
             db_factory::execute(sprintf("update %switkey_task_work set work_file='%d' where task_id='%d' and work_id='%d'", TABLEPRE, $fid, $this->_task_id, $work_id));
             db_factory::execute(sprintf(" update %switkey_file set obj_type='work',task_id='%d',obj_id='%d' where file_id='%d'", TABLEPRE, $this->_task_id, $work_id, $fid));
         } else {
             db_factory::execute(sprintf("update %switkey_task set task_file='%d' where task_id='%d'", TABLEPRE, $fid, $this->_task_id));
             db_factory::execute(sprintf(" update %switkey_file set obj_type='task',task_id='%d' where file_id='%d'", TABLEPRE, $this->_task_id, $fid));
         }
         kekezu::echojson('', 1);
     } else {
         kekezu::echojson(array('r' => 'Upload failed'), 0);
     }
     die;
 }
Ejemplo n.º 29
0
 function show_msg($content, $status, $url = '', $t = 3)
 {
     global $_lang, $_K;
     switch ($this->_login_type) {
         case "3":
             $data = $url;
             kekezu::echojson($content, $status, $data);
             die;
             break;
         case "4":
             $data = $url;
             if (ISWAP == 1) {
                 preg_match_all('/src=\'(.*)\'/iU', $data['pic'], $m);
                 preg_match_all('/src=\\"(.*)\\?/i', $data['g_pic']['pic'], $m1);
                 preg_match_all('/src=\\"(.*)\\?/i', $data['s_pic']['pic'], $m2);
                 $data = array('uid' => $data['uid'], 'username' => $data['username'], 'pic' => $m[1][0], 'g_pic' => $_K['siteurl'] . '/' . $m1[1][0], 's_pic' => $_K['siteurl'] . '/' . $m2[1][0]);
                 $status != 1 && ($content = array('r' => $content));
             }
             kekezu::echojson($content, $status, $data);
             break;
         case "0":
         case '2':
         case "1":
             if ($_K['inajax']) {
                 $status == 1 and $type = 'ok' or $type = 'fail';
             } else {
                 $status == 1 and $type = 'ok' or $type = 'fail';
             }
             kekezu::show_msg($content, $url, 2, '', $type);
             break;
     }
 }
Ejemplo n.º 30
0
<?php

defined('IN_KEKE') or exit('Access Denied');
$strUrl = "index.php?do=user&view=focus&op=fans";
$objFollowT = keke_table_class::get_instance('witkey_free_follow');
$strWhere = " 1 = 1 ";
$strWhere .= " and f.fuid = " . $uid;
if (isset($action)) {
    switch ($action) {
        case 'addFollow':
            $arrFd['uid'] = $uid;
            $arrFd['fuid'] = intval($fansId);
            $arrFd['on_time'] = time();
            $res = $objFollowT->save($arrFd);
            $res and kekezu::echojson($fansId, 1, '');
    }
} else {
    $page and $intPage = intval($page);
    $intPage = intval($intPage) ? $intPage : 1;
    $intPagesize = intval($intPagesize) ? $intPagesize : 10;
    $strSql = 'select f.*,s.uid focus_uid,s.username focus_username,s.seller_level,s.skill_ids from ' . TABLEPRE . 'witkey_free_follow as f';
    $strSql .= ' left join ' . TABLEPRE . 'witkey_space as s on f.uid = s.uid where ' . $strWhere;
    $strSql .= ' order by f.on_time desc ';
    $arrDatas = db_factory::query($strSql);
    $arrPageArr = $kekezu->_page_obj->page_by_arr($arrDatas, $intPagesize, $intPage, $strUrl);
    $arrFansLists = $arrPageArr['data'];
    if (is_array($arrFansLists)) {
        foreach ($arrFansLists as $k => $v) {
            $arrFocusData = CommonClass::getMemberFocus($v['focus_uid']);
            $arrFansLists[$k]['data'] = $arrFocusData;
            $arrShopInfo = CommonClass::getShopInfo($v['focus_uid']);