IsError) ParamError();
//妫€鏌ラ槄璇绘潈闄
$needMoney = $arc->Fields['money'];
$needRank = $arc->Fields['arcrank'];
require_once(DEDEINC.'/memberlogin.class.php');
$cfg_ml = new MemberLogin();
if($needRank < 0 && $arc->Fields['mid'] != $cfg_ml->M_ID)
{
ShowMsg('鏂囩珷灏氭湭瀹℃牳,闈炰綔鑰呮湰浜烘棤鏉冩煡鐪?', 'javascript:;');
exit();
}
//璁剧疆浜嗘潈闄愰檺鍒剁殑鏂囩珷
//arctitle msgtitle moremsg
if($needMoney>0 || $needRank>1)
{
$arctitle = $arc->Fields['title'];
/*
$arclink = GetFileUrl($arc->ArcID,$arc->Fields["typeid"],$arc->Fields["senddate"],
$arc->Fields["title"],$arc->Fields["ismake"],$arc->Fields["arcrank"]);
*/
$arclink = $cfg_phpurl.'/view.php?aid='.$arc->ArcID;
$arcLinktitle = "".$arctitle."";
$description = $arc->Fields["description"];
$pubdate = GetDateTimeMk($arc->Fields["pubdate"]);
//浼氬憳绾у埆涓嶈冻
if(($needRank>1 && $cfg_ml->M_Rank < $needRank && $arc->Fields['mid']!=$cfg_ml->M_ID))
{
$dsql->Execute('me' , "SELECT * FROM `#@__arcrank` ");
while($row = $dsql->GetObject('me'))
{
$memberTypes[$row->rank] = $row->membername;
}
$memberTypes[0] = "娓稿鎴栨病鏉冮檺浼氬憳";
$msgtitle = "浣犳病鏈夋潈闄愭祻瑙堟枃妗o細{$arctitle} 锛?;
$moremsg = "杩欑瘒鏂囨。闇€瑕 ".$memberTypes[$needRank]." 鎵嶈兘璁块棶锛屼綘鐩墠鏄細".$memberTypes[$cfg_ml->M_Rank]." 锛?;
include_once(DEDETEMPLATE.'/plus/view_msg.htm');
exit();
}
//闇€瑕侀噾甯佺殑鎯呭喌
if($needMoney > 0 && $arc->Fields['mid'] != $cfg_ml->M_ID)
{
$sql = "SELECT aid,money FROM `#@__member_operation` WHERE buyid='ARCHIVE".$aid."' AND mid='".$cfg_ml->M_ID."'";
$row = $dsql->GetOne($sql);
//鏈喘涔拌繃姝ゆ枃绔
if(!is_array($row))
{
if($cfg_ml->M_Money=='' || $needMoney > $cfg_ml->M_Money)
{
$msgtitle = "浣犳病鏈夋潈闄愭祻瑙堟枃妗o細{$arctitle} 锛?;
$moremsg = "杩欑瘒鏂囨。闇€瑕 ".$needMoney." 閲戝竵 鎵嶈兘璁块棶锛屼綘鐩墠鎷ユ湁閲戝竵锛欬font color='red'>".$cfg_ml->M_Money." 涓?/font> 锛?;
include_once(DEDETEMPLATE.'/plus/view_msg.htm');
$arc->Close();
exit();
}
else
{
if($dopost=='buy')
{
$inquery = "INSERT INTO `#@__member_operation`(mid,oldinfo,money,mtime,buyid,product,pname)
VALUES ('".$cfg_ml->M_ID."','$arctitle','$needMoney','".time()."', 'ARCHIVE".$aid."', 'archive',''); ";
if($dsql->ExecuteNoneQuery($inquery))
{
$inquery = "UPDATE `#@__member` SET money=money-$needMoney WHERE mid='".$cfg_ml->M_ID."'";
if(!$dsql->ExecuteNoneQuery($inquery))
{
showmsg('璐拱澶辫触, 璇疯繑鍥?, -1);
exit;
}
#api{{
if(defined('UC_APPID'))
{
include_once DEDEROOT.'/api/uc.func.php';
$row = $dsql->GetOne("SELECT `scores`,`userid` FROM `#@__member` WHERE `mid`='".$cfg_ml->M_ID."'");
uc_credit_note($row['userid'],-$needMoney,'money');
}
#/aip}}
showmsg('璐拱鎴愬姛锛岃喘涔版墸鐐逛笉浼氶噸鎵i噾甯侊紝璋㈣阿锛?, '/plus/view.php?aid='.$aid);
exit;
} else {
showmsg('璐拱澶辫触, 璇疯繑鍥?, -1);
exit;
}
}
$msgtitle = "鎵i噾甯佽喘涔伴槄璇伙紒";
$moremsg = "闃呰璇ユ枃妗e唴瀹归渶瑕佷粯璐癸紒
杩欑瘒鏂囨。闇€瑕 ".$needMoney." 閲戝竵 鎵嶈兘璁块棶锛屼綘鐩墠鎷ユ湁閲戝竵 ".$cfg_ml->M_Money." 涓紒
纭闃呰璇风偣 [纭浠樼偣闃呰]" ;
include_once($cfg_basedir.$cfg_templets_dir."/plus/view_msg.htm");
$arc->Close();
exit();
}
}
}//閲戝竵澶勭悊浠樺鐞
}
$arc->Display();