Пример #1
0
 function pub_mode_init($std_cache_name, $data = array())
 {
     global $kekezu;
     global $_lang;
     $release_info = $this->_std_obj->_release_info;
     switch ($this->_pub_mode) {
         case "professional":
             break;
         case "guide":
             break;
         case "onekey":
             if (!$release_info) {
                 $sql = " select model_id,task_title,task_desc,indus_id,indus_pid,\n\t\t\t\t\t\ttask_cash_coverage,start_time,end_time,contact from %switkey_task where task_id='%d' and model_id='%d'";
                 $task_info = db_factory::get_one(sprintf($sql, TABLEPRE, $data['t_id'], $this->_model_id));
                 $task_info or kekezu::show_msg($_lang['operate_notice'], $_SERVER['HTTP_REFERER'], 3, $_lang['not_exsist_relation_task_and_not_user_onekey'], "warning");
                 $release_info = $this->onekey_mode_format($task_info);
                 $allow_time = $task_info['end_time'] - $task_info['start_time'];
                 $task_day = date('Y-m-d', $allow_time + time());
                 $release_info['txt_task_day'] = $task_day;
                 $release_info['task_cash_cove'] = $task_info['task_cash_coverage'];
                 $this->save_task_obj($release_info, $std_cache_name);
             }
             break;
     }
 }
Пример #2
0
 function pub_mode_init($std_cache_name, $data = array())
 {
     global $kekezu;
     global $_lang;
     $release_info = $this->_std_obj->_release_info;
     switch ($this->_pub_mode) {
         case "professional":
             break;
         case "guide":
             break;
         case "onekey":
             if (!$release_info) {
                 $sql = " select model_id,task_title,task_desc,indus_id,indus_pid,\n\t\t\t\t\t\ttask_cash,contact from %switkey_task where task_id='%d' and model_id='%d'";
                 $task_info = db_factory::get_one(sprintf($sql, TABLEPRE, $data['t_id'], $this->_model_id));
                 $task_info or kekezu::show_msg($_lang['operate_notice'], $_SERVER['HTTP_REFERER'], 3, $_lang['not_exsist_relation_task_and_not_user_onekey'], "warning");
                 $release_info = $this->onekey_mode_format($task_info);
                 $allow_time = $kekezu->get_show_day($task_info['task_cash'], $this->_model_id);
                 $task_day = date('Y-m-d', $allow_time * 24 * 3600 + time());
                 $release_info['txt_task_day'] = $task_day;
                 $release_info['txt_task_cash'] = intval($task_info['task_cash']);
                 $prize_info = db_factory::query(sprintf("select * from %switkey_task_prize where task_id='%d'", TABLEPRE, $data['t_id']));
                 foreach ($prize_info as $v) {
                     $release_info['txt_prize' . $v['prize'] . '_num'] = $v['prize_count'];
                     $release_info['txt_prize' . $v['prize'] . '_cash'] = intval($v['prize_cash']);
                 }
                 $this->save_task_obj($release_info, $std_cache_name);
             }
             break;
     }
 }
Пример #3
0
 public function add_auth($email, $file_name = '')
 {
     global $_K, $user_info, $_lang;
     $data['email'] = $email;
     $data = $this->format_auth_apply($data);
     $data['email'] or kekezu::show_msg($this->auth_lang() . $_lang['apply_submit_fail'], $_SERVER['HTTP_REFERER'], 3, $this->auth_lang() . $_lang['apply_fail_and_info_fail'], 'warning');
     $data['auth_time'] = time();
     $arrAuthInfo = $this->get_user_auth_info($user_info[uid]);
     if ($arrAuthInfo) {
         $success = $this->_tab_obj->save($data, array($this->_primary_key => $arrAuthInfo[$this->_primary_key]));
         $success and $success = $arrAuthInfo[$this->_primary_key];
         $this->set_auth_record_status($user_info['uid'], '0');
     } else {
         $success = $this->_tab_obj->save($data);
     }
     if ($success) {
         if ($this->send_mail($success, $data)) {
             $data['start_time'] == $data['end_time'] and $end_time = $data['end_time'] or $end_time = 0;
             db_factory::execute(" update " . TABLEPRE . "witkey_space set email = '{$data['email']}' where uid = '{$data['uid']}'");
             db_factory::execute(" update " . TABLEPRE . "witkey_member set email = '{$data['email']}' where uid = '{$data['uid']}'");
             return $this->add_auth_record($data['uid'], $data['username'], $this->_auth_code, $end_time);
         }
     }
 }
Пример #4
0
<?php

