本文整理匯總了PHP中RepPostStr函數的典型用法代碼示例。如果您正苦於以下問題:PHP RepPostStr函數的具體用法?PHP RepPostStr怎麽用?PHP RepPostStr使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了RepPostStr函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: AddGbook
function AddGbook($add)
{
global $empire, $dbtbpre, $level_r, $public_r;
//驗證IP
eCheckAccessDoIp('gbook');
CheckCanPostUrl();
//驗證來源
$bid = (int) getcvar('gbookbid');
if (empty($bid)) {
$bid = intval($add[bid]);
}
$name = RepPostStr(trim($add[name]));
$email = RepPostStr($add[email]);
$call = RepPostStr($add[call]);
$lytext = RepPostStr($add[lytext]);
if (empty($bid) || empty($name) || empty($email) || !trim($lytext)) {
printerror("EmptyGbookname", "history.go(-1)", 1);
}
if (!chemail($email)) {
printerror("EmailFail", "history.go(-1)", 1);
}
//驗證碼
$keyvname = 'checkgbookkey';
if ($public_r['gbkey_ok']) {
ecmsCheckShowKey($keyvname, $add['key'], 1);
}
$lasttime = getcvar('lastgbooktime');
if ($lasttime) {
if (time() - $lasttime < $public_r['regbooktime']) {
printerror("GbOutTime", "", 1);
}
}
//版麵是否存在
$br = $empire->fetch1("select bid,checked,groupid from {$dbtbpre}enewsgbookclass where bid='{$bid}';");
if (empty($br[bid])) {
printerror("EmptyGbook", "history.go(-1)", 1);
}
//權限
if ($br['groupid']) {
$user = islogin();
if ($level_r[$br[groupid]][level] > $level_r[$user[groupid]][level]) {
printerror("HaveNotEnLevel", "history.go(-1)", 1);
}
}
$lytime = date("Y-m-d H:i:s");
$ip = egetip();
$userid = (int) getcvar('mluserid');
$username = RepPostVar(getcvar('mlusername'));
$sql = $empire->query("insert into {$dbtbpre}enewsgbook(name,email,`call`,lytime,lytext,retext,bid,ip,checked,userid,username) values('{$name}','{$email}','{$call}','{$lytime}','{$lytext}','','{$bid}','{$ip}','{$br['checked']}','{$userid}','{$username}');");
ecmsEmptyShowKey($keyvname);
//清空驗證碼
if ($sql) {
esetcookie("lastgbooktime", time(), time() + 3600 * 24);
//設置最後發表時間
$reurl = DoingReturnUrl("../tool/gbook/?bid={$bid}", $add['ecmsfrom']);
printerror("AddGbookSuccess", $reurl, 1);
} else {
printerror("DbError", "history.go(-1)", 1);
}
}
示例2: EditSpaceStyle
function EditSpaceStyle($add,$userid,$username){
global $empire,$dbtbpre;
$styleid=intval($add[styleid]);
if(empty($add[stylename])||empty($add[stylepath])||!$styleid)
{
printerror('EmptySpaceStyle','history.go(-1)');
}
$add[stylepath]=RepPathStr($add[stylepath]);
$add['stylepath']=RepPostStr($add['stylepath'],1);
//目錄是否存在
if(!file_exists("../../space/template/".$add[stylepath]))
{
printerror("EmptySpaceStylePath","history.go(-1)");
}
$mg=ReturnSpaceStyleMemberGroup($add['membergroup']);
$sql=$empire->query("update {$dbtbpre}enewsspacestyle set stylename='$add[stylename]',stylepic='$add[stylepic]',stylesay='$add[stylesay]',stylepath='$add[stylepath]',membergroup='$mg' where styleid='$styleid'");
if($sql)
{
insert_dolog("styleid=$styleid&stylename=$add[stylename]");//操作日誌
printerror("EditSpaceStyleSuccess","ListSpaceStyle.php".hReturnEcmsHashStrHref2(1));
}
else
{
printerror("DbError","history.go(-1)");
}
}
示例3: EditMoreport
function EditMoreport($add, $userid, $username)
{
global $empire, $dbtbpre;
$add[pid] = (int) $add[pid];
if (!$add[pid] || !$add[pname] || !$add[ppath] || !$add[purl] || !$add[postpass] || !$add[tempgid]) {
printerror("EmptyMoreport", "history.go(-1)");
}
//驗證權限
CheckLevel($userid, $username, $classid, "moreport");
$add['pname'] = hRepPostStr($add['pname'], 1);
$add['purl'] = RepPostStr($add['purl'], 1);
$add['ppath'] = RepPostStr($add['ppath'], 1);
$add['postpass'] = RepPostStr($add['postpass'], 1);
$add['postfile'] = RepPostStr($add['postfile'], 1);
$add['tempgid'] = (int) $add['tempgid'];
$add['mustdt'] = (int) $add['mustdt'];
$add['isclose'] = (int) $add['isclose'];
$add['closeadd'] = (int) $add['closeadd'];
if (!file_exists($add['ppath'] . 'e/config/config.php')) {
printerror("ErrorMoreportPath", "history.go(-1)");
}
$sql = $empire->query("update {$dbtbpre}enewsmoreport set pname='{$add['pname']}',purl='{$add['purl']}',ppath='{$add['ppath']}',postpass='{$add['postpass']}',postfile='{$add['postfile']}',tempgid='{$add['tempgid']}',mustdt='{$add['mustdt']}',isclose='{$add['isclose']}',closeadd='{$add['closeadd']}' where pid='{$add['pid']}'");
//更新緩存
Moreport_UpdateIsclose();
GetConfig();
if ($sql) {
//操作日誌
insert_dolog("pid={$add['pid']}&pname={$add['pname']}");
printerror("EditMoreportSuccess", "ListMoreport.php" . hReturnEcmsHashStrHref2(1));
} else {
printerror("DbError", "history.go(-1)");
}
}
示例4: EditSafeInfo
function EditSafeInfo($add)
{
global $empire, $dbtbpre, $public_r;
$user_r = islogin();
//是否登陸
$userid = $user_r[userid];
$username = $user_r[username];
$rnd = $user_r[rnd];
//郵箱
$email = trim($add['email']);
if (!$email || !chemail($email)) {
printerror("EmailFail", "history.go(-1)", 1);
}
$email = RepPostStr($email);
//驗證原密碼
$oldpassword = RepPostVar($add[oldpassword]);
if (!$oldpassword) {
printerror('FailOldPassword', '', 1);
}
$add[password] = RepPostVar($add[password]);
$num = 0;
$ur = $empire->fetch1("select " . eReturnSelectMemberF('userid,password,salt') . " from " . eReturnMemberTable() . " where " . egetmf('userid') . "='{$userid}'");
if (empty($ur['userid'])) {
printerror('FailOldPassword', '', 1);
}
if (!eDoCkMemberPw($oldpassword, $ur['password'], $ur['salt'])) {
printerror('FailOldPassword', '', 1);
}
//郵箱
$pr = $empire->fetch1("select regemailonly from {$dbtbpre}enewspublic limit 1");
if ($pr['regemailonly']) {
$num = $empire->gettotal("select count(*) as total from " . eReturnMemberTable() . " where " . egetmf('email') . "='{$email}' and " . egetmf('userid') . "<>'{$userid}' limit 1");
if ($num) {
printerror("ReEmailFail", "history.go(-1)", 1);
}
}
//密碼
$a = '';
$salt = '';
$truepassword = '';
if ($add[password]) {
if ($add[password] !== $add[repassword]) {
printerror('NotRepassword', 'history.go(-1)', 1);
}
$salt = eReturnMemberSalt();
$password = eDoMemberPw($add[password], $salt);
$a = "," . egetmf('password') . "='{$password}'," . egetmf('salt') . "='{$salt}'";
$truepassword = $add[password];
}
$sql = $empire->query("update " . eReturnMemberTable() . " set " . egetmf('email') . "='{$email}'" . $a . " where " . egetmf('userid') . "='{$userid}'");
if ($sql) {
//易通行係統
DoEpassport('editpassword', $userid, $username, $truepassword, $salt, $email, $user_r['groupid'], '');
printerror("EditInfoSuccess", "../member/EditInfo/EditSafeInfo.php", 1);
} else {
printerror("DbError", "history.go(-1)", 1);
}
}
示例5: DoSetSpace
function DoSetSpace($add)
{
global $empire, $dbtbpre;
$user_r = islogin();
//是否登陸
$spacename = RepPostStr($add['spacename']);
$spacegg = RepPostStr($add['spacegg']);
$sql = $empire->query("update {$dbtbpre}enewsmemberadd set spacename='{$spacename}',spacegg='{$spacegg}' where userid='{$user_r['userid']}' limit 1");
if ($sql) {
printerror('SetSpaceSuccess', 'SetSpace.php', 1);
} else {
printerror('DbError', '', 1);
}
}
示例6: ReMemberGbook
function ReMemberGbook($add)
{
global $empire, $dbtbpre;
$user_r = islogin();
//ÊÇ·ñµÇ½
$gid = intval($add['gid']);
if (!$gid) {
printerror("EmptyReMemberGbook", "history.go(-1)", 1);
}
$retext = RepPostStr($add['retext']);
$sql = $empire->query("update {$dbtbpre}enewsmembergbook set retext='{$retext}' where gid='{$gid}' and userid='{$user_r['userid']}'");
if ($sql) {
printerror("ReMemberGbookSuccess", $_SERVER['HTTP_REFERER'], 1);
} else {
printerror("DbError", "history.go(-1)", 1);
}
}
示例7: AddMemberFeedback
function AddMemberFeedback($add)
{
global $empire, $dbtbpre;
//驗證碼
$keyvname = 'checkspacefbkey';
ecmsCheckShowKey($keyvname, $add['key'], 1);
//用戶
$userid = intval($add['userid']);
$ur = $empire->fetch1("select " . egetmf('userid') . " from " . eReturnMemberTable() . " where " . egetmf('userid') . "='{$userid}' limit 1");
if (empty($ur['userid'])) {
printerror("NotUsername", "", 1);
}
//發表者
$uid = (int) getcvar('mluserid');
if ($uid) {
$uname = RepPostVar(getcvar('mlusername'));
} else {
$uid = 0;
$uname = '';
}
$uname = RepPostStr($uname);
$name = RepPostStr($add['name']);
$company = RepPostStr($add['company']);
$phone = RepPostStr($add['phone']);
$fax = RepPostStr($add['fax']);
$email = RepPostStr($add['email']);
$address = RepPostStr($add['address']);
$zip = RepPostStr($add['zip']);
$title = RepPostStr($add['title']);
$ftext = RepPostStr($add['ftext']);
if (!trim($name) || !trim($title) || !trim($ftext)) {
printerror("EmptyMemberFeedback", "history.go(-1)", 1);
}
$addtime = date("Y-m-d H:i:s");
$ip = egetip();
$eipport = egetipport();
$sql = $empire->query("insert into {$dbtbpre}enewsmemberfeedback(name,company,phone,fax,email,address,zip,title,ftext,userid,ip,uid,uname,addtime,eipport) values('{$name}','{$company}','{$phone}','{$fax}','{$email}','{$address}','{$zip}','{$title}','{$ftext}',{$userid},'{$ip}',{$uid},'{$uname}','{$addtime}','{$eipport}');");
ecmsEmptyShowKey($keyvname);
//清空驗證碼
if ($sql) {
printerror("AddMemberFeedbackSuccess", $_SERVER['HTTP_REFERER'], 1);
} else {
printerror("DbError", "history.go(-1)", 1);
}
}
示例8: AddMsg
function AddMsg($add)
{
global $empire, $level_r, $dbtbpre;
$user = islogin();
$title = RepPostStr(trim($add['title']));
$to_username = RepPostVar(trim($add['to_username']));
$msgtext = RepPostStr($add['msgtext']);
if (empty($title) || !trim($msgtext) || empty($to_username)) {
printerror("EmptyMsg", "", 1);
}
if ($user['username'] == $to_username) {
printerror("MsgToself", "", 1);
}
//字數
$len = strlen($msgtext);
if ($len > $level_r[$user[groupid]][msglen]) {
printerror("MoreMsglen", "", 1);
}
//接收方是否存在
$r = $empire->fetch1("select " . eReturnSelectMemberF('userid,groupid') . " from " . eReturnMemberTable() . " where " . egetmf('username') . "='{$to_username}' limit 1");
if (!$r['userid']) {
printerror("MsgNotToUsername", "", 1);
}
//對方短消息是否滿
$mnum = $empire->gettotal("select count(*) as total from {$dbtbpre}enewsqmsg where to_username='{$to_username}'");
if ($mnum + 1 > $level_r[$r[groupid]][msgnum]) {
printerror("UserMoreMsgnum", "", 1);
}
$msgtime = date("Y-m-d H:i:s");
$sql = $empire->query("insert into {$dbtbpre}enewsqmsg(title,msgtext,haveread,msgtime,to_username,from_userid,from_username,isadmin,issys) values('" . addslashes($title) . "','" . addslashes($msgtext) . "',0,'{$msgtime}','{$to_username}','{$user['userid']}','{$user['username']}',0,0);");
$newhavemsg = eReturnSetHavemsg($user['havemsg'], 0);
$usql = $empire->query("update " . eReturnMemberTable() . " set " . egetmf('havemsg') . "='{$newhavemsg}' where " . egetmf('username') . "='{$to_username}' limit 1");
if ($sql) {
printerror("AddMsgSuccess", "../member/msg/", 1);
} else {
printerror("DbError", "", 1);
}
}
示例9: PayApiShopPay
function PayApiShopPay($ddid, $money, $paybz, $orderid, $userid, $username, $ecms_paytype)
{
global $empire, $dbtbpre;
//驗證是否重複提交
$orderid = RepPostVar($orderid);
$num = $empire->gettotal("select count(*) as total from {$dbtbpre}enewspayrecord where orderid='{$orderid}' limit 1");
if ($num) {
printerror('您已成功購買此訂單', '../../ShopSys/buycar/', 1, 0, 1);
}
$ddr = PayApiShopDdMoney($ddid);
if ($money == $ddr['tmoney']) {
$money = (double) $money;
$sql = $empire->query("update {$dbtbpre}enewsshopdd set haveprice=1 where ddid='{$ddid}'");
$posttime = date("Y-m-d H:i:s");
$payip = egetip();
$userid = (int) $ddr[userid];
$username = $ddr[username] ? $ddr[username] : $ddr[truename];
$username = RepPostStr($username);
$paybz = str_replace('[!--ddno--]', $ddr[ddno], $paybz);
$empire->query("insert into {$dbtbpre}enewspayrecord(id,userid,username,orderid,money,posttime,paybz,type,payip) values(NULL,'{$userid}','{$username}','{$orderid}','{$money}','{$posttime}','{$paybz}','{$ecms_paytype}','{$payip}');");
}
printerror('您已成功購買此訂單', '../../ShopSys/buycar/', 1, 0, 1);
}
示例10: DoWapListPage
function DoWapListPage($num, $line, $page, $search)
{
if (empty($num)) {
return '';
}
$str = '';
$pagenum = ceil($num / $line);
$search = RepPostStr($search, 1);
$phpself = eReturnSelfPage(0);
if ($page) {
$str .= "<a href=\"" . $phpself . "?page=0" . $search . "\">首頁</a> ";
}
if ($page) {
$str .= "<a href=\"" . $phpself . "?page=" . ($page - 1) . $search . "\">上一頁</a> ";
}
if ($page != $pagenum - 1) {
$str .= "<a href=\"" . $phpself . "?page=" . ($page + 1) . $search . "\">下一頁</a> ";
}
if ($page != $pagenum - 1) {
$str .= "<a href=\"" . $phpself . "?page=" . ($pagenum - 1) . $search . "\">尾頁</a> ";
}
return $str;
}
示例11: EditSafeInfo
function EditSafeInfo($add)
{
global $empire, $user_tablename, $public_r, $user_userid, $user_username, $user_password, $user_dopass, $user_email, $user_salt, $user_saltnum, $dbtbpre, $user_group;
$user_r = islogin();
//是否登陸
$userid = $user_r[userid];
$username = $user_r[username];
$rnd = $user_r[rnd];
//郵箱
$email = trim($add['email']);
if (!$email || !chemail($email)) {
printerror("EmailFail", "history.go(-1)", 1);
}
$email = RepPostStr($email);
$email = doUtfAndGbk($email, 0);
//驗證原密碼
$oldpassword = RepPostVar($add[oldpassword]);
if (!$oldpassword) {
printerror('FailOldPassword', '', 1);
}
$a = '';
$sa = '';
$add[password] = RepPostVar($add[password]);
$password = doUtfAndGbk($add[password], 0);
$oldpassword = doUtfAndGbk($oldpassword, 0);
if (empty($user_dopass)) {
$password = md5($password);
$oldpassword = md5($oldpassword);
} elseif ($user_dopass == 2) {
$salt = make_password($user_saltnum);
$password = md5(md5($password) . $salt);
$sa = "," . $user_salt . "='{$salt}'";
} elseif ($user_dopass == 3) {
$password = substr(md5($password), 8, 16);
$oldpassword = substr(md5($oldpassword), 8, 16);
}
$num = 0;
//雙重md5
if ($user_dopass == 2) {
$ur = $empire->fetch1("select " . $user_userid . "," . $user_salt . "," . $user_password . " from " . $user_tablename . " where " . $user_userid . "='{$userid}'");
$oldpassword = md5(md5($oldpassword) . $ur[$user_salt]);
$num = 0;
if ($oldpassword == $ur[$user_password]) {
$num = 1;
}
if (empty($ur[$user_userid])) {
$num = 0;
}
} else {
$num = $empire->gettotal("select count(*) as total from " . $user_tablename . " where " . $user_userid . "='{$userid}' and " . $user_password . "='" . $oldpassword . "'");
}
if (!$num) {
printerror('FailOldPassword', '', 1);
}
//郵箱
$pr = $empire->fetch1("select regemailonly from {$dbtbpre}enewspublic limit 1");
if ($pr['regemailonly']) {
$num = $empire->gettotal("select count(*) as total from " . $user_tablename . " where " . $user_email . "='{$email}' and " . $user_userid . "<>'{$userid}' limit 1");
if ($num) {
printerror("ReEmailFail", "history.go(-1)", 1);
}
}
//密碼
if ($add[password]) {
if ($add[password] !== $add[repassword]) {
printerror('NotRepassword', 'history.go(-1)', 1);
}
$a = "," . $user_password . "='" . $password . "'" . $sa;
}
$sql = $empire->query("update " . $user_tablename . " set " . $user_email . "='{$email}'" . $a . " where " . $user_userid . "='{$userid}'");
if ($sql) {
printerror("EditInfoSuccess", "../member/EditInfo/EditSafeInfo.php", 1);
} else {
printerror("DbError", "history.go(-1)", 1);
}
}
示例12: RepPIntvar
$page = RepPIntvar($page);
$start = 0;
$line = 12;
//每頁顯示條數
$page_line = 12;
//每頁顯示鏈接數
$offset = $page * $line;
//總偏移量
//搜索
$search = '';
$search .= $ecms_hashur['ehref'];
$and = '';
if ($_GET['sear']) {
$keyboard = RepPostVar2($_GET['keyboard']);
if ($keyboard) {
$show = RepPostStr($_GET['show'], 1);
if ($show == 1) {
$and .= " where gbtext like '%{$keyboard}%'";
} elseif ($show == 2) {
$and .= " where retext like '%{$keyboard}%'";
} elseif ($show == 3) {
$and .= " where uname like '%{$keyboard}%'";
} elseif ($show == 4) {
$and .= " where userid='{$keyboard}'";
} elseif ($show == 5) {
$and .= " where ip like '%{$keyboard}%'";
}
$search .= "&sear=1&keyboard={$keyboard}&show={$show}";
}
}
$query = "select gid,isprivate,uid,uname,ip,addtime,gbtext,retext,userid,eipport from {$dbtbpre}enewsmembergbook" . $and;
示例13: DelMoreGbook
function DelMoreGbook($add, $logininid, $loginin)
{
global $empire, $dbtbpre;
CheckLevel($logininid, $loginin, $classid, "gbook");
//驗證權限
//變量處理
$name = RepPostStr($add['name']);
$ip = RepPostVar($add['ip']);
$email = RepPostStr($add['email']);
$mycall = RepPostStr($add['mycall']);
$lytext = RepPostStr($add['lytext']);
$startlyid = (int) $add['startlyid'];
$endlyid = (int) $add['endlyid'];
$startlytime = RepPostVar($add['startlytime']);
$endlytime = RepPostVar($add['endlytime']);
$checked = (int) $add['checked'];
$ismember = (int) $add['ismember'];
$bid = (int) $add['bid'];
$havere = (int) $add['havere'];
$where = '';
//留言分類
if ($bid) {
$where .= " and bid='{$bid}'";
}
//是否會員
if ($ismember) {
if ($ismember == 1) {
$where .= " and userid=0";
} else {
$where .= " and userid>0";
}
}
//留言ID
if ($endlyid) {
$where .= ' and lyid BETWEEN ' . $startlyid . ' and ' . $endlyid;
}
//發布時間
if ($startlytime && $endlytime) {
$where .= " and lytime>='{$startlytime}' and lytime<='{$endlytime}'";
}
//是否審核
if ($checked) {
$checkval = $checked == 1 ? 0 : 1;
$where .= " and checked='{$checkval}'";
}
//是否回複
if ($havere) {
if ($havere == 1) {
$where .= " and retext<>''";
} else {
$where .= " and retext=''";
}
}
//姓名
if ($name) {
$where .= " and name like '%{$name}%'";
}
//發布IP
if ($ip) {
$where .= " and ip like '%{$ip}%'";
}
//郵箱
if ($email) {
$where .= " and email like '%{$email}%'";
}
//電話
if ($mycall) {
$where .= " and `mycall` like '%{$mycall}%'";
}
//留言內容
if ($lytext) {
$where .= " and lytext like '%{$lytext}%'";
}
if (!$where) {
printerror("EmptyDelMoreGbook", "history.go(-1)");
}
$where = substr($where, 5);
$sql = $empire->query("delete from {$dbtbpre}enewsgbook where " . $where);
insert_dolog("");
//操作日誌
printerror("DelGbookSuccess", "DelMoreGbook.php" . hReturnEcmsHashStrHref2(1));
}
示例14: RepPIntvar
$search = $ecms_hashur['ehref'];
$page = (int) $_GET['page'];
$page = RepPIntvar($page);
$start = 0;
$line = 25;
//每頁顯示條數
$page_line = 18;
//每頁顯示鏈接數
$offset = $page * $line;
//總偏移量
$totalquery = "select count(*) as total from {$dbtbpre}enewsshopdd";
$query = "select ddid,ddno,ddtime,userid,username,outproduct,haveprice,checked,truename,psid,psname,pstotal,alltotal,payfsid,payfsname,payby,alltotalfen,fp,fptotal,pretotal from {$dbtbpre}enewsshopdd";
$add = '';
$and = ' where ';
//搜索
$sear = RepPostStr($_GET['sear'], 1);
if ($sear) {
$keyboard = $_GET['keyboard'];
$keyboard = RepPostVar2($keyboard);
if ($keyboard) {
$show = (int) $_GET['show'];
if ($show == 1) {
$add = $and . "ddno like '%{$keyboard}%'";
} elseif ($show == 2) {
$add = $and . "username like '%{$keyboard}%'";
} elseif ($show == 3) {
$add = $and . "truename like '%{$keyboard}%'";
} elseif ($show == 4) {
$add = $and . "email like '%{$keyboard}%'";
} else {
$add = $and . "address like '%{$keyboard}%'";
示例15: AddDd
function AddDd($add)
{
global $empire, $user_tablename, $user_money, $user_userid, $user_userfen, $user_rnd, $public_r, $dbtbpre;
//驗證權限
ShopCheckAddDdGroup();
//購物車無內容
if (!getcvar('mybuycar')) {
printerror("EmptyBuycar", "history.go(-1)", 1);
}
$add[ddno] = RepPostVar($add[ddno]);
$add[truename] = RepPostStr($add[truename]);
$add[oicq] = RepPostStr($add[oicq]);
$add[msn] = RepPostStr($add[msn]);
$add[call] = RepPostStr($add[call]);
$add[phone] = RepPostStr($add[phone]);
$add[email] = RepPostStr($add[email]);
$add[address] = RepPostStr($add[address]);
$add[zip] = RepPostStr($add[zip]);
$add[bz] = RepPostStr($add[bz]);
$add[g_truename] = RepPostStr($add[g_truename]);
$add[g_oicq] = RepPostStr($add[g_oicq]);
$add[g_msn] = RepPostStr($add[g_msn]);
$add[g_call] = RepPostStr($add[g_call]);
$add[g_phone] = RepPostStr($add[g_phone]);
$add[g_email] = RepPostStr($add[g_email]);
$add[g_address] = RepPostStr($add[g_address]);
$add[g_zip] = RepPostStr($add[g_zip]);
$add[fptt] = RepPostStr($add[fptt]);
$add[fp] = (int) $add[fp];
$add[psid] = (int) $add[psid];
$add[payfsid] = (int) $add[payfsid];
if (!$add[truename] || !$add[call] || !$add[email] || !$add[address] || !$add[g_truename] || !$add[g_call] || !$add[g_address] || !$add[g_email] || !$add[psid] || !$add[payfsid]) {
printerror("MustEnterSelect", "history.go(-1)", 1);
}
$mess = "AddDdSuccess";
$haveprice = 0;
$payby = 0;
//返回購物車存放格式
$buyr = ReturnBuycardd();
$alltotal = $buyr[2];
$alltotalfen = $buyr[1];
$buycar = $buyr[3];
//發票
$fptotal = 0;
if ($add[fp]) {
$fptotal = $alltotal * ($public_r[fpnum] / 100);
}
//配送方式
$pr = $empire->fetch1("select pid,pname,price from {$dbtbpre}enewsshopps where pid='{$add['psid']}'");
if (empty($pr[pid])) {
printerror("NotPsid", "history.go(-1)", 1);
}
//支付方式
$payr = $empire->fetch1("select payid,payname,payurl,userpay,userfen from {$dbtbpre}enewsshoppayfs where payid='{$add['payfsid']}'");
if (empty($payr[payid])) {
printerror("NotPayfsid", "history.go(-1)", 1);
}
//取得用戶信息
$userid = (int) getcvar('mluserid');
$username = RepPostVar(getcvar('mlusername'));
if ($userid) {
$rnd = RepPostVar(getcvar('mlrnd'));
$user = $empire->fetch1("select " . $user_userid . "," . $user_money . "," . $user_userfen . " from " . $user_tablename . " where " . $user_userid . "='{$userid}' and " . $user_rnd . "='{$rnd}' limit 1");
if (!$user[$user_userid]) {
printerror("MustSingleUser", "history.go(-1)", 1);
}
}
$location = "../ShopSys/buycar/";
//直接扣點
if ($payr[userfen]) {
if ($buyr[0]) {
printerror("NotProductForBuyfen", "history.go(-1)", 1);
} else {
if ($userid) {
$buyallfen = $alltotalfen + $pr[price];
if ($buyallfen > $user[$user_userfen]) {
printerror("NotEnoughFenBuy", "history.go(-1)", 1);
}
//扣除點數
$usql = $empire->query("update " . $user_tablename . " set " . $user_userfen . "=" . $user_userfen . "-" . $buyallfen . " where " . $user_userid . "='{$userid}'");
if ($usql) {
$mess = "AddDdSuccessa";
$payby = 1;
$haveprice = 1;
}
} else {
printerror("NotLoginTobuy", "history.go(-1)", 1);
}
}
} elseif ($payr[userpay]) {
if ($userid) {
$buyallmoney = $alltotal + $pr[price] + $fptotal;
if ($buyallmoney > $user[$user_money]) {
printerror("NotEnoughMoneyBuy", "history.go(-1)", 1);
}
//扣除金額
$usql = $empire->query("update " . $user_tablename . " set " . $user_money . "=" . $user_money . "-" . $buyallmoney . " where " . $user_userid . "='{$userid}'");
if ($usql) {
$mess = "AddDdSuccessa";
$payby = 2;
//.........這裏部分代碼省略.........