public function orderquery() { $platform = 'p1'; //平台乾多多标识 $LoanNo = $_POST['LoanNo']; //乾多多流水号 $OrderNo = $_POST['OrderNo']; //网贷平台订单号 $BatchNo = $_POST['BatchNo']; //网贷平台标号 $BeginTime = $_POST['start_time']; //开始时间 $EndTime = $_POST['end_time']; //结束时间 import("ORG.Loan.Escrow"); //$url='http://218.4.234.150:88/main/loan/loanorderquery.action'; $loan = new Escrow(); // $orderdata = $loan->orderquery($orderdata,$url); $out = $loan->loanOrder($platform, $LoanNo, $OrderNo, $BatchNo, $BeginTime, $EndTime); //echo $out; $this->assign('out', $out); //$data['html'] = $this->fetch(); //dump(json_encode($data)); $this->display(); }
public function moneymmcharge() { import("ORG.Loan.Escrow"); $charge = new Escrow(); $data = M('escrow_account')->field('*')->where('uid=' . $this->uid)->find(); if (!$data) { $this->error('请先绑定托管账户', '/member/bank#fragment-2'); } $add = array('uid' => $this->uid, 'add_time' => time(), 'money' => $_POST['money']); $id = M("member_payonline")->add($add); //利用返回id 查找表自动生成的 orderno(平台充值单号) if (!$id) { $this->error('订单生成出错!'); } $orders = date("YmdHi") . $id; $Amount = floatval($_POST['money']); $ReturnURL = 'http://' . $_SERVER['HTTP_HOST'] . U('/member/charge/wapchargeReturn'); $NotifyURL = 'http://' . $_SERVER['HTTP_HOST'] . U("/member/Notify/charge"); $RechargeType = '2'; $FeeType = '1'; //dump($data['platform_marked']);die; $array = $charge->Moneymoremorecharge($data['qdd_marked'], $data['platform_marked'], $orders, $Amount, $ReturnURL, $NotifyURL, $RechargeType, $FeeType); file_put_contents("C:\\www\tsx\\App\\Runtime\\a.txt", json_encode($array)); $form = $charge->setForm($array, 'charge'); echo $form; exit; }
/** * 转账返回地址 * */ public function returnUrl() { import("ORG.Loan.Escrow"); $loan = new Escrow(); if ($loan->loanVerify($_POST)) { $lang = L('invest'); $msg = $lang[$_POST['ResultCode']]; if ($_POST['ResultCode'] != 88) { $this->error($_POST['Message'], U('index')); } else { $this->success('转账成功', U('index')); exit; } } $msg = "返回信息被篡改"; $this->error($msg, U('index')); }
public function authorizenotify() { //dump($_POST); $AuthorizeTypeOpen = $_POST["AuthorizeTypeOpen"]; $AuthorizeTypeClose = $_POST["AuthorizeTypeClose"]; $MoneymoremoreId = $_POST['MoneymoremoreId']; if ($_POST["ResultCode"] == '88') { import("ORG.Loan.Escrow"); $loan = new Escrow(); if ($loan->Authorizenotify($_POST)) { $escrow = M('escrow_account'); $open = $AuthorizeTypeOpen; strpos(',', $AuthorizeTypeOpen) && ($open = explode(',', $AuthorizeTypeOpen)); $close = $AuthorizeTypeClose; strpos(',', $AuthorizeTypeClose) && ($close = explode(',', $AuthorizeTypeClose)); if (strstr($close, '1')) { $auth['invest_auth'] = '0'; } else { if (strstr($open, '1')) { $auth['invest_auth'] = '1'; } } if (strstr($close, '2')) { $auth['repayment'] = '0'; } else { if (strstr($open, '2')) { $auth['repayment'] = '1'; } } if (strstr($close, '3')) { $auth['secondary_percent'] = '0'; } else { if (strstr($open, '3')) { $auth['secondary_percent'] = '1'; } } $info = $escrow->field('uid')->where(array(qdd_marked => $MoneymoremoreId))->find(); //dump($info); $nid = $escrow->where(array('uid' => $info['uid']))->save($auth); if ($nid) { echo 'SUCCESS'; } } } }
/** * 绑定乾多多账号 * */ public function bindingAccount() { header("Content-type:text/html;charset=utf-8"); $status = M('members_status')->field('*')->where("uid={$this->uid}")->find(); //$status['email_status']!=1 && $this->error('请先认证邮箱再来绑定托管账户', '/member/verify#fragment-1'); $status['phone_status'] != 1 && $this->error('请先认证手机号再来绑定托管账户', '/M/verify/cellphone'); $status['id_status'] != 1 && $this->error('请先实名认证再来绑定托管账户', '/M/verify/idcard'); if (M('escrow_account')->where("uid={$this->uid}")->count('uid')) { $this->error('您已经绑定了托管账户,无需重复绑定', '/member.html'); } $user_info = M('members')->field('user_name, user_email, user_phone')->where("id={$this->uid}")->find(); $id_info = M("member_info")->field('idcard, real_name')->where("uid={$this->uid}")->find(); import("ORG.Loan.Escrow"); $loan = new Escrow(); $data = $loan->wapregisterAccount($user_info['user_phone'], $user_info['user_email'], $id_info['real_name'], $id_info['idcard'], $user_info['user_name']); $form = $loan->setForm($data, 'register'); echo $form; exit; }
public function invest() { if (!$this->uid) { if ($this->isAjax()) { die("请先登录后投资"); } else { $this->redirect('M/pub/login'); } } if ($this->isAjax()) { $borrow_id = intval($this->_get('bid')); $tnum = intval($_POST['cnum']); $pre = c("DB_PREFIX"); $m = M("member_money")->field('account_money,back_money,money_collect')->find($this->uid); $amoney = $m['account_money'] + $m['back_money']; $uname = session("u_user_name"); $binfo = M("transfer_borrow_info")->field("borrow_uid,borrow_interest_rate,transfer_out,transfer_back,transfer_total,\n per_transfer,is_show,deadline,min_month,increase_rate,reward_rate,borrow_duration")->find($borrow_id); if ($this->uid == $binfo['borrow_uid']) { ajaxmsg("不能去投自己的标", 0); } $month = $binfo['borrow_duration']; //手机版默认投资最大期限 $max_num = $binfo['transfer_total'] - $binfo['transfer_out']; if ($max_num < $tnum) { die("本标还能认购最大份数为" . $max_num . "份,请重新输入认购份数"); } $money = $binfo['per_transfer'] * $tnum; if ($amoney < $money) { die("尊敬的{$uname},您准备认购{$money}元,但您的账户可用余额为{$amoney}元,请先去充值再认购"); } $vm = getMinfo($this->uid, "m.pin_pass,mm.invest_vouch_cuse,mm.money_collect"); $pin_pass = $vm['pin_pass']; $pin = md5($_POST['paypass']); // if ($pin != $pin_pass){ // die( "支付密码错误,请重试" ); // } $tinvest_id = TinvestMoney($this->uid, $borrow_id, $tnum, $month); //投企业直投 if ($tinvest_id) { //die('TRUE'); $loanconfig = FS("Webconfig/loanconfig"); $orders = 'T' . date("YmdHi") . $tinvest_id; // 发送到乾多多 $invest_qdd = M("escrow_account")->field('*')->where("uid={$this->uid}")->find(); $borrow_qdd = M("escrow_account")->field('*')->where("uid={$binfo['borrow_uid']}")->find(); $invest_info = M("transfer_borrow_investor")->field("reward_money, borrow_fee")->where("id={$tinvest_id}")->find(); $secodary = ''; import("ORG.Loan.Escrow"); $loan = new Escrow(); if ($invest_info['reward_money'] > 0.0) { // 投标奖励 $secodary[] = $loan->secondaryJsonList($invest_qdd['qdd_marked'], $invest_info['reward_money'], '二次分配', '投标奖励'); } if ($invest_info['borrow_fee'] > 0.0) { // 借款管理费 $secodary[] = $loan->secondaryJsonList($loanconfig['pfmmm'], $invest_info['borrow_fee'], '二次分配', '借款管理费'); } $secodary && ($secodary = json_encode($secodary)); $loanList = $loan->loanJsonList($invest_qdd['qdd_marked'], $borrow_qdd['qdd_marked'], $orders, 'T_' . $borrow_id, $money, $binfo['borrow_money'], '投标', "对{$borrow_id}号企业直投进行投标", $secodary); $loanJsonList = json_encode($loanList); $returnURL = C('WEB_URL') . U("tinvest/wapinvestReturn"); $notifyURL = C('WEB_URL') . U("tinvest/notify"); $data = $loan->transfer($loanJsonList, $returnURL, $notifyURL, 1, 1, 2, 1); // 自动到帐 $form = $loan->setForm($data, 'transfer'); // echo "aaaaaa";die(); echo $form . "正在跳转至乾多多。。。"; exit; } else { die("很遗憾,认购失败,请重试!"); } } else { $borrow_id = $this->_get('bid'); $pre = C('DB_PREFIX'); $borrowinfo = M("transfer_borrow_info b")->join("{$pre}transfer_detail d ON d.borrow_id=b.id")->field(true)->find($borrow_id); $borrowinfo['progress'] = getfloatvalue($borrowinfo['transfer_out'] / $borrowinfo['transfer_total'] * 100, 2); $borrowinfo['need'] = getfloatvalue(($borrowinfo['transfer_total'] - $borrowinfo['transfer_out']) * $borrowinfo['per_transfer'], 2); $borrowinfo['updata'] = unserialize($borrowinfo['updata']); $this->assign("vo", $borrowinfo); $user_info = M('member_money')->field("account_money+back_money as money ")->where("uid='{$this->uid}'")->find(); $this->assign('user_info', $user_info); $paypass = M("members")->field('pin_pass')->where('id=' . $this->uid)->find(); $this->assign('paypass', $paypass['pin_pass']); $this->display(); } }
function projectTheme_template_redirect() { global $wp; global $wp_query, $post, $wp_rewrite; if (isset($_GET['_ad_delete_pid'])) { if (is_user_logged_in()) { $pid = $_GET['_ad_delete_pid']; $pstpst = get_post($pid); global $current_user; get_currentuserinfo(); if ($pstpst->post_author == $current_user->ID or current_user_can('manage_options')) { wp_delete_post($_GET['_ad_delete_pid']); echo "done"; } } exit; } if (isset($_GET['my_upload_of_project_files'])) { get_template_part('lib/upload_main/uploady2'); die; } if (isset($_GET['my_upload_of_project_files_proj'])) { get_template_part('lib/upload_main/uploady5'); die; } if (isset($_GET['my_upload_of_project_files2'])) { get_template_part('lib/upload_main/uploady'); die; } if (isset($_GET['alert_ipn'])) { projectTheme_alert_pay_IPN(); die; } if (isset($_GET['my_upload_of_project_files8'])) { get_template_part('lib/upload_main/uploady8'); die; } if (isset($_GET['complete_paypal_escrow'])) { get_template_part('lib/gateways/complete_paypal_escrow'); die; } if (isset($_GET['get_subcats_for_me'])) { $cat_id = $_POST['queryString']; if (empty($cat_id)) { echo " "; } else { $args2 = "orderby=name&order=ASC&hide_empty=0&parent=" . $cat_id; $sub_terms2 = get_terms('project_cat', $args2); if (count($sub_terms2) > 0) { $ret = '<select class="do_input_new" name="subcat">'; $ret .= '<option value="">' . __('Select Subcategory', 'ProjectTheme') . '</option>'; foreach ($sub_terms2 as $sub_term2) { $sub_id2 = $sub_term2->term_id; $ret .= '<option ' . ($selected == $sub_id2 ? "selected='selected'" : " ") . ' value="' . $sub_id2 . '">' . $sub_term2->name . '</option>'; } $ret .= "</select>"; echo $ret; } } die; } if (isset($_GET['get_locscats_for_me'])) { $cat_id = $_POST['queryString']; if (empty($cat_id)) { echo " "; } else { $args2 = "orderby=name&order=ASC&hide_empty=0&parent=" . $cat_id; $sub_terms2 = get_terms('project_location', $args2); if (count($sub_terms2) > 0) { $ret = '<select class="do_input_new" name="subloc" onchange="display_subcat3(this.value)">'; $ret .= '<option value="">' . __('Select Sublocation', 'ProjectTheme') . '</option>'; foreach ($sub_terms2 as $sub_term2) { $sub_id2 = $sub_term2->term_id; $ret .= '<option ' . ($selected == $sub_id2 ? "selected='selected'" : " ") . ' value="' . $sub_id2 . '">' . $sub_term2->name . '</option>'; } $ret .= "</select>"; echo $ret; } } die; } if (isset($_GET['set_image_for_term'])) { if (is_user_logged_in()) { $term_id = $_GET['term_id']; $attachment_id = $_GET['attachment_id']; update_post_meta($attachment_id, 'category_image', $term_id); } die; } //--------------------------- if (isset($_GET['get_locscats_for_me2'])) { $cat_id = $_POST['queryString']; if (empty($cat_id)) { echo " "; } else { $args2 = "orderby=name&order=ASC&hide_empty=0&parent=" . $cat_id; $sub_terms2 = get_terms('project_location', $args2); if (count($sub_terms2) > 0) { $ret = '<select class="do_input_new" name="subloc2" >'; $ret .= '<option value="">' . __('Select Sublocation', 'ProjectTheme') . '</option>'; foreach ($sub_terms2 as $sub_term2) { $sub_id2 = $sub_term2->term_id; $ret .= '<option ' . ($selected == $sub_id2 ? "selected='selected'" : " ") . ' value="' . $sub_id2 . '">' . $sub_term2->name . '</option>'; } $ret .= "</select>"; echo $ret; } } die; } //--------------------------------------------------- if (isset($_GET['redirect_search'])) { if ($_POST['redirect_search'] == "freelancers") { $_SESSION['tt_ss'] = 'freelancers'; $string = "username="******"?" . $string); } else { wp_redirect($ProjectTheme_provider_search_page_id . "&" . $string); } } else { $_SESSION['tt_ss'] = 'projects'; $string = "term=" . urlencode($_POST['input_text_serch']); $ProjectTheme_advanced_search_page_id = get_permalink(get_option('ProjectTheme_advanced_search_page_id')); $perm = ProjectTheme_using_permalinks(); if ($perm == true) { wp_redirect($ProjectTheme_advanced_search_page_id . "?" . $string); } else { wp_redirect($ProjectTheme_advanced_search_page_id . "&" . $string); } } exit; } if (isset($_GET['get_my_project_vl_thing'])) { $pids = $_POST['queryString']; if ($pids == 0) { echo 0; die; } $ar = 1; $bids = Bid::get_by_pid_uid($pids, $uid = '', $single = false, $filters = array("winner='1'", "paid='0'", "outstanding='0'", "delivered='1'")); echo '<select name="uids" onchange="on_winner_sel();" required="">'; foreach ($bids as $key => $bid) { $escrow = Escrow::get_by_field('bid', $bid->id); if (!isset($escrow)) { $user = get_userdata($bid->uid); echo '<option value="' . $bid->uid . '" bid="' . $bid->id . '">' . $user->user_login . '</option>'; } } echo "</select>"; //echo $bid->bid; die; } $my_pid = $post->ID; $parent = $post->post_parent; $paagee = $wp_query->query_vars['my_custom_page_type']; $p_action = $wp_query->query_vars['p_action']; $ProjectTheme_my_account_page_id = get_option('ProjectTheme_my_account_page_id'); $ProjectTheme_post_new_page_id = get_option('ProjectTheme_post_new_page_id'); $ProjectTheme_my_account_page_id = get_option('ProjectTheme_my_account_page_id'); //------------- if (isset($_GET['redir1'])) { $_SESSION['redir1'] = $_GET['redir1']; } if (($parent == $ProjectTheme_my_account_page_id or $my_pid == get_option('ProjectTheme_my_account_milestones_id')) and !empty($my_pid)) { if (!is_user_logged_in()) { wp_redirect(ProjectTheme_login_url()); exit; } } //------------- $ProjectTheme_enable_2_user_tp = get_option('ProjectTheme_enable_2_user_tp'); if ($ProjectTheme_enable_2_user_tp == "yes" && $p_action != 'choose_user_tp') { if (is_user_logged_in()) { global $current_user; get_currentuserinfo(); $user_tp = get_user_meta($current_user->ID, 'user_tp', true); if (empty($user_tp) && !current_user_can('level_10')) { wp_redirect(get_bloginfo('siteurl') . "/?p_action=choose_user_tp"); exit; } } } if ($p_action == "payza_listing") { get_template_part('lib/gateways/payza_listing'); die; } if (isset($_GET['notify_chained'])) { if ($_POST['status'] == "INCOMPLETE") { $trID = $_POST['tracking_id']; $trID = explode("_", $trID); $pid = $trID[0]; update_post_meta($pid, 'outstanding', "1"); //update_post_meta($pid, 'paid_user',"1"); //update_post_meta($pid, "paid_user_date", current_time('timestamp',0)); update_post_meta($pid, "adaptive_done", "started"); $projectTheme_get_winner_bid = projectTheme_get_winner_bid($pid); ProjectTheme_send_email_on_escrow_project_to_bidder($pid, $projectTheme_get_winner_bid->uid, $_POST['amount']); ProjectTheme_send_email_on_escrow_project_to_owner($pid, $_POST['amount']); //$projectTheme_get_winner_bid = projectTheme_get_winner_bid($pid); //ProjectTheme_send_email_when_on_completed_project($pid, $projectTheme_get_winner_bid->uid, $projectTheme_get_winner_bid->bid); } } if (isset($_GET['return_chained'])) { $ret_id = $_GET['return_chained']; $pid_d = get_option('adaptive_payment_ID_thing_' . $ret_id); wp_redirect(get_permalink(get_option('ProjectTheme_my_account_awaiting_completion_id'))); exit; } //------------ if ($my_pid == $ProjectTheme_post_new_page_id) { if (!is_user_logged_in()) { wp_redirect(ProjectTheme_login_url() . '?redirect_to=' . urlencode(get_permalink($ProjectTheme_post_new_page_id))); exit; } global $current_user; get_currentuserinfo(); if (!ProjectTheme_is_user_business($current_user->ID)) { wp_redirect(get_bloginfo('siteurl') . '?contr_error=1'); /*wp_redirect(get_bloginfo('siteurl'));*/ exit; } if (!isset($_GET['projectid'])) { $set_ad = 1; } else { $set_ad = 0; } if (!empty($_GET['projectid'])) { $my_main_post = get_post($_GET['projectid']); if ($my_main_post->post_author != $current_user->ID) { wp_redirect(get_bloginfo('siteurl')); exit; } } if ($set_ad == 1) { $pid = ProjectTheme_get_auto_draft($current_user->ID); wp_redirect(ProjectTheme_post_new_with_pid_stuff_thg($pid)); } get_template_part('lib/post_new_post'); } //------------- if ($my_pid == $ProjectTheme_my_account_page_id) { if (!is_user_logged_in()) { wp_redirect(ProjectTheme_login_url()); exit; } } //---------------------------------------------------- if ($p_action == "choose_user_tp") { get_template_part('lib/choose_user_tp'); die; } if (isset($_GET['autosuggest'])) { get_template_part('autosuggest'); } if ($p_action == "mark_delivered") { get_template_part('lib/my_account/mark_delivered'); die; } if ($p_action == "work_timer") { get_template_part('lib/my_account/work_timer'); die; } if ($p_action == "mark_completed") { get_template_part('lib/my_account/mark_completed'); die; } if ($p_action == "mark_in_progress") { get_template_part('lib/my_account/mark_in_progress'); die; } if ($p_action == "credits_listing") { get_template_part('lib/gateways/credits_listing'); die; } if ($p_action == "relist_this_done") { get_template_part('lib/my_account/relist_this_done'); die; } if ($p_action == "mb_listing_response") { get_template_part('lib/gateways/moneybookers_listing_response'); die; } if ($p_action == "mb_listing") { get_template_part('lib/gateways/moneybookers_listing'); die; } if ($p_action == "paypal_listing") { get_template_part('lib/gateways/paypal_listing'); die; } if ($p_action == "pay_for_project_paypal") { get_template_part('lib/gateways/pay_for_project_paypal'); die; } if ($p_action == "edit_project") { get_template_part('lib/my_account/edit_project'); die; } if ($p_action == "rate_user") { get_template_part('lib/my_account/rate_user'); die; } if ($p_action == "choose_winner") { get_template_part('lib/choose_winner'); die; } if ($p_action == "group_winner") { get_template_part('lib/group_winner'); die; } if ($p_action == "remove_provider") { get_template_part('lib/remove_provider'); die; } if ($p_action == "user_profile") { get_template_part('lib/user-profile'); die; } if ($p_action == "user_feedback") { get_template_part('lib/user-feedback'); die; } if ($p_action == "delete_project") { get_template_part('lib/my_account/delete_project'); die; } if ($p_action == "close_project") { get_template_part('lib/my_account/close_project'); die; } if ($p_action == "repost_project") { get_template_part('lib/my_account/repost_project'); die; } if ($p_action == "paypal_deposit_pay") { get_template_part('lib/gateways/paypal_deposit_pay'); die; } if ($p_action == "payza_deposit_pay") { get_template_part('lib/gateways/payza_deposit_pay'); die; } if ($p_action == "mb_deposit_response") { get_template_part('lib/gateways/mb_deposit_response'); die; } if ($p_action == "mb_deposit_pay") { get_template_part('lib/gateways/mb_deposit_pay'); die; } if ($paagee == "pay_projects_by_credits") { get_template_part('lib/pay-projects-by-credits'); die; } if ($paagee == "show-all-categories") { get_template_part('lib/show-all-categories'); die; } if ($paagee == "show-all-locations") { get_template_part('lib/show-all-locations'); die; } if ($paagee == "post-new") { get_template_part('post-new'); die; } if ($paagee == "pay_paypal") { get_template_part('lib/gateways/paypal'); die; } if ($paagee == "advanced_search") { get_template_part('lib/advanced-search'); die; } if ($paagee == "alert-pay-return") { get_template_part('lib/gateways/alert-pay-return'); die; } if (isset($_GET['get_files_panel'])) { get_template_part('lib/get_files_panel'); die; } if (isset($_GET['get_bidding_panel'])) { get_template_part('lib/bidding-panel'); die; } if (isset($_GET['get_message_board'])) { get_template_part('lib/message-board'); die; } if ($paagee == "all-blog-posts") { get_template_part('lib/blog'); die; } if ($paagee == "all_featured_projects") { get_template_part('lib/all_featured_projects'); die; } if ($paagee == "user_feedback") { get_template_part('lib/user-feedback'); die; } if ($paagee == "buy_now") { get_template_part('lib/buy-now'); die; } if ($paagee == "pay-for-project") { get_template_part('lib/gateways/paypal-project'); die; } if ($paagee == "deposit_pay") { get_template_part('lib/gateways/deposit-pay'); die; } }
public function Invest() { if (!$this->uid) { if ($this->isAjax()) { die("请先登录后投资"); } else { $this->redirect('M/pub/login'); } } $loanconfig = FS("Webconfig/loanconfig"); if ($this->isAjax()) { // ajax提交投资信息 $borrow_id = intval($this->_get('bid')); //$borrow_id ='22'; $invest_money = intval($this->_post('invest_money')); //die($borrow_id); $paypass = $this->_post('paypass'); $invest_pass = isset($_POST['invest_pass']) ? $_POST['invest_pass'] : ''; $binfo = M("borrow_info")->field('borrow_money,borrow_max,has_borrow,has_vouch,borrow_type,borrow_min,money_collect, borrow_uid')->find($borrow_id); $status = checkInvest($this->uid, $borrow_id, $invest_money, $paypass, $invest_pass); if ($status == 'TRUE') { $invest_id = investMoney($this->uid, $borrow_id, $invest_money); if ($invest_id == true) { $orders = date("YmdHi") . $invest_id; $invest_qdd = M("escrow_account")->field('*')->where("uid={$this->uid}")->find(); $borrow_qdd = M("escrow_account")->field('*')->where("uid={$binfo['borrow_uid']}")->find(); $invest_info = M("borrow_investor")->field("reward_money, borrow_fee")->where("id={$invest_id}")->find(); $secodary = ''; import("ORG.Loan.Escrow"); $loan = new Escrow(); if ($invest_info['reward_money'] > 0.0) { // 投标奖励 $secodary[] = $loan->secondaryJsonList($invest_qdd['qdd_marked'], $invest_info['reward_money'], '二次分配', '支付投标奖励'); } if ($invest_info['borrow_fee'] > 0.0) { // 借款管理费 $secodary[] = $loan->secondaryJsonList($loanconfig['pfmmm'], $invest_info['borrow_fee'], '二次分配', '支付平台借款管理费'); } $secodary && ($secodary = json_encode($secodary)); // 投标奖励 $loanList[] = $loan->loanJsonList($invest_qdd['qdd_marked'], $borrow_qdd['qdd_marked'], $orders, $borrow_id, $invest_money, $binfo['borrow_money'], '投标', "对{$borrow_id}号投标", $secodary); $loanJsonList = json_encode($loanList); //$returnURL = C('WEB_URL').U("invest/investReturn"); $returnURL = 'http://' . $_SERVER['HTTP_HOST'] . U("/invest/wapinvestReturn"); $notifyURL = 'http://' . $_SERVER['HTTP_HOST'] . U("invest/notify"); //echo $returnURL." notifyURL:".$notifyURL;die(); //var_dump($loanJsonList);die(); $data = $loan->transfer($loanJsonList, $returnURL, $notifyURL); //var_dump($data);die(); $form = $loan->setForm($data, 'transfer'); echo $form . "正在跳转至乾多多。。。"; //die('TRUE'); exit; //die('TURE'); } elseif ($invest_id) { die($invest_id); } else { die(L('investment_failure')); } } else { die($status); } } else { $borrow_id = $this->_get('bid'); $borrow_info = M("borrow_info")->field('borrow_duration, borrow_money, borrow_interest, borrow_interest_rate, has_borrow, borrow_min, borrow_max, password, repayment_type')->where("id='{$borrow_id}'")->find(); $this->assign('borrow_info', $borrow_info); $this->assign('borrow_pass', $borrow_info . password); $user_info = M('member_money')->field("account_money+back_money as money ")->where("uid='{$this->uid}'")->find(); $this->assign('user_info', $user_info); $paypass = M("members")->field('pin_pass')->where('id=' . $this->uid)->find(); $this->assign('paypass', $paypass['pin_pass']); $this->display(); } }
function ProjectTheme_my_account_payments_area_function() { global $current_user, $wpdb, $wp_query; get_currentuserinfo(); $uid = $current_user->ID; ?> <div id="content" class="account-main-area"> <?php $pg = $_GET['pg']; if (!isset($pg)) { $pg = 'home'; } global $wpdb; if ($_GET['pg'] == 'closewithdrawal') { $id = $_GET['id']; $s = "select * from " . $wpdb->prefix . "project_withdraw where id='{$id}' AND uid='{$uid}'"; $r = $wpdb->get_results($s); if (count($r) == 1) { $row = $r[0]; $amount = $row->amount; $cr = projectTheme_get_credits($uid); projectTheme_update_credits($uid, $cr + $amount); $s = "delete from " . $wpdb->prefix . "project_withdraw where id='{$id}' AND uid='{$uid}'"; $wpdb->query($s); echo '<div class="">'; echo sprintf(__('Request canceled! <a href="%s">Return to payments</a>.', 'ProjectTheme'), get_permalink(get_option('ProjectTheme_my_account_payments_id'))); echo '</div>'; } } if ($_GET['pg'] == 'releasepayment') { $id = $_GET['id']; $escrow = Escrow::get_by_field('id', $id); $bid = Bid::get_by_id($escrow->bid); $s = "select * from " . $wpdb->prefix . "project_escrow where id='{$id}' AND fromid='{$uid}'"; $r = $wpdb->get_results($s); if (count($r) == 1 and $r[0]->released != 1) { $row = $r[0]; $amount = $row->amount; $toid = $row->toid; $pid = $row->pid; $my_pst = get_post($pid); $projectTheme_get_winner_bid = projectTheme_get_winner_bid($pid); ProjectTheme_send_email_when_on_completed_project($pid, $projectTheme_get_winner_bid->uid, $projectTheme_get_winner_bid->bid); //------------------------------------------------------------------------------- $projectTheme_fee_after_paid = get_option('projectTheme_fee_after_paid'); if (!empty($projectTheme_fee_after_paid)) { $deducted = $amount * ($projectTheme_fee_after_paid * 0.01); } else { $deducted = 0; } //------------------------------------------------------------------------------- $cr = projectTheme_get_credits($toid); projectTheme_update_credits($toid, $cr + $amount - $deducted); $reason = sprintf(__('Escrow payment received from <a href="%s">%s</a> for the project <a href="%s">%s</a>', 'ProjectTheme'), ProjectTheme_get_user_profile_link($current_user->ID), $current_user->user_login, get_permalink($my_pst->ID), $my_pst->post_title); projectTheme_add_history_log('1', $reason, $amount, $toid, $uid); if ($deducted > 0) { $reason = sprintf(__('Payment fee for project <a href="%s">%s</a>', 'ProjectTheme'), get_permalink($my_pst->ID), $my_pst->post_title); } projectTheme_add_history_log('0', $reason, $deducted, $toid); //----------------------------- $email = get_bloginfo('admin_email'); $site_name = get_bloginfo('name'); $usr = get_userdata($uid); $usr2 = get_userdata($toid); $subject = __("Money Escrow Completed", 'ProjectTheme'); //$message = sprintf(__("You have released the escrow of: %s","ProjectTheme"), ProjectTheme_get_show_price($amount)); //$message = sprintf(__('Escrow Payment completed, sent %s to <a href="%s">%s</a> for project <a href="%s">%s</a>','ProjectTheme'), $amount, ProjectTheme_get_user_profile_link($usr2->ID), $usr2->user_login, get_permalink($my_pst->ID), $my_pst->post_title); $message = sprintf(__('Escrow Payment completed, sent %s to %s for %s', 'ProjectTheme'), $amount, $usr2->user_login, $my_pst->post_title); ProjectTheme_send_email($usr->user_email, $subject, $message); //($usr->user_email, $subject , $message); //----------------------------- //$usr = get_userdata($toid); $reason = sprintf(__('Escrow Payment completed, sent to <a href="%s">%s</a> for project <a href="%s">%s</a>', 'ProjectTheme'), ProjectTheme_get_user_profile_link($usr2->ID), $usr2->user_login, get_permalink($my_pst->ID), $my_pst->post_title); projectTheme_add_history_log('0', $reason, $amount, $uid, $toid); $subject = __("Money Escrow Completed", "ProjectTheme"); //$message = sprintf(__("You have received the amount of: %s","ProjectTheme"), ProjectTheme_get_show_price($amount)); //$message = sprintf(__('Escrow Payment received $ %s, from <a href="%s">%s</a> for project <a href="%s">%s</a>','ProjectTheme'), $amount, ProjectTheme_get_user_profile_link($usr->ID), $usr->user_login, get_permalink($my_pst->ID), $my_pst->post_title); $message = sprintf(__('Escrow Payment received $ %s, from %s for project %s', 'ProjectTheme'), $amount, $usr->user_login, $my_pst->post_title); ProjectTheme_send_email($usr2->user_email, $subject, $message); //($usr->user_email, $subject , $message); //----------------------------- /* * Update bid and project meta */ $tm = current_time('timestamp', 0); if (!empty($bid)) { Bid::update_meta_by_id($bid->id, 'paid', "1"); Bid::update_meta_by_id($bid->id, 'paid_user_date', $tm); Project::update_postmeta($bid->pid, 'paid_user'); } else { // for old projects update_post_meta($pid, 'paid_user', '1'); update_post_meta($pid, 'paid_user_date', current_time('timestamp', 0)); } $s = "update " . $wpdb->prefix . "project_escrow set released='1', releasedate='{$tm}' where id='{$id}'"; $r = $wpdb->query($s); } echo __('Escrow completed! Redirecting...', 'ProjectTheme'); echo '<br/><br/>'; $url_redir = ProjectTheme_get_payments_page_url('transactions'); //ProjectTheme_get_payments_page_url(); echo '<meta http-equiv="refresh" content="2;url=' . $url_redir . '" />'; } do_action('ProjectTheme_before_payments_in_payments'); $ProjectTheme_enable_credits_wallet = get_option('ProjectTheme_enable_credits_wallet'); if ($ProjectTheme_enable_credits_wallet != 'no') { if ($pg == 'home') { ?> <div class="my_box3"> <div class="box_title"><?php _e("Finances", "ProjectTheme"); ?> </div> <div class="box_content"> <?php $bal = projectTheme_get_credits($uid); echo '<span class="balance">' . __("Your Current Balance is", "ProjectTheme") . ": " . ProjectTheme_get_show_price($bal, 2) . "</span>"; ?> </div> </div> <div class="clear10"></div> <div class="my_box3"> <div class="box_title"><?php _e('What do you want to do ?', 'ProjectTheme'); ?> </div> <div class="box_content"> <ul class="cms_cms"> <?php if (ProjectTheme_is_user_business($uid)) { ?> <li> <a href="<?php echo ProjectTheme_get_payments_page_url('deposit'); ?> " class="green_btn old_mm_k"><?php _e('Deposit Money', 'ProjectTheme'); ?> </a> </li> <?php } ?> <li> <a href="<?php echo ProjectTheme_get_payments_page_url('makepayment'); ?> " class="green_btn old_mm_k"><?php _e('Make Payment', 'ProjectTheme'); ?> </a> </li> <?php if (ProjectTheme_is_user_business($uid)) { ?> <li> <a href="<?php echo ProjectTheme_get_payments_page_url('escrow'); ?> " class="green_btn old_mm_k"><?php _e('Deposit Escrow', 'ProjectTheme'); ?> </a> </li> <?php } ?> <li> <a href="<?php echo ProjectTheme_get_payments_page_url('withdraw'); ?> " class="green_btn old_mm_k"><?php _e('Withdraw Money', 'ProjectTheme'); ?> </a> </li> <li> <a href="<?php echo ProjectTheme_get_payments_page_url('transactions'); ?> " class="green_btn old_mm_k"><?php _e('Transactions', 'ProjectTheme'); ?> </a></li> <!-- <li> <a href="<?php echo ProjectTheme_get_payments_page_url('bktransfer'); ?> " class="green_btn old_mm_k"><?php _e('Bank Transfer Details', 'ProjectTheme'); ?> </a> </li> --> <?php do_action('ProjectTheme_financial_buttons_main'); ?> </ul> </div> </div> <!-- ###################### --> <div class="clear10"></div> <div class="my_box3"> <div class="box_title"><?php _e('Pending Withdrawals', 'ProjectTheme'); ?> </div> <div class="box_content"> <?php global $wpdb; //---------------- $s = "select * from " . $wpdb->prefix . "project_withdraw where done='0' and rejected!='1' AND uid='{$uid}' order by id desc"; $r = $wpdb->get_results($s); if (count($r) == 0) { echo __('No withdrawals pending yet.', 'ProjectTheme'); } else { echo '<table width="100%">'; foreach ($r as $row) { echo '<tr>'; echo '<td>' . date_i18n('d-M-Y H:i:s', $row->datemade) . '</td>'; echo '<td>' . ProjectTheme_get_show_price($row->amount) . '</td>'; echo '<td>' . $row->methods . '</td>'; echo '<td>' . $row->payeremail . '</td>'; echo '<td><a href="' . ProjectTheme_get_payments_page_url('closewithdrawal', $row->id) . '" class="green_btn block">' . __('Close Request', 'ProjectTheme') . '</a></td>'; echo '</tr>'; } echo '</table>'; } ?> </div> </div> <div class="clear10"></div> <div class="my_box3"> <div class="box_title"><?php _e('Rejected Withdrawals', 'ProjectTheme'); ?> </div> <div class="box_content"> <?php global $wpdb; //---------------- $s = "select * from " . $wpdb->prefix . "project_withdraw where done='0' and rejected='1' AND uid='{$uid}' order by id desc"; $r = $wpdb->get_results($s); if (count($r) == 0) { echo __('no withdrawals rejected yet.', 'ProjectTheme'); } else { echo '<table width="100%">'; foreach ($r as $row) { echo '<tr>'; echo '<td>' . date_i18n('d-M-Y H:i:s', $row->datemade) . '</td>'; echo '<td>' . ProjectTheme_get_show_price($row->amount) . '</td>'; echo '<td>' . $row->methods . '</td>'; echo '<td>' . $row->payeremail . '</td>'; echo '<td> </td>'; echo '</tr>'; } echo '</table>'; } ?> </div> </div> <!-- ###################### --> <div class="clear10"></div> <div class="my_box3"> <div class="box_title"><?php _e("Pending Incoming Payments", "ProjectTheme"); ?> </div> <div class="box_content"> <?php $s = "select * from " . $wpdb->prefix . "project_escrow where released='0' AND toid='{$uid}' order by id desc"; $r = $wpdb->get_results($s); if (count($r) == 0) { echo __('No payments pending yet.', 'ProjectTheme'); } else { echo '<table width="100%">'; foreach ($r as $row) { $post = get_post($row->pid); $from = get_userdata($row->fromid); echo '<tr>'; echo '<td>' . $from->user_login . '</td>'; echo '<td>' . $post->post_title . '</td>'; echo '<td>' . date_i18n('d-M-Y H:i:s', $row->datemade) . '</td>'; echo '<td>' . ProjectTheme_get_show_price($row->amount) . '</td>'; echo '</tr>'; } echo '</table>'; } ?> </div> </div> <!-- ###################### --> <?php if (ProjectTheme_is_user_business($uid)) { ?> <div class="clear10"></div> <div class="my_box3"> <div class="box_title"><?php _e('Pending Outgoing Payments', 'ProjectTheme'); ?> </div> <div class="box_content"> <?php $s = "select * from " . $wpdb->prefix . "project_escrow where released='0' AND fromid='{$uid}' order by id desc"; $r = $wpdb->get_results($s); if (count($r) == 0) { echo __('No payments pending yet.', 'ProjectTheme'); } else { echo '<table width="100%">'; echo '<tr>'; echo '<td><b>' . __('User', 'ProjectTheme') . '</b></td>'; echo '<td><b>' . __('Project', 'ProjectTheme') . '</b></td>'; echo '<td><b>' . __('Date', 'ProjectTheme') . '</b></td>'; echo '<td><b>' . __('Amount', 'ProjectTheme') . '</b></td>'; echo '<td><b>' . __('Options', 'ProjectTheme') . '</b></td>'; echo '</tr>'; foreach ($r as $row) { $post = get_post($row->pid); $from = get_userdata($row->toid); echo '<tr>'; echo '<td><a href="' . ProjectTheme_get_user_profile_link($from->ID) . '">' . $from->user_login . '</a></td>'; echo '<td><a href="' . get_permalink($post->ID) . '">' . $post->post_title . '</a></td>'; echo '<td>' . date_i18n('d-M-Y H:i:s', $row->datemade) . '</td>'; echo '<td>' . ProjectTheme_get_show_price($row->amount) . '</td>'; echo '<td><a href="' . ProjectTheme_get_payments_page_url('releasepayment', $row->id) . '" class="green_btn block">' . __('Release Payment', 'ProjectTheme') . '</a></td>'; echo '</tr>'; } echo '</table>'; } ?> </div> </div> <?php } ?> <?php } elseif ($pg == 'escrow') { ?> <div class="my_box3"> <div class="box_title"><?php _e('Make Escrow Payment', 'ProjectTheme'); ?> </div> <div class="box_content"> <?php $bal = projectTheme_get_credits($uid); if (isset($_POST['escrowme'])) { $amount = $_POST['amount']; $projects = $_POST['projectss']; $bid_id = $_POST['bid_id']; /*$amount_and_ids = explode(',', $_POST['amount_and_ids']); $amount = $amount_and_ids[0]*1; */ if (!is_numeric($amount) || $amount <= 0) { echo '<div class="newproject_error">' . __('Enter a valid amount.', 'ProjectTheme') . '</div>'; } else { if (empty($projects)) { echo '<div class="newproject_error">' . __('Please choose a project.', 'ProjectTheme') . '</div>'; } else { if ($bal < $amount) { echo '<div class="newproject_error">' . __('Your balance is smaller than the amount requested.', 'ProjectTheme') . '</div>'; } else { $post = get_post($projects); // $uid2 = get_post_meta($projects, "winner", true); $bid = Bid::get_by_id($bid_id); $uid2 = $bid->uid; $tm = $_POST['tm']; if (empty($tm)) { $tm = current_time('timestamp', 0); } if ($post->post_author != $uid) { $uid2 = $post->post_author; } $uid2 = $_POST['uids']; //----------------------- $email = get_bloginfo('admin_email'); $site_name = get_bloginfo('name'); $usr = get_userdata($uid); $subject = __("Money Escrow Sent", "ProjectTheme"); $message = sprintf(__("You have placed in escrow the amount of: %s to user: \n\t\t\t\t\t\t\t<b>%s</b>", "ProjectTheme"), ProjectTheme_get_show_price($amount), $username); //($usr->user_email, $subject , $message); $s = "select * from " . $wpdb->prefix . "project_escrow where datemade='{$tm}' and fromid='{$uid}' AND bid='{$bid->id}'"; $rr = $wpdb->get_results($s); if (count($rr) == 0) { $s = "insert into " . $wpdb->prefix . "project_escrow (datemade, amount, fromid, toid, pid, bid) \n\t\t\t\t\t\t\t\tvalues('{$tm}','{$amount}','{$uid}','{$uid2}','{$projects}', '{$bid->id}')"; $wpdb->query($s); // for logged in user, the user who sends //====================================================== $cr = projectTheme_get_credits($uid); projectTheme_update_credits($uid, $cr - $amount); } //====================================================== // for other user, the user who receives //====================================================== $usr2 = get_userdata($uid2); $subject = __("Money Escrow Received", "ProjectTheme"); $message = sprintf(__("You have received in escrow the amount of: \$ %s from user: <b>%s</b>", "ProjectTheme"), ProjectTheme_get_show_price($amount), $usr->user_login); //($usr2->user_email, $subject , $message); //====================================================== echo '<div class="saved_thing">' . __('Your payment has been sent. Redirecting...', 'ProjectTheme') . '</div>'; $url_redir = get_permalink(get_option('ProjectTheme_my_account_payments_id')); echo '<meta http-equiv="refresh" content="2;url=' . $url_redir . '" />'; } } } } $bal = projectTheme_get_credits($uid); echo '<span class="balance">' . sprintf(__('Your Current Balance is: %s', 'ProjectTheme'), ProjectTheme_get_show_price($bal)) . "</span>"; echo ' <a class="post_bid_btn" href="' . ProjectTheme_get_payments_page_url_redir('deposit') . '">' . __('Add More Credits', 'ProjectTheme') . '</a>'; echo "<br/><br/>"; ?> <script> function on_proj_sel() { var sel_value = jQuery("#my_proj_sel").val(); $.post("<?php bloginfo('siteurl'); ?> /?get_my_project_vl_thing=1", {queryString: ""+sel_value+""}, function(data){ if(data.length >0) { //var currency = '<?php echo ProjectTheme_get_currency(); ?> '; /*jQuery("#my_escrow_amount").html(currency + data); jQuery("#amount").val(data);*/ jQuery("#win_providers").html(data); on_winner_sel(); } }); } function on_winner_sel(){ var uid = jQuery('select[name=uids]').val(); var bid = jQuery('select[name=uids]').children('option[value='+uid+']').attr('bid'); jQuery('#bid_id').val(bid); } <?php if (!empty($_GET['poid'])) { ?> jQuery(function() { on_proj_sel(); }); <?php } ?> /*jQuery(document).ready(function(){ jQuery('#make_esc_providers').submit(function(){ jQuery("#amount").val(jQuery('#win_providers').val()); }); });*/ </script> <br /><br /> <form id="make_esc_providers" name="form1" method="post" onsubmit="on_winner_sel(); return vali();" action=""> <table> <input type="hidden" value="<?php echo current_time('timestamp', 0); ?> " name="tm" /> <tr> <td width="150"><?php _e('Escrow amount', 'ProjectTheme'); ?> :</td><td> <input value="0" size="10" name="amount" id="amount" type="text" /> <!-- <span id="my_escrow_amount"><?php _e('Select your project.', 'ProjectTheme'); ?> </span> --></td> </tr> <tr> <td><?php _e('Escrow for Project', 'ProjectTheme'); ?> :</td><td> <?php $st = ProjectTheme_get_my_awarded_projects($uid); if ($st == false) { echo '<strong>' . __('You dont have any awarded projects.', 'ProjectTheme') . '</strong>'; } else { echo $st; } ?> </td> </tr> <tr> <td><?php _e('Escrow for<br>QA Engineer', 'ProjectTheme'); ?> :</td><td id="win_providers"><input type="text"/></td> </tr> <tr> <td> <input hidden id="bid_id" name="bid_id" value=""/> </td> <td> <input type="submit" name="escrowme" value="<?php _e('Make Escrow', 'ProjectTheme'); ?> " /></td></tr></table></form> </div> </div> <!-- ----code updation-----> <script> function vali() { var amount=document.form1.amount.value; var decimal= /^\s*-?[1-9]\d*(\.\d{1,2})?\s*$/; var am=decimal.test(amount); if(am==false) { alert("please enter 2 digit decimal point"); document.form1.amount.focus(); return false; } } </script> <?php } elseif ($pg == 'bktransfer') { ?> <div class="my_box3"> <div class="box_title"><?php _e('Set your Bank Transfer Details', 'ProjectTheme'); ?> </div> <div class="box_content"> <?php $bal = projectTheme_get_credits($uid); if (isset($_POST['bank_details'])) { $bank_details = $_POST['bank_details']; update_user_meta($uid, 'bank_details', $bank_details); echo __("Saved", "ProjectTheme"); } ?> <br /><br /> <table> <form method="post"> <tr> <td valign="top"><?php _e("Bank details", "ProjectTheme"); ?> :</td> <td> <textarea cols="60" name="bank_details" rows="6"><?php echo get_user_meta($uid, 'bank_details', true); ?> </textarea></td> </tr> <tr> <td></td> <td> <input type="submit" name="submit" value="<?php _e("Save Details", "ProjectTheme"); ?> " /></td></tr></form></table> </div> </div> <?php } elseif ($pg == 'makepayment') { ?> <div class="my_box3"> <div class="box_title"><?php echo __("Make Payment", "ProjectTheme"); ?> </div> <div class="box_content"> <?php $bal = projectTheme_get_credits($uid); if (isset($_POST['payme'])) { $amount = $_POST['amount']; $username = $_POST['username']; $username_select = $_POST['projectss']; if (!is_numeric($amount) || $amount < 0) { echo '<div class="newproject_error">' . __('ERROR: Enter a valid amount.', 'ProjectTheme') . '</div>'; } else { if (projectTheme_username_is_valid($username) == false && empty($username_select)) { echo '<div class="newproject_error">' . __('ERROR: Invalid username provided.', 'ProjectTheme') . '</div>'; } else { if ($username == $current_user->user_login) { echo '<div class="newproject_error">' . __('ERROR: You cannot transfer money to your own account.', 'ProjectTheme') . '</div>'; } else { $min = get_option('project_theme_transfer_limit'); if (empty($min)) { $min = 1; } if ($bal < $amount) { echo '<div class="newproject_error">' . __('ERROR: Your balance is smaller than the amount requested.', 'ProjectTheme') . '</div>'; } else { if ($amount < $min) { echo '<div class="newproject_error">' . sprintf(__('ERROR: The amount should not be less than %s', 'ProjectTheme'), ProjectTheme_get_show_price($min)) . '.</div>'; } else { $tm = current_time('timestamp', 0); $uid2 = projectTheme_get_userid_from_username($username); $usr2 = get_userdata($uid2); if (!empty($username_select)) { $uid2 = $username_select; $usr2 = get_userdata($uid2); /*$username = $username->user_login;*/ } // for logged in user, the user who sends //====================================================== $cr = projectTheme_get_credits($uid); projectTheme_update_credits($uid, $cr - $amount); //----------------------- $email = get_bloginfo('admin_email'); $site_name = get_bloginfo('name'); $usr = get_userdata($uid); $subject = __("Money Sent", "ProjectTheme"); //$message = sprintf(__("You have sent amount of: %s to user: <b>%s</b>","ProjectTheme") //$message = sprintf(__('You have sent the amount of $%s to the user <a href="%s">%s</a>','ProjectTheme'), $amount, ProjectTheme_get_user_profile_link($usr2->ID), $usr2->user_login); $message = sprintf(__('You have sent the amount of $%s to the user %s', 'ProjectTheme'), $amount, $usr2->user_login); //,ProjectTheme_get_show_price($amount),$usr2->user_login); ProjectTheme_send_email($usr->user_email, $subject, $message); $subject = __("Money received", "ProjectTheme"); $message = sprintf(__('You have received amount of: $%s from user %s', 'ProjectTheme'), $amount, $usr->user_login); //$message = sprintf(__('You have received amount of: $%s from user <a href="%s">%s</a>','ProjectTheme'), $amount, ProjectTheme_get_user_profile_link($usr->ID), $usr->user_login); //$message = sprintf(__("You have sent amount of: %s to user: <b>%s</b>","ProjectTheme") //,ProjectTheme_get_show_price($amount),$usr2->user_login); ProjectTheme_send_email($usr2->user_email, $subject, $message); //($usr->user_email, $subject , $message); $reason = sprintf(__('Amount transfered to user <a href="%s">%s</a>', 'ProjectTheme'), ProjectTheme_get_user_profile_link($usr2->ID), $usr2->user_login); projectTheme_add_history_log('0', $reason, $amount, $uid, $uid2); //====================================================== // for other user, the user who receives //====================================================== $cr = projectTheme_get_credits($uid2); projectTheme_update_credits($uid2, $cr + $amount); $subject = __("Money Received", "ProjectTheme"); $message = sprintf(__("You have received amount of: \$ %s from user: <b>%s</b>", "ProjectTheme"), ProjectTheme_get_show_price($amount), $usr->user_login); //($usr2->user_email, $subject , $message); $reason = sprintf(__('Amount transfered from user <a href="%s">%s</a>', 'ProjectTheme'), ProjectTheme_get_user_profile_link($usr->ID), $usr->user_login); projectTheme_add_history_log('1', $reason, $amount, $uid2, $uid); //====================================================== echo '<div class="saved_thing">' . __('Your payment has been sent. Redirecting...', 'ProjectTheme') . '</div>'; $url_redir = get_permalink(get_option('ProjectTheme_my_account_payments_id')); echo '<meta http-equiv="refresh" content="2;url=' . $url_redir . '" /><br/>'; } } } } } } global $current_user; get_currentuserinfo(); $uid = $current_user->ID; $bal = projectTheme_get_credits($uid); echo '<span class="balance">' . sprintf(__("Your Current Balance is %s", ""), ProjectTheme_get_show_price($bal)) . ":</span><br/><br/>"; ?> <br /><br /> <table> <form method="post" name="form1" id="form1" onsubmit="return vali();" enctype="application/x-www-form-urlencoded"> <tr> <td><?php echo __("Payment amount", "ProjectTheme"); ?> :</td> <td> <?php echo projectTheme_currency(); ?> <input value="<?php echo $_POST['amount']; ?> " type="text" size="10" name="amount" id="amount" /> </td> </tr> <tr> <td><?php echo __("Pay to user", "ProjectTheme"); ?> :</td> <td><input value="<?php echo $_POST['username']; ?> " type="text" size="30" name="username" /> <?php $trg = ProjectTheme_get_my_awarded_projects2($uid); if ($trg) { _e('or', 'ProjectTheme') . " "; echo ProjectTheme_get_my_awarded_projects2($uid); } ?> </td> </tr> <script type="text/javascript"> $(document).ready(function(){ $('select[name="projectss"]').on("change",function(){ $('input[name="username"]').val($('option[value="'+$(this).val()+'"]').text()); }); $('input[name="username"]').on("change",function(){ $('select[name="projectss"]').val(''); }); }); // $(document).ready(function(){ // $('#form1').submit(function() { // var text = $('input[name="username"]').val(); // var sel = $('select[name="projectss"]').val(); // var sel_text = $('option[value="'+$(this).val()+'"]').text(); // if (sel != '' && sel_text != text){ // alert("<?php // _e("You cannot send payments to multiple different users at the same time.","ProjectTheme"); ?> "); // return false; // } // return true; // return false to cancel form action // }); // }); </script> <tr> <td></td> <td> <input type="submit" name="payme" value="<?php echo __("Make Payment", "ProjectTheme"); ?> " /></td></tr></form></table> </div> </div> <!-- ----code updation-----> <script> function vali() { var amount=document.form1.amount.value; var decimal= /^\s*-?[1-9]\d*(\.\d{1,2})?\s*$/; var am=decimal.test(amount); if(am==false) { alert("please enter 2 digit decimal point"); document.form1.amount.focus(); return false; } } </script> <?php } elseif ($pg == 'withdraw') { ?> <div class="my_box3"> <div class="box_title"><?php _e("Request Withdrawal", "ProjectTheme"); ?> </div> <div class="box_content"> <?php $bal = projectTheme_get_credits($uid); echo '<span class="balance">'; printf(__('Your Current Balance is: %s', 'ProjectTheme'), ProjectTheme_get_show_price($bal)); echo "</span><br/><br/>"; do_action('ProjectTheme_add_new_withdraw_posts'); if (isset($_POST['withdraw']) or isset($_POST['withdraw2']) or isset($_POST['withdraw3'])) { function isDomainAvailible($domain) { if (!filter_var($domain, FILTER_VALIDATE_URL)) { return false; } $curlInit = curl_init($domain); curl_setopt($curlInit, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($curlInit, CURLOPT_HEADER, true); curl_setopt($curlInit, CURLOPT_NOBODY, true); curl_setopt($curlInit, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($curlInit); curl_close($curlInit); if ($response) { return true; } return false; } $amount = $_POST['amount']; $paypal = $_POST['paypal']; $meth = $_POST['meth']; if (isset($_POST['withdraw2'])) { $amount = $_POST['amount2']; $paypal = $_POST['paypal2']; $meth = $_POST['meth2']; } if (isset($_POST['withdraw3'])) { $amount = $_POST['amount3']; $paypal = $_POST['paypal3']; $meth = $_POST['meth3']; } $em_dom = strstr(trim($paypal), '@'); $em_dom = str_replace('@', '', $em_dom); if (!is_numeric($amount) || $amount < 0) { echo '<br/><span class="newproject_error">' . __('Enter a valid amount.', 'ProjectTheme') . '</span><br/>'; } else { if (project_isValidEmail($paypal) == false && !isDomainAvailible($em_dom)) { echo '<br/><span class="newproject_error">' . __('Invalid email provided.', 'ProjectTheme') . '</span><br/>'; } else { $min = get_option('project_theme_min_withdraw'); if (empty($min)) { $min = 25; } if ($bal < $amount) { echo '<br/><span class="newproject_error">' . __('Your balance is smaller than the amount requested.', 'ProjectTheme') . '</span><br/>'; } else { if ($amount < $min) { echo '<br/><span class="newproject_error">' . sprintf(__('The amount should not be less than %s', 'ProjectTheme'), projecttheme_get_show_price($min)) . '.</span><br/>'; } else { $tm = current_time('timestamp', 0); global $wpdb; $wpdb->show_errors = true; if (!empty($_POST['tm'])) { $tm = $_POST['tm']; //current_time('timestamp',0); } $s = "select * from " . $wpdb->prefix . "project_withdraw where uid='{$uid}' and datemade='{$tm}' "; $r = $wpdb->get_results($s); if (count($r) == 0) { $s = "insert into " . $wpdb->prefix . "project_withdraw (methods, payeremail, amount, datemade, uid, done) \n\t\t\t\t\t\t\t\tvalues('{$meth}','{$paypal}','{$amount}','{$tm}','{$uid}','0')"; $wpdb->query($s); if (!empty($wpdb->last_error)) { echo $wpdb->last_error; exit; } $cr = projectTheme_get_credits($uid); projectTheme_update_credits($uid, $cr - $amount); } //----------------------- $email = get_bloginfo('admin_email'); $site_name = get_bloginfo('name'); $usr = get_userdata($uid); $subject = __("Money Withdraw Requested", "ProjectTheme"); $message = sprintf(__("You have requested a new withdrawal of: %s", "ProjectTheme"), $amount . " " . projectTheme_currency()); //($usr->user_email, $subject , $message); //----------------------- echo '<div class="saved_thing">' . __('Your request has been queued. Redirecting...', 'ProjectTheme') . '</div>'; $url_redir = get_permalink(get_option('ProjectTheme_my_account_payments_id')); echo '<meta http-equiv="refresh" content="2;url=' . $url_redir . '" />'; } } } } } global $current_user; get_currentuserinfo(); $uid = $current_user->ID; $opt = get_option('ProjectTheme_paypal_enable'); if ($opt == "yes") { ?> <br /><br /> <!-- ----code updation-----> <script> function vali() { var amount=document.form1.amount.value; var decimal= /^\s*-?[1-9]\d*(\.\d{1,2})?\s*$/; var am=decimal.test(amount); if(am==false) { alert("please enter 2 digit decimal point"); document.form1.amount.focus(); return false; } } </script> <table> <form method="post" enctype="application/x-www-form-urlencoded" action="" name="form1" id="form1" onsubmit="return vali();"> <input type="hidden" name="meth" value="PayPal" /> <input type="hidden" name="tm" value="<?php echo current_time('timestamp', 0); ?> " /> <tr> <td><?php echo __("Withdraw amount", "ProjectTheme"); ?> :</td> <td> <?php echo projectTheme_currency(); ?> <input value="<?php echo $_POST['amount']; ?> " type="text" size="10" name="amount" id="amount" /></td> </tr> <tr> <td><?php echo __("PayPal Email", "ProjectTheme"); ?> :</td> <td><input value="<?php echo get_user_meta($uid, 'paypal_email', true); ?> " type="text" size="30" name="paypal" /></td> </tr> <tr> <td></td> <td> <input type="submit" name="withdraw" value="<?php echo __("Withdraw", "ProjectTheme"); ?> " /></td></tr></form></table> <!-- ---- end code updation-----> <?php } $opt = get_option('ProjectTheme_moneybookers_enable'); if ($opt == "yes") { ?> <br /><br /> <table> <form method="post" name="form1" enctype="application/x-www-form-urlencoded" onsubmit="raturn vali();"> <input type="hidden" name="meth2" value="Moneybookers" /> <input type="hidden" name="tm" value="<?php echo current_time('timestamp', 0); ?> " /> <tr> <td><?php echo __("Withdraw amount", "ProjectTheme"); ?> :</td> <td><?php echo projectTheme_currency(); ?> <input value="<?php echo $_POST['amount2']; ?> " type="text" size="10" name="amount2" id="amount" /> </td> </tr> <tr> <td><?php echo __("Moneybookers Email", "ProjectTheme"); ?> :</td> <td><input value="<?php echo get_user_meta($uid, 'moneybookers_email', true); ?> " type="text" size="30" name="paypal2" /></td> </tr> <tr> <td></td> <td> <input type="submit" name="withdraw2" value="<?php echo __("Withdraw", "ProjectTheme"); ?> " /></td></tr></form></table> <!-- ----code updation-----> <script> function vali() { var amount=document.form1.amount.value; var decimal= /^\s*-?[1-9]\d*(\.\d{1,2})?\s*$/; var am=decimal.test(amount); if(am==false) { alert("please enter 2 digit decimal point"); document.form1.amount.focus(); return false; } } </script> <?php } $opt = get_option('ProjectTheme_alertpay_enable'); if ($opt == "yes") { ?> <br /><br /> <table> <form method="post" name="form1" id="form1" onsubmit="return vali();" enctype="application/x-www-form-urlencoded"> <input type="hidden" name="meth3" value="Payza" /> <tr> <td><?php echo __("Withdraw amount", "ProjectTheme"); ?> :</td> <td> <?php echo projectTheme_currency(); ?> <input value="<?php echo $_POST['amount3']; ?> " type="text" size="10" name="amount3" id="amount"/></td> </tr> <tr> <td><?php echo __("Payza Email", "ProjectTheme"); ?> :</td> <td><input value="<?php echo get_user_meta($uid, 'payza_email', true); ?> " type="text" size="30" name="paypal3" /></td> </tr> <tr> <td></td> <td> <input type="submit" name="withdraw3" value="<?php echo __("Withdraw", "ProjectTheme"); ?> " /></td></tr></form></table> <?php } ?> <?php do_action('ProjectTheme_add_new_withdraw_methods'); ?> </div> </div> <?php } elseif ($pg == 'deposit') { global $USERID; $USERID = $uid; ?> <div class="my_box3"> <div class="box_title"><?php _e('Deposit Money', 'ProjectTheme'); ?> </div> <div class="box_content"> <?php $ProjectTheme_bank_details_enable = get_option('ProjectTheme_bank_details_enable'); if ($ProjectTheme_bank_details_enable == "yes") { ?> <strong><?php _e('Deposit money by Bank Transfer', 'ProjectTheme'); ?> </strong><br/><br/> <?php echo get_option('ProjectTheme_bank_details_txt'); ?> <br/><br/> <?php } ?> <?php $ProjectTheme_paypal_enable = get_option('ProjectTheme_paypal_enable'); if ($ProjectTheme_paypal_enable == "yes") { ?> <strong><?php _e('Deposit money by PayPal', 'ProjectTheme'); ?> </strong><br/><br/> <form method="post" name="form1" id="form1" onsubmit="return vali();" action="<?php bloginfo('siteurl'); ?> /?p_action=paypal_deposit_pay"> <?php _e("Amount to deposit:", "ProjectTheme"); ?> <?php echo projectTheme_currency(); ?> <input type="text" size="10" name="amount" id="amount" /> <input type="submit" name="deposit" value="<?php _e('Deposit', 'ProjectTheme'); ?> " /></form> <br/><br/> <?php } ?> <!-- ################## --> <!-- ----code updation-----> <script> function vali() { var amount=document.form1.amount.value; var decimal= /^\s*-?[1-9]\d*(\.\d{1,2})?\s*$/; var am=decimal.test(amount); if(am==false) { alert("please enter 2 digit decimal point"); document.form1.amount.focus(); return false; } } </script> <?php $ProjectTheme_alertpay_enable = get_option('ProjectTheme_alertpay_enable'); if ($ProjectTheme_alertpay_enable == "yes") { ?> <strong><?php _e('Deposit money by Payza', 'ProjectTheme'); ?> </strong><br/><br/> <form method="post" name="form1" id="form1" onsubmit="return vali();" action="<?php bloginfo('siteurl'); ?> /?p_action=payza_deposit_pay"> <?php _e("Amount to deposit:", "ProjectTheme"); ?> <?php echo projectTheme_currency(); ?> <input type="text" size="10" name="amount" /> <input type="submit" name="deposit" value="<?php _e('Deposit', 'ProjectTheme'); ?> " /></form> <br/><br/> <?php } ?> <?php $ProjectTheme_moneybookers_enable = get_option('ProjectTheme_moneybookers_enable'); if ($ProjectTheme_moneybookers_enable == "yes") { ?> <strong><?php _e('Deposit money by Moneybookers', 'ProjectTheme'); ?> </strong><br/><br/> <form method="post" name="form1" id="form1" onsubmit="return vali();" action="<?php bloginfo('siteurl'); ?> /?p_action=mb_deposit_pay"> <?php _e("Amount to deposit:", "ProjectTheme"); ?> <?php echo projectTheme_currency(); ?> <input type="text" size="10" name="amount" id="amount" /> <input type="submit" name="deposit" value="<?php _e('Deposit', 'ProjectTheme'); ?> " /></form> <br/><br/> <?php } ?> <?php do_action('ProjectTheme_deposit_methods', $uid); ?> </div> </div> <?php } elseif ($pg == 'transactions') { ?> <div class="my_box3"> <div class="box_title"><?php _e('Payment Transactions', 'ProjectTheme'); ?> </div> <div class="box_content"> <?php $s = "select * from " . $wpdb->prefix . "project_payment_transactions where uid='{$uid}' order by id desc"; $r = $wpdb->get_results($s); if (count($r) == 0) { echo __('No activity yet.', 'ProjectTheme'); } else { $i = 0; echo '<table width="100%" cellpadding="5">'; foreach ($r as $row) { if ($row->tp == 0) { $class = "redred"; $sign = "-"; } else { $class = "greengreen"; $sign = "+"; } echo '<tr style="background:' . ($i % 2 ? "#f2f2f2" : "#f9f9f9") . '" >'; echo '<td>' . $row->reason . '</td>'; echo '<td width="25%">' . date_i18n('d-M-Y H:i:s', $row->datemade) . '</td>'; echo '<td width="20%" class="' . $class . '"><b>' . $sign . ProjectTheme_get_show_price($row->amount) . '</b></td>'; echo '</tr>'; $i++; } echo '</table>'; } ?> </div> </div> <?php } } ?> </div> <!-- end dif content --> <script type="text/javascript"> $(document).ready(function(){ $('input[name="deposit"]').click(function(ev){ ev.preventDefault(); var amount = $(this).parent().find('input[name="amount"]').val(); console.log(amount); if (amount>0){ $(this).parent().submit(); } else{ $(this).prev().css('border-color','red'); } }); $( 'input[name="amount"]' ).keypress(function( event ) { var kk = event.which; console.log(kk); if((kk>47 && kk<58) || kk==13 || kk==0 || kk==8 || kk==46){ return true; } else{ return false; } }); }); </script> <?php ProjectTheme_get_users_links(); ?> <?php }
public function authorizenotify() { $MoneymoremoreId = $_POST["MoneymoremoreId"]; $PlatformMoneymoremore = $_POST["PlatformMoneymoremore"]; $AuthorizeTypeOpen = $_POST["AuthorizeTypeOpen"]; $AuthorizeTypeClose = $_POST["AuthorizeTypeClose"]; $AuthorizeType = $_POST["AuthorizeType"]; $RandomTimeStamp = $_POST["RandomTimeStamp"]; $Remark1 = $_POST["Remark1"]; $Remark2 = $_POST["Remark2"]; $Remark3 = $_POST["Remark3"]; $ResultCode = $_POST["ResultCode"]; $SignInfo = $_POST["SignInfo"]; //$dataStr = //$MoneymoremoreId.$PlatformMoneymoremore.$AuthorizeTypeOpen.$AuthorizeTypeClose.$AuthorizeType.$RandomTimeStamp.$Remark1.$Remark2.$Remark3.$ResultCode; import("ORG.Loan.Escrow"); $loan = new Escrow(); if ($verifySignature = $loan->Authorizenotify($_POST)) { } $model = M('escrow_account'); //dump($AuthorizeTypeOpen); $Open = explode(',', $AuthorizeTypeOpen); $close = explode(',', $AuthorizeTypeClose); if ($ResultCode == '88') { if (is_array($Open)) { if (in_array('1', $Open)) { $auth['invest_auth'] = '1'; } if (in_array('2', $Open)) { $auth['repayment'] = '1'; } if (in_array('3', $Open)) { $auth['secondary_percent'] = '1'; } } if (is_array($close)) { if (in_array('1', $close)) { $auth['invest_auth'] = '0'; } if (in_array('2', $close)) { $auth['repayment'] = '0'; } if (in_array('3', $close)) { $auth['secondary_percent'] = '0'; } } //dump($auth); $nid = $model->where("uid=" . $this->uid)->save($auth); //dump($nid);exit; } }
/** ** 转账 ** **/ public function transfer() { import("ORG.Loan.Escrow"); $loan = new Escrow(); if ($loan->loanVerify($_POST) && $_POST['ResultCode'] == 88) { if (empty($_POST['Action'])) { //空为冻结 暂不处理 notifyMsg('转账冻结', $_POST, 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'SUCCESS'); echo "SUCCESS"; exit; } elseif (intval($_POST['Action']) == 1) { $loan_list = json_decode(urldecode($_POST['LoanJsonList']), true); isset($loan_list[0]) ? $transfer_info = $loan_list[0] : ($transfer_info = $loan_list); $orders = $transfer_info['OrderNo']; $transfer = M('transfer')->field('status, loanno, uid')->where("orders='{$orders}'")->find(); if ($transfer['status'] != 1) { $arr['status'] = 1; $arr['loanno'] = $transfer_info['LoanNo']; if (M('transfer')->where("orders='{$orders}'")->save($arr)) { if (membermoneylog($transfer['uid'], 7, $transfer_info['Amount'], $transfer_info['Remark'], 0, "@网站管理员@")) { notifyMsg('转账', $_POST, 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'SUCCESS'); echo "SUCCESS"; exit; } else { $arr['status'] = 0; //$arr['loanno'] = $transfer['LoanNo']; M('transfer')->where("orders='{$orders}'")->save($arr); notifyMsg('转账', $_POST, 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'ERROR'); } } } } notifyMsg('转账', $_POST, 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], ''); } }
public function tinvestmoney() { $jsoncode = file_get_contents("php://input"); //alogsm("tinvestmoney",0,1,session("u_id").$jsoncode); if (!$this->uid) { ajaxmsg('请先登录', 0); exit; } $arr = array(); $arr = json_decode($jsoncode, true); if (intval($arr['uid']) != $this->uid) { ajaxmsg("查询错误!", 0); } if (!is_array($arr) || empty($arr) || empty($arr['borrow_id']) || empty($arr['zhifu_money']) || $arr['type'] != 2) { ajaxmsg("查询错误!", 0); } $_pin = $arr['pin']; $_month = $arr['month']; $borrow_id = $arr['borrow_id']; $month = intval($_month); $binfo = M("transfer_borrow_info")->field("borrow_max,borrow_uid,borrow_interest_rate,transfer_out,transfer_back,transfer_total,per_transfer,is_show,deadline,min_month,increase_rate,reward_rate,borrow_duration,borrow_money")->find($borrow_id); //$_tnum = $arr['zhifu_money']/$binfo['per_transfer']; $tnum = $arr['zhifu_money'] / $binfo['per_transfer']; $m = M("member_money")->field('account_money,back_money,money_collect')->find($this->uid); $amoney = $m['account_money'] + $m['back_money']; $uname = session("u_user_name"); //ajaxmsg($binfo);die; if ($this->uid == $binfo['borrow_uid']) { ajaxmsg("不能去投自己的标", 0); } $max_month = $binfo['borrow_duration']; //getTransferLeftmonth($binfo['deadline']); $min_month = $binfo['min_month']; $max_num = $binfo['transfer_total'] - $binfo['transfer_out']; if ($tnum < 1) { ajaxmsg("购买份数必须大于等于1份!" . $binfo['per_transfer'], 0); } if ($month < $min_month || $max_month < $month) { ajaxmsg("本标认购期限只能在'" . $min_month . "个月---" . $max_month . "个月'之间", 0); } //echo $max_num;die(); // echo $tnum;die(); //echo $max_num;die(); if ($max_num * $binfo['per_transfer'] < $tnum * $binfo['per_transfer']) { ajaxmsg("本标还能认购最大金额为" . $max_num . "元,请重新输入认购金额", 0); } $map['i.investor_uid'] = $this->uid; $map['i.status'] = 1; $map['i.borrow_id'] = $borrow_id; $map['i.loanno'] = array('neq', ''); $list = getttenderlist($map, 15); $invested_money_t = $tnum * $binfo['per_transfer'] + $list['total_money']; if ($binfo['borrow_max'] != 0) { if ($binfo['borrow_max'] * $binfo['per_transfer'] < $invested_money_t) { ajaxmsg("本标个人认购最大金额为" . $binfo['borrow_max'] * $binfo['per_transfer'] . "元", 0); } } $money = $tnum; if ($amoney < $money) { ajaxmsg("尊敬的{$uname},您准备认购{$money}元,但您的账户可用余额为{$amoney}元,请先去充值再认购", 0); } $vm = getMinfo($this->uid, "m.pin_pass,mm.invest_vouch_cuse,mm.money_collect"); $pin_pass = $vm['pin_pass']; $pin = md5($_pin); $tinvest_id = TinvestMoney($this->uid, $borrow_id, $tnum, $month); //投企业直投 if ($tinvest_id) { $loanconfig = FS("Webconfig/loanconfig"); $orders = date("YmdHi") . $tinvest_id; // 发送到乾多多 $invest_qdd = M("escrow_account")->field('*')->where("uid={$this->uid}")->find(); $borrow_qdd = M("escrow_account")->field('*')->where("uid={$binfo['borrow_uid']}")->find(); $invest_info = M("transfer_borrow_investor")->field("reward_money, borrow_fee")->where("id={$tinvest_id}")->find(); $secodary = ''; import("ORG.Loan.Escrow"); $loan = new Escrow(); if ($invest_info['reward_money'] > 0.0) { // 投标奖励 // $secodary[] = $loan->secondaryJsonList($invest_qdd['qdd_marked'], $invest_info['reward_money'],'二次分配', '支付投标奖励'); $secodary['LoanInMoneymoremore'] = $invest_qdd['qdd_marked']; $secodary['Amount'] = $invest_info['reward_money']; $secodary['TransferName'] = '二次分配'; $secodary['Remark'] = '支付投标奖励'; $secodarys['reward_money'] = $secodary; } if ($invest_info['borrow_fee'] > 0.0) { // 借款管理费 // $secodary[] = $loan->secondaryJsonList($loanconfig['pfmmm'], $invest_info['borrow_fee'],'二次分配', '支付平台借款管理费'); $secodary['LoanInMoneymoremore'] = $loanconfig['pfmmm']; $secodary['Amount'] = $invest_info['borrow_fee']; $secodary['TransferName'] = '二次分配'; $secodary['Remark'] = '支付平台借款管理费'; $secodarys['borrow_fee'] = $secodary; } //$secodarys && $secodarys = json_encode($secodarys); // 投标奖励 // $loanList[] = $loan->loanJsonList($invest_qdd['qdd_marked'], $borrow_qdd['qdd_marked'], $orders, $borrow_id, $money, $binfo['borrow_money'],'投标',"对{$borrow_id}号投标",$secodary); $loanJsonList = array(); $loanJsonList['LoanOutMoneymoremore'] = $invest_qdd['qdd_marked']; $loanJsonList['LoanInMoneymoremore'] = $borrow_qdd['qdd_marked']; $loanJsonList['OrderNo'] = 'T' . $orders; $loanJsonList['BatchNo'] = 'T_' . $borrow_id; $loanJsonList['Amount'] = $money * $binfo['per_transfer']; $loanJsonList['FullAmount'] = $binfo['borrow_money']; $loanJsonList['TransferName'] = '投标'; $loanJsonList['Remark'] = "对{$borrow_id}号投标"; $loanJsonList['NeedAudit'] = '1'; //$loanJsonList['SecondaryJsonList'] = $secodarys; //$loanJsonList = json_encode($loanList); //$returnURL = C('WEB_URL').U("invest/investReturn"); // $notifyURL = C('WEB_URL').U("notify/notifys"); $notifyURL = C('WEB_URL') . "/tinvest/notify"; //echo $notify;die(); //$data = $loan->transfer('',$returnURL , $notifyURL); $data1 = $loan->transfer('', $returnURL, $notifyURL, 1, 1, 2, 1); // 自动到帐 //$data['LoanJsonList']=$data1['LoanJsonList']; //$data['LoanJsonList'] = $loanJsonList; $data['PlatformMoneymoremore'] = $data1['PlatformMoneymoremore']; $data['TransferAction'] = $data1['TransferAction']; $data['Action'] = $data1['Action']; $data['TransferType'] = $data1['TransferType']; $data['NeedAudit'] = $data1['NeedAudit']; $data['RandomTimeStamp'] = $data1['RandomTimeStamp']; $data['Remark1'] = $data1['Remark1']; $data['Remark2'] = $data1['Remark2']; $data['Remark3'] = $data1['Remark3']; $data['NotifyURL'] = $data1['NotifyURL']; $data['LoanJsonList'] = $loanJsonList; $data['SecondaryJsonList'] = $secodarys; ajaxmsg($data); // $loanconfig = FS("Webconfig/loanconfig"); // $orders = date("YmdHi").$tinvest_id; // // 发送到乾多多 // $invest_qdd = M("escrow_account")->field('*')->where("uid={$this->uid}")->find(); // $borrow_qdd = M("escrow_account")->field('*')->where("uid={$binfo['borrow_uid']}")->find(); // $invest_info = M("transfer_borrow_investor")->field("reward_money, borrow_fee")->where("id={$tinvest_id}")->find(); // $secodary = ''; // import("ORG.Loan.Escrow"); // $loan = new Escrow(); // if($invest_info['reward_money']>0.00){ // 投标奖励 // // $secodary[] = $loan->secondaryJsonList($invest_qdd['qdd_marked'], $invest_info['reward_money'],'二次分配', '支付投标奖励'); // $secodary['LoanInMoneymoremore'] = $invest_qdd['qdd_marked']; // $secodary['Amount'] = $invest_info['reward_money']; // $secodary['TransferName'] = '二次分配'; // $secodary['Remark'] = '支付投标奖励'; // //$secodarys['reward_money'] = $secodary; // } // if($invest_info['borrow_fee']>0.00){ // 借款管理费 // // $secodary[] = $loan->secondaryJsonList($loanconfig['pfmmm'], $invest_info['borrow_fee'],'二次分配', '支付平台借款管理费'); // $secodary['LoanInMoneymoremore'] = $loanconfig['pfmmm']; // $secodary['Amount'] = $invest_info['borrow_fee']; // $secodary['TransferName'] = '二次分配'; // $secodary['Remark'] = '支付平台借款管理费'; // //$secodarys['borrow_fee'] = $secodary; // } // //$secodarys && $secodarys = json_encode($secodarys); // // 投标奖励 // // $loanList[] = $loan->loanJsonList($invest_qdd['qdd_marked'], $borrow_qdd['qdd_marked'], $orders, $borrow_id, $money, $binfo['borrow_money'],'投标',"对{$borrow_id}号投标",$secodary); // $loanJsonList = array(); // $loanJsonList['LoanOutMoneymoremore'] = $invest_qdd['qdd_marked']; // $loanJsonList['LoanInMoneymoremore'] = $borrow_qdd['qdd_marked']; // $loanJsonList['OrderNo'] = 'T'.$orders; // $loanJsonList['BatchNo'] = 'T_'.$borrow_id; // $loanJsonList['Amount'] = $money*$binfo['per_transfer']; // $loanJsonList['FullAmount'] = $binfo['borrow_money']; // $loanJsonList['TransferName'] = '投标'; // $loanJsonList['Remark'] = "对{$borrow_id}号投标"; // //$loanJsonList['NeedAudit']='1'; // $loanJsonList['SecondaryJsonList']=$secodary; // $notifyURL = C('WEB_URL').U("tinvest/notify"); // //$data1 = $loan->transfer('',$returnURL , $notifyURL); // $data1= $loan->transfer($loanJsonList, $returnURL , $notifyURL,1,1,2,1); // 自动到帐 // //$data['LoanJsonList']=$data1['LoanJsonList']; // $data['LoanJsonList'] = $loanJsonList; // $data['PlatformMoneymoremore']=$data1['PlatformMoneymoremore']; // $data['TransferAction']=$data1['TransferAction']; // $data['Action']=$data1['Action']; // $data['TransferType']=$data1['TransferType']; // $data['NeedAudit']=$data1['NeedAudit']; // $data['RandomTimeStamp']=$data1['RandomTimeStamp']; // $data['Remark1']=$data1['Remark1']; // $data['Remark2']=$data1['Remark2']; // $data['Remark3']=$data1['Remark3']; // $data['NotifyURL']=$data1['NotifyURL']; //$data['SecondaryJsonList'] = $secodarys; } else { $ajaxmsg("对不起,认购失败,请重试!"); } }
//harits $user = User::find(1); $user->role = "admin"; $user->save(); //yogi $user = User::find(2); $user->role = "admin"; $user->save(); //test $user = User::find(3); $user->role = "admin"; $user->save(); return "OK!"; }); Route::get('test_add_escrow', function () { Escrow::add(4, 40, "ini adalah info yey"); return "OK!"; }); Route::get('test_add_best', function () { BestSelling::increase(6); }); //Untuk kepentingan debugging. bisa dihapus kemudian hari Route::get('hapuscart', function () { Session::forget('shopping_cart'); Session::forget('shopping_cart["item"]'); Session::forget('shopping_cart["totalprice"]'); }); Route::get('test_locations', function () { $q = "vaio"; $category = 6; $location = "Nangroe Aceh Darussalam";
public function repayment() { /* $secodary = ""; $loanconfig = FS("Webconfig/loanconfig"); $borrow_id = intval($_GET['bid']); $sort_order = intval($_GET['sort_order']); $vo = M("borrow_info")->field('id')->where("id={$borrow_id} AND borrow_uid={$this->uid}")->find(); if(!is_array($vo)) $this->error("数据有误"); $borrow_qdd = M('escrow_account')->field('qdd_marked')->where("uid={$this->uid}")->find(); $repayment = $this->repaymentList($borrow_id, $sort_order); // 测试列表 import("ORG.Loan.Escrow"); $loan = new Escrow(); foreach($repayment['list'] as $k=> $val){ if(floatval($val['interest_fee'])){ $secodary[0] = $loan->secondaryJsonList($loanconfig['pfmmm'], $val['interest_fee'],'利息管理费'); } $secodary && $secodary = json_encode($secodary); $money = $val['capital']+$val['interest']; $orders = date("YmdHi").$val['invest_id'].'_'.$sort_order; $loanList[] = $loan->loanJsonList($borrow_qdd['qdd_marked'], $val['qdd_marked'], $orders, $borrow_id, $money, '','还款',"对{$borrow_id}号标第{$sort_order}期还款",$secodary); $secodary = ""; } if($repayment['is_expired']){ $order_no = 'yqfk'.date("YmdHi").'_'.$borrow_id.'_'.$sort_order; $fine = floatval($repayment['call_fee'] + $repayment['expired_money']); if($fine>0) $loanList[] = $loan->loanJsonList( $borrow_qdd['qdd_marked'], $loanconfig['pfmmm'], $order_no, $borrow_id, $fine, '','逾期罚款+催收费用',"对第{$borrow_id}号标第{$sort_order}期逾期{$repayment['expired_days']}天罚款{$repayment['expired_money']}元罚款+催收费用({$repayment['call_fee']})元"); } $loanJsonList = json_encode($loanList); $returnURL = C('WEB_URL').U("detailReturn"); $notifyURL = C('WEB_URL').U("notify/detail"); $expired = "{$repayment['is_expired']}/{$repayment['expired_days']}/{$repayment['expired_money']}/{$repayment['call_fee']}"; $data = $loan->transfer($loanJsonList, $returnURL , $notifyURL, 2, 1, 1, 1, $borrow_id.'_'.$sort_order, $expired); $form = $loan->setForm($data, 'transfer'); echo $form; exit; */ //$_investinfo = M("transfer_borrow_investor bi")->field($_fieldx)->join("{$pre}members m ON bi.investor_uid = m.id")->join("{$pre}transfer_borrow_info bo ON bo.id //=bi.borrow_id")->limit(10)->where("bi.investor_uid={$this->uid}")->order("bi.id DESC")->select(); $jsoncode = file_get_contents("php://input"); $arr = array(); $arr = json_decode($jsoncode, true); if (!$this->uid || $arr['uid'] != $this->uid) { ajaxmsg("请先登录" . $arr['uid'], 0); exit; } if (!is_array($arr) || empty($arr) || empty($arr['uid'])) { ajaxmsg("查询错误!", 0); } $secodary = ""; $loanconfig = FS("Webconfig/loanconfig"); $borrow_id = intval($arr['bid']); $sort_order = intval($arr['sort_order']); $vo = M("borrow_info")->field('id')->where("id={$borrow_id} AND borrow_uid={$this->uid}")->find(); if (!is_array($vo)) { ajaxmsg("数据有误", 0); } $borrow_qdd = M('escrow_account')->field('qdd_marked')->where("uid={$this->uid}")->find(); $repayment = repaymentList($borrow_id, $sort_order); // 测试列表 import("ORG.Loan.Escrow"); $loan = new Escrow(); foreach ($repayment['list'] as $k => $val) { if (floatval($val['interest_fee'])) { $secodary[0] = $loan->secondaryJsonList($loanconfig['pfmmm'], $val['interest_fee'], '利息管理费'); $secodary['LoanInMoneymoremore'] = $secodary[0]['LoanInMoneymoremore']; $secodary['Amount'] = $secodary[0]['Amount']; $secodary['TransferName'] = $secodary[0]['TransferName']; $secodary['Remark'] = $secodary[0]['Remark']; $secodarys['borrow_fee'] = $secodary; } $secodary && ($secodary = json_encode($secodary)); $money = $val['capital'] + $val['interest']; $orders = date("YmdHi") . $val['invest_id'] . '_' . $sort_order; $loanList = $loan->loanJsonList($borrow_qdd['qdd_marked'], $val['qdd_marked'], $orders, $borrow_id, $money, '', '还款', "对{$borrow_id}号标第{$sort_order}期还款", $secodary); $loanJsonList['LoanOutMoneymoremore'] = $loanList['LoanOutMoneymoremore']; $loanJsonList['LoanInMoneymoremore'] = $loanList['LoanInMoneymoremore']; $loanJsonList['OrderNo'] = $loanList['OrderNo']; $loanJsonList['BatchNo'] = $loanList['BatchNo']; $loanJsonList['Amount'] = $loanList['Amount']; $loanJsonList['FullAmount'] = $loanList['borrow_money']['FullAmount']; $loanJsonList['TransferName'] = $loanList['TransferName']; $loanJsonList['Remark'] = $loanList['Remark']; $secodary = ""; } if ($repayment['is_expired']) { $order_no = 'yqfk' . date("YmdHi") . '_' . $borrow_id . '_' . $sort_order; $fine = floatval($repayment['call_fee'] + $repayment['expired_money']); if ($fine > 0) { $loanList[] = $loan->loanJsonList($borrow_qdd['qdd_marked'], $loanconfig['pfmmm'], $order_no, $borrow_id, $fine, '', '逾期罚款+催收费用', "对第{$borrow_id}号标第{$sort_order}期逾期{$repayment['expired_days']}天罚款{$repayment['expired_money']}元罚款+催收费用({$repayment['call_fee']})元"); } } //$loanJsonList = json_encode($loanList); // $returnURL=C('WEB_URL').U("detailReturn"); $notifyURL = C('WEB_URL') . "Member/Notify/detail"; $expired = "{$repayment['is_expired']}/{$repayment['expired_days']}/{$repayment['expired_money']}/{$repayment['call_fee']}"; $data1 = $loan->transfer($loanJsonList, $returnURL, $notifyURL, 2, 1, 1, 1, $borrow_id . '_' . $sort_order, $expired); //var_dump($data1);die; $data['PlatformMoneymoremore'] = $data1['PlatformMoneymoremore']; $data['TransferAction'] = $data1['TransferAction']; $data['Action'] = $data1['Action']; $data['TransferType'] = $data1['TransferType']; $data['NeedAudit'] = $data1['NeedAudit']; $data['RandomTimeStamp'] = $data1['RandomTimeStamp']; $data['Remark1'] = $data1['Remark1']; $data['Remark2'] = $data1['Remark2']; $data['Remark3'] = $data1['Remark3']; $data['NotifyURL'] = $data1['NotifyURL']; $data['LoanJsonList'] = $loanJsonList; ajaxmsg($data); //$data['SecondaryJsonList'] = $secodarys; }
public function hkwithdraw() { $pre = C('DB_PREFIX'); $money_info = M("member_money")->field("account_money, back_money")->where("uid={$this->uid}")->find(); $amount = floatval($_POST['Amount']); if ($amount > $money_info['back_money']) { $this->error('回款资金余额不足'); } $amount > $money_info['account_money'] + $money_info['back_money'] && $this->error('提现金额超过了可用资金金额!'); //被注释了 $tx['uid'] = $this->uid; $tx['add_ip'] = get_client_ip(); $tx['add_time'] = time(); $tx['withdraw_money'] = $amount; $nid = M('member_withdraw')->add($tx); $field = "m.user_name,m.user_phone,(mm.account_money+mm.back_money) all_money,mm.account_money,mm.back_money,i.real_name,b.bank_num,b.bank_name,b.bank_address,b.bank_province,b.bank_city"; $vo = M('members m')->field($field)->join("{$pre}member_info i on i.uid = m.id")->join("{$pre}member_money mm on mm.uid = m.id")->join("{$pre}member_banks b on b.uid = m.id")->where("m.id={$this->uid}")->find(); if (empty($vo['bank_num'])) { $data['html'] = '<script type="text/javascript">alert("您还未绑定银行帐户,请先绑定");window.location.href="' . __APP__ . '/member/bank#fragment-1";</script>'; } else { $tqfee = explode("|", $this->glo['fee_tqtx']); $fee[0] = explode("-", $tqfee[0]); $fee[1] = explode("-", $tqfee[1]); $fee[2] = explode("-", $tqfee[2]); $this->assign("fee", $fee); $borrow_info = M("borrow_info")->field("sum(borrow_money+borrow_interest+borrow_fee) as borrow, sum(repayment_money+repayment_interest) as also")->where("borrow_uid = {$this->uid} and borrow_type=4 and borrow_status in (0,2,4,6,8,9,10)")->find(); $vo['all_money'] -= $borrow_info['borrow'] + $borrow_info['also']; $vo['OrderNo'] = $nid; } $va = M('escrow_account')->where("uid={$this->uid}")->find(); $submitdata['WithdrawMoneymoremore'] = $va['qdd_marked']; if ($nid) { $submitdata['OrderNo'] = date("YmdHi") . $nid; } $submitdata['CardNo'] = $vo['bank_num']; $submitdata['CardType'] = 0; //(0.借记卡 1.信用卡) $submitdata['BankCode'] = $vo['bank_name']; //银行代码 $submitdata['BranchBankName'] = ''; //auto_charset($vo['bank_name']);// $submitdata['Province'] = $vo['bank_province']; $submitdata['City'] = $vo['bank_city']; $submitdata['FeePercent'] = 100; //$vo['']; $submitdata['Amount'] = $amount; //$submitdata['txtPassword']=$vo[''];//提现密码 $submitdata['PlatformMoneymoremore'] = $va['platform_marked']; $submitdata['Remark1'] = ''; //dump($submitdata);exit; import("ORG.Loan.Escrow"); $loan = new Escrow(); $data = $loan->withdraws($submitdata); $form = $loan->setForm($data, 'withdraw'); echo $form; exit; }
/** * 企业直投还款 * */ public function edetail() { if ($_POST['ResultCode'] == '88') { import("ORG.Loan.Escrow"); $loan = new Escrow(); if ($loan->loanVerify($_POST)) { if (intval($_POST['Action']) == 1) { $info = explode("_", $_POST['Remark1']); if (repaymentEnterprise($info[0], $info[1]) == 'TRUE') { notifyMsg('直投还款', $_POST, 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'SUCCESS'); echo 'SUCCESS'; exit; } } else { notifyMsg('直投还款冻结', $_POST, 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'SUCCESS'); echo 'SUCCESS'; exit; } notifyMsg('直投还款', $_POST, 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], ''); } } }