"124.227.192.131") { //showError("对不起,银行暂时关闭,请稍后再来。"); //exit; } if ($bbuserinfo[userid]==1333998 || $bbuserinfo[userid]==197323 || $bbuserinfo[userid]==42368) { showError("发现有不正当透支绿豆行为,暂停该用户转账功能。"); } /*if (date("H")>=2 && date("H")<=7) { showError("系统升级维护,2-8点暂停转豆功能。"); }*/ // #################### DEFINE PLUS_NAME ####################### define('PLUS_NAME', $vbphrase['bank']); // ####################################################################### // ######################## START MAIN SCRIPT ############################ // ####################################################################### // 银行功能被禁用 if (!$vboptions['bankonoff']) { eval(print_standard_error('bank_off')); exit(); } // check moderator permissions for getting ip if ($bbuserinfo[userid]==0) { print_no_permission(); } $accrual = $vboptions['accrual']; //每天利息 $showaccrual = ($accrual*100)."%"; //显示利息 $shouxufei = $vboptions['shouxufei']; //转帐手续费 $showshouxufei = ($shouxufei*100)."%"; //显示转帐手续费 $danwei = $vboptions['danwei']; //社区金钱单位 $minmon = $vboptions['minmon']; //至少需要多少钱才可以使用银行业务 if (empty($_REQUEST['action'])) { $_REQUEST['action'] = 'showroom'; } //########################## showbankmoney begin ################# if ($_REQUEST['action'] == 'showroom') { //检查利息 //showbankmoney(); //取个人信息 $userbank = $DB_site->query_first(" SELECT bank,money,savemt FROM " . TABLE_PREFIX . "user AS user WHERE userid='$bbuserinfo[userid]'"); $userbankmoney= $userbank['bank']; $usernm=$bbuserinfo['username']; $usermoney= $userbank['money']; $allmoney = $userbank['bank']+$userbank['money']; if($userbank['savemt'] !=0) { $savedate=vbdate($vboptions['dateformat'],$userbank['savemt'], true); } else { $savedate = $vbphrase['no_bank_info']; } //取用户最近银行操作记录-20条(时间?条数?) $banklog = $DB_site->query(" SELECT operate, sum, logtime, note FROM " . TABLE_PREFIX . "bank_log WHERE userid='$bbuserinfo[userid]' ORDER BY logid DESC LIMIT 20 "); if(!$banklog) { $logbit=""; } else { while ($userlog = $DB_site->fetch_array($banklog)) { $userlog['logtimedate'] = vbdate($vboptions['dateformat'], $userlog['logtime'], true); $userlog['logtimetime'] = vbdate($vboptions['timeformat'], $userlog['logtime'], true); $userlog['logtime'] = $userlog['logtimedate']." ".$userlog['logtimetime']; $userlog['operate'] = iif($userlog['operate']=="1", $vbphrase['deposit'], $userlog['operate']); $userlog['operate'] = iif($userlog['operate']=="2", $vbphrase['getdeposit'], $userlog['operate']); $userlog['operate'] = iif($userlog['operate']=="3", $vbphrase['changein'], $userlog['operate']); $userlog['operate'] = iif($userlog['operate']=="4", $vbphrase['changeout'], $userlog['operate']); $userlog['operate'] = iif($userlog['operate']=="5", $vbphrase['getaccrual'], $userlog['operate']); $userlog['operate'] = iif($userlog['operate']=="6", $vbphrase['changefee'], $userlog['operate']); $userlog['sum'] = iif($userlog['sum']>0, "+$userlog[sum]", $userlog['sum']); eval('$logbit .= "' . fetch_template('bank_log') . '";'); } } $titlename = PLUS_NAME; $thisprograme = $vbphrase['bank_room']; $navbits = array(); $navbits["bank.php?action=showroom"] = $titlename; $navbits[''] = $thisprograme; $templatename = 'bank_showroom'; } //########################## showbankmoney end ################# //########################## 显示竞猜转豆 begin ################# if ($_REQUEST['action'] == 'jcshowroom') { //检查利息 //showbankmoney(); //取个人信息 //echo "备份数据暂停服务。"; //exit; $userbank = $DB_site->query_first(" SELECT bank,money,savemt FROM " . TABLE_PREFIX . "user AS user WHERE userid='$bbuserinfo[userid]'"); $userbankmoney= $userbank['bank']; $usernm=$bbuserinfo['username']; $usermoney= $userbank['money']; $allmoney = $userbank['bank']+$userbank['money']; if($userbank['savemt'] !=0) { $savedate=vbdate($vboptions['dateformat'],$userbank['savemt'], true); } else { $savedate = $vbphrase['no_bank_info']; } $action_str = "change_jc"; $bank_title = "从社区转入竞猜中心1"; $titlename = PLUS_NAME; $thisprograme = $vbphrase['bank_room']; $navbits = array(); $navbits["bank.php?action=jcshowroom"] = $titlename; $navbits[''] = $thisprograme; $templatename = 'bank_jcshowroom'; } //########################## 显示竞猜转豆 end ################# //########################## 执行转入竞猜中心数据 begin ################# if ($_REQUEST['action'] == 'change_jc') { $moneynumber = intval($_REQUEST['ld_num']); //判断是否是短时间提交 $sigintime = $memcache->get("banklock_".$bbuserinfo['userid']); if (!$sigintime) { $memcache->save("banklock_".$bbuserinfo['userid'], TIMENOW); //echo date("Y-m-d H:i:s",TIMENOW); //exit; } else { if ((TIMENOW - $sigintime) <20) { echo ""; exit; } else { $memcache->save("banklock_".$bbuserinfo['userid'], TIMENOW); } } //判断是否是短时间提交 $money=$moneynumber; $datamoney = $DB_site->query_first("SELECT username,money FROM " . TABLE_PREFIX . "user AS user WHERE userid='$bbuserinfo[userid]'"); $usermoney= $datamoney['money']; $username = $datamoney['username']; if ($money<100) { echo ""; exit; } if ($usermoney<$money) { echo ""; exit; } else { $str_url = "http://jingcai.gxnews.com.cn/bank/moveld_jcs_check.asp?ld_num=".$money."&res_id=".$bbuserinfo['userid']."&res_name=".$bbuserinfo['username'].""; //$message_str = @file_get_contents($str_url); $message_str = file_get_contents2($str_url); /* if ($bbuserinfo['userid']==96761) { echo $message_str; exit; } */ if ($message_str==1) { echo ""; exit; } elseif ($message_str==2) { echo ""; exit; } elseif ($message_str==6) { echo ""; exit; } elseif ($message_str==4) { $DB_site->query("UPDATE " . TABLE_PREFIX . "user SET money=money-$money,savemt='".time()."' WHERE userid='$bbuserinfo[userid]'"); echo ""; exit; } else { if ($bbuserinfo['userid'] == 96761) { echo "$message_str"; exit; } echo ""; exit; } // } } // #################################执行转入竞猜中心数据 end############################################ //########################## 显示由竞猜中心转入社区绿豆 begin ################# if ($_REQUEST['action'] == 'jcshowroom_tobbs') { //检查利息 //showbankmoney(); //取个人信息 //echo "备份数据暂停服务。"; //exit; $userbank = $DB_site->query_first(" SELECT bank,money,savemt FROM " . TABLE_PREFIX . "user AS user WHERE userid='$bbuserinfo[userid]'"); $userbankmoney= $userbank['bank']; $usernm=$bbuserinfo['username']; $usermoney= $userbank['money']; $allmoney = $userbank['bank']+$userbank['money']; if($userbank['savemt'] !=0) { $savedate=vbdate($vboptions['dateformat'],$userbank['savemt'], true); } else { $savedate = $vbphrase['no_bank_info']; } $action_str = "change_jc_tobbs"; $bank_title = "从竞猜中心转入社区"; $titlename = PLUS_NAME; $thisprograme = $vbphrase['bank_room']; $navbits = array(); $navbits["bank.php?action=jcshowroom"] = $titlename; $navbits[''] = $thisprograme; $templatename = 'bank_jcshowroom'; } //########################## 显示由竞猜中心转入社区绿豆 end ################# //########################## 执行由竞猜中心转入社区 begin ################# if ($_REQUEST['action'] == 'change_jc_tobbs') { $moneynumber = intval($_REQUEST['ld_num']); /*if ($bbuserinfo['userid'] != 96761){ echo "备份数据暂停服务。"; exit; } */ //echo "备份数据暂停服务。"; //exit; //判断是否是短时间提交 $sigintime = $memcache->get("banklock_".$bbuserinfo['userid']); if (!$sigintime) { $memcache->save("banklock_".$bbuserinfo['userid'], TIMENOW); //echo date("Y-m-d H:i:s",TIMENOW); //exit; } else { if ((TIMENOW - $sigintime) <20) { echo ""; exit; } else { $memcache->save("banklock_".$bbuserinfo['userid'], TIMENOW); } } //判断是否是短时间提交 $money=$moneynumber; if ($money<100) { echo ""; exit; } $str_url = "http://jingcai.gxnews.com.cn/bank/moveld_jcs_check_tobbs.asp?ld_num=".$money."&res_id=".$bbuserinfo['userid']."&res_name=".$bbuserinfo['username'].""; //$message_str = file_get_contents($str_url); $message_str = file_get_contents2($str_url); if ($message_str==1) { echo ""; exit; } elseif ($message_str==2) { echo ""; exit; } elseif ($message_str==6) { echo ""; exit; } elseif ($message_str==5) { echo ""; exit; } elseif ($message_str==4) { $DB_site->query("UPDATE " . TABLE_PREFIX . "user SET money=money+$money,savemt='".time()."' WHERE userid='$bbuserinfo[userid]'"); echo ""; exit; } else { if ($bbuserinfo['userid'] == 96761) { $call_back = $message_str; } echo ""; exit; } // } // #################################执行由竞猜中心转入社区 end############################################ //########################## changemoney begin ################# if ($_POST['action'] == 'change') { $moneynumber = intval($_REQUEST['moneynumber']); /* if (!ereg('^[0-9]{1,10}$',$moneynumber)) { eval(print_standard_error('money_money_error')); exit(); } */ $str_time = strtotime(date("Y-m-d 00:00:00",time())); //判断短时间重复签到的问题。 $banktime = $memcache->get("banklock_".$bbuserinfo['userid']); if (!$banktime) { $memcache->save("banklock_".$bbuserinfo['userid'], TIMENOW); //echo date("Y-m-d H:i:s",TIMENOW); //exit; } else { if ((TIMENOW - $banktime) <120 && $bbuserinfo['userid']!=1932903) { echo ""; exit; } else { $memcache->save("banklock_".$bbuserinfo['userid'], TIMENOW); } } //echo "备份数据暂停服务。"; //exit; $money=$moneynumber; $changeuser = addslashes(htmlspecialchars($_REQUEST['changeuser'])); $datamoney = $DB_site->query_first(" SELECT money FROM " . TABLE_PREFIX . "user AS user WHERE userid='$bbuserinfo[userid]'"); $usermoney= $datamoney['money']; $shouxu = $shouxufei+1; $moneyk=$money*$shouxu; $moneyk=iif($moneyk==intval($moneyk),$moneyk,intval($moneyk)+1); //$moneyk=intval($moneyk)+1; $money=intval($money); $charge=$moneyk-$money; if ($money<$minmon) { eval(print_standard_error('bank_money_not_enough')); exit(); } else if ($moneyk>$usermoney) { eval(print_standard_error('bank_money_not_enough_to')); exit(); } else { if ($changeuser=="") { eval(print_standard_error('bank_user_error')); exit(); } $userna=$DB_site->query_first("SELECT * FROM " . TABLE_PREFIX . "user AS user WHERE username=binary('".$changeuser."')"); if ($userna=="") { eval(print_standard_error('bank_user_error')); exit(); } else if ($userna['userid']==$bbuserinfo['userid']) { eval(print_standard_error('bank_to_me_error')); exit(); } else { //$DB_site->query("UPDATE " . TABLE_PREFIX . "user SET money=money+$money,savemt='".time()."' WHERE username='".$changeuser."'"); $DB_site->query("INSERT INTO " . TABLE_PREFIX . "bank_log (userid,operate,sum,logtime,note) VALUES ($userna[userid],'3','$money','".time()."','转出从: $bbuserinfo[username]')"); $DB_site->query("UPDATE " . TABLE_PREFIX . "user SET money=money+$money,savemt='".time()."' WHERE userid={$userna['userid']}"); $DB_site->query("INSERT INTO " . TABLE_PREFIX . "bank_log (userid,operate,sum,logtime,note) VALUES ($bbuserinfo[userid],'4','-$money','".time()."','转入到: $changeuser')"); $DB_site->query("INSERT INTO " . TABLE_PREFIX . "bank_log (userid,operate,sum,logtime,note) VALUES ($bbuserinfo[userid],'6','-$charge','".time()."','转帐手续费')"); $DB_site->query("UPDATE " . TABLE_PREFIX . "user SET money=money-$moneyk,savemt='".time()."' WHERE userid='$bbuserinfo[userid]'"); //写入到用户悄悄话 //$user=$DB_site->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE username=binary('".$changeuser."')"); if ($vboptions['banksendpm']) { // sent_msg($user['userid'],$user['username'],addslashes($vbphrase['bank_message']),"$vbphrase[bank_message_c] $money $danwei"); sent_msg($userna['userid'],$userna['username'],addslashes($vbphrase['bank_message']),"$vbphrase[bank_message_c] $money $danwei"); /* $DB_site->query("INSERT INTO " . TABLE_PREFIX . "pmtext\n\t(fromuserid, fromusername, title, message, touserarray, iconid, dateline, showsignature, allowsmilie)\nVALUES\n\t($bbuserinfo[userid], '" . addslashes($bbuserinfo['username']) . "', '" . addslashes($vbphrase['money_message']) . "', ' $money $danwei $vbphrase[money_message_c]', '" . addslashes(serialize(array($changeuser))) . "', '', " . TIMENOW . ", 1, 1)"); $pmtextid = $DB_site->insert_id(); $DB_site->query("INSERT INTO " . TABLE_PREFIX . "pm (pmtextid, userid) VALUES ($pmtextid, $user[userid])"); $DB_site->query("INSERT INTO " . TABLE_PREFIX . "pm (pmtextid, userid, folderid, messageread) VALUES ($pmtextid, $bbuserinfo[userid], -1, 1)"); $DB_site->shutdown_query("UPDATE " . TABLE_PREFIX . "user SET pmtotal=pmtotal+1 WHERE userid=$bbuserinfo[userid]"); $DB_site->shutdown_query("UPDATE " . TABLE_PREFIX . "user SET pmtotal=pmtotal+1,pmunread=pmunread+1 WHERE userid=$user[userid]"); */ } //记录到log表-转账(转入3和转出4,扣费6) $url="bank.php?$session[sessionurl]action=showroom"; eval(print_standard_redirect('bank_change_ok')); exit(); } } } // ############################################################################# if ($templatename != '') { $navbits = construct_navbits($navbits); eval('$navbar = "' . fetch_template('navbar') . '";'); eval('print_output("' . fetch_template($templatename) . '");'); } ?>