function save_comment($comment_arr, $obj_id, $is_reply = false)
 {
     global $_lang, $kekezu, $uid, $username;
     if (!$uid) {
         return -1;
         die;
     }
     $r = kekezu::check_session('task_leave', 2, 4);
     if ($r == false) {
         return -2;
         die;
     }
     strtolower(CHARSET) == 'gbk' and $comment_arr['content'] = kekezu::utftogbk(kekezu::escape($comment_arr['content']));
     if (kekezu::k_match(array($kekezu->_sys_config['ban_content']), $comment_arr['content'])) {
         return -3;
         die;
     }
     $comment_id = $this->_comment_obj->save($comment_arr);
     $model_list = $kekezu->_model_list;
     if (!$is_reply) {
         if ($this->_comment_type == 'task') {
             $res = db_factory::execute(sprintf(" update %switkey_task set leave_num =ifnull(leave_num,0)+1 where task_id='%d'", TABLEPRE, $obj_id));
             $obj_info = db_factory::get_one(sprintf("select * from %switkey_task where task_id=%d", TABLEPRE, $obj_id));
             if ($obj_info['task_cash_coverage']) {
                 $cash = $obj_info['task_cash_coverage'];
             } else {
                 $cash = $obj_info['task_cash'];
             }
         } elseif ($this->_comment_type == 'service') {
             $res = db_factory::execute(sprintf(" update %switkey_service set leave_num =ifnull(leave_num,0)+1 where service_id='%d'", TABLEPRE, $obj_id));
             $obj_info = db_factory::get_one(sprintf("select * from %switkey_service where service_id=%d", TABLEPRE, $obj_id));
         }
     }
     return $comment_id;
 }
function checkFieldName($name, $model_id)
{
    $result = db_factory::get_one("SELECT f_name FROM `" . TABLEPRE . "witkey_custom_fields` where f_name = '" . kekezu::escape($name) . "' and model_id=" . intval($model_id));
    if ($result['f_name']) {
        return true;
    } else {
        return false;
    }
}
Exemple #3
0
 static function SendFeedMsg($receiver, $title, $content, $type = '1')
 {
     $receiverInfo = kekezu::get_user_info(intval($receiver));
     if (!$receiverInfo) {
         return false;
     }
     $objMsgM = new Keke_witkey_msg_class();
     $objMsgM->setType($type);
     $objMsgM->setTo_uid($receiverInfo['uid']);
     $objMsgM->setTo_username($receiverInfo['username']);
     $objMsgM->setTitle(kekezu::escape($title));
     $objMsgM->setContent(kekezu::escape($content));
     $objMsgM->setOn_time(time());
     return $objMsgM->create_keke_witkey_msg();
 }
Exemple #4
0
 static function editExtData($objid, $model_id, $data)
 {
     if (!self::checkCustom($model_id)) {
         return false;
     }
     $extCode = CustomClass::getExtCodeByModelId($model_id);
     if ($data) {
         foreach ($data as $k => $v) {
             if (in_array($k, $extCode)) {
                 $fieldInfo = self::getFieldName($k);
                 $extData = array();
                 $extData[$k]['fieldname'] = $fieldInfo['f_name'];
                 $extData[$k]['content'] = kekezu::escape($v);
                 $jsondata = serialize($extData);
                 $sql = "UPDATE " . TABLEPRE . "witkey_custom_fields_ext SET extdata='{$jsondata}' WHERE objid='{$objid}' AND model_id ='{$model_id}' AND c_id = '{$fieldInfo['id']}' ";
                 db_factory::execute($sql);
             }
         }
     }
 }
 function save($fields, $pk = array())
 {
     foreach ($fields as $k => $v) {
         $kk = ucfirst($k);
         $set_query = "set" . $kk;
         $this->_table_obj->{$set_query}($v);
     }
     $keys = array_keys($pk);
     $key = $keys[0];
     if (!empty($pk[$key])) {
         $this->_table_obj->setWhere(" {$key} = '" . kekezu::escape($pk[$key]) . "'");
         $edit_query = "edit_" . $this->_pre . $this->_table_name;
         $res = $this->_table_obj->{$edit_query}();
     } else {
         $create_query = "create_" . $this->_pre . $this->_table_name;
         $res = $this->_table_obj->{$create_query}();
     }
     if ($res) {
         return $res;
     } else {
         return false;
     }
 }
