$amount = intval($_GET['amount']);
        $email = dhtmlspecialchars($_GET['email']);
        if (empty($amount)) {
            showmessage('buyinvitecode_no_count');
        }
        if (strlen($email) < 6 || !preg_match("/^[\\w\\-\\.]+@[\\w\\-\\.]+(\\.\\w+)+\$/", $email)) {
            showmessage('buyinvitecode_email_error');
        }
        $price = round($amount * $_G['setting']['inviteconfig']['invitecodeprice'], 2);
        $orderid = '';
        $apitype = $_GET['apitype'];
        if (empty($apitype)) {
            showmessage('parameters_error');
        }
        require_once libfile('function/trade');
        $requesturl = invite_payurl($amount, $price, $orderid);
        if (C::t('forum_order')->fetch($orderid)) {
            showmessage('credits_addfunds_order_invalid');
        }
        C::t('forum_order')->insert(array('orderid' => $orderid, 'status' => '1', 'uid' => 0, 'amount' => $amount, 'price' => $price, 'submitdate' => $_G['timestamp'], 'email' => $email, 'ip' => $_G['clientip']));
        include template('common/header_ajax');
        echo '<form id="payform" action="' . $requesturl . '" method="post"></form><script type="text/javascript" reload="1">$(\'payform\').submit();</script>';
        include template('common/footer_ajax');
        dexit();
    } else {
        showmessage('action_closed', NULL);
    }
}
if ($_GET['action'] == 'paysucceed' && $_GET['orderid']) {
    $orderid = $_GET['orderid'];
    $order = C::t('forum_order')->fetch($orderid);
示例#2
0
        $amount = intval($_GET['amount']);
        $email = dhtmlspecialchars($_GET['email']);
        if (empty($amount)) {
            showmessage('buyinvitecode_no_count');
        }
        if (strlen($email) < 6 || !preg_match("/^[\\w\\-\\.]+@[\\w\\-\\.]+(\\.\\w+)+\$/", $email)) {
            showmessage('buyinvitecode_email_error');
        }
        $price = round($amount * $_G['setting']['inviteconfig']['invitecodeprice'], 2);
        $orderid = '';
        $apitype = is_numeric($_GET['bank_type']) ? 'tenpay' : $_GET['bank_type'];
        if (empty($apitype)) {
            showmessage('parameters_error');
        }
        require_once libfile('function/trade');
        $requesturl = invite_payurl($amount, $price, $orderid, $_GET['bank_type']);
        if (C::t('forum_order')->fetch($orderid)) {
            showmessage('credits_addfunds_order_invalid');
        }
        C::t('forum_order')->insert(array('orderid' => $orderid, 'status' => '1', 'uid' => 0, 'amount' => $amount, 'price' => $price, 'submitdate' => $_G['timestamp'], 'email' => $email, 'ip' => $_G['clientip']));
        include template('common/header_ajax');
        echo '<form id="payform" action="' . $requesturl . '" method="post"></form><script type="text/javascript" reload="1">$(\'payform\').submit();</script>';
        include template('common/footer_ajax');
        dexit();
    } else {
        showmessage('action_closed', NULL);
    }
}
if ($_GET['action'] == 'paysucceed' && $_GET['orderid']) {
    $orderid = $_GET['orderid'];
    $order = C::t('forum_order')->fetch($orderid);