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,work_count,single_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['txt_task_cash']);
                 $release_info['txt_work_count'] = intval($task_info['work_count']);
                 $release_info['txt_single_cash'] = intval($task_info['single_cash']);
                 $this->save_task_obj($release_info, $std_cache_name);
             }
             break;
     }
 }
 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 write($session_id, $session_data)
 {
     $tablename = TABLEPRE . "witkey_session";
     $_SESSION[uid] > 0 and $uid = $_SESSION['uid'] or $uid = 0;
     $data_arr = array('session_id' => $session_id, 'session_data' => $session_data, 'session_expirse' => time() + $this->_left_time, 'session_ip' => kekezu::get_ip(), 'session_uid' => $uid);
     return $this->_db->inserttable($tablename, $data_arr, 1, 1);
 }
Example #4
0
 protected function getusercash($uid)
 {
     if (!$this->_a_uinfo[$uid]) {
         $this->_a_uinfo[$uid] = kekezu::get_user_info($uid);
     }
     return $this->_a_uinfo[$uid]['balance'] + $this->_a_uedit_arr[$uid]['balance'];
 }
 public function process_report($op_result, $type)
 {
     global $_lang;
     $trans_name = $this->get_transrights_name($this->_report_type);
     $op_result = $this->op_result_format($op_result);
     if ($op_result['action']) {
         if ($op_result['product_remove'] == 1) {
             $res = db_factory::execute(sprintf(" update %switkey_service set service_status='3' where service_id='%d'", TABLEPRE, $this->_obj_info['origin_id']));
             $this->process_notify('pass', $this->_report_info, $this->_user_info, $this->_to_user_info, $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=report&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');
         }
         if ($op_result['product_remove'] == 2) {
             $this->process_notify('nopass', $this->_report_info, $this->_user_info, $this->_to_user_info, $op_result['process_result']);
             $res = $this->change_status($this->_report_id, '3', $op_result, $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');
         }
         if ($op_result['product_remove'] == 3) {
             $this->disablePeople();
             $this->process_notify('pass', $this->_report_info, $this->_user_info, $this->_to_user_info, $op_result['process_result']);
             $res = $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');
         }
     }
 }
 public function send_mail($email_a_id, $data)
 {
     global $_K, $_lang;
     $md5_code = md5($data['uid'] . $data['username'] . $data['email']);
     $title = $_K['html_title'] . '--' . $_lang['email_auth'];
     $body = '<font color="red">' . $_K['html_title'] . $_lang['__email_auth'] . '</font><br><br>&nbsp;&nbsp;&nbsp;' . $_lang['please_click_email_auth_url'] . '<a href="' . $_K[siteurl] . '/index.php?do=user&view=account&op=auth&code=email&email_a_id=' . $email_a_id . '&ac=check_email&step=step3&ver=1&active_code=' . $md5_code . '">' . $_K[siteurl] . '/index.php?do=user&view=account&op=auth&code=email&email_a_id=' . $email_a_id . '&ac=check_email&step=step3&ver=1&active_code=' . $md5_code . '</a>,如果链接无法点击,请复制以下链接到浏览器中执行' . $_K[siteurl] . '/index.php?do=user&view=account&op=auth&code=email&email_a_id=' . $email_a_id . '&ac=check_email&step=step3&ver=1&active_code=' . $md5_code;
     return kekezu::send_mail($data['email'], $title, $body);
 }
 public static function get_item_info($num_iid)
 {
     $taoapi = new taoapi_get('item', array('num_iid' => $num_iid));
     $data = $taoapi->send();
     $status = 1;
     $data['code'] && ($status = 0);
     kekezu::echojson('', $status, $data);
 }
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;
    }
}
Example #9
0
 function create_node_attr($element = '', $attrname = '', $attrvalue = '')
 {
     if ($this->_K['charset'] != 'utf-8') {
         $attrname = kekezu::gbktoutf($attrname);
         $attrvalue = kekezu::gbktoutf($attrvalue);
     }
     $attr = new DOMAttr($attrname, $attrvalue);
     $element->appendChild($attr);
     $this->_doc->save($this->_filepath);
 }