Exemple #6
0
         CustomClass::editExtData($task_id, $model_id, $ext_fds);
     }
     $task_obj = new Keke_witkey_task_class();
     $task_obj->setWhere(" task_id ='{$task_id}'");
     $task_obj->setTask_title(kekezu::escape($task_title));
     if ($txt_task_day) {
         $task_obj->setSub_time(strtotime($txt_task_day));
         $task_obj->setEnd_time(strtotime($txt_task_day) + $task_config['choose_time'] * 24 * 3600);
     }
     $task_obj->setIndus_id($slt_indus_id);
     $task_obj->setTask_cash($task_cash);
     $task_obj->setReal_cash($task_cash * (1 - $task_info['profit_rate'] / 100));
     $fds['task_cash_coverage'] and $task_obj->setTask_cash_coverage($fds['task_cash_coverage']);
     $fds['budget'] and $task_obj->setBudget($fds['budget']);
     $task_obj->setTask_desc($task_desc);
     $fields = kekezu::escape($fields);
     $task_obj->setSeo_title($fields['seo_title']);
     $task_obj->setSeo_keyword($fields['seo_keyword']);
     $task_obj->setSeo_desc($fields['seo_desc']);
     if ($_FILES['fle_task_pic']['name']) {
         $task_pic = keke_file_class::upload_file("fle_task_pic");
     } else {
         $task_pic = $task_pic_path;
     }
     $task_obj->setTask_pic($task_pic);
     kekezu::admin_system_log($_lang['edit_task'] . ":{$task_title}");
     $res = $task_obj->edit_keke_witkey_task();
     $v_arr = array($_lang['admin_name'] => $myinfo_arr['username'], $_lang['time'] => date('Y-m-d H:i:s', time()), $_lang['model_name'] => $model_info['model_name'], $_lang['task_id'] => $task_info['task_id'], $_lang['task_title'] => $task_info['task_title']);
     keke_msg_class::notify_user($task_info['uid'], $task_info['username'], 'task_edit', $_lang['edit_task'], $v_arr, 1);
 } elseif ($sbt_act) {
     switch ($sbt_act) {
$indus_table_obj = new Keke_witkey_industry_class();
$indus_obj = keke_table_class::get_instance("witkey_industry");
$file_obj = new keke_file_class();
$indus_arr = kekezu::get_industry(0);
isset($indus_id) and intval($indus_id) > 0 and $indus_info = $indus_obj->get_table_info('indus_id', $indus_id);
empty($art_info) or extract($art_info);
if (isset($indus_id) && intval($indus_id) > o) {
    $indus_info = $indus_obj->get_table_info('indus_id', $indus_id);
    $indus_pid = $indus_info['indus_pid'];
}
if ($sbt_edit) {
    $indus_table_obj->setWhere("indus_name = '" . $fs['indus_name'] . "'");
    $res = $indus_table_obj->count_keke_witkey_industry();
    !$pk && $res and kekezu::admin_show_msg($_lang['operate_fail'], $url, 3, $_lang['indus_has']);
    $fs['on_time'] = time();
    isset($fs['is_recommend']) or $fs['is_recommend'] = 0;
    isset($fs['totask']) or $fs['totask'] = 0;
    isset($fs['togoods']) or $fs['togoods'] = 0;
    $fs = kekezu::escape($fs);
    $res = $indus_obj->save($fs, $pk);
    $indus_info = $indus_obj->get_table_info('indus_id', $pk['indus_id']);
    $url = "index.php?do=task&view=industry";
    !$pk and kekezu::admin_system_log($_lang['add_industry']) or kekezu::admin_system_log($_lang['edit_industry'] . ':' . $indus_info['indus_name']);
    $file_obj->delete_files(S_ROOT . "./data/data_cache/");
    $file_obj->delete_files(S_ROOT . './data/tpl_c/');
    $res and kekezu::admin_show_msg($_lang['operate_success'], $url, 3, '', 'success') or kekezu::admin_show_msg($_lang['operate_fail'], $url, 3, '', 'warning');
}
$temp_arr = array();
kekezu::get_tree($indus_arr, $temp_arr, 'option', $indus_pid, 'indus_id');
$indus_arr = $temp_arr;
require $template_obj->template(ADMIN_DIRECTORY . '/tpl/admin_task_' . $view);
<?php

defined('ADMIN_KEKE') or exit('Access Denied');
kekezu::admin_check_role(82);
$suggest_obj = new keke_table_class('witkey_proposal');
$proposal_obj = new Keke_witkey_proposal_class();
$suggest_type_arr = array('1' => '我的建议', '2' => '我的问题');
$suggest_status_arr = array('1' => '待回复', '2' => '已回复');
$url = "index.php?do={$do}&view={$view}&suggest_id={$suggest_id}";
if ($suggest_id) {
    $suggest_info = db_factory::get_one(sprintf("select * from %switkey_proposal where p_id = '%d'", TABLEPRE, $suggest_id));
    $user_info = kekezu::get_user_info($suggest_info['uid']);
    if ($sbt_op) {
        $proposal_obj->setWhere('p_id = ' . $suggestid);
        $proposal_obj->setOp_content(kekezu::escape($op_result['process_result']));
        $proposal_obj->setOp_time(time());
        $proposal_obj->setPro_status(2);
        $proposal_obj->setOp_uid($_SESSION['uid']);
        $proposal_obj->setOp_username($_SESSION['username']);
        $res_id = $proposal_obj->edit_keke_witkey_proposal();
        $v_arr = array('用户名' => $suggest_username, '用户标题' => $suggest_title, '建议内容' => kekezu::escape($pro_desc), '回复内容' => kekezu::escape($op_result['process_result']), $_lang['website_name'] => $kekezu->_sys_config['website_name']);
        keke_shop_class::notify_user($suggest_uid, $suggest_username, 'suggest_reply', '建议答复', $v_arr, 2);
        $res_id and kekezu::admin_show_msg($_lang['operate_notice'], $url, "2", '回复成功', 'success') or kekezu::admin_show_msg($_lang['operate_notice'], $url, "2", '回复失败', 'warning');
    }
}
require $template_obj->template(ADMIN_DIRECTORY . '/tpl/admin_user_suggest_reply');
Exemple #9
0
         $strPageDescription = kekezu::cutstr($arrServiceInfo['content'], 100);
     }
 }
 $floatGoodMark = CommonClass::getGoodsMark(intval($intId));
 if ($uid != $arrServiceInfo['uid'] && $arrServiceInfo['service_status'] != 2 && $arrServiceInfo['service_status'] != 5) {
     $gUid == ADMIN_UID or kekezu::show_msg('操作提示', "index.php?do=goodslist", '1', '商品不存在', 'warning');
 }
 if (isset($op)) {
     switch ($op) {
         case "report":
             $transname = keke_report_class::get_transrights_name($type);
             $report_reason = keke_report_class::get_report_product_reason();
             if (isset($formhash) && kekezu::submitcheck($formhash)) {
                 $resCheck = keke_report_class::check_if_report($type, $objType, $objId, $uid, $toUid);
                 if ($resCheck === true) {
                     $tarContent = kekezu::escape($tarContent);
                     $toUserInfo = keke_user_class::get_user_info($toUid);
                     $resText = keke_shop_class::set_report($objId, $toUid, $type, $filepath, $tarContent, $sltReason);
                     if ($resText === true) {
                         kekezu::show_msg('感谢您的举报,管理员会尽快受理,请耐心等待处理结果。', 'index.php?do=goods&id=' . $id, 3, NULL, 'ok');
                     } else {
                         kekezu::show_msg($resText, null, null, NULL, 'fail');
                     }
                 } else {
                     kekezu::show_msg($resCheck, null, null, NULL, 'fail');
                 }
             } else {
                 $strUrl .= '&op=report';
                 require keke_tpl_class::template("tpl/default/ajax/report");
                 die;
             }
Exemple #10
0
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);
        }
        kekezu::admin_system_log($_lang['to_witkey_service_name_is'] . $service_info[title] . $_lang['in_edit_operate']);
        service_shop_class::set_on_sale_num($pk['service_id'], $fds['service_status']);
        $service_obj = keke_table_class::get_instance('witkey_service');
        $c = $service['content'];
        $fds = kekezu::escape($service);
        $service['content'] = $c;
        isset($service['is_top']) or $service['is_top'] = 0;
        $service_obj->save($service, array("service_id" => $service_id));
        kekezu::admin_show_msg($_lang['service_edit_success'], 'index.php?do=model&model_id=7&view=list', 2, $_lang['service_edit_success'], 'success');
    }
} else {
    require S_ROOT . '/shop/' . $model_info['model_dir'] . '/admin/shop_misc.php';
}
require keke_tpl_class::template('shop/' . $model_info['model_dir'] . '/admin/tpl/service_edit_' . $op);
 public function get_user_auth_info($uid, $is_username = 0, $show_id = '')
 {
     $sql = "select * from " . TABLEPRE . $this->_auth_table_name;
     if ($uid) {
         $is_username == '0' and $sql .= " where uid = '" . intval($uid) . "' " or $sql .= " where username = '******' ";
         $show_id and $sql .= " and " . $this->_primary_key . "=" . intval($show_id);
         $sql .= " order by {$this->_primary_key} desc";
         $data = db_factory::query($sql);
         if (sizeof($data) == 1) {
             return $data[0];
         } else {
             return $data;
         }
     } else {
         return array();
     }
 }
