Beispiel #1
0
         $username = trim($username);
         if (!$username) {
             continue;
         }
         $r = $db->get_one("SELECT username,sms FROM {$DT_PRE}member WHERE username='******'");
         if (!$r) {
             $error .= '<br/>会员[' . $username . ']不存在';
             continue;
         }
         if (!$type && $r['sms'] < abs($amount)) {
             $error .= '<br/>会员[' . $username . ']短信余额不足,当前余额为:' . $r['sms'];
             continue;
         }
         $reason or $reason = '奖励';
         $note or $note = '手工';
         sms_add($username, $amount);
         sms_record($username, $amount, $_username, $reason, $note);
     }
     if ($error) {
         message('操作成功 ' . $success . ' 位会员,发生以下错误:' . $error);
     }
     dmsg('操作成功', '?moduleid=' . $moduleid . '&file=' . $file . '&action=record');
 } else {
     if (isset($userid)) {
         if ($userid) {
             $userids = is_array($userid) ? implode(',', $userid) : $userid;
             $result = $db->query("SELECT username FROM {$DT_PRE}member WHERE userid IN ({$userids})");
             while ($r = $db->fetch_array($result)) {
                 $username .= $r['username'] . "\n";
             }
         }
Beispiel #2
0
    if ($DT['sms'] && $_sms && $item['username'] && isset($sendsms)) {
        $touser = userinfo($item['username']);
        if ($touser['mobile']) {
            $message = lang('sms->sms_price', array($item['tag'], $itemid, $truename, $telephone));
            $message = strip_sms($message);
            $word = word_count($message);
            $sms_num = ceil($word / $DT['sms_len']);
            if ($sms_num <= $_sms) {
                $sms_code = send_sms($touser['mobile'], $message, $word);
                if (strpos($sms_code, $DT['sms_ok']) !== false) {
                    $tmp = explode('/', $sms_code);
                    if (is_numeric($tmp[1])) {
                        $sms_num = $tmp[1];
                    }
                    if ($sms_num) {
                        sms_add($_username, -$sms_num);
                    }
                    if ($sms_num) {
                        sms_record($_username, -$sms_num, $_username, $L['sms_price'], 'ID:' . $itemid);
                    }
                }
            }
        }
    }
    //send sms
    if (send_message($item['username'], $title, $message, 2, $_username)) {
        message($L['msg_price_success'], $linkurl);
    } else {
        message($_userid ? $L['msg_price_member_failed'] : $L['msg_price_guest_failed'], $linkurl);
    }
} else {
Beispiel #3
0
                 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='******'");
                 dheader('?code=1&action=' . $action);
             } else {
                 message($L['send_mobile_fail']);
             }
         }
         $head_title = $L['send_mobile_title'];
         include template('send', $module);
     }
     break;
 default:
     if ($_userid) {
Beispiel #4
0
     }
     break;
 case 'buy':
     $fee = $DT['sms_fee'];
     $fee or message($L['sms_msg_no_price']);
     if ($fee) {
         if ($submit) {
             is_payword($_username, $password) or message($L['error_payword']);
             $total = intval($total);
             $total > 0 or message($L['sms_msg_buy_num']);
             $amount = $total * $fee;
             if ($amount > 0) {
                 $_money >= $amount or message($L['money_not_enough'], 'charge.php?action=pay&amount=' . ($amount - $_money));
                 money_add($_username, -$amount);
                 money_record($_username, -$amount, $L['in_site'], 'system', $L['sms_buy_note'], $total);
                 sms_add($_username, $total);
                 sms_record($_username, $total, 'system', $L['sms_buy_record'], $amount . $DT['money_unit']);
             }
             dmsg($L['sms_buy_success'], '?action=index');
         }
     } else {
         message($L['sms_msg_no_price']);
     }
     $head_title = $L['sms_buy_title'];
     break;
 case 'record':
     isset($fromtime) or $fromtime = '';
     isset($totime) or $totime = '';
     $condition = "mobile='{$mobile}'";
     if ($keyword) {
         $condition .= " AND message LIKE '%{$keyword}%'";
Beispiel #5
0
 function add($member)
 {
     global $DT, $DT_TIME, $DT_IP, $MOD, $L;
     if (!$this->is_member($member)) {
         return false;
     }
     $member = $this->set_member($member);
     $member['linkurl'] = userurl($member['username']);
     $member['password'] = $member['payword'] = md5(md5($member['password']));
     $member['sound'] = 1;
     $member_fields = array('username', 'company', 'passport', 'password', 'payword', 'email', 'sound', 'gender', 'truename', 'mobile', 'msn', 'qq', 'ali', 'skype', 'department', 'career', 'groupid', 'regid', 'areaid', 'edittime', 'inviter');
     $company_fields = array('username', 'groupid', 'company', 'type', 'catid', 'catids', 'areaid', 'mode', 'capital', 'regunit', 'size', 'regyear', 'sell', 'buy', 'business', 'telephone', 'fax', 'mail', 'address', 'postcode', 'homepage', 'introduce', 'thumb', 'keyword', 'linkurl');
     $member_sqlk = $member_sqlv = $company_sqlk = $company_sqlv = '';
     foreach ($member as $k => $v) {
         if (in_array($k, $member_fields)) {
             $member_sqlk .= ',' . $k;
             $member_sqlv .= ",'{$v}'";
         }
         if (in_array($k, $company_fields)) {
             $company_sqlk .= ',' . $k;
             $company_sqlv .= ",'{$v}'";
         }
     }
     $member_sqlk = substr($member_sqlk, 1);
     $member_sqlv = substr($member_sqlv, 1);
     $company_sqlk = substr($company_sqlk, 1);
     $company_sqlv = substr($company_sqlv, 1);
     $this->db->query("INSERT INTO {$this->table_member} ({$member_sqlk},regip,regtime,loginip,logintime)  VALUES ({$member_sqlv},'{$DT_IP}','{$DT_TIME}','{$DT_IP}','{$DT_TIME}')");
     $this->userid = $this->db->insert_id();
     if (!$this->userid) {
         return 0;
     }
     $member['userid'] = $this->userid;
     $this->username = $member['username'];
     $this->db->query("INSERT INTO {$this->table_company} (userid, {$company_sqlk}) VALUES ('{$this->userid}', {$company_sqlv})");
     $content_table = content_table(4, $this->userid, is_file(DT_CACHE . '/4.part'), $this->table_company_data);
     $this->db->query("INSERT INTO {$content_table} (userid, content) VALUES ('{$this->userid}', '{$member['content']}')");
     if ($MOD['credit_register'] > 0) {
         credit_add($this->username, $MOD['credit_register']);
         credit_record($this->username, $MOD['credit_register'], 'system', $L['member_record_reg'], $DT_IP);
     }
     if ($MOD['money_register'] > 0) {
         money_add($this->username, $MOD['money_register']);
         money_record($this->username, $MOD['money_register'], $L['in_site'], 'system', $L['member_record_reg'], $DT_IP);
     }
     if ($MOD['sms_register'] > 0) {
         sms_add($this->username, $MOD['sms_register']);
         sms_record($this->username, $MOD['sms_register'], 'system', $L['member_record_reg'], $DT_IP);
     }
     return $this->userid;
 }
Beispiel #6
0
         $username = trim($username);
         if (!$username) {
             continue;
         }
         $vip['username'] = $username;
         $do->vip_edit($vip);
         if ($money) {
             money_add($username, $money);
             money_record($username, $money, '站内', $_username, $reason, $GROUP[$vip['groupid']]['groupname']);
         }
         if ($credit) {
             credit_add($username, $credit);
             credit_record($username, $credit, $_username, $reason, $GROUP[$vip['groupid']]['groupname']);
         }
         if ($sms) {
             sms_add($username, $sms);
             sms_record($username, $sms, $_username, $reason, $GROUP[$vip['groupid']]['groupname']);
         }
     }
     dmsg('添加成功', $this_forward);
 } else {
     isset($username) or $username = '';
     if (isset($userid)) {
         if ($userid) {
             $userids = is_array($userid) ? implode(',', $userid) : $userid;
             $result = $db->query("SELECT username FROM {$DT_PRE}member WHERE userid IN ({$userids})");
             while ($r = $db->fetch_array($result)) {
                 $username .= $r['username'] . "\n";
             }
         }
     }