Example #10
0
 public function __construct()
 {
     global $kekezu;
     $cfg = kekezu::get_payment_config('wxpay');
     $this->_appid = $cfg['appid'];
     $this->_appsecert = $cfg['appsecert'];
     $this->_mchid = $cfg['mchid'];
     $this->_key = $cfg['key'];
     $this->_sslcert_path = S_ROOT . '/include/payment/wxpay/cert/apiclient_cert.pem';
     $this->_sslkey_path = S_ROOT . '/include/payment/wxpay/cert/apiclient_key.pem';
 }
Example #11
0
 public function newfilename($file)
 {
     $ext = strtolower(trim(substr(strrchr($file, '.'), 1)));
     $rand = kekezu::randomkeys(8);
     $time = microtime();
     $str = $file . $time . $rand;
     if (function_exists('sha1')) {
         return sha1($str) . '.' . $ext;
     }
     return md5($str) . '.' . $ext;
 }
 function __construct($charge_type, $model_id = '', $uid = '', $obj_id = '', $order_id = '', $total_fee = '')
 {
     $this->_userinfo = kekezu::get_user_info($uid);
     $this->_model_id = intval($model_id);
     $this->_uid = intval($uid);
     $this->_username = $this->_userinfo['username'];
     $this->_charge_type = $charge_type;
     $this->_order_id = intval($order_id);
     $this->_total_fee = $total_fee;
     $this->_obj_id = intval($obj_id);
 }
 public function get_max_day($task_cash)
 {
     global $kekezu;
     global $_lang;
     if ($task_cash >= $this->_task_config['min_cash']) {
         $time = keke_task_release_class::get_default_max_day($task_cash, $this->_model_id, $this->_task_config['min_day']);
         kekezu::echojson($time, 1, $time);
     } else {
         kekezu::echojson($_lang['task_min_cash_limit_notice'] . $this->_task_config['min_cash'], 0);
         die;
     }
 }
 function login($call_back, $url)
 {
     global $oauth_verifier, $code, $_K;
     if (isset($code) && $this->_wb_type == 'sina') {
         $oauth_verifier = array('code' => $code, 'redirect_uri' => $url);
     }
     if ($call_back) {
         if (isset($code) && $this->_wb_type == 'sina') {
             if ($oauth_verifier) {
                 oauth_api_factory::create_access_token($oauth_verifier, $this->_wb_type, $this->_app_id, $this->_app_secret);
                 $oauth_user_info = $this->get_login_user_info();
                 $bind_info = keke_register_class::is_oauth_bind($this->_wb_type, $oauth_user_info['account']);
                 if ($oauth_user_info && $bind_info) {
                     $user_info = kekezu::get_user_info($bind_info['uid']);
                     $login_obj = new keke_user_login_class();
                     $login_user_info = $login_obj->user_login($user_info['username'], $user_info['password'], null, 1);
                     $login_obj->save_user_info($login_user_info, 1);
                 } else {
                     $_SESSION['wb_type'] = $this->_wb_type;
                     header("Location:{$_K['siteurl']}/index.php?do=index");
                     die;
                 }
             } else {
                 header("Location:{$_K['siteurl']}/index.php?do=login");
                 die;
             }
         } else {
             oauth_api_factory::create_access_token($oauth_verifier, $this->_wb_type, $this->_app_id, $this->_app_secret);
             $oauth_user_info = $this->get_login_user_info();
             $bind_info = keke_register_class::is_oauth_bind($this->_wb_type, $oauth_user_info['account']);
             if ($oauth_user_info && $bind_info) {
                 $user_info = kekezu::get_user_info($bind_info['uid']);
                 $login_obj = new keke_user_login_class();
                 $login_user_info = $login_obj->user_login($user_info['username'], $user_info['password'], null, 1);
                 $login_obj->save_user_info($login_user_info, 1);
             } else {
                 $_SESSION['wb_type'] = $this->_wb_type;
                 header("Location:{$_K['siteurl']}/index.php?do=index");
                 die;
             }
         }
     }
     $this->_url = $url;
     if (oauth_api_factory::get_access_token($this->_wb_type, $this->_app_id, $this->_app_secret)) {
         return true;
     } else {
         $aurl = oauth_api_factory::get_auth_url("{$url}&call_back=1", $this->_wb_type, $this->_app_id, $this->_app_secret);
         header('Location:' . $aurl);
         die;
     }
 }