Exemple #12
0
if (strtoupper(CHARSET) == 'GBK') {
    $arrOauthInfo = kekezu::utftogbk($arrOauthInfo);
}
$objReg = new keke_register_class();
$objLogin = new keke_user_login_class();
$arrBindInfo = keke_register_class::is_oauth_bind($type, $arrOauthInfo['account']);
$account = $arrBindInfo['username'];
if ($_SESSION[$type . '_oauthInfo'] && $arrBindInfo && !$to_bind) {
    $_SESSION[$type . '_oauthInfo'] = null;
    setcookie($type . 'uid', 1, time() - 1);
    $arrUserInfo = kekezu::get_user_info($arrBindInfo['uid']);
    $loginUserInfo = $objLogin->oauth_user_login($arrUserInfo['username'], $arrUserInfo['password'], null, 1);
    $objLogin->save_user_info($loginUserInfo, 1);
} elseif ($_SESSION[$type . '_oauthInfo'] && !$arrBindInfo && !$formhash && !$to_bind) {
    $password = kekezu::randomkeys(6);
    $account = kekezu::escape($arrOauthInfo['nickname']);
    $is_nameExist = 1;
    while ($is_nameExist) {
        $hasUser = db_factory::get_one("select * from " . TABLEPRE . "witkey_space where username='******'");
        if ($hasUser) {
            $is_nameExist = 1;
            $code = kekezu::randomkeys(6);
            $account = $account . $code;
        } else {
            $is_nameExist = 0;
        }
    }
    $intRegUid = $objReg->user_register($account, $password, $email, $code, false, $password, 1);
    $arrUserInfo = keke_user_class::get_user_info($intRegUid);
    UserCenter::bindingAccount($arrUserInfo['uid'], $arrUserInfo['username'], $arrOauthInfo);
    $_SESSION['uid'] = $arrUserInfo['uid'];
Exemple #13
0
$objRss = new keke_rss_class();
$objRss->title = $kekezu->_sys_config['rss_title'];
$objRss->link = $kekezu->_sys_config['website_url'];
$objRss->description = $kekezu->_sys_config['rss_content'];
if ($kekezu->_sys_config['rss_choice_task'] == '1') {
    $arrTask = db_factory::query(sprintf("select * from %switkey_task where task_status>=2 order by task_id desc limit 10", TABLEPRE));
    foreach ($arrTask as $k => $v) {
        $arrRss[$v['start_time']]['title'] = '[任务]' . $v['task_title'];
        $arrRss[$v['start_time']]['link'] = $kekezu->_sys_config['website_url'] . '/index.php?do=task&id=' . $v['task_id'];
        $arrRss[$v['start_time']]['description'] = kekezu::cutstr(kekezu::escape(strip_tags(htmlspecialchars_decode($v['task_desc']))), 100) . '...';
    }
}
if ($kekezu->_sys_config['rss_choice_news'] == '1') {
    $arrAct = db_factory::query(sprintf("select * from %switkey_article where cat_type = 'article' order by art_id desc limit 10", TABLEPRE));
    foreach ($arrAct as $k => $v) {
        $arrRss[$v['pub_time']]['title'] = '[资讯]' . $v['art_title'];
        $arrRss[$v['pub_time']]['link'] = $kekezu->_sys_config['website_url'] . '/index.php?do=article&id=' . $v['art_id'];
        $arrRss[$v['pub_time']]['description'] = kekezu::cutstr(kekezu::escape(strip_tags(htmlspecialchars_decode($v['content']))), 100) . '...';
    }
}
krsort($arrRss);
$arr = array_slice($arrRss, 0, 10);
foreach ($arr as $v) {
    $objItem = new FeedItem();
    $objItem->title = $v['title'];
    $objItem->link = $v['link'];
    $objItem->description = $v['description'];
    $objRss->addItem($objItem);
}
$objRss->saveFeed("RSS2.0", "data/index.xml");
Exemple #14
0
    $objMsgM = new Keke_witkey_msg_class();
    if (strtoupper(CHARSET) == 'GBK') {
        $to_username = kekezu::utftogbk($to_username);
    }
    $arrSpaceInfo = kekezu::get_user_info($to_username, 1);
    if (!$arrSpaceInfo) {
        $tips['errors']['to_username'] = '******';
        kekezu::show_msg($tips, NULL, NULL, NULL, 'error');
    }
    if ($arrSpaceInfo['uid'] == $gUid) {
        $tips['errors']['to_username'] = '******';
        kekezu::show_msg($tips, NULL, NULL, NULL, 'error');
    }
    if (strtoupper(CHARSET) == 'GBK') {
        $title = kekezu::utftogbk($title);
        $content = kekezu::utftogbk($content);
    }
    $objMsgM->setUid($gUid);
    $objMsgM->setUsername($username);
    $objMsgM->setTo_uid($arrSpaceInfo['uid']);
    $objMsgM->setTo_username($arrSpaceInfo['username']);
    $objMsgM->setTitle(kekezu::str_filter(kekezu::escape($title)));
    $objMsgM->setContent(kekezu::str_filter(kekezu::escape($content)));
    $objMsgM->setOn_time(time());
    $objMsgM->setType(3);
    $objMsgM->create_keke_witkey_msg();
    unset($objMsgM);
    kekezu::show_msg('已发送', NULL, NULL, NULL, 'ok');
} else {
    $userArrData = keke_user_class::get_user_info($id);
}
Exemple #15
0
     if (!$fds[indus_id]) {
         kekezu::admin_show_msg($_lang['must_select_a_industry'], $_SERVER['HTTP_REFERER'], 3, '', 'warning');
     }
     if ($_FILES['fle_task_pic']['name']) {
         $task_pic = keke_file_class::upload_file("fle_task_pic");
     } else {
         $task_pic = $task_pic_path;
     }
     $task_pic and $fds['task_pic'] = $task_pic;
     if ($txt_task_day) {
         $fds['sub_time'] = strtotime($txt_task_day);
     }
     $fds['seo_title'] = $fields['seo_title'];
     $fds['seo_keyword'] = $fields['seo_keyword'];
     $fds['seo_desc'] = $fields['seo_desc'];
     $fds = kekezu::escape($fds);
     $pk and $success = $task_obj->save($fds, $pk);
     kekezu::admin_system_log($_lang['edit_task'], '{$fds[task_title]}');
     $v_arr = array($_lang['admin_name'] => $myinfo_arr['username'], $_lang['time'] => date('Y-m-d H:i:s', time()), $_lang['model_name'] => $model_info['model_name'], $_lang['task_id'] => $task_info['task_id'], $_lang['task_title'] => $task_info['task_title']);
     keke_msg_class::notify_user($task_info['uid'], $task_info['username'], 'task_edit', $_lang['edit_task'], $v_arr, 1);
     kekezu::admin_show_msg($_lang['task_edit_success'], "index.php?do=model&model_id={$model_id}&view=list", 3, '', 'success');
 }
 $indus_arr = $kekezu->_indus_arr;
 $temp_arr = array();
 $indus_option_arr = $indus_arr;
 $indus_arr = kekezu::get_industry(1);
 $temp_arr = array();
 $status_arr = dtender_task_class::get_task_status();
 $payitem_list = keke_payitem_class::get_payitem_config('employer');
 kekezu::get_tree($indus_option_arr, $temp_arr, "option", $task_info['indus_id']);
 $indus_option_arr = $temp_arr;