$strUrl = 'index.php?do=user&view=shop&op=caseadd';
$shopInfo = db_factory::get_one(sprintf(" select * from %switkey_shop where uid='%d' ", TABLEPRE, $gUid));
keke_shop_release_class::checkShopStatus($uid, 'index.php?do=user&view=shop&op=setting');
$objCaseT = keke_table_class::get_instance('witkey_shop_case');
if ($objId) {
    $caseInfo = db_factory::get_one(sprintf(" select * from %switkey_shop_case where case_id='%d' ", TABLEPRE, intval($objId)));
}
if (isset($formhash) && kekezu::submitcheck($formhash)) {
    if (strtoupper(CHARSET) == 'GBK') {
        $case_name = kekezu::utftogbk($case_name);
        $case_desc = kekezu::utftogbk($case_desc);
    }
    $arrData = array('shop_id' => $shopInfo['shop_id'], 'case_name' => $case_name, 'case_url' => $case_url, 'case_pic' => $case_pic, 'case_desc' => $case_desc, 'on_time' => time());
    if ($objId) {
        $intRes = $objCaseT->save($arrData, array('case_id' => intval($objId)));
    } else {
        $intRes = $objCaseT->save($arrData);
    }
    unset($objCaseT);
    kekezu::show_msg('已保存', 'index.php?do=user&view=shop&op=caselist', NULL, NULL, 'ok');
}
Пример #5
0
 public static function payitem_cost($item_code, $use_num = '1', $obj_type = false, $use_type = 'buy', $obj_id = null, $origin_id = null)
 {
     global $uid, $username;
     global $_lang;
     $payitem_config = self::get_payitem_config(null, null, $item_code, 'item_code');
     $use_cash = $payitem_config['item_cash'] * $use_num;
     if ($use_type == 'buy' && $use_cash) {
         $data = array(':item_name' => $payitem_config['item_name']);
         keke_finance_class::init_mem('payitem', $data);
         $use_cash > 0 and $fid_cash = keke_finance_class::cash_out($uid, $use_cash, 'payitem', $use_cash, '', 'payitem');
         $fid_cash or kekezu::show_msg($_lang['friendly_notice'], 'index.php?do=user&view=finance&op=recharge', 3, $_lang['your_balance_not_enough']);
     }
     $record_obj = new Keke_witkey_payitem_record_class();
     $record_obj->_record_id = null;
     $record_obj->setItem_code($item_code);
     $record_obj->setUid($uid);
     $record_obj->setUsername($username);
     $record_obj->setUse_type($use_type);
     $record_obj->setUse_cash($use_cash);
     $record_obj->setUse_num(intval($use_num));
     $record_obj->setObj_type($obj_type);
     $record_obj->setObj_id($obj_id);
     $record_obj->setOrigin_id($origin_id);
     $record_obj->setOn_time(time());
     $record_id = $record_obj->create_keke_witkey_payitem_record();
     return $record_id;
 }
Пример #6
0
$step = strval(trim($step));
$strRandKf = kekezu::get_rand_kf();
$is_task_template = db_factory::query("select * from " . TABLEPRE . "witkey_task_template");
$arrPubProcess = array(1 => array('step' => 'step1', 'desc' => '选择交易模式'), 2 => array('step' => 'step2', 'desc' => '描述任务需求'), 3 => array('step' => 'step3', 'desc' => '核对交易清单'), 4 => array('step' => 'step4', 'desc' => '成功发布任务'));
$arrPayitemLists = PayitemClass::getPayitemListForPub();
$arrPayitemPriceLists = PayitemClass::getPayitemPriceList();
$arrDistribution = array(1 => '单人中标', 2 => '多人中标', 3 => '', 4 => '单人中标', 5 => '单人中标', 12 => '单人中标');
$arrTopIndustrys = $kekezu->_indus_task_arr;
$arrModelLists = kekezu::get_table_data('*', 'witkey_model', " model_type = 'task' and model_status='1'", 'listorder asc ', '', '', 'model_id', 3600);
if (0 === $id) {
    $arrModelIds = array_keys($arrModelLists);
    $id = $arrModelIds['0'];
}
$arrModelInfo = $arrModelLists[$id];
if (empty($arrModelInfo)) {
    kekezu::show_msg('不存在该任务模型,请重新选择', 'index.php?do=pubtask', 3, null, 'warning');
}
$arrStep = array('step1', 'step2', 'step3', 'step4');
if (!in_array($step, $arrStep)) {
    $step = 'step1';
}
$strUrl = "index.php?do=pubtask&id=" . $id;
$arrOutFinance = db_factory::query(sprintf("select * from %switkey_finance where fina_type='out' and obj_id='%d' and uid='%d'", TABLEPRE, $taskId, $gUid));
if ($arrOutFinance) {
    $isReturn = 2;
}
if ($arrModelInfo['open_custom'] == '1') {
    $c_open = 1;
    $arrCustoms = CustomClass::getFieldListsByModelId($arrModelInfo['model_id']);
}
$arrProvinces = CommonClass::getDistrictByPid('0', 'id,upid,name');
 public function check_access($r_step, $model_id, $release_info, $task_id = null, $output = 'normal')
 {
     global $_lang, $gUid, $uid;
     $model_id = intval($model_id);
     switch ($r_step) {
         case "step1":
             break;
         case "step2":
             $release_info['step1'] or kekezu::keke_show_msg("index.php?do=pubtask&id={$model_id}", $_lang['you_not_choose_task_model'], "error", $output);
             break;
         case "step3":
             if (!$release_info['step2'] && !$release_info['step1']) {
                 kekezu::keke_show_msg("index.php?do=pubtask&id={$model_id}", $_lang['you_not_choose_task_model_and_not_in'], "error", $output);
             } elseif (!$release_info['step2']) {
                 kekezu::keke_show_msg("index.php?do=pubtask&id={$model_id}&step=step2", $_lang['you_not_fill_requirement_and_not_in'], "error", $output);
             }
             break;
         case "step4":
             $sql = sprintf(" select * from %switkey_task where task_id = '%d' and model_id = '%d'", TABLEPRE, $task_id, $model_id);
             $task_info = db_factory::get_one($sql);
             if ($task_info['uid'] != $uid) {
                 kekezu::show_msg('无权访问该页面', "index.php?do=pubtask", '3', '你没有权限访问该页面', 'danger');
             }
             $task_info or kekezu::show_msg('无权访问该页面', "index.php?do=pubtask", '3', '你没有权限访问该页面', 'danger');
             return $task_info;
             break;
     }
 }