Example #15
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();
 }
Example #16
0
function reset_set_password($user_info)
{
    $code = kekezu::randomkeys(6);
    $user_code = md5($code);
    $slt = kekezu::randomkeys(6);
    $user_seccode = keke_user_class::get_password($code, $slt);
    $sql = "update %switkey_member set password = '******' , rand_code = '%s' where uid=%d";
    $sql = sprintf($sql, TABLEPRE, $user_code, $slt, $user_info['uid']);
    $res = db_factory::execute($sql);
    $sql = "update %switkey_space set  password = '******' , sec_code = '%s' where uid=%d";
    $sql = sprintf($sql, TABLEPRE, $user_code, $user_seccode, $user_info['uid']);
    db_factory::execute($sql);
    $pass_info['code'] = $pass_info['sec_code'] = $code;
    keke_user_class::user_edit($user_info['username'], '', $code, '', 1);
    return $pass_info;
}
Example #17
0
function nav_analysis($url)
{
    global $_K;
    $front_route = kekezu::route_output();
    $readnonly = true;
    $site_ali = parse_url($_K['siteurl']);
    $nav_ali = parse_url($url);
    if (sizeof($nav_ali) > 2 && $site_ali['scheme'] . '://' . $site_ali['host'] != $nav_ali['scheme'] . '://' . $nav_ali['host']) {
        $readnonly = false;
    } else {
        parse_str($nav_ali['query'], $data);
        $data['do'] or $data['do'] = 'index';
        in_array($data['do'], $front_route) or $readnonly = false;
    }
    return $readnonly;
}
Example #18
0
 public function return_notify($pay_mode, $response = array())
 {
     global $_K;
     global $_lang;
     $pay_config = kekezu::get_payment_config($pay_mode);
     if (empty($response)) {
         $response['title'] = $_lang['operate_notice'];
         $response['content'] = $_lang['pay'] . $_lang['fail'];
         $response['url'] = $_K['siteurl'];
         $response['type'] = 'warning';
     } else {
         $response['title'] = $_lang['operate_notice'];
         $response['type'] == 'success';
         $response['content'] = $pre . $response['content'];
     }
     header('Location:' . $response['url']);
 }
 function process_report($op_result, $type)
 {
     global $_lang;
     $op_result['result'] = $op_result['process_result'];
     $op_result = $this->op_result_format($op_result);
     $trans_name = $this->get_transrights_name($this->_report_info['report_type']);
     if ($op_result['action']) {
         switch ($op_result['task']) {
             case 1:
                 $this->_task_obj->set_task_status(9);
                 $this->process_notify('pass', $this->_report_info, $this->_user_info, $this->_to_user_info, $op_result['result']);
                 $res = $this->change_status($this->_report_id, '4', $op_result, $op_result['result']);
                 break;
             case 2:
                 kekezu::admin_show_msg('操作提示', "index.php?do=trans&view=report&type={$type}", "3", "该任务不能进行此操作");
                 break;
             case 3:
                 $this->process_notify('nopass', $this->_report_info, $this->_user_info, $this->_to_user_info, $op_result['process_result'], $op_result['reply']);
                 $res = $this->change_status($this->_report_id, '3', $op_result, $op_result, $op_result['result']);
                 break;
             case 4:
                 $res = $this->shield_work($this->_obj_info['obj_id']);
                 $this->_task_obj->set_task_status(2);
                 $this->process_notify('pass', $this->_report_info, $this->_user_info, $this->_to_user_info, $op_result['result']);
                 $res = $this->change_status($this->_report_id, '4', $op_result, $op_result['result']);
                 break;
             case 5:
                 $this->cancel_bid($this->_obj_info['obj_id']);
                 $this->_task_obj->set_task_status(2);
                 $this->process_notify('pass', $this->_report_info, $this->_user_info, $this->_to_user_info, $op_result['result']);
                 $res = $this->change_status($this->_report_id, '4', $op_result, $op_result['result']);
                 break;
             case 6:
                 $this->disablePeople();
                 $this->process_notify('pass', $this->_report_info, $this->_user_info, $this->_to_user_info, $op_result['process_result']);
                 $res = $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');
         }
         if ($res) {
             kekezu::admin_show_msg($trans_name . $_lang['deal_success'], "index.php?do=trans&view=report&type={$type}", "3", "", "success");
         } else {
             kekezu::admin_show_msg($trans_name . $_lang['deal_fail'], "index.php?do=trans&view=process&type={$type}&report_id=" . $this->_report_id, "3", "", "warning");
         }
     }
 }
 public function wap_release()
 {
     $task_obj = $this->_task_obj;
     $_D = $_REQUEST;
     $this->wap_public();
     $this->set_task_status($this->get_total_cash($_D['task_cash']), $_D['task_cash']);
     $task_id = $task_obj->create_keke_witkey_task();
     if ($task_id) {
         $t = $this->wap_update($task_id);
     }
     if ($t[0] == 'success') {
         $s = 1;
     } else {
         $msg = array('r' => $t[1]);
         $s = 0;
     }
     kekezu::echojson($msg, $s, $task_id);
     die;
 }