Exemple #16
0
}
switch ($step) {
    case 'step1':
        if (isset($formhash) && kekezu::submitcheck($formhash)) {
            if (strtoupper(CHARSET) == 'GBK') {
                $title = kekezu::utftogbk($title);
                $content = kekezu::utftogbk($content);
            }
            $serviceOrderInfo = array();
            $serviceOrderInfo['uid'] = $gUid;
            $serviceOrderInfo['username'] = $gUsername;
            $serviceOrderInfo['service_id'] = 0;
            $serviceOrderInfo['title'] = kekezu::escape($title);
            $serviceOrderInfo['indus_pid'] = intval($indus_pid);
            $serviceOrderInfo['indus_id'] = intval($indus_id);
            $serviceOrderInfo['content'] = kekezu::escape($content);
            $serviceOrderInfo['file_ids'] = $file_ids;
            $serviceOrderInfo['price'] = floatval($price);
            $orderId = keke_order_class::create_order(7, $arrSellerInfo['uid'], $arrSellerInfo['username'], $serviceOrderInfo['title'], $serviceOrderInfo['price'], '雇佣服务:' . $serviceOrderInfo['title'], 'seller_confirm');
            if ($orderId) {
                $serviceOrderInfo['order_id'] = $orderId;
                keke_order_class::create_order_detail($orderId, $serviceOrderInfo['title'], 'gy', $serviceOrderInfo['service_id'], $serviceOrderInfo['price']);
                keke_order_class::createServiceOrder($serviceOrderInfo);
                $order_url = "<a href=\"" . $_K['siteurl'] . "/index.php?do=gy&id=" . $arrSellerInfo['uid'] . "&orderId=" . $orderId . "\">" . $title . "</a>";
                $v_arr = array('用户名' => $arrSellerInfo['username'], '用户' => $username, '雇佣订单链接' => $order_url, '网站名称' => $kekezu->_sys_config['website_name']);
                $msg_obj = new keke_msg_class();
                $msg_obj->send_message($arrSellerInfo['uid'], $arrSellerInfo['username'], 'gy_order_notice', '雇佣订单消息', $v_arr);
                $feed_arr = array("feed_username" => array("content" => $arrSellerInfo['username'], "url" => "index.php?do=seller&id=" . $arrSellerInfo['uid']), "action" => array("content" => '雇佣', "url" => ''), "event" => array("content" => $serviceOrderInfo['title'], "url" => ""));
                kekezu::save_feed($feed_arr, $gUid, $gUsername, 'gy', $id, '');
                $feed_arr = array("feed_username" => array("content" => $gUsername, "url" => "index.php?do=seller&id=" . $gUid), "action" => array("content" => '雇佣', "url" => ''), "event" => array("content" => $serviceOrderInfo['title'], "url" => ""));
                kekezu::save_feed($feed_arr, $arrSellerInfo['uid'], $arrSellerInfo['username'], 'gy_bei', $id, '');
Exemple #17
0
keke_lang_class::loadlang('task_edit', 'task');
$task_sub_time = date('Y-m-d', $task_info['sub_time']);
$task_end_time = date('Y-m-d', $task_info['end_time']);
$task_start_time = date('Y-m-d', $task_info['start_time']);
if ($op == 'basic') {
    if ($sbt_recmmend) {
        $res = db_factory::execute(sprintf("update %switkey_task set is_top=1 where task_id='%d' ", TABLEPRE, $task_id));
        $res and kekezu::admin_show_msg($_lang['task_operate_successfully'], "index.php?do=model&model_id={$model_id}&view=list", 3, '', 'success') or kekezu::admin_show_msg($_lang['task_operate_fail'], "index.php?do=model&model_id={$model_id}&view=list", 3, '', 'warning');
    }
    if ($sbt_edit) {
        if ($ext_fds) {
            CustomClass::editExtData($task_id, $model_id, $ext_fds);
        }
        $task_obj = new Keke_witkey_task_class();
        $task_obj->setWhere(" task_id ='{$task_id}'");
        $task_obj->setTask_title(kekezu::escape($task_title));
        if ($txt_task_day) {
            $task_obj->setSub_time(strtotime($txt_task_day));
            $task_obj->setEnd_time(strtotime($txt_task_day) + $task_config['choose_time'] * 24 * 3600);
        }
        $task_obj->setIndus_id($slt_indus_id);
        $task_obj->setTask_cash($task_cash);
        $task_obj->setReal_cash($task_cash * (1 - $task_info['profit_rate'] / 100));
        $task_obj->setTask_desc($task_desc);
        $task_obj->setTask_file($file_ids);
        $task_obj->setSeo_title($fields['seo_title']);
        $task_obj->setSeo_keyword($fields['seo_keyword']);
        $task_obj->setSeo_desc($fields['seo_desc']);
        if ($_FILES['fle_task_pic']['name']) {
            $task_pic = keke_file_class::upload_file("fle_task_pic");
        } else {
 public function public_pubtask()
 {
     $this->submit_check();
     $std_obj = $this->_std_obj;
     $release_info = $std_obj->_release_info;
     $task_obj = $this->_task_obj;
     $user_info = $this->_user_info;
     $task_obj->setModel_id($this->_model_id);
     $task_obj->setIndus_id($release_info['indus_id']);
     $task_obj->setIndus_pid($release_info['indus_pid']);
     $task_obj->setProvince($release_info['province']);
     $task_obj->setCity($release_info['city']);
     $task_obj->setArea($release_info['area']);
     $task_obj->setTask_title(kekezu::str_filter(kekezu::escape($release_info['txt_title'])));
     $task_obj->setTask_desc(kekezu::str_filter(kekezu::escape($release_info['tar_content'])));
     $strFileIds = implode(',', array_filter(explode('|', $release_info['file_ids'])));
     $task_obj->setTask_file($strFileIds);
     $task_obj->setTask_pic($this->filerPic($strFileIds));
     $task_obj->setContact($release_info['txt_mobile']);
     $task_obj->setProfit_rate($this->_task_config['task_rate']);
     $task_obj->setTask_fail_rate($this->_task_config['task_fail_rate']);
     $task_obj->setTask_cash($release_info['txt_task_cash']);
     $task_obj->setReal_cash($release_info['txt_task_cash'] * (100 - $this->_task_config['task_rate']) / 100);
     $task_obj->setStart_time(time());
     $time_arr = getdate();
     $rel_time = $time_arr['hours'] * 3600 + $time_arr['minutes'] * 60 + $time_arr['seconds'];
     if ($this->_model_id == 15) {
         $objRelease = sreward_release_class::get_instance($this->_model_id, $pub_mode);
         $arrConfig = $objRelease->_task_config;
         $end_times = time() + $arrConfig['max_time'] * 24 * 60 * 60;
         $task_obj->setSub_time($end_times);
         $task_obj->setEnd_time($end_times);
     } else {
         $task_obj->setSub_time(strtotime($release_info['txt_task_day']) + $rel_time);
         $task_obj->setEnd_time(strtotime($release_info['txt_task_day']) + $this->_task_config['choose_time'] * 24 * 3600 + $rel_time);
     }
     $task_obj->setUid($this->_uid);
     $task_obj->setUsername($this->_username);
     $task_obj->setTeamwork($release_info['txt_teamwork']);
     $selfIp = keke_base_class::get_ip();
     $ipinfo = json_decode(file_get_contents("http://ip.taobao.com/service/getIpInfo.php?ip=" . $selfIp), true);
     $ipinfo = db_factory::get_one("select * from " . TABLEPRE . "witkey_district where name='" . $ipinfo['data']['region'] . "'");
     $task_obj->setTask_status(0);
     $task_obj->setCash_cost($release_info['txt_task_cash']);
     $task_obj->setKf_uid($this->_kf_uid);
 }
 function save_userinfo($reg_username, $reg_email, $reg_uid = null, $user_type, $reg_user_type_xf)
 {
     global $_K;
     $reg_username = kekezu::escape($reg_username);
     $slt = kekezu::randomkeys(6);
     $pwd = keke_user_class::get_password($this->_reg_pwd, $slt);
     $this->_member_obj->setUid($reg_uid);
     $this->_member_obj->setEmail($reg_email);
     $this->_member_obj->setUsername($reg_username);
     $this->_member_obj->setPassword($this->_reg_pwd);
     $this->_member_obj->setRand_code($slt);
     $this->_member_obj->setUser_type($user_type);
     //增加user_type
     $reg_member_uid = $this->_member_obj->create_keke_witkey_member();
     $this->_oltime_obj->setUid($reg_member_uid);
     $this->_oltime_obj->setUsername($reg_username);
     $this->_oltime_obj->setLast_op_time(time());
     $this->_oltime_obj->setOnline_total_time(0);
     $this->_oltime_obj->create_keke_witkey_member_oltime();
     if ($reg_member_uid) {
         $buyer_level = keke_user_mark_class::get_mark_level(0, '2');
         $seller_level = keke_user_mark_class::get_mark_level('0', '1');
         $this->_shop_obj->setShop_type(1);
         $this->_shop_obj->setUid($reg_member_uid);
         $this->_shop_obj->setUsername($reg_username);
         $this->_shop_obj->setShop_name($reg_username);
         $this->_shop_obj->setShop_status($_K['autoshop'] == '1' ? '1' : '3');
         $res_shop_id = $this->_shop_obj->create_keke_witkey_shop();
         $this->_space_obj->setUid($reg_member_uid);
         $this->_space_obj->setUsername($reg_username);
         $this->_space_obj->setPassword($this->_reg_pwd);
         $this->_space_obj->setSec_code($pwd);
         $this->_space_obj->setEmail($reg_email);
         $this->_space_obj->setReg_time(time());
         $this->_space_obj->setReg_ip(keke_glob_class::checkipaddres($this->_reg_ip) ? $this->_reg_ip : '0.0.0.0');
         $this->_space_obj->setBuyer_level(serialize($buyer_level));
         $this->_space_obj->setSeller_level(serialize($seller_level));
         $this->_space_obj->setAutoshop($_K['autoshop']);
         $this->_space_obj->setUser_type($reg_user_type_xf);
         //修改用户实名认证类型
         $space_id = $this->_space_obj->create_keke_witkey_space();
     }
     $info = array('uid' => $reg_member_uid, 'username' => $reg_username, 'email' => $reg_email);
     $this->_sys_config['allow_reg_action'] == 1 and keke_user_class::send_email_action_user($info);
     return $reg_member_uid;
 }
Exemple #20
0
         if ($intEndDate < $intMinDay || $intEndDate > $intMaxDay) {
             $tips['errors']['txt_task_day'] = '当前预算允许最小天数为:' . intval($arrConfig['min_day']) . '天,最大截止时间:' . $strMaxDay;
             kekezu::show_msg($tips, NULL, NULL, NULL, 'error');
         }
         $arrPubInfo and $_POST = array_merge($arrPubInfo, $_POST);
         $_POST['txt_task_cash'] = keke_curren_class::convert($_POST['txt_task_cash'], 0, true);
         $objRelease->save_task_obj($_POST, $stdCacheName);
         kekezu::show_msg($tips, $strUrl . '&step=step2', NULL, NULL, 'ok');
     }
     break;
 case 'step2':
     if (isset($formhash) && kekezu::submitcheck($formhash)) {
         if (strtoupper(CHARSET) == 'GBK') {
             $_POST = kekezu::utftogbk($_POST);
         }
         if (!kekezu::escape($tar_content)) {
             $tips['errors']['tar_content'] = '请输入需求描述';
             kekezu::show_msg($tips, NULL, NULL, NULL, 'error');
         }
         $arrPubInfo and $_POST = array_merge($arrPubInfo, $_POST);
         $objRelease->save_task_obj($_POST, $stdCacheName);
         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) {
Exemple #21
0
         }
         $arrPubInfo and $_POST = array_merge($arrPubInfo, $_POST);
         $objRelease->save_task_obj($_POST, $stdCacheName);
         kekezu::show_msg($tips, $strUrl . '&step=step2', NULL, NULL, 'ok');
     }
     break;
 case 'step2':
     if (isset($formhash) && kekezu::submitcheck($formhash)) {
         if (strtoupper(CHARSET) == 'GBK') {
             $_POST = kekezu::utftogbk($_POST);
         }
         if ($_POST['province'] == 'p') {
             $tips['errors']['province'] = '请选择省份';
             kekezu::show_msg($tips, null, null, null, 'error');
         }
         $_POST['tar_content'] = kekezu::escape($_POST['tar_content']);
         if (!$_POST['tar_content']) {
             $tips['errors']['tar_content'] = '请输入需求描述';
             kekezu::show_msg($tips, NULL, NULL, NULL, 'error');
         }
         $arrPubInfo and $_POST = array_merge($arrPubInfo, $_POST);
         $objRelease->save_task_obj($_POST, $stdCacheName);
         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']);
     break;
 case 'step3':
 public function work_edit($work_id, $quote, $tar_content, $cycle, $url = '', $output = 'normal')
 {
     $strNotice = $this->check_if_can_edit($work_id, $url, $output);
     if ($strNotice === true) {
         $match_obj = new Keke_witkey_task_match_work_class();
         $match_obj->setWhere("work_id=" . $work_id);
         $match_obj->setQuote($quote);
         CHARSET == 'gbk' and $tar_content = kekezu::utftogbk($tar_content);
         $match_obj->setQuote_desc(kekezu::escape($tar_content));
         $match_obj->setCycle(intval($cycle));
         $match_obj->edit_keke_witkey_task_match_work();
         $g_notice = array($_lang['description'] => '修改了报价信息', $_lang['task_title'] => $this->_notice_url);
         $this->notify_user('match_task', $_lang['work_hand_notice'], $g_notice);
         return true;
     } else {
         return $strNotice;
     }
 }
Exemple #23
0
<?php

if (isset($formhash) && kekezu::submitcheck($formhash)) {
    if (strtoupper(CHARSET) == 'GBK') {
        $tar_content = kekezu::utftogbk($tar_content);
    }
    $tar_content = kekezu::escape($tar_content);
    $aid = implode(",", array_keys($star));
    $aid_star = implode(",", array_values($star));
    $res = keke_user_mark_class::exec_mark($markId, $tar_content, $mark_status, $aid, $aid_star);
    if ($markType == 'gz') {
        $strJumpUrl = 'index.php?do=user&view=gz&op=mark';
    } elseif ($markType == 'wk') {
        $strJumpUrl = 'index.php?do=user&view=wk&op=mark';
    }
    if ($res === true) {
        kekezu::show_msg('操作成功', $strJumpUrl, 3, NULL, 'ok');
    } else {
        kekezu::show_msg($res, $strJumpUrl, 3, NULL, 'fail');
    }
} else {
    $arrMark = keke_user_mark_class::get_mark_info(array('model_code' => $code, 'obj_id' => $objId, 'by_uid' => $uid, 'uid' => $to_uid));
    $markInfo = $arrMark['mark_info']['0'];
    $markInfo or kekezu::show_msg($_lang['operate_notice'], "", "", $_lang['mark_sya_busy_try_later'], "error");
    $aidList = keke_user_mark_class::get_mark_aid($roleType);
    $aidInfo = keke_user_mark_class::get_user_aid($markInfo['by_uid'], $markInfo['mark_type'], $markInfo['mark_status'], 2, $markInfo['model_code'], $objId);
}
require keke_tpl_class::template("tpl/default/ajax/mark");
die;
Exemple #24
0
                 kekezu::show_msg('访问页面不存在', 'index.php', 3, null, 'warning');
                 break;
         }
     }
     break;
 case 'step5':
     if (isset($action)) {
         switch ($action) {
             case 'complete':
                 $objShop = new service_shop_class();
                 $resText = $objShop->dispose_order($orderId, 'confirm_complete');
                 unset($objShop);
                 if (true === $resText) {
                     $objSerOrderM = new Keke_witkey_service_order_class();
                     $objSerOrderM->setWhere('order_id =' . $orderId);
                     $objSerOrderM->setWorkfile(strval(trim(kekezu::escape($workfile))));
                     $objSerOrderM->edit_keke_witkey_service_order();
                     kekezu::show_msg('订单处理完成,已确认完工', $strUrl . "&step=step5&orderId=" . $orderId, 3, null, 'ok');
                 } else {
                     kekezu::show_msg($resText, $strUrl, 3, null, 'fail');
                 }
                 break;
             default:
                 kekezu::show_msg('访问页面不存在', 'index.php', 3, null, 'warning');
                 break;
         }
     }
     break;
 case 'step6':
     $objId = $orderId;
     $arrMark = keke_user_mark_class::get_mark_info(array('model_code' => 'service', 'obj_id' => $objId, 'by_uid' => $gUid, 'uid' => $arrServiceOrderInfo['uid']));
<?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}");
 public function save_service_obj($release_info = array(), $obj_name)
 {
     global $kekezu;
     if ($release_info['step1'] == 'step1') {
         if ($_POST['fileid1']) {
             $fileIdArr = explode('|', $_POST['fileid1']);
             if (is_array($fileIdArr)) {
                 $fileIdStr = implode(',', $fileIdArr);
                 $filePathArr = db_factory::query('select save_name from ' . TABLEPRE . 'witkey_file where file_id in (' . $fileIdStr . ')');
                 if ($filePathArr) {
                     foreach ($filePathArr as $v) {
                         $filePathStr .= ',' . $v['save_name'];
                     }
                     $filePathStr = substr($filePathStr, 1);
                     $pic = kekezu::escape($filePathStr);
                     $release_info['pic_patch'] = $pic;
                 }
             } else {
                 $filePathArr = db_factory::get_one('select save_name from ' . TABLEPRE . 'witkey_file where file_id = ' . intval($_POST['fileid1']));
                 $filePathStr = $filePathArr['save_name'];
                 $pic = kekezu::escape($filePathStr);
                 $release_info['pic_patch'] = $pic;
             }
         }
     }
     empty($release_info) or $this->_std_obj->_release_info = $release_info;
     $_SESSION[$obj_name] = serialize($this->_std_obj);
 }
Exemple #27
0
$pd and $arrIndusPInfo = kekezu::get_indus_info($pd);
$i and $arrIndusInfo = kekezu::get_indus_info($i);
$arrCityInfo = CommonClass::getDistrictById($p);
$arrDisplaypro = CommonClass::getDistrictByPid('0', 'id,upid,name');
$arrItemConfig = PayitemClass::getPayitemConfig(null, null, null, 'item_id');
$arrIndusP = $kekezu->_indus_goods_arr;
$arrIndusC = $kekezu->get_classify_indus('shop', 'child');
if (is_array($arrIndusC)) {
    $arrNewIndusC = array();
    foreach ($arrIndusC as $k => $v) {
        $arrNewIndusC[$v['indus_pid']][] = $v;
    }
}
if (isset($ky)) {
    $ky = htmlspecialchars($ky);
    $ky = kekezu::escape($ky);
    $arrHwStatus = db_factory::query("select v from " . TABLEPRE . "witkey_basic_config where k='hot_words_status'");
    $arrUpdateStatus = db_factory::query("select v from " . TABLEPRE . "witkey_basic_config where k='update_status'");
    $arrSearch = db_factory::query("select * from " . TABLEPRE . "witkey_hotwords where words = '{$ky}'");
    if ($arrHwStatus[0]['v'] == 'open') {
        if ($arrUpdateStatus[0]['v'] == 'auto') {
            if (count($arrSearch)) {
                db_factory::updatetable(TABLEPRE . "witkey_hotwords", array('count' => $arrSearch[0]['count'] + 1, 'time' => time()), array('words' => $arrSearch[0]['words']));
            } else {
                db_factory::inserttable(TABLEPRE . "witkey_hotwords", array('words' => $ky, 'time' => time(), 'auto' => '1'));
            }
        } else {
            if (count($arrSearch)) {
                db_factory::updatetable(TABLEPRE . "witkey_hotwords", array('count' => $arrSearch[0]['count'] + 1, 'time' => time()), array('words' => $arrSearch[0]['words'], 'auto' => '0'));
            }
        }
Exemple #28
0
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);
        $res and kekezu::admin_show_msg($_lang['modify_case_success'], 'index.php?do=case&view=lise', 3, '', 'success') or kekezu::admin_show_msg($_lang['modify_case_fail'], 'index.php?do=case&view=lise', 3, '', 'warning');
    } else {
        $res = $case_obj->create_keke_witkey_case();
        kekezu::admin_system_log($_lang['add_case']);
        $res and kekezu::admin_show_msg($_lang['add_case_success'], 'index.php?do=case&view=lise', 3, '', 'success') or kekezu::admin_show_msg($_lang['add_case_fail'], 'index.php?do=case&view=add', 3, '', 'warning');
    }
}
function case_obj_exists($id, $obj = 'task')
{
<?php

defined('IN_KEKE') or exit('Access Denied');
$strUrl = 'index.php?do=user&view=account&op=password';
if (isset($formhash) && kekezu::submitcheck($formhash)) {
    $old_pass = kekezu::escape(trim($old_password));
    $new_pass = kekezu::escape(trim($new_password));
    $confirm_pass = kekezu::escape(trim($confirm_password));
    if (md5($old_pass) != $gUserInfo['password']) {
        $title['errors']['old_password'] = '******';
        kekezu::show_msg($title, NULL, NULL, NULL, 'error');
    }
    if ($old_pass === $new_pass) {
        $title['errors']['new_password'] = '******';
        kekezu::show_msg($title, NULL, NULL, NULL, 'error');
    }
    if ($new_pass != $confirm_pass) {
        $title['errors']['confirm_password'] = '******';
        kekezu::show_msg($title, NULL, NULL, NULL, 'error');
    }
    $intRes1 = db_factory::updatetable(TABLEPRE . 'witkey_space', array('password' => md5($new_pass)), array('uid' => $gUid));
    $intRes2 = db_factory::updatetable(TABLEPRE . 'witkey_member', array('password' => md5($new_pass)), array('uid' => $gUid));
    $flag = keke_user_class::user_edit($gUserInfo['username'], $old_pass, $new_pass, '', 0) > 0 ? 1 : 0;
    if ($flag && $intRes1 === 1 && $intRes2 === 1) {
        kekezu::admin_system_log($_SESSION['username'] . '于' . date("Y-m-d H:i:s") . '修改了密码');
        keke_msg_class::notify_user($gUserInfo['uid'], $gUserInfo['username'], 'update_password', '修改密码', array('新密码' => $new_pass, '网站名称' => $kekezu->_sys_config['website_name'], '用户名' => $gUserInfo['username']), 2);
        setcookie('rememberme', '');
        unset($_SESSION, $_SESSION['uid'], $_SESSION['username']);
        unset($_COOKIE['rememberme']);
        session_destroy();
        kekezu::show_msg('新密码已生效', 'index.php?do=login', NULL, NULL, 'ok');
Exemple #30
0
        $tips['errors']['email'] = '该email非法或已经被注册';
        kekezu::show_msg($tips, NULL, NULL, NULL, 'error');
    }
    if (strtoupper(CHARSET) == 'GBK') {
        $account = kekezu::utftogbk($account);
    }
    $strNameCheck = keke_user_class::check_username($account);
    if ($strNameCheck != 1) {
        $tips['errors']['account'] = $strNameCheck;
        kekezu::show_msg($tips, NULL, NULL, NULL, 'error');
    }
    $strCodeCheck = kekezu::check_secode($code);
    if ($strCodeCheck != 1) {
        $tips['errors']['code'] = $strCodeCheck;
        kekezu::show_msg($tips, NULL, NULL, NULL, 'error');
    }
    if (intval($agree) == 0) {
        $tips['errors']['agree'] = '请先同意注册协议';
        kekezu::show_msg($tips, NULL, NULL, NULL, 'error');
    }
    //增加$user_type,
    $intRegUid = $objReg->user_register(kekezu::escape($account), $password, $email, $code, 1, $password, $reg_user_type, $reg_user_type_xf);
    $arrUserInfo = keke_user_class::get_user_info($intRegUid);
    $objReg->register_login($arrUserInfo);
}
if (isset($check_username) && !empty($check_username)) {
    $res = keke_user_class::check_username($check_username);
    echo $res;
    die;
}
$_SESSION['spread'] = 'index.php?do=register';