Пример #8
0
            PayitemClass::validPayitemCount($arrPayitems, $arrPubInfo['txt_task_day']);
            $_POST['payitem'] = $arrPayitems;
            $arrPubInfo and $_POST = array_merge($arrPubInfo, $_POST);
            $objRelease->save_task_obj($_POST, $stdCacheName);
            $intTaskId = $objRelease->pub_task();
            $objRelease->save_task_match($intTaskId);
            $objRelease->update_task_info($intTaskId, $stdCacheName);
            kekezu::show_msg($tips, $strUrl . '&step=step4&taskId=' . $intTaskId, 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);
            $strTarComment = htmlspecialchars_decode($arrPubInfo['tar_content']);
            $strCommentLen = strlen($strTarComment);
            if ($strCommentLen > 1000) {
                $strPartComment = kekezu::cutstr($strTarComment, 1000);
            }
        }
        break;
    case 'step4':
        $taskId = intval($taskId);
        if (0 === $taskId) {
            kekezu::show_msg('无权访问', $strUrl, 3, NULL, 'warning');
        }
        $arrTaskInfo = $objRelease->check_access($step, $id, $arrPubInfo, $taskId);
        $arrPayInfo = $objRelease->checkWhetherToPay($taskId);
        $boolValue = $arrPayInfo['balance_pay'];
        $floatPayCash = $arrPayInfo['total_cash'];
        break;
}
require keke_tpl_class::template('pubtask');
die;
Пример #9
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;
Пример #10
0
 public function send_notice($type, $url = '', $output = 'normal')
 {
     global $_lang, $username;
     $work_info = $this->work_exists();
     $user_type = 1;
     switch ($type) {
         case "host":
             $notice = $_lang['notice_host_reward'];
             $user_type = 2;
             break;
         case "start":
             $notice = $_lang['notice_start_work'];
             $to_uid = $work_info['uid'];
             break;
         case "over":
             $notice = $_lang['notice_confirm_work'];
             $to_uid = $work_info['uid'];
             break;
         case "modify":
             $notice = $_lang['notice_modify_work'];
             $to_uid = $work_info['uid'];
             break;
         case "accept":
             $notice = $_lang['notice_acceptance_work'];
             $user_type = 2;
             break;
     }
     $notify = array($_lang['description'] => "【{$username}】" . $notice, $_lang['task_title'] => $this->_notice_url);
     $this->notify_user('match_task', $_lang['match_task_notice'], $notify, $user_type, $to_uid);
     kekezu::show_msg('发送成功', 'index.php?do=task&id=' . $this->_task_id, 3, NULL, 'ok');
 }
Пример #11
0
 function show_msg($content, $status, $url = '', $t = 2)
 {
     global $_lang, $_K;
     $status == 1 and $type = 'ok' or $type = 'error';
     kekezu::show_msg($content, $url, NULL, NULL, $type);
 }
Пример #12
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');
    }
    $title = '稿件议价';
    $content = '尊敬的' . $to_username . ':您的稿件被雇主入围,并向你发出了议价请求。订单详情:<a href="' . $url . '">' . $taskInfo['task_title'] . '</a><p>留言:' . $txt_content . '</p>感谢您对客客专业威客系统的信任。如有特殊情况,请致电客服';
    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('议价已发送给威客', $url, NULL, NULL, 'ok');
}
Пример #13
0
 public static function upload_file($file_name, $ext = '', $isr = 1, $folder = '', $output = 'normal')
 {
     global $_lang, $kekezu;
     if ($_FILES[$file_name]['size']) {
         $ext == '' && ($ext = $kekezu->_sys_config['file_type']);
         if ($folder != '') {
             $absolute_path = S_ROOT . '/data/uploads/sys/' . $folder;
             $filepath = 'data/uploads/sys/' . $folder;
         } else {
             $absolute_path = UPLOAD_ROOT;
             $filepath = 'data/uploads/' . UPLOAD_RULE;
         }
         $upload_obj = new keke_upload_class($absolute_path, explode('|', $ext), UPLOAD_MAXSIZE);
         $files = $upload_obj->run($file_name, $isr);
         if (!empty($files) && is_array($files)) {
             $file = $files[0]['saveName'];
             return $filepath . $file;
         } else {
             $err = $files;
             switch ($output) {
                 case "normal":
                     kekezu::show_msg($_lang['operate_notice'], '', 2, $err, 'warning');
                     break;
                 case "json":
                     echo kekezu::json_encode_k(array('err' => $err));
                     die;
                     break;
             }
         }
     }
 }
Пример #14
0
$arrAuthItems = keke_auth_fac_class::getAuthItemListByUid($id);
$arrSellerLevel = unserialize($arrSellerInfo['seller_level']);
$arrSellerMark = keke_user_mark_class::get_user_aid($arrSellerInfo['uid'], '2', null, '1');
foreach ($arrSellerMark as $k => $v) {
    $arrSellerMark[$k]['star'] = intval($v['avg']);
}
$arrFollow = db_factory::get_count(sprintf('select count(*) from %s where uid = %d and fuid = %d', TABLEPRE . 'witkey_free_follow', intval($gUid), intval($arrSellerInfo['uid'])));
if ($arrFollow) {
    $arrSellerInfo['follow'] = 1;
} else {
    $arrSellerInfo['follow'] = 0;
}
unset($arrFollow);
if ($closeshop) {
    keke_shop_release_class::closeShop($arrSellerInfo['uid'], 3);
    kekezu::show_msg("店铺已关闭", null, null, NULL, 'success');
    die;
}
if ($openshop) {
    keke_shop_release_class::updateShopStatus($arrSellerInfo['uid'], 1);
    kekezu::show_msg("店铺已开张,可以添加商品哦!", null, null, NULL, 'success');
    die;
}
$intGoodsCount = db_factory::get_count(sprintf('select count(*) from %s where uid = %d and service_status = 2 ', TABLEPRE . 'witkey_service ', $arrSellerInfo['uid']));
$intTaskCount = db_factory::get_count(sprintf('select count(*) from %s where uid = %d and task_status >1', TABLEPRE . 'witkey_task', $arrSellerInfo['uid']));
$intCaseCount = db_factory::get_count(sprintf('select count(*) from %s where shop_id = %d ', TABLEPRE . 'witkey_shop_case', $arrSellerInfo['shop_id']));
$intMarkCount = db_factory::get_count(sprintf('select count(*) from %s where mark_status > 0  and uid = %d', TABLEPRE . 'witkey_mark', $arrSellerInfo['uid']));
$_SESSION['spread'] = 'index.php?do=seller&id=' . intval($id);
require $do . '/' . $view . '.php';
require $kekezu->_tpl_obj->template($do . '/' . $view);
die;
Пример #15
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;
     }
 }
Пример #16
0
 $arrModelInfo = $model_list[$arrTaskInfo['model_id']];
 if ($arrTaskInfo['uid']) {
     $arrFavorite = 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 ($arrFavorite) {
         $arrTaskInfo['favorite'] = true;
     }
 }
 $arrTaskInfo['uid'] != $uid && $gUid != ADMIN_UID && $arrTaskInfo['task_status'] == 1 and kekezu::show_msg($_lang['friendly_notice'], 'index.php?do=tasklist', 1, $_lang['task_auditing'], 'warning');
 $arrTaskInfo['uid'] != $uid && $gUid != ADMIN_UID && $arrTaskInfo['task_status'] == 0 and kekezu::show_msg($_lang['friendly_notice'], 'index.php?do=tasklist', 1, $_lang['task_not_pay'], 'warning');
 $arrConfig = unserialize($model_list[$arrTaskInfo['model_id']]['config']);
 if (!$arrModelInfo) {
     kekezu::show_msg('页面不存在', 'index.php?do=tasklist', 3, null, 'warning');
 }
 if ($arrTaskInfo['seohide'] == 1) {
     if (!$gUid) {
         kekezu::show_msg('页面不存在', 'index.php?do=tasklist', 3, null, 'warning');
     }
 } else {
     if ($arrTaskInfo['indus_id']) {
         $indusInfo = CommonClass::getIndustryById($arrTaskInfo['indus_id']);
     } elseif ($arrTaskInfo['indus_pid']) {
         $indusInfo = CommonClass::getIndustryById($arrTaskInfo['indus_pid']);
     }
     if ($arrTaskInfo['seo_title']) {
         $strPageTitle = $arrTaskInfo['seo_title'];
     } else {
         if ($indusInfo['seo_title']) {
             $strPageTitle = $indusInfo['seo_title'];
         } else {
             $strPageTitle = $arrTaskInfo['task_title'] . '-' . $indus_arr[$arrTaskInfo['indus_id']]['indus_name'] . ',' . $indus_p_arr[$arrTaskInfo['indus_pid']]['indus_name'] . '-' . $_K['html_title'];
         }
Пример #17
0
    $intAuthStatus = keke_auth_fac_class::auth_check('enterprise', $gUid);
    if ($intUserRole && !$intAuthStatus) {
        $intAuthStatus = 1;
    }
} else {
    $strCodeWh = " auth_code!='enterprise' ";
    $intAuthStatus = keke_auth_fac_class::auth_check('realname', $gUid);
    if ($intUserRole && !$intAuthStatus) {
        $intAuthStatus = 1;
    }
}
$arrAuthItems = keke_auth_base_class::get_auth_item(null, null, 1, $strCodeWh);
$arrAllAuthItems = keke_auth_base_class::get_auth_item(null, null, 1, null);
$keys = array_keys($arrAuthItems);
$arrAllowAuth = array('realname', 'enterprise', 'bank', 'mobile', 'email', 'alipayjs');
if ($code && in_array($code, $arrAllowAuth)) {
    $code or $code = $keys['0'];
    $code or kekezu::show_msg($_lang['param_error'], "index.php?do=auth", 3, '', 'warning');
    $auth_class = "keke_auth_" . $code . "_class";
    $objAuth = new $auth_class($code);
    $auth_item = $arrAllAuthItems[$code];
    $auth_dir = $auth_item['auth_dir'];
    $arrAuthInfo = $objAuth->get_user_auth_info($gUid, 0, $intBankAid);
    require S_ROOT . "/auth/{$code}/control/index.php";
    require keke_tpl_class::template('auth/' . $code . '/tpl/' . $_K['template'] . '/' . $step);
    die;
} else {
    $real_pass = keke_auth_fac_class::auth_check('enterprise', $gUid) or $real_pass = keke_auth_fac_class::auth_check("realname", $gUid);
    $arrHasAuthItem = keke_auth_fac_class::get_auth($gUserInfo);
    $arrUserAuthInfo = $arrHasAuthItem['info'];
}
Пример #18
0
                if (is_array($ckb)) {
                    foreach ($ckb as $k => $v) {
                        $ckb[$k] = intval($v);
                    }
                }
                is_array($ckb) and $strMsgId = implode(",", $ckb);
                $arrDatas = db_factory::query("select * from " . TABLEPRE . "witkey_msg where msg_id in ({$strMsgId})");
                foreach ($arrDatas as $v) {
                    if ($gUid == $v['to_uid'] && $v['view_status'] < 1) {
                        db_factory::execute("update " . TABLEPRE . "witkey_msg set view_status=1 where msg_id = " . intval($v['msg_id']));
                    }
                }
            } else {
                kekezu::show_msg('设置失败', NULL, NULL, NULL, 'error');
            }
            kekezu::show_msg('设置成功', $strUrl, NULL, NULL, 'ok');
            break;
    }
} else {
    $strWhere = " type =1 and uid<1 and to_uid=" . intval($gUid);
    if ($s == '2') {
        $strWhere .= " and view_status = 0";
    } elseif ($s == '1') {
        $strWhere .= " and view_status = " . intval($s);
    }
    $page and $intPage = intval($page);
    $intPage = intval($intPage) ? $intPage : 1;
    $intPagesize = intval($intPagesize) ? $intPagesize : 10;
    $strWhere .= " order by msg_id desc";
    $arrDatas = $objMsgT->get_grid($strWhere, $strUrl, $intPage, $intPagesize, null, null, null);
    $arrMessageLists = $arrDatas['data'];
Пример #19
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);
}
Пример #20
0
            $strSql = sprintf(" select card_num from %switkey_member_bank where bind_status=1 and card_num='%s'", TABLEPRE, $strCardNum);
            if (db_factory::get_count($strSql)) {
                $tips['errors']['card_num'] = '此账号已被他人绑定';
                kekezu::show_msg($tips, NULL, NULL, NULL, 'error');
            }
            $arrDistrictData = CommonClass::getAllDistrict('id,upid,name');
            $province = $arrDistrictData[$province]['name'];
            $city = $arrDistrictData[$city]['name'];
            $strBankAddress = $province . "," . $city;
            if (strtoupper(CHARSET) == 'GBK') {
                $strTxtName = kekezu::utftogbk($strTxtName);
                $strBankName = kekezu::utftogbk($strBankName);
                $strBankAddress = kekezu::utftogbk($strBankAddress);
                $strBankFullName = kekezu::utftogbk($strBankFullName);
            }
            $arrData = array($strInputName => $strTxtName, 'bank_name' => $strBankName, 'bank_address' => $strBankAddress, 'bank_full_name' => $strBankFullName, 'bank_type' => $intUserRole, 'card_num' => $strCardNum, 'uid' => $gUid, 'on_time' => time(), 'bind_status' => 1);
            $intBankId = $objMemBankT->save($arrData);
            if ($intBankId) {
                unset($_SESSION['bank_zone']);
                unset($_SESSION['bank_zone_detail']);
                $strJumpUrl = $strUrl . '&step=step2&intBankType=' . $intUserRole . '&intBankId=' . $intBankId;
                kekezu::show_msg('账户绑定成功', $strJumpUrl, NULL, NULL, 'ok');
            }
        }
        break;
    case "step2":
        $strSql = sprintf(" select * from %switkey_member_bank where bank_id='%d' and uid='%d' and bind_status='1' ", TABLEPRE, intval($intBankId), $gUid);
        $arrBankInfo = db_factory::get_one($strSql);
        $arrBankInfo or kekezu::show_msg('不存在的绑定账号,请先进行绑定', $strUrl . '&step=step1', NULL, NULL, 'ok');
        break;
}
Пример #21
0
        if ($arrServiceInfo['service_status'] == '1') {
            $objServiceT = new keke_table_class('witkey_service');
            $objServiceT->save($arrData, $pk);
        } else {
            if (!empty($arrUpdateParts)) {
                CommonClass::createEditLog($pk['service_id'], $arrServiceInfo['model_id'], serialize($arrUpdateParts));
                keke_shop_release_class::updateEditStatusBySid($pk['service_id'], 1);
            } else {
                kekezu::show_msg($strServiceName . '信息没有更改', $strJumpUrl, NULL, NULL, 'ok');
            }
        }
    }
    if ($objId && $intTaskId) {
        $strBidSql = ' UPDATE `' . TABLEPRE . 'witkey_task_bid`  SET `hasdel`=1 WHERE (`bid_id` =' . $objId . ')  and task_id = ' . $intTaskId;
        $strWorkSql = ' UPDATE `' . TABLEPRE . 'witkey_task_work` SET `hasdel`=1 WHERE (`work_id`=' . $objId . ')  and task_id = ' . $intTaskId;
        db_factory::execute($strBidSql);
        db_factory::execute($strWorkSql);
    }
    kekezu::show_msg('操作成功', $strJumpUrl, NULL, NULL, 'ok');
}
function updateFilepath($serviceId, $filepath, $type)
{
    if ($type == 'pic') {
        $sql = ' update ' . TABLEPRE . 'witkey_service set pic = "' . $filepath . '" where service_id = ' . intval($serviceId);
    } else {
        $sql = ' update ' . TABLEPRE . 'witkey_service set file_path = "' . $filepath . '" where service_id = ' . intval($serviceId);
    }
    db_factory::execute($sql);
}
require $kekezu->_tpl_obj->template($do . '/' . $view . '_' . $op);
die;
Пример #22
0
$objLogin = new keke_user_login_class();
$arrBindInfo = keke_register_class::is_oauth_bind($type, $arrOauthInfo['account']);
if ($_SESSION[$type . '_oauthInfo'] && $arrBindInfo && !$is_binding) {
    $_SESSION[$type . '_oauthInfo'] = null;
    $arrUserInfo = kekezu::get_user_info($arrBindInfo['uid']);
    $loginUserInfo = $objLogin->oauth_user_login($arrUserInfo['username'], $arrUserInfo['password'], null, 1);
    $objLogin->save_user_info($loginUserInfo, 1);
}
$inter = $kekezu->_sys_config['user_intergration'];
$intLoginTimes = intval($_SESSION['login_times']);
if (kekezu::submitcheck(isset($formhash)) || isset($login_type) == 3) {
    if ($code) {
        $strCodeCheck = kekezu::check_secode($code);
        if ($strCodeCheck != 1) {
            $tips['errors']['code'] = $strCodeCheck;
            kekezu::show_msg($tips, NULL, NULL, NULL, 'error');
        }
    }
    $strCode = isset($code) ? $code : "";
    $intLoginType = isset($login_type) ? $login_type : "";
    $ckb_cookie = isset($ckb_cookie) ? $ckb_cookie : "";
    if (strtoupper(CHARSET) == 'GBK') {
        $account = kekezu::utftogbk($account);
    }
    $arrUserInfo = $objLogin->user_login($account, $password, $strCode, $intLoginType, 1);
    db_factory::execute("delete from " . TABLEPRE . "witkey_space where uid =" . intval($arrBindInfo['uid']));
    db_factory::execute("delete from " . TABLEPRE . "witkey_shop where uid=" . intval($arrBindInfo['uid']));
    db_factory::execute("delete from " . TABLEPRE . "witkey_member where uid=" . intval($arrBindInfo['uid']));
    $objMemberOauth = new Keke_witkey_member_oauth_class();
    $objMemberOauth->setWhere(array('oauth_id' => $arrBindInfo['oauth_id'], 'uid' => $arrBindInfo[uid]));
    $objMemberOauth->setUid($arrUserInfo[uid]);
Пример #23
0
                        $objMsgT->del('msg_id', intval($intMsgId));
                    }
                }
                kekezu::show_msg('删除成功', $strUrl, NULL, NULL, 'ok');
            } else {
                kekezu::show_msg('删除失败', NULL, NULL, NULL, 'error');
            }
            break;
        case 'delSingle':
            if ($objId) {
                if ($msgStatus == 0) {
                    db_factory::execute("update " . TABLEPRE . "witkey_msg set msg_status=1 where msg_id = " . intval($objId));
                } else {
                    $objMsgT->del('msg_id', intval($objId));
                }
                kekezu::show_msg('删除成功', $strUrl, NULL, NULL, 'ok');
            } else {
                kekezu::show_msg('删除失败', NULL, NULL, NULL, 'error');
            }
            break;
    }
} else {
    $strWhere = " msg_status<>1 and uid = " . intval($gUid);
    $page and $intPage = intval($page);
    $intPage = intval($intPage) ? $intPage : 1;
    $intPagesize = intval($intPagesize) ? $intPagesize : 10;
    $strWhere .= " order by msg_id desc";
    $arrDatas = $objMsgT->get_grid($strWhere, $strUrl, $intPage, $intPagesize, null, null, null);
    $arrMessageLists = $arrDatas['data'];
    $strPages = $arrDatas['pages'];
}
Пример #24
0
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');
    }
}
Пример #25
0
                    $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']));
        $markInfo = $arrMark['mark_info']['0'];
        $aidList = keke_user_mark_class::get_mark_aid(1);
        $aidInfo = keke_user_mark_class::get_user_aid($markInfo['by_uid'], $markInfo['mark_type'], $markInfo['mark_status'], 2, $markInfo['model_code'], $objId);
        $strJumpUrl = "index.php?do=goods&id={$sid}&view=mark#pageT";
        if ($markInfo['mark_status'] == '1') {
            header('location:' . $strJumpUrl);
            kekezu::show_msg('操作提示', $strJumpUrl, 3, '评价完成,服务结束', 'success');
        }
        break;
}
Пример #26
0
                    header("Location:" . $request);
                    break;
                case false:
                    if (in_array($type, array('sina', 'qq', 'taobao', 'renren', 'douban', 'baidu'))) {
                        $oauth_obj = OAuthClass::factory($type);
                        $oauth_obj->requestAuthorize();
                    } else {
                        exit('type参数错误');
                    }
                    break;
            }
        }
        break;
    case 'unbind':
        if (abs(intval($id))) {
            switch ($type == "alipay_trust") {
                case true:
                    $interface = "cancel_bind";
                    require S_ROOT . "/payment/alipay_trust/order.php";
                    header("Location:" . $request);
                    break;
                case false:
                    $objMemberOauth = new Keke_witkey_member_oauth_class();
                    $objMemberOauth->setId($id);
                    $objMemberOauth->del_keke_witkey_member_oauth();
                    kekezu::show_msg('解绑成功', $strUrl, null, null, 'ok');
                    break;
            }
        }
        break;
}
Пример #27
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;
     }
 }
Пример #28
0
 public static function checkShopStatus($uid, $redirect_url = '')
 {
     $return = db_factory::get_one("SELECT * FROM `" . TABLEPRE . "witkey_shop` WHERE uid = '{$uid}'");
     if ($return['shop_status'] != '1') {
         if ($redirect_url) {
             kekezu::show_msg('您需要先开启店铺', $redirect_url, NULL, NULL, 'warning');
         }
         if ($_SERVER['HTTP_REFERER']) {
             kekezu::show_msg('您需要先开启店铺', $_SERVER['HTTP_REFERER'], NULL, NULL, 'warning');
         } else {
             kekezu::show_msg('您需要先开启店铺', 'index.php', NULL, NULL, 'warning');
         }
     }
 }
Пример #29
0
    if ($intModelId) {
        $className = $arrServiceModels[$intModelId]['model_code'] . '_shop_class';
    } else {
        $orderInfo = db_factory::get_one("select * from " . TABLEPRE . "witkey_order where order_id = " . intval($orderId));
        if (!in_array($orderInfo['model_id'], array(6, 7))) {
            kekezu::show_msg("订单不存在", null, null, null, 'fail');
        }
        $className = $arrServiceModels[$orderInfo['model_id']]['model_code'] . '_shop_class';
    }
    $objShop = new $className();
    $resText = $objShop->dispose_order($orderId, $action);
    unset($objShop);
    if (true === $resText) {
        kekezu::show_msg('操作成功', $strUrl, 3, null, 'ok');
    } else {
        kekezu::show_msg($resText, null, null, null, 'fail');
    }
}
$strWhere = ' 1=1 ';
$strWhere .= ' and a.seller_uid = ' . $gUid;
$intModelId and $strWhere .= ' and a.model_id = ' . $intModelId;
$strWhere .= ' and b.obj_type = ' . "'service'";
$page and $intPage = intval($page);
$intPage = intval($intPage) ? $intPage : 1;
$intPagesize = 10;
$intId and $strWhere .= " and b.order_id=" . intval($intId);
$strTitle and $strWhere .= " and a.order_name like '%" . trim($strTitle) . "%' ";
if (isset($strStatus) && $strStatus != '' && $strStatus > -1 && in_array($strStatus, array_keys($arrStatus))) {
    $strWhere .= " and a.order_status ='" . strval($strStatus) . "'";
} else {
    $strStatus = -1;
Пример #30
0
<?php

defined('IN_KEKE') or exit('Access Denied');
$strNavActive = 'articlelist';
intval($id) and $intId = intval($id);
$strSql = "select a.* ,b.cat_name from %switkey_article as a left join %switkey_article_category as b  on a.art_cat_id = b.art_cat_id where a.cat_type = 'article' and a.art_id='%d'";
$arrArtInfo = db_factory::get_one(sprintf($strSql, TABLEPRE, TABLEPRE, $intId));
$arrArtInfo or kekezu::show_msg(kekezu::lang("operate_notice"), "index.php?do=articlelist", 2, "对不起,您访问的页面没找到!", "warning");
$arrBreadcrumbs = array(1 => array('url' => 'index.php?do=articlelist', 'name' => '资讯中心'), 2 => array('url' => 'index.php?do=articlelist&catid=' . $arrArtInfo['art_cat_id'], 'name' => $arrArtInfo['cat_name']));
$arrArtKeyword = db_factory::query("select * from " . TABLEPRE . "witkey_article_keyword where keyword_status=1");
if (is_array($arrArtKeyword)) {
    foreach ($arrArtKeyword as $v) {
        $arrArtInfo['content'] = str_replace($v['word'], "<a href='" . $v['url'] . "' target='_blank'>" . $v['word'] . "</a>", $arrArtInfo['content']);
        $intShowCount = substr_count($arrArtInfo['content'], $v['word']);
        if ($intShowCount && !$arrArtInfo['views']) {
            db_factory::execute(sprintf("update %switkey_article_keyword set show_count = show_count +%d where keyword_id=%d", TABLEPRE, intval($intShowCount), $v['keyword_id']));
        }
    }
}
$strWhere = " and 1=1 ";
$intCatid and $strWhere .= " and  art_cat_id  = " . intval($arrArtInfo['art_cat_id']);
$arrArtUp = db_factory::get_one(sprintf("select  art_id ,art_cat_id,art_title  from %switkey_article  where cat_type = 'article' and  art_id<'%d'  %s order by art_id desc limit 0,1", TABLEPRE, $intId, $strWhere));
$arrArtDown = db_factory::get_one(sprintf("select art_id ,art_cat_id,art_title  from %switkey_article  where cat_type = 'article' and  art_id>'%d' %s order by art_id asc limit 0,1", TABLEPRE, $intId, $strWhere));
if (!$_COOKIE["article_" . $intId]) {
    $sqlplus = "update %switkey_article set views = views+1 where art_id = %d";
    db_factory::execute(sprintf($sqlplus, TABLEPRE, $intId));
}
setcookie("article_" . $intId, "exist_" . $intId, time() + 3600 * 24, COOKIE_PATH, COOKIE_DOMAIN, NULL, TRUE);
if ($arrArtInfo['seo_title']) {
    $strPageTitle = $arrArtInfo['seo_title'];
} else {