Example #21
0
 static function run_backup()
 {
     global $_lang;
     set_time_limit(0);
     ini_set('memory_limit', '1024M');
     $output = array();
     $db_factory = new db_factory();
     $tables = $db_factory->query(" show table status from `" . DBNAME . "`");
     $temp_arr = array();
     foreach ($tables as $v) {
         if (substr($v[Name], 0, strlen(TABLEPRE)) == TABLEPRE) {
             $temp_arr[] = $v;
         }
     }
     $tables = $temp_arr;
     $sqlmsg = '';
     foreach ($tables as $tablesarr) {
         $table_name = $tablesarr['Name'];
         $table_type = $tablesarr['Type'];
         $result = $db_factory->query("show fields from " . $table_name);
         $sqlmsg .= "#" . $_lang['table_name'] . ":<" . $table_name . ">\n";
         $sqlmsg .= "DROP TABLE IF EXISTS `" . $table_name . "`;\n";
         $createtable = $db_factory->query("SHOW CREATE TABLE " . $table_name);
         $sqlmsg .= $createtable[0]['Create Table'] . " ;\n";
         $result = $db_factory->query("show fields from " . $table_name);
         foreach ($result as $fileds) {
             $fields[] = "`" . $fileds['Field'] . "`";
         }
         $field = join(",", $fields);
         $sql_insert = self::querySelect($table_name, $field, $result);
         if ($sql_insert !== false) {
             $sqlmsg .= $sql_insert;
         }
         unset($fields);
         $output[] = str_replace(TABLEPRE . 'witkey_', '**********************', $table_name);
     }
     $sqlmsg .= "\n";
     $path = S_ROOT . './data/backup/backup_' . time() . '_' . DBNAME . ".sql";
     keke_tpl_class::swritefile($path, $sqlmsg);
     kekezu::admin_system_log($_lang['backup_database'] . '' . "backup_" . time() . '_' . DBNAME . ".sql");
     file_exists($path) and kekezu::echojson('', 1, $output) or kekezu::echojson('', 0, $output);
     die;
 }
Example #22
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);
             }
         }
     }
 }
 public function auth_confirm($auth_info, $user_get_cash)
 {
     global $user_info, $kekezu, $_lang;
     $uid = $user_info['uid'];
     $username = $user_info['username'];
     $intBankAid = $auth_info[$this->_primary_key];
     $pk[$this->_primary_key] = $intBankAid;
     $data['user_get_cash'] = $user_get_cash;
     $this->_tab_obj->save($data, $pk);
     $ac_url = "index.php?do=user&view=account&op=auth&code=" . $this->_auth_code . "&intBankAid=" . $intBankAid . "#userCenter";
     if ($this->set_auth_status($intBankAid, '1')) {
         $this->set_auth_record_status($uid, '1');
         $objProm = keke_prom_class::get_instance();
         $objProm->dispose_prom_event('reg', $uid, $uid);
         $feed_arr = array("feed_username" => array("content" => $username, "url" => "index.php?do=seller&id={$uid}"), "action" => array("content" => $_lang['have_passed'], "url" => ""), "event" => array("content" => $this->auth_lang(), "url" => ""));
         kekezu::save_feed($feed_arr, $uid, $username, $this->_auth_name);
         $v_arr = array($_lang['auth_code'] => $this->auth_lang(), $_lang['auth_url'] => $ac_url);
         keke_msg_class::notify_user($uid, $username, 'auth_success', $this->auth_lang() . $_lang['success'], $v_arr, 2);
     }
 }
 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);
 }
 public function pub_task()
 {
     $release_info = kekezu::k_input($this->_std_obj->_release_info);
     $task_obj = $this->_task_obj;
     $this->public_pubtask();
     if ($release_info['budget_radio'] == '2') {
         $task_cash = $release_info['txt_budget'];
         $task_obj->setBudget($release_info['txt_budget']);
         $task_obj->setTask_cash_coverage(0);
     } else {
         $cash_cove = $this->_cash_cove;
         $cove = $cash_cove[$release_info['task_cash_cove']];
         $task_cash = $cove['end_cove'];
         $task_cash or $task_cash = $cove['start_cove'];
         $task_obj->setTask_cash_coverage($release_info['task_cash_cove']);
         $task_obj->setBudget(0);
     }
     $task_obj->setTask_cash($task_cash);
     $task_id = $task_obj->create_keke_witkey_task();
     return $task_id;
 }
Example #26
0
 public function task_agreement_freeze()
 {
     global $model_list, $_K, $_lang;
     $config = unserialize($model_list[1]['config']);
     $sql = " select a.agree_id,a.agree_status,a.seller_status,a.buyer_status,a.seller_uid,a.buyer_uid,a.task_id,a.on_time,b.task_title from %switkey_agreement a left join %switkey_task b on a.task_id=b.task_id where\n\t\t\t\ta.model_id=1  and b.task_status=6 and a.on_time<'%d'";
     $agree_list = db_factory::query(sprintf($sql, TABLEPRE, TABLEPRE, time() - intval($config['agree_complete_time']) * 24 * 3600));
     if (!empty($agree_list)) {
         $msg_obj = new keke_msg_class();
         foreach ($agree_list as $k => $v) {
             $ginfo = kekezu::get_user_info($v['seller_uid']);
             $winfo = kekezu::get_user_info($v['buyer_uid']);
             db_factory::execute(sprintf(" update %switkey_task set task_status=13 where task_id='%d'", TABLEPRE, $v['task_id']));
             db_factory::execute(sprintf(" update %switkey_agreement set agree_status=5 where agree_id='%d'", TABLEPRE, $v['agree_id']));
             $url = "<a href=\"" . $_K['siteurl'] . '/index.php?do=task&id=' . $v['task_id'] . "\">" . $v['task_title'] . "</a>";
             $v1 = array('动作' => $_lang['agree_g_ac'], '原因' => '由于超时未完成交付已被系统冻结,请尽快联系客服,由客服介入处理', '任务标题' => $url);
             $v2 = array('动作' => $_lang['agree_w_ac'], '原因' => '由于超时未完成交付已被系统冻结,请尽快联系客服,由客服介入处理', '任务标题' => $url);
             $msg_obj->send_message($ginfo['uid'], $ginfo['username'], "task_freeze", '协议交付超时冻结通知', $v1, $ginfo['email'], $ginfo['mobile']);
             $msg_obj->send_message($winfo['uid'], $winfo['username'], "task_freeze", '协议交付超时冻结通知', $v2, $winfo['email'], $winfo['mobile']);
         }
     }
 }
Example #27
0
 public function create($dbtype)
 {
     if (is_object(self::$dbs[$dbtype])) {
         return self::$dbs[$dbtype];
     } else {
         switch ($dbtype) {
             case "odbc":
                 $this->_dbtype = $dbtype;
                 if (empty(self::$dbs[$dbtype])) {
                     kekezu::keke_require_once(S_ROOT . '/lib/db/odbc_driver.php');
                     return self::$dbs[$dbtype] = new odbc_driver();
                 } else {
                     return self::$dbs[$dbtype];
                 }
                 break;
             case "pdo_sqlite":
                 $this->_dbtype = "pdo_sqlite";
                 kekezu::keke_require_once(S_ROOT . '/lib/db/sqlite_driver.php');
                 break;
             case "mysqli":
                 $this->_dbtype = "mysqli";
                 if (empty(self::$dbs[$dbtype])) {
                     kekezu::keke_require_once(S_ROOT . '/lib/db/mysqli_driver.php');
                     return self::$dbs[$dbtype] = new mysqli_drver();
                 } else {
                     return self::$dbs[$dbtype];
                 }
                 break;
             default:
                 $this->_dbtype = $dbtype;
                 if (empty(self::$dbs[$dbtype])) {
                     kekezu::keke_require_once(S_ROOT . '/lib/db/mysql_driver.php');
                     return self::$dbs[$dbtype] = new mysql_drver();
                 } else {
                     return self::$dbs[$dbtype];
                 }
                 break;
         }
     }
 }
Example #28
0
function get_pay_url($charge_type, $pay_amount, $payment_config, $subject, $order_id, $model_id = null, $obj_id = null, $service = "DEFAULT", $sign_type = 'MD5', $show_url = 'index.php?do=user&view=finance&op=details')
{
    global $_K, $uid, $username;
    $tenpayid = $payment_config['seller_id'];
    $tenpaykey = $payment_config['safekey'];
    $tenpay_return_url = $_K['siteurl'] . '/include/payment/tenpay/return.php';
    $order_no = $order_id;
    $product_name = $subject;
    $order_price = $pay_amount;
    $out_trade_no = "charge-{$charge_type}-{$uid}-{$obj_id}-{$order_id}-{$model_id}-" . time();
    $remarkexplain = $out_trade_no;
    $bargainor_id = $tenpayid;
    $key = $tenpaykey;
    $return_url = $tenpay_return_url;
    $strDate = date("Ymd");
    $strTime = date("His");
    $randNum = rand(1000, 9999);
    $strReq = $strTime . $randNum;
    $sp_billno = $order_no;
    $transaction_id = $bargainor_id . $strDate . $strReq;
    $total_fee = $order_price * 100;
    $desc = $product_name;
    $reqHandler = new PayRequestHandler();
    $reqHandler->init();
    $reqHandler->setKey($key);
    $reqHandler->setParameter("bargainor_id", $bargainor_id);
    $reqHandler->setParameter("sp_billno", $sp_billno);
    $reqHandler->setParameter("transaction_id", $transaction_id);
    $reqHandler->setParameter("total_fee", $total_fee);
    $reqHandler->setParameter("return_url", $return_url);
    $reqHandler->setParameter("desc", $desc);
    $reqHandler->setParameter("attach", $remarkexplain);
    $reqHandler->setParameter("bank_type", $service);
    $reqHandler->setParameter('cs', CHARSET);
    $reqHandler->setParameter("spbill_create_ip", kekezu::get_ip());
    $reqUrl = $reqHandler->getRequestURL();
    keke_order_class::create_order_charge('online_charge', 'tenpay', null, $obj_id, $uid, $username, $pay_amount, 'wait', '用户充值', $out_trade_no);
    return build_postform($reqUrl);
}
 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;
 }
Example #30
0
 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;
     }
 }