if ($MG['article_free_limit'] >= 0) { $fee_add = $MOD['fee_add'] && (!$MOD['fee_mode'] || !$MG['fee_mode']) && $limit_used >= $MG['article_free_limit'] && $_userid ? dround($MOD['fee_add']) : 0; } else { $fee_add = 0; } $fee_currency = $MOD['fee_currency']; $fee_unit = $fee_currency == 'money' ? $DT['money_unit'] : $DT['credit_unit']; $need_password = $fee_add && $fee_currency == 'money'; $need_captcha = $MOD['captcha_add'] == 2 ? $MG['captcha'] : $MOD['captcha_add']; $need_question = $MOD['question_add'] == 2 ? $MG['question'] : $MOD['question_add']; $could_color = check_group($_groupid, $MOD['group_color']) && $MOD['credit_color'] && $_userid; if ($submit) { if ($fee_add && $fee_add > ($fee_currency == 'money' ? $_money : $_credit)) { dalert($L['balance_lack']); } if ($need_password && !is_payword($_username, $password)) { dalert($L['error_payword']); } if ($MG['add_limit']) { $last = $db->get_one("SELECT addtime FROM {$table} WHERE {$sql} ORDER BY itemid DESC"); if ($last && $DT_TIME - $last['addtime'] < $MG['add_limit']) { dalert(lang($L['add_limit'], array($MG['add_limit']))); } } $msg = captcha($captcha, $need_captcha, true); if ($msg) { dalert($msg); } $msg = question($answer, $need_question, true); if ($msg) { dalert($msg);
if ($buy_price < $price) { message($L['spread_msg_price_min']); } if (($buy_price - $price) % $step != 0) { message($L['spread_msg_step']); } $buy_month = intval($buy_month); if ($buy_month < 1 || $buy_month > $month) { message($L['spread_msg_month']); } $amount = $buy_price * $buy_month; if ($currency == 'money') { if ($amount > $_money) { message($L['money_not_enough'], $MODULE[2]['linkurl'] . 'charge.php?action=pay&amount=' . ($amount - $_money)); } is_payword($_username, $password) or message($L['error_payword']); } else { if ($amount > $_credit) { message($L['credit_not_enough'], $MODULE[2]['linkurl'] . 'trade.php?action=credit'); } } $buy_tid = $mid == 4 ? $_userid : intval($buy_tid); if (!$buy_tid) { message($L['spread_msg_itemid']); } if ($mid == 5 || $mid == 6) { $table = get_table($mid); $item = $db->get_one("SELECT itemid FROM {$table} WHERE itemid='{$buy_tid}' AND status=3 AND username='******'"); if (!$item) { message($L['spread_msg_yours']); }
require 'common.inc.php'; require DT_ROOT . '/include/post.func.php'; require DT_ROOT . '/include/module.func.php'; isset($auth) or $auth = ''; $_auth = decrypt($auth, DT_KEY . 'PAY'); $_auth or dheader('channel.php?reload=' . $DT_TIME); list($moduleid, $itemid, $currency, $fee, $title) = explode('|', $_auth); isset($MODULE[$moduleid]) or dheader('channel.php?reload=' . $DT_TIME); $itemid = intval($itemid); $itemid or dheader('channel.php?reload=' . $DT_TIME); $fee = dround($fee); $fee > 0 or dheader('channel.php?reload=' . $DT_TIME); $note = $MODULE[$moduleid]['name'] . '/' . $itemid; if ($currency == 'money') { if (isset($password)) { is_payword($_username, $password) or mobile_msg($L['not_payword']); $discount = $MG['discount'] > 0 && $MG['discount'] < 100 ? $MG['discount'] : 100; $discount = dround($discount / 100); $_fee = dround($fee * $discount); $_money >= $_fee or mobile_msg($L['need_charge']); $db->query("INSERT INTO {$DT_PRE}finance_pay (moduleid,itemid,username,fee,currency,paytime,ip,title) VALUES ('{$moduleid}','{$itemid}','{$_username}','{$fee}','{$currency}','{$DT_TIME}','{$DT_IP}','" . addslashes($title) . "')"); money_add($_username, -$fee); money_record($_username, -$fee, $L['pay_by_site'], 'system', $L['pay_info'], $note); mobile_msg($L['pay_success'], mobileurl($moduleid, 0, $itemid)); } else { $head_title = $L['pay_title'] . $DT['seo_delimiter'] . $head_title; $foot = 'channel'; include template('pay', 'mobile'); if (DT_CHARSET != 'UTF-8') { toutf8(); }
$db->query("INSERT INTO {$DT_PRE}validate (type,username,ip,addtime,status,title,editor,edittime) VALUES ('mobile','{$username}','{$DT_IP}','{$DT_TIME}','3','{$mobile}','system','{$DT_TIME}')"); message($L['send_mobile_success'], $MOD['linkurl']); } message($L['send_mobile_code_error']); } else { $DT['sms'] or message($L['send_sms_close']); $fee = $DT['sms_fee']; if ($submit) { is_mobile($mobile) or message($L['send_mobile_bad']); $r = $db->get_one("SELECT userid FROM {$DT_PRE}member WHERE mobile='{$mobile}' AND vmobile=1 AND userid<>{$_userid}"); if ($r) { message($L['send_mobile_exist']); } if ($fee && $_sms < 1) { $fee <= $_money or message($L['money_not_enough'], $MOD['linkurl'] . 'charge.php?action=pay'); is_payword($_username, $password) or dalert($L['error_payword']); } $auth = random(6, '0123456789'); $content = lang('sms->sms_code', array($auth, $MOD['auth_days'])) . $DT['sms_sign']; $sms_code = send_sms($mobile, $content); if (strpos($sms_code, $DT['sms_ok']) !== false) { if ($fee) { if ($_sms < 1) { money_add($_username, -$fee); money_record($_username, -$fee, $L['in_site'], $_username, $L['send_mobile_record'], $mobile); } else { sms_add($_username, -1); sms_record($_username, -1, $_username, $L['send_mobile_record'], $mobile); } } $db->query("UPDATE {$DT_PRE}member SET auth='{$auth}',authvalue='{$mobile}',authtime='{$DT_TIME}' WHERE username='******'");
<?php /* [Destoon B2B System] Copyright (c) 2008-2013 Destoon.COM This is NOT a freeware, use is subject to license.txt */ defined('IN_DESTOON') or exit('Access Denied'); require_once DT_ROOT . '/include/post.func.php'; $currency = $MOD['fee_currency']; $mid = isset($resume) ? -$moduleid : $moduleid; $note = ($mid == -9 ? $L['resume'] : $MODULE[$mid]['name']) . '/' . $itemid; if ($currency == 'money') { $password or wap_msg($L['type_payword']); is_payword($_username, $password) or wap_msg($L['not_payword']); $discount = $MG['discount'] > 0 && $MG['discount'] < 100 ? $MG['discount'] : 100; $discount = dround($discount / 100); $_fee = dround($fee * $discount); $_money >= $_fee or wap_msg($L['need_charge']); $db->query("INSERT INTO {$DT_PRE}finance_pay (moduleid,itemid,username,fee,currency,paytime,ip,title) VALUES ('{$mid}','{$itemid}','{$_username}','{$fee}','{$currency}','{$DT_TIME}','{$DT_IP}','" . addslashes($title) . "')"); money_add($_username, -$fee); money_record($_username, -$fee, $L['pay_by_site'], 'system', $L['pay_info'], $note); } else { if ($_credit >= $fee) { $db->query("INSERT INTO {$DT_PRE}finance_pay (moduleid,itemid,username,fee,currency,paytime,ip,title) VALUES ('{$mid}','{$itemid}','{$_username}','{$fee}','{$currency}','{$DT_TIME}','{$DT_IP}','" . addslashes($title) . "')"); credit_add($_username, -$fee); credit_record($_username, -$fee, 'system', $L['pay_info'], $note); } else { wap_msg($L['need_credit']); } } wap_msg($L['pay_success'], 'index.php?moduleid=' . $moduleid . '&itemid=' . $itemid . (isset($resume) && $resume ? '&resume=1' : ''));