コード例 #1
0
 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;
 }
コード例 #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_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;
     }
 }
コード例 #3
0
 public static function cash_out($id, $cash, $action, $profit = 0, $obj_type = null, $obj_id = null)
 {
     $user_info = db_factory::get_one("select * from " . TABLEPRE . "witkey_space where uid = " . intval($id));
     $res = false;
     $fo = new Keke_witkey_finance_class();
     $fo->setFina_action($action);
     $fo->setFina_type("out");
     $fo->setObj_type($obj_type);
     $fo->setObj_id($obj_id);
     $fo->setSite_profit($profit);
     $fo->setUid($user_info['uid']);
     $fo->setUsername($user_info['username']);
     if (empty(self::$_mem)) {
         $action_arr = keke_glob_class::get_finance_action($action);
         self::$_mem = $action_arr[$action];
     }
     $fo->setFina_mem(self::$_mem);
     $user_balance = $user_info['balance'];
     if ($cash && $action) {
         try {
             if ($user_balance < $cash) {
                 return false;
             }
             db_factory::execute("update " . TABLEPRE . "witkey_space set balance = balance-" . abs(floatval($cash)) . " where uid ='{$user_info['uid']}'");
             $fo->setFina_cash($cash);
             $fo->setUser_balance($user_balance - abs($cash));
             $fo->setFina_time(time());
             $res = $fo->create_keke_witkey_finance();
         } catch (Exception $e) {
             keke_exception::handler($e);
         }
     }
     return $res;
 }
コード例 #4
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;
     }
 }
コード例 #5
0
 public function __construct($report_id, $report_info, $obj_info)
 {
     parent::__construct($report_id, $report_info, $obj_info);
     $this->_task_info = $this->get_task_info($this->_report_info['origin_id']);
     $this->_task_obj = new match_task_class($this->_task_info);
     $this->_match_task = db_factory::get_one(sprintf(" select * from %switkey_task_match where task_id='%d'", TABLEPRE, $this->_obj_info['origin_id']));
     $this->_match_work = db_factory::get_one(sprintf(" select b.* from %switkey_task_work a left join %switkey_task_match_work b on a.work_id=b.work_id where a.task_id='%d' and a.work_status=4", TABLEPRE, TABLEPRE, $this->_obj_info['origin_id']));
 }
コード例 #6
0
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;
    }
}
コード例 #7
0
ファイル: admin_user_charge.php プロジェクト: pengfeiaaa/web
function get_info($uid, $t)
{
    $sql = " select balance,credit,uid,username from %switkey_space where ";
    if ($t == '1') {
        $sql1 = sprintf($sql . " uid=%d ", TABLEPRE, $uid, $uid);
        $info = db_factory::get_one($sql1);
    } else {
        $sql = sprintf($sql . " username='******'", TABLEPRE, $uid);
        $info = db_factory::get_one($sql);
    }
    return $info;
}
コード例 #8
0
 function order_charge()
 {
     global $_K;
     $order_id = $this->_order_id;
     $sid = $this->_obj_id;
     $uid = $this->_uid;
     $user_info = $this->_userinfo;
     $order_info = db_factory::get_one(sprintf(" select order_status,order_uid,order_username,seller_uid,seller_username from %switkey_order where order_id='%d'", TABLEPRE, $order_id));
     $url = $_K['siteurl'] . "/index.php?do=user&view=finance&op=order&obj_type=service&role=2&order_id=" . $order_id;
     $s_order_link = "<a href=\"" . $_K['siteurl'] . "/index.php?do=user&view=finance&op=order&obj_type=service&role=1&order_id=" . $order_id . "\">" . $order_info['order_name'] . "</a>";
     $b_order_link = "<a href=\"" . $_K['siteurl'] . "/index.php?do=user&view=finance&op=order&obj_type=service&role=2&order_id=" . $order_id . "\">" . $order_info['order_name'] . "</a>";
     if ($order_info['order_status'] == 'wait') {
         $service_info = keke_shop_class::get_service_info($sid);
         $service_status = db_factory::get_count(sprintf(" select service_status from %switkey_service where service_id='%d'", TABLEPRE, $sid));
         if ($service_status == '2') {
             $data = array(':service_id' => $service_info['service_id'], ':title' => $service_info['title']);
             keke_finance_class::init_mem('buy_service', $data);
             $this->_total_fee > 0 and $res = keke_finance_class::cash_out($uid, $this->_total_fee, 'buy_service', '0', 'service', $order_id);
             if ($res) {
                 db_factory::execute(sprintf(" update %switkey_order set order_status='ok' where order_id='%d'", TABLEPRE, $order_id));
                 $v_arr = array('用户名' => $order_info['order_username'], '网站名称' => $kekezu->_sys_config['website_name'], '用户' => $_lang['you'], '动作' => $_lang['haved_confirm_pay'], '订单编号' => $order_id, '订单链接' => $b_order_link);
                 keke_shop_class::notify_user($order_info['order_uid'], $order_info['order_username'], "order_change", $_lang['goods_order_confirm_pay'], $v_arr);
                 $v_arr = array('用户名' => $order_info['order_username'], '网站名称' => $kekezu->_sys_config['website_name'], '用户' => $order_info['order_username'], '动作' => $_lang['haved_confirm_pay'], '订单编号' => $order_id, '订单链接' => $s_order_link);
                 keke_shop_class::notify_user($order_info['seller_uid'], $order_info['seller_username'], "order_change", $_lang['goods_order_confirm_pay'], $v_arr);
                 $notice = $_lang['goods_pay_success'];
                 $type = 'success';
             } else {
                 $notice = $_lang['goods_pay_fail'];
                 $type = 'warning';
             }
         } else {
             db_factory::execute(sprintf(" update %switkey_order set order_status='close' where order_id='%d'", TABLEPRE, $order_id));
             $v_arr = array('用户名' => $order_info['seller_username'], '网站名称' => $kekezu->_sys_config['website_name'], "用户" => $_lang['system'], '动作' => $_lang['stop_your_order_and_your_cash_return'], '订单编号' => $order_id, '订单链接' => $s_order_link);
             keke_shop_class::notify_user($order_info['seller_uid'], $order_info['seller_username'], "order_change", $_lang['goods_order_close'], $v_arr);
             $v_arr = array('用户名' => $order_info['order_username'], '网站名称' => $kekezu->_sys_config['website_name'], "用户" => $_lang['system'], '动作' => $_lang['stop_your_order_and_your_cash_return'], '订单编号' => $order_id, '订单链接' => $b_order_link);
             keke_shop_class::notify_user($order_info['order_uid'], $order_info['order_username'], "order_change", $_lang['goods_order_close'], $v_arr);
             $notice = $_lang['goods_pay_fail'];
             $type = 'warning';
         }
     } else {
         $notice = $_lang['goods_pay_success'];
         $type = 'success';
     }
     return pay_return_fac_class::struct_response($_lang['operate_notice'], $notice, $url, $type);
 }
コード例 #9
0
 function service_pass($service_ids)
 {
     is_array($service_ids) and $ids = implode(",", $service_ids) or $ids = $service_ids;
     $ids and self::set_on_sale_num($ids, 2);
     $res = db_factory::execute(sprintf("update %switkey_service set service_status='%d'  where service_id in(%s)", TABLEPRE, 2, $ids));
     if ($res) {
         if (is_array($service_ids)) {
             foreach ($service_ids as $key => $val) {
                 $service_info = keke_shop_class::get_service_info($val);
                 $feed_arr = array("feed_username" => array("content" => $service_info['username'], "url" => "index.php?do=seller&id={$service_info['uid']}"), "action" => array("content" => '发布了服务', "url" => ""), "event" => array("content" => "{$service_info['title']}", "url" => "index.php?do=goods&id={$val}", "cash" => "{$service_info['price']}", "model_id" => "{$service_info['model_id']}"));
                 kekezu::save_feed($feed_arr, $service_info['uid'], $service_info['username'], 'pub_service', $service_info['service_id']);
             }
         } else {
             $service_info = db_factory::get_one(sprintf("select * from %switkey_service where service_id=%d", TABLEPRE, $service_ids));
             $feed_arr = array("feed_username" => array("content" => $service_info['username'], "url" => "index.php?do=seller&id={$service_info['uid']}"), "action" => array("content" => '发布服务', "url" => ""), "event" => array("content" => "{$service_info['title']}", "url" => "index.php?do=goods&id={$service_ids}", "cash" => "{$service_info['price']}", "model_id" => "{$service_info['model_id']}"));
             kekezu::save_feed($feed_arr, $service_info['uid'], $service_info['username'], 'pub_service', $service_info['service_id']);
         }
     }
     return $res;
 }
コード例 #10
0
 public function dispose_task()
 {
     global $kekezu, $_lang;
     $prom_obj = $objProm = keke_prom_class::get_instance();
     $model_code = $this->_model_code;
     $agree_info = $this->_agree_info;
     $cash_info = db_factory::get_one(sprintf(" select task_cash,task_union,real_cash from %switkey_task where task_id = '%d'", TABLEPRE, $this->_task_id));
     $this->plus_mark_num();
     keke_user_mark_class::create_mark_log($model_code, '1', $agree_info['seller_uid'], $agree_info['buyer_uid'], $agree_info['work_id'], $cash_info['task_cash'], $this->_task_id, $this->_seller_username, $this->_buyer_username);
     keke_user_mark_class::create_mark_log($model_code, '2', $agree_info['buyer_uid'], $agree_info['seller_uid'], $agree_info['work_id'], $cash_info['real_cash'], $this->_task_id, $this->_buyer_username, $this->_seller_username);
     $site_profit = $cash_info['task_cash'] - $cash_info['real_cash'];
     $task_title = db_factory::get_count(sprintf(" select task_title from %switkey_task where task_id='%d'", TABLEPRE, $this->_task_id));
     $data = array(':task_id' => $this->_task_id, ':task_title' => $task_title);
     keke_finance_class::init_mem('task_bid', $data);
     keke_finance_class::cash_in($agree_info['seller_uid'], $cash_info['real_cash'], 'task_bid', '', 'task', $this->_task_id, $site_profit);
     $feed_arr = array("feed_username" => array("content" => $this->_seller_uid, "url" => "index.php?do=seller&id={$this->_seller_uid}"), "action" => array("content" => $_lang['success_bid_haved'], "url" => ""), "event" => array("content" => $task_title, "url" => "index.php?do=task&id={$this->_task_id}", 'cash' => $cash_info['real_cash']));
     kekezu::save_feed($feed_arr, $this->_seller_uid, $this->_seller_username, 'work_accept', $this->_task_id);
     $prom_obj->dispose_prom_event("bid_task", $agree_info['seller_uid'], $this->_task_id);
     $prom_obj->dispose_prom_event("pub_task", $agree_info['buyer_uid'], $this->_task_id);
 }
コード例 #11
0
 private function user_charge()
 {
     global $_K;
     global $_lang;
     $uid = $this->_uid;
     $order_id = $this->_order_id;
     $order_id = keke_order_class::update_order_charge($this->_out_trade_no, $this->_total_fee);
     $order_info = db_factory::get_one(sprintf(" select order_status,order_type from %switkey_order_charge where order_id='%d' and uid='%d'", TABLEPRE, $order_id, $uid));
     if ($order_info['order_status'] == 'wait') {
         db_factory::execute(sprintf(" update %switkey_order_charge set order_status='ok' where order_id='%d'", TABLEPRE, $order_id));
         $res = keke_finance_class::cash_in($uid, $this->_total_fee, $order_info['order_type'], $this->_charge_type, 'user_charge', $order_id);
         $v_arr = array($_lang['recharge_account'] => $this->_total_fee);
         keke_shop_class::notify_user($this->_uid, $this->_username, "pay_success", $_lang['online_recharge_success'], $v_arr, 2);
     } else {
         $res = true;
     }
     if ($res) {
         return $this->struct_response($_lang['operate_notice'], $_lang['online_recharge_success'], $url, 'success');
     } else {
         return $this->struct_response($_lang['operate_notice'], $_lang['online_recharge_fail'], $url, 'warning');
     }
 }
コード例 #12
0
 public function add_auth($data, $file_name = '')
 {
     global $kekezu, $user_info, $_lang;
     $moblie_obj = new Keke_witkey_auth_mobile_class();
     $fdata = $this->format_auth_apply($data);
     $valid_code = kekezu::randomkeys(4);
     $fdata['valid_code'] = $valid_code;
     $fdata[auth_time] = time();
     $msg_obj = new keke_msg_class();
     $content = $_lang['dear'] . $user_info['username'] . $_lang['hello'] . $_lang['mobile_auth_code'] . " {$fdata['valid_code']}   " . $_lang['from'] . "[{$kekezu->_sys_config[website_url]}]";
     $msg_res = $msg_obj->send_phone_sms($fdata['mobile'], $content);
     if ($msg_res == "操作成功") {
         $auth_info = db_factory::get_one(sprintf("select * from %switkey_auth_mobile where uid='%d'", TABLEPRE, $user_info['uid']));
         if ($auth_info) {
             $moblie_obj->setWhere('uid=' . $fdata['uid']);
             $moblie_obj->setMobile($fdata[mobile]);
             $moblie_obj->setValid_code($fdata['valid_code']);
             $moblie_obj->setAuth_status(0);
             $moblie_obj->edit_keke_witkey_auth_mobile();
         } else {
             $moblie_obj->setUid($fdata[uid]);
             $moblie_obj->setMobile($fdata[mobile]);
             $moblie_obj->setValid_code($fdata['valid_code']);
             $moblie_obj->setUsername($fdata[username]);
             $moblie_obj->setCash($fdata[cash]);
             $moblie_obj->setAuth_time($fdata[auth_time]);
             $moblie_obj->setAuth_status(0);
             $moblie_obj->create_keke_witkey_auth_mobile();
         }
         $fdata['start_time'] == $fdata['end_time'] and $end_time = $fdata['end_time'] or $end_time = 0;
         $res = $this->add_auth_record($fdata['uid'], $fdata['username'], $this->_auth_code, $end_time, 0);
         parse_str($_SERVER['QUERY_STRING'], $arr);
         $arr[auth_step] = "step2";
         unset($arr['inajax']);
         return true;
     }
     return false;
 }
コード例 #13
0
 public function process_rights($op_result, $type)
 {
     global $_lang;
     $trans_name = $this->get_transrights_name($this->_report_type);
     $op_result = $this->op_result_format($op_result);
     $g_info = $this->user_role('gz');
     $w_info = $this->user_role('wk');
     switch ($op_result['action']) {
         case "pass":
             if ($this->_process_can['sharing']) {
                 $total_cash = floatval($this->_obj_info['cash']);
                 $gz_get = floatval($op_result['gz_get']);
                 $wk_get = floatval($op_result['wk_get']);
                 if ($total_cash != $gz_get + $wk_get) {
                     kekezu::admin_show_msg($_lang['wain_you_give_cash_error_notice'], "index.php?do=trans&view=process&type={$type}&report_id=" . $this->_report_id, "3", "", "warning");
                 } else {
                     $res = keke_finance_class::cash_in($g_info['uid'], $gz_get, 'rights_return');
                     $res .= keke_finance_class::cash_in($w_info['uid'], $wk_get, 'rights_return');
                     if ($res) {
                         $order_info = db_factory::get_one(sprintf("SELECT obj_id FROM `%switkey_report` WHERE obj = 'order' and report_id = %d", TABLEPRE, $this->_report_id));
                         db_factory::execute(sprintf("update %switkey_order set `order_status`='close' where order_id = '%d'", TABLEPRE, intval($order_info['obj_id'])));
                         $this->process_unfreeze('pass', $op_result['process_result']);
                         $this->change_status($this->_report_id, '4', $op_result, $op_result['process_result']);
                     }
                 }
                 $res and kekezu::admin_show_msg($trans_name . $_lang['deal_success'], "index.php?do=trans&view=rights&type={$type}", "3", '', 'success') or kekezu::admin_show_msg($trans_name . $_lang['deal_fail'], "index.php?do=trans&view=process&type={$type}&report_id=" . $this->_report_id, "3", '', 'warning');
             } else {
                 kekezu::admin_show_msg($trans_name . $_lang['deal_fail_now_forbit_deal_cash'], "index.php?do=trans&view=process&type={$type}&report_id=" . $this->_report_id, "3", '', 'warning');
             }
             break;
         case "nopass":
             $this->process_unfreeze('nopass', $op_result['reply']);
             $res = $this->change_status($this->_report_id, '3', $op_result, $op_result['reply']);
             $res and kekezu::admin_show_msg($trans_name . $_lang['deal_success'], "index.php?do=trans&view=rights&type={$type}", "3", '', 'success') or kekezu::admin_show_msg($trans_name . $_lang['deal_fail'], "index.php?do=trans&view=process&type={$type}&report_id=" . $this->_report_id, "3", '', 'warning');
             break;
     }
 }
コード例 #14
0
 public function add_auth_record($uid, $username, $auth_code, $end_time, $data = array(), $auth_status = '0')
 {
     $record_obj = new Keke_witkey_auth_record_class();
     $record_info = db_factory::get_one(sprintf(" select * from %switkey_auth_record where uid = '%d' and auth_code = '%s'", TABLEPRE, $uid, $auth_code));
     if ($record_info['ext_data'] && $data) {
         $odata = unserialize($record_info['ext_data']);
         $odata and $data = array_merge($odata, $data);
     }
     $record_obj->setAuth_code($auth_code);
     $record_obj->setUid($uid);
     $record_obj->setUsername($username);
     if ($data) {
         is_array($data) and $data = serialize($data);
         $data and $record_obj->setExt_data($data);
     }
     $record_obj->setEnd_time($end_time);
     if ($record_info) {
         $record_obj->setWhere('record_id = ' . $record_info['record_id']);
         return $record_obj->edit_keke_witkey_auth_record();
     } else {
         $record_obj->setAuth_status($auth_status);
         return $record_obj->create_keke_witkey_auth_record();
     }
 }
コード例 #15
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);
コード例 #16
0
ファイル: index.php プロジェクト: huangbinzd/kppwGit
$arrProcess_can = $objTask->process_can();
$arrTaskFiles = $objTask->get_task_file();
$arrPayitemShow = $objTask->getPayitemShow();
$arrWorkStatus = $objTask->get_work_status();
if (strtoupper(CHARSET) == 'GBK') {
    $arrWorkStatus = kekezu::gbktoutf($arrWorkStatus);
}
$jsonWorkStatus = json_encode($arrWorkStatus);
$Exitworker = db_factory::get_one("select * from " . TABLEPRE . "witkey_task_work where task_id = " . $arrTaskInfo['task_id'] . " and uid=" . $gUid);
$arrProjectProgress = $objTask->getProjectProgressDesc();
$objTime = new preward_time_class();
$objTime->validtaskstatus();
$intBidCount = $objTask->get_work_count("work_status=6");
switch ($view) {
    case "work":
        $arrUid = db_factory::get_one("select uid from " . TABLEPRE . "witkey_task where task_id = '{$id}'");
        intval($page) and $p['page'] = intval($page) or $p['page'] = '1';
        intval($pagesize) and $p['page_size'] = intval($pagesize) or $p['page_size'] = 10;
        $p['url'] = $strUrl . "&view=work&pagesize=" . $p['page_size'] . "&page=" . $p['page'];
        $p['anchor'] = '#detail';
        if ($st) {
            $p['url'] .= "&st=" . $st;
        }
        if ($ut) {
            $p['url'] .= "&ut=" . $ut;
        }
        $w['work_status'] = $st;
        $w['work_type'] = $ut;
        $arrWorkArrs = $objTask->get_work_info($w, $p);
        $strPages = $arrWorkArrs['pages'];
        $arrWorkInfo = $arrWorkArrs['work_info'];
コード例 #17
0
<?php

defined('ADMIN_KEKE') or exit('Access Denied');
kekezu::admin_check_role(57);
$feed_type = keke_glob_class::get_feed_type();
$feed_obj = new Keke_witkey_feed_class();
$tag_obj = new Keke_witkey_tag_class();
$type or $type = 'manage';
$url = "index.php?do={$do}&view={$view}&type={$type}&tag_id={$tag_id}";
if ($type === 'manage') {
    $tag_id and $feed_info = db_factory::get_one(" select tagname,tag_id,cache_time,tag_code,tpl_type,code from " . TABLEPRE . "witkey_tag where tag_type=8 and tag_id='{$tag_id}'");
    $code = unserialize($feed_info['code']);
}
if ($sbt_edit) {
    if ($type === 'manage') {
        $slt_feed_type == 1 and kekezu::admin_show_msg($_lang['add_fail_select_type'], $url, 3, '', 'warning');
        $cbk_group and $tpl_type = implode(",", $cbk_group) or $tpl_type = $_K['template'];
        $tag_obj->setTagname($txt_tag_name);
        $tag_obj->setTag_code($tag_code);
        $tag_obj->setCache_time($txt_cache_time);
        $tag_obj->setTpl_type($tpl_type);
        $tag_obj->setTag_type(8);
        $code['feed_type'] = $slt_feed_type;
        $code['load_num'] = intval($txt_load_num) ? intval($txt_load_num) : 9;
        $code['user_id'] = 0;
        $code['obj_id'] = 0;
        $code['cache_name'] = $txt_cache_name ? $txt_cache_name : $txt_tag_name;
        $code = serialize($code);
        $tag_obj->setCode($code);
        if ($hdn_tag_id) {
            $tag_obj->setTag_id($hdn_tag_id);
コード例 #18
0
 static function get_adgroup_by_target($target_id, $target_name, $ad_list_num)
 {
     global $kekezu, $_K;
     $arrTag = db_factory::get_one(sprintf('select * from %s where target_id = %d', TABLEPRE . 'witkey_ad_target', intval($target_id)));
     $datalist = kekezu::get_table_data('*', 'witkey_ad', '1=1 and is_allow=1 and target_id = ' . intval($target_id), 'listorder', '', $ad_list_num, '', 3600);
     require keke_tpl_class::parse_code(htmlspecialchars_decode($arrTag['content']), $arrTag['target_id']);
 }
コード例 #19
0
ファイル: goodslist.php プロジェクト: pengfeiaaa/web
function get_good_rate($rateuid)
{
    $good_rate = db_factory::get_one("select if(seller_total_num>0,seller_good_num/seller_total_num,0) as good_rate from " . TABLEPRE . "witkey_space where uid=" . intval($rateuid));
    return $good_rate[good_rate];
}
コード例 #20
0
 function valid_moble_auth()
 {
     global $_lang;
     $sql = sprintf("select * from %switkey_auth_record where auth_code='mobile' and auth_status = 1", TABLEPRE, $this->_account);
     $auth_arr = db_factory::get_one($sql);
     if ($auth_arr) {
         $user_info = keke_user_class::get_user_info($auth_arr[uid]);
         $user_info[login_type] = 'mobile';
         return $user_info;
     } else {
         $this->add_login_time();
         $this->show_msg($_lang['no_tel_auth_not_login'], 5);
     }
 }
コード例 #21
0
<?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');
コード例 #22
0
 public static function getSeverTitle($service_id)
 {
     $strSql = "select * from " . TABLEPRE . "witkey_service where service_id=" . intval($service_id);
     $arrResult = db_factory::get_one($strSql);
     return $arrResult['title'];
 }
コード例 #23
0
ファイル: admin_watermark.php プロジェクト: pengfeiaaa/web
<?php

$waterMark = db_factory::get_one('select * from ' . TABLEPRE . 'witkey_basic_config where k="watermark"');
$config = unserialize($waterMark['v']);
if ($submit) {
    $data['switch'] = $switch;
    $data['hight'] = $hight;
    $data['width'] = $width;
    $data['img'] = $filepath1;
    $d = serialize($data);
    $res = db_factory::updatetable(TABLEPRE . 'witkey_basic_config', array('v' => $d), array('k' => 'watermark'));
    $res and kekezu::admin_show_msg('修改成功', 'index.php?do=watermark', 3, '', 'success');
}
require $template_obj->template(ADMIN_DIRECTORY . '/tpl/admin_' . $do);
コード例 #24
0
ファイル: keke_prom_class.php プロジェクト: pengfeiaaa/web
 public static function get_prom_obj_info($prom_type, $obj_id)
 {
     if ($prom_type == 'pub_task' || $prom_type == 'bid_task') {
         $obj_info = db_factory::get_one(sprintf(" select model_id,indus_id,profit_rate,task_cash cash from %switkey_task where task_id='%d'", TABLEPRE, $obj_id));
     } elseif ($prom_type == 'service') {
         $obj_info = db_factory::get_one(sprintf(" select model_id,indus_id,profit_rate,price cash from %switkey_service where service_id='%d'", TABLEPRE, $obj_id));
     }
     return $obj_info;
 }
コード例 #25
0
ファイル: auth_info.php プロジェクト: huangbinzd/kppwGit
<?php

defined('ADMIN_KEKE') or exit('Access Denied');
$alipayjs_obj = new Keke_witkey_auth_alipayjs_class();
$pay_tool_arr = array(1 => $_lang['alipay'], 2 => $_lang['tenpay'], 3 => $_lang['payment_online']);
$alipayjs_name_arr = keke_glob_class::get_bank();
if ($sbt_pay_to_user) {
    $alipayjs_obj->setWhere('alipayjs_a_id=' . $fds['alipayjs_a_id']);
    $alipayjs_obj->setPay_to_user_cash($fds['pay_to_user_cash']);
    $alipayjs_obj->setPay_time(time());
    $res = $alipayjs_obj->edit_keke_witkey_auth_alipayjs();
    $alipayjs_info = db_factory::get_one(sprintf(" select uid,username from %switkey_auth_alipayjs where alipayjs_a_id = '%d'", TABLEPRE, $fds[alipayjs_a_id]));
    $v_arr = array($_lang['username'] => $alipayjs_info['username']);
    keke_msg_class::notify_user($alipayjs_info['uid'], $alipayjs_info['username'], 'alipayjs_auth', "支付宝认证通知", $v_arr, 2);
    $res and kekezu::admin_show_msg($_lang['give_cach_success'], $_SERVER['HTTP_REFERER'], '3', '', 'success');
} else {
    $alipayjs_a_id and $alipayjs_info = db_factory::get_one(sprintf(" select * from %switkey_auth_alipayjs where alipayjs_a_id = '%d'", TABLEPRE, $alipayjs_a_id));
}
require $template_obj->template('auth/' . $auth_dir . '/admin/tpl/auth_info');
コード例 #26
0
ファイル: index.php プロジェクト: xupnge1314/project
    $strSql = ' select a.case_id,a.obj_id,a.obj_type,a.case_img,a.case_title,a.case_price ';
    $task_open and $strSql .= ',b.work_num,b.model_id,b.username,b.uid ';
    $shop_open and $strSql .= ' ,c.sale_num,c.model_id,c.username,b.uid ';
    $strSql .= ' from ' . TABLEPRE . 'witkey_case a ';
    $task_open and $strSql .= ' left join ' . TABLEPRE . 'witkey_task b ON a.obj_id = b.task_id ';
    $shop_open or $strSql .= ' where a.obj_type="task" ';
    $shop_open and $strSql .= ' left join ' . TABLEPRE . 'witkey_service c on  a.obj_id= c.service_id ';
    $task_open or $strSql .= ' where a.obj_type="service" ';
    $strSql .= " order by a.on_time desc limit 9 ";
    $arrCaseLists = db_factory::query($strSql, 1, $intIndexCacheTime);
    if (!$basic_config['css_auto_fit']) {
        $arrCaseLists = array_merge(array($arrCaseLists[0]), $arrCaseLists);
        if (count($arrCaseLists) > 9) {
            unset($arrCaseLists[9]);
        }
    }
    $arrDynamicPlays = kekezu::get_feed("feedtype='work_accept'", "feed_time desc", 10);
    $arrRecommShops = db_factory::query(sprintf("select a.username,a.uid,b.indus_id,b.indus_pid,a.shop_name,if(b.seller_total_num>0,b.seller_good_num/b.seller_total_num,0) as good_rate from %switkey_shop a " . " left join %switkey_space b on a.uid=b.uid  where b.recommend=1 and b.status=1 and IFNULL(a.is_close,0)=0 and shop_status=1 order by good_rate desc limit 0,6", TABLEPRE, TABLEPRE), 1, $intIndexCacheTime);
    $arrRecommShops1 = db_factory::query(sprintf("select a.username,a.uid,b.indus_id,b.indus_pid,a.shop_name,if(b.seller_total_num>0,b.seller_good_num/b.seller_total_num,0) as good_rate from %switkey_shop a " . " left join %switkey_space b on a.uid=b.uid  where b.recommend=1 and b.status=1 and IFNULL(a.is_close,0)=0 and shop_status=1 order by good_rate desc ", TABLEPRE, TABLEPRE), 1, $intIndexCacheTime);
    $arrArticleTop = db_factory::get_one("select * from " . TABLEPRE . "witkey_article where cat_type='article' and  LENGTH(art_pic)>20 order by pub_time desc limit 1", 1, $intIndexCacheTime);
    $arrArticleLists = db_factory::query("select * from " . TABLEPRE . "witkey_article where cat_type='article' and art_id !='" . $arrArticleTop['art_id'] . "' order by pub_time desc limit 6", 1, $intIndexCacheTime);
    $arrPubToday = db_factory::query("select count(*) as count from " . TABLEPRE . "witkey_task where date(from_unixtime(start_time)) = curdate() and task_status>=2", 1, $intIndexCacheTime);
    $arrAcceptTask = db_factory::query("SELECT obj_id FROM " . TABLEPRE . "witkey_feed where obj_id>0 and feedtype='work_accept' and date(from_unixtime(feed_time)) = curdate() group by obj_id ; ", 1, $intIndexCacheTime);
    $arrAcceptToday = count($arrAcceptTask);
    $arrCashToday = db_factory::query("SELECT sum(fina_cash) as cash FROM " . TABLEPRE . "witkey_finance where (fina_action='task_bid' or fina_action='sale_service')  and date(from_unixtime(fina_time)) = curdate()  ;", 1, $intIndexCacheTime);
    $arrPubAll = db_factory::query("select count(*) as count from " . TABLEPRE . "witkey_task where task_status>=2", 1, $intIndexCacheTime);
    $arrAcceptTasks = db_factory::query("SELECT obj_id FROM " . TABLEPRE . "witkey_feed where obj_id>0 and feedtype='work_accept'  group by obj_id  ;", 1, $intIndexCacheTime);
    $arrAcceptAll = count($arrAcceptTasks);
    $arrCashAll = db_factory::query("SELECT sum(fina_cash)  as cash FROM " . TABLEPRE . "witkey_finance where (fina_action='task_bid' or fina_action='sale_service')  ;", 1, $intIndexCacheTime);
    $arrFlink = kekezu::get_table_data("link_id,link_name,link_url,listorder", "witkey_link", "", " listorder asc", "", "", "", $intIndexCacheTime);
}
コード例 #27
0
ファイル: auth_list.php プロジェクト: huangbinzd/kppwGit
if (isset($ac)) {
    switch ($ac) {
        case "pass":
            kekezu::admin_system_log($obj . $_lang['enterprise_auth_pass']);
            $auth_obj->review_auth($enterprise_auth_id, 'pass', $url);
            break;
        case "not_pass":
            if ($is_submit == "1") {
                $v_arr = array($_lang['username'] => $name, '网站名称' => $kekezu->_sys_config['website_name'], "审核原因" => $reason);
                keke_shop_class::notify_user($_GET['uid'], $name, 'auth_auth_fail', "企业认证失败", $v_arr, 2);
                kekezu::admin_system_log($obj . $_lang['enterprise_auth_nopass']);
                $auth_obj->review_auth($enterprise_auth_id, 'not_pass', $url);
            } else {
                $uid = $_GET['uid'];
                $strSql = "select * from " . TABLEPRE . "witkey_space where uid=" . $uid;
                $arrResult = db_factory::get_one($strSql);
                require keke_tpl_class::template('auth/enterprise/admin/tpl/auth_tp');
                die;
            }
            break;
        case 'del':
            kekezu::admin_system_log($obj . $_lang['enterprise_auth_delete']);
            $auth_obj->del_auth($enterprise_auth_id, $url);
            break;
    }
} elseif (isset($sbt_action)) {
    $keyids = $ckb;
    switch ($sbt_action) {
        case $_lang['mulit_delete']:
            kekezu::admin_system_log($_lang['mulit_delete_enterprise_auth']);
            $auth_obj->del_auth($keyids, $url);
コード例 #28
0
ファイル: keke_order_class.php プロジェクト: pengfeiaaa/web
 public static function order_cancel_return($order_id)
 {
     $fina_info = db_factory::get_one(sprintf(" select uid,fina_cash,fina_credit from %switkey_finance where order_id ='%d'", TABLEPRE, $order_id));
     if ($fina_info) {
         keke_finance_class::init_mem('order_cancel', array(':order_id' => $order_id));
         return keke_finance_class::cash_in($fina_info['uid'], $fina_info['fina_cash'], "order_cancel", '', 'order', $order_id);
     } else {
         return true;
     }
 }
コード例 #29
0
$strStatus and $strUrl .= "&strStatus=" . strval($strStatus);
$strOrder and $strUrl .= "&strOrder=" . strval($strOrder);
$strTitle and $strUrl .= "&strTitle=" . strval($strTitle);
$arrListOrder = array('b.order_id desc' => '编号降序', 'b.order_id asc' => '编号升序');
if ($intModelId) {
    $arrStatus = call_user_func(array($arrServiceModels[$intModelId]['model_code'] . '_shop_class', 'get_order_status'));
} else {
    $arrStatus1 = call_user_func(array($arrServiceModels[6]['model_code'] . '_shop_class', 'get_order_status'));
    $arrStatus2 = call_user_func(array($arrServiceModels[7]['model_code'] . '_shop_class', 'get_order_status'));
    $arrStatus = array_merge($arrStatus1, $arrStatus2);
}
if (isset($action)) {
    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 ';
コード例 #30
0
<?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}");