define('SCR', 'act_alipay_push'); require_once 'global.php'; S::gp(array('action')); require_once R_P . 'lib/activity/alipay.php'; $service = $action; $AlipayInterface = new AlipayInterface($service); if ($action == 'user_authentication') { //身份验证 $param = array('return_url' => "{$db_bbsurl}/act_alipay_receive.php?action={$action}"); ObHeader($AlipayInterface->alipayurl($param)); } elseif ($action == 'confirm_aa_detail_payment') { //订单支付 S::gp(array('actuid', 'tid', 'fromuid', 'actmid'), GP, 2); $memberdb = $db->get_one("SELECT am.uid,am.username,am.ifpay,am.isrefund,am.out_trade_no,am.totalcash,am.ifanonymous,t.authorid FROM pw_activitymembers am LEFT JOIN pw_threads t USING(tid) WHERE am.actuid=" . S::sqlEscape($actuid)); L::loadClass('ActivityForBbs', 'activity', false); $postActForBbs = new PW_ActivityForBbs($data); $data = array(); $memberdb['authorid'] == $winduid && Showmsg('act_toalipay_authorid'); //发起人无法替别人支付 $isAdminright = $postActForBbs->getAdminRight($memberdb['authorid']); if ($memberdb['isrefund'] || $memberdb['ifanonymous'] && !$isAdminright && $memberdb['uid'] != $winduid) { //退款的无法支付、匿名但没有权限的无法支付 Showmsg('act_toalipay_error'); } $memberdb['ifpay'] != 0 && Showmsg('act_toalipay_payed'); //只有未支付状态才可以支付 if (!$memberdb['totalcash'] || !preg_match("/^(([1-9]\\d*)|0)(\\.\\d{0,2})?\$/", $memberdb['totalcash'])) { //费用错误 Showmsg('act_toalipay_cash_error'); } $memberdb['totalcash'] = number_format($memberdb['totalcash'], 2, '.', '');
$overprint = $overPrintService->getOverPrintIcon($read['overprint']); } if ($forumset['viewpic'] && !$winduid) { $viewpic = 1; } if ($read['modelid'] || $foruminfo['modelid']) { L::loadClass('posttopic', 'forum', false); $postTopic = new postTopic($read); } if ($read['special'] > 20 || $foruminfo['pcid']) { L::loadClass('postcate', 'forum', false); $postCate = new postCate($read); } if ($read['special'] == 8 || $foruminfo['actmids']) { L::loadClass('ActivityForBbs', 'activity', false); $postActForBbs = new PW_ActivityForBbs($data); } //分类信息主题帖 if ($read['modelid']) { $modelid = $read['modelid']; $topicvalue = $postTopic->getTopicvalue($read['modelid']); $initSearchHtml = $postTopic->initSearchHtml($read['modelid']); foreach ($postTopic->topicmodeldb as $key => $value) { if ($value['cateid'] == $foruminfo['cateid']) { $modeldb[$key] = $value; } } } //团购主题帖 if ($read['special'] > 20) { $pcid = $read['special'] - 20;
//所有子分类预设字段共用默认查询、高级查询的设置 //$allModelUpdateFields = array('ifsearch'=>$ifsearch[$key],'ifasearch'=>$ifasearch[$key]); //$db->update("UPDATE pw_activityfield SET " . S::sqlSingle($allModelUpdateFields) . " WHERE fieldname=" . S::sqlEscape($fieldRow['fieldname'])); if (!$fieldRow['mustenable']) { $updateFields['ifmust'] = $ifmust[$key]; $updateFields['ifable'] = $ifable[$key]; } } $fieldService->updateField($key, $updateFields); } adminmsg("operate_success", $basename . "&action=editmodel&actid=" . $actid . "&actmid=" . $actmid); } elseif ('3' == $step) { //预览 $pwpost = array(); L::loadClass('ActivityForBbs', 'activity', false); $postActForBbs = new PW_ActivityForBbs($data); $topichtml = $postActForBbs->getActHtml($actmid); include PrintEot('activity'); exit; } } elseif ('editmodelname' == $action) { S::gp(array('step'), GP, 2); define('AJAX', 1); if (empty($step)) { $ajax_basename_editmodelname = EncodeUrl($basename . '&action=editmodelname&'); $ajax_basename_delmodel = EncodeUrl($basename . "&action=delmodel"); $modeldb = $categoryService->getModelsByCateId($actid); //获取活动子分类 include PrintEot('activity'); ajax_footer(); } elseif (2 == $step) {
/** * 将活动帖子的数据删除 * @param array $activityDb 帖子数据,形入array(tid, tid) */ function _delActivityTopic($activityDb) { global $db; $defaultValueTableName = getActivityValueTableNameByActmid(); $newActivityDb = array(); $query = $db->query("SELECT actmid,tid FROM {$defaultValueTableName} WHERE tid IN(" . S::sqlImplode($activityDb) . ")"); while ($rt = $db->fetch_array($query)) { $newActivityDb[$rt['actmid']][] = $rt['tid']; } /*帖子被删除费用日志更新*/ L::loadClass('ActivityForBbs', 'activity', false); $postActForBbs = new PW_ActivityForBbs($data); $data = array(); /*帖子被删除费用日志更新*/ foreach ($newActivityDb as $key => $value) { $tids = S::sqlImplode($value); $userDefinedValueTableName = getActivityValueTableNameByActmid($key, 1, 1); $db->update("DELETE FROM {$defaultValueTableName} WHERE tid IN({$tids})"); $db->update("DELETE FROM {$userDefinedValueTableName} WHERE tid IN({$tids})"); $db->update("DELETE FROM pw_activitymembers WHERE tid IN({$tids})"); /*帖子被删除费用日志更新*/ $postActForBbs->UpdatePayLog($value, 0, 4); /*帖子被删除费用日志更新*/ /*帖子被删除发送站内信*/ $postActForBbs->activityDelSendmsg($value); /*帖子被删除发送站内信*/ } }
list($rt['name1'], $rt['name2']) = explode('{#}', $rt['newname']); $rt['searchhtml'] = $postTopic->getASearchHtml($rt['type'], $rt['fieldid'], $rt['textsize'], $rt['rules']); $asearchdb[$rt['fieldid']] = $rt; } } elseif ($pcid) { L::loadClass('postcate', 'forum', false); $postTopic = new postCate($pwpost); $query = $db->query("SELECT fieldid,name as newname,type,rules,vieworder,textsize FROM pw_pcfield WHERE pcid = " . S::sqlEscape($pcid) . " AND ifable='1' AND ifasearch='1' ORDER BY vieworder ASC,fieldid ASC"); while ($rt = $db->fetch_array($query)) { list($rt['name1'], $rt['name2']) = explode('{#}', $rt['newname']); $rt['searchhtml'] = $postTopic->getASearchHtml($rt['type'], $rt['fieldid'], $rt['textsize'], $rt['rules']); $asearchdb[$rt['fieldid']] = $rt; } } elseif ($actmid || $allactmid) { L::loadClass('ActivityForBbs', 'activity', false); $postActForBbs = new PW_ActivityForBbs($data); $fieldService = L::loadClass('ActivityField', 'activity'); if ($actmid) { $advancedSearchFieldDb = $fieldService->getEnabledAndAdvancedSearchableFieldsByModelId($actmid); } else { $advancedSearchFieldDb = $fieldService->getDefaultSearchFields(); } foreach ($advancedSearchFieldDb as $rt) { if ($rt['ifasearch'] == 1) { $rt['searchhtml'] = $postActForBbs->getASearchHtml($rt['type'], $rt['fieldname'], $rt['textwidth'], $rt['rules']); $asearchdb[$rt['fieldname']] = $rt; } } } if (empty($asearchdb)) { showmsg('topic_search_forum');
//只有支付方式为支付宝才可以退款 $tempcost = $db->get_value("SELECT SUM(totalcash) as sum FROM pw_activitymembers WHERE isrefund=1 AND fupid=" . S::sqlEscape($actuid)); if ($refund_fee > number_format($memberdb['totalcash'] - $tempcost, 2, '.', '')) { paymsg("read.php?tid={$tid}", 'act_refund_cost_error'); } $sqlarray = array('fupid' => $actuid, 'tid' => $tid, 'uid' => $memberdb['uid'], 'actmid' => $memberdb['actmid'], 'username' => $memberdb['username'], 'totalcash' => $refund_fee, 'signuptime' => $timestamp, 'isrefund' => 1, 'refundreason' => $memberdb['refundreason']); $db->update("INSERT INTO pw_activitymembers SET " . S::sqlSingle($sqlarray)); $db->update("UPDATE {$defaultValueTableName} SET updatetime=" . S::sqlEscape($timestamp) . " WHERE tid=" . S::sqlEscape($tid)); //报名列表动态时间 $newactuid = $db->insert_id(); /*支付成功费用流通日志 退款成功 */ $data = array(); L::loadClass('ActivityForBbs', 'activity', false); $postActForBbs = new PW_ActivityForBbs($data); $statusValue = $postActForBbs->getActivityStatusValue($tid); $postActForBbs->UpdatePayLog($tid, $newactuid, $statusValue); /*支付成功费用流通日志*/ /*短消息通知 退款 发起人*/ $msgContentText = $memberdb['isadditional'] ? 'activity_refund2_content' : 'activity_refund_content'; M::sendNotice(array($memberdb['author']), array('title' => getLangInfo('writemsg', 'activity_refund_title', array('uid' => $memberdb['uid'], 'username' => $memberdb['username'], 'tid' => $tid, 'subject' => $memberdb['subject'], 'totalcash' => $refund_fee)), 'content' => getLangInfo('writemsg', $msgContentText, array('uid' => $memberdb['uid'], 'username' => $memberdb['username'], 'tid' => $tid, 'subject' => $memberdb['subject'], 'totalcash' => $refund_fee))), 'notice_active', 'notice_active'); /*短消息通知 退款 参与人*/ $msgContentText = $memberdb['isadditional'] ? 'activity_refund2_signuper_content' : 'activity_refund_signuper_content'; M::sendNotice(array($memberdb['username']), array('title' => getLangInfo('writemsg', 'activity_refund_signuper_title', array('uid' => $memberdb['authorid'], 'username' => $memberdb['author'], 'tid' => $tid, 'subject' => $memberdb['subject'], 'totalcash' => $refund_fee)), 'content' => getLangInfo('writemsg', $msgContentText, array('uid' => $memberdb['authorid'], 'username' => $memberdb['author'], 'tid' => $tid, 'subject' => $memberdb['subject'], 'totalcash' => $refund_fee))), 'notice_active', 'notice_active'); paymsg("read.php?tid={$tid}", 'act_refund_success'); } else { paymsg("index.php", 'undefined_action'); } function paymsg($url, $msg, $notify = 'success') {
function RevertActivityTopic($activityDb) { global $db; $defaultValueTableName = getActivityValueTableNameByActmid(); $newActivityDb = array(); $query = $db->query("SELECT actmid,tid FROM {$defaultValueTableName} WHERE tid IN(" . S::sqlImplode($activityDb) . ")"); while ($rt = $db->fetch_array($query)) { $newActivityDb[$rt['actmid']][] = $rt['tid']; } /*支付成功费用流通日志*/ L::loadClass('ActivityForBbs', 'activity', false); $postActForBbs = new PW_ActivityForBbs($data); $data = array(); /*支付成功费用流通日志*/ foreach ($newActivityDb as $key => $value) { $tids = S::sqlImplode($value); $userDefinedValueTableName = getActivityValueTableNameByActmid($key, 1, 1); $db->update("UPDATE {$defaultValueTableName} SET ifrecycle='0' WHERE tid IN({$tids})"); $db->update("UPDATE {$userDefinedValueTableName} SET ifrecycle='0' WHERE tid IN({$tids})"); /*支付成功费用流通日志*/ foreach ($value as $tid) { $statusValue = $postActForBbs->getActivityStatusValue($tid); $postActForBbs->UpdatePayLog($tid, 0, $statusValue); } /*支付成功费用流通日志*/ } }
$userrvrc = round($winddb['rvrc'] / 10, 1); $windid = $winddb['username']; if (file_exists(D_P . "data/groupdb/group_{$groupid}.php")) { //* require_once pwCache::getPath(S::escapePath(D_P . "data/groupdb/group_$groupid.php")); pwCache::getData(S::escapePath(D_P . "data/groupdb/group_{$groupid}.php")); } else { //* require_once pwCache::getPath(D_P . "data/groupdb/group_1.php"); pwCache::getData(D_P . "data/groupdb/group_1.php"); } define('FX', 1); } $read = $db->get_one("SELECT authorid,subject,fid FROM pw_threads WHERE tid=" . S::sqlEscape($tid)); //帖子信息 $data = array(); L::loadClass('ActivityForBbs', 'activity', false); $postActForBbs = new PW_ActivityForBbs($data); $isAdminright = $postActForBbs->getAdminRight($read['authorid']); !$isAdminright && Showmsg('act_export_noright'); $ifpaydb = array('0' => getLangInfo('other', 'act_ifpay_0'), '1' => getLangInfo('other', 'act_ifpay_1'), '2' => getLangInfo('other', 'act_ifpay_1'), '3' => getLangInfo('other', 'act_ifpay_3'), '4' => getLangInfo('other', 'act_ifpay_4')); if ($db_charset == 'utf-8' || $db_charset == 'big5') { foreach ($ifpaydb as $key => $value) { $ifpaydb[$key] = pwConvert($value, 'gbk', $db_charset); } } $payMemberNums = $orderMemberNums = 0; $query = $db->query("SELECT signupnum,ifpay FROM pw_activitymembers WHERE fupid=0 AND tid=" . S::sqlEscape($tid)); while ($rt = $db->fetch_array($query)) { if ($rt['ifpay'] != 3) { //费用关闭的不算 $orderMemberNums += $rt['signupnum']; //已报名人数
foreach ($signupnumsdb as $key => $value) { $signupdetail .= ($signupdetail ? ',' : '') . $feesdb[$key]['condition'] . $value . getLangInfo('other', 'act_people'); } } $totalcash = $defaultValue['totalcash']; require_once PrintEot('ajax'); ajax_footer(); } require_once PrintEot('ajax'); ajax_footer(); } elseif ($job == 'sendmsg') { //群发短消息 S::gp(array('tid', 'actmid', 'authorid')); $data = array(); L::loadClass('ActivityForBbs', 'activity', false); $postActForBbs = new PW_ActivityForBbs($data); $isAdminright = $postActForBbs->getAdminRight($authorid); $isAdminright != 1 && Showmsg('act_sendmsg_noright'); if (empty($_POST['step'])) { $tid = $db->get_value("SELECT tid FROM pw_activitymembers WHERE tid=" . S::sqlEscape($tid)); !$tid && Showmsg('act_sendmsg_fail'); require_once PrintEot('ajax'); ajax_footer(); } elseif ($_POST['step'] == 2) { PostCheck(); S::gp(array('subject', 'atc_content', 'tid', 'ifsave')); require_once R_P . 'require/common.php'; $msg_title = trim($subject); $atc_content = trim($atc_content); if (empty($atc_content) || empty($msg_title)) { Showmsg('msg_empty');
$N_allowtypeopen = true; } } /*团购*/ if ($foruminfo['pcid'] || $pcid > 0) { L::loadClass('postcate', 'forum', false); $postCate = new postCate($pwpost); $pcids = explode(",", $foruminfo['pcid']); if ($foruminfo['pcid']) { $N_allowtypeopen = true; } } /*活动*/ if ($foruminfo['actmids'] || $actmid > 0) { L::loadClass('ActivityForBbs', 'activity', false); $postActForBbs = new PW_ActivityForBbs($data); $actmids = explode(",", $foruminfo['actmids']); $firstactmid = 0; foreach ($actmids as $value) { if (isset($postActForBbs->activitymodeldb[$value]) && $postActForBbs->activitymodeldb[$value]['ifable'] && $postActForBbs->activitycatedb[$postActForBbs->activitymodeldb[$value]['actid']]['ifable']) { $firstactmid = $value; break; } } if ($foruminfo['actmids']) { $N_allowtypeopen = true; } $db_menuinit .= ",'td_activitylist' : 'menu_activitylist'"; } $theSpecialFlag = false; //是否是特殊帖子(分类、团购、活动)
} else { $postmodify = new topicModify($tid, 0, $pwpost); } $atcdb = $postmodify->init(); $postmodify->check(); if ($postmodify->type == 'topic') { $atc_email = $atcdb['ifmail'] == 1 || $atcdb['ifmail'] == 3 ? 'checked' : ""; $atc_newrp = $atcdb['ifmail'] == 2 || $atcdb['ifmail'] == 3 ? 'checked' : ""; list($magicid, $magicname) = explode("\t", $atcdb['magic']); $type = $atcdb['type']; $special = $atcdb['special']; $modelid = $atcdb['modelid']; $pcid = $atcdb['special'] > 20 ? $atcdb['special'] - 20 : 0; if ($atcdb['special'] == 8) { L::loadClass('ActivityForBbs', 'activity', false); $postActForBbs = new PW_ActivityForBbs($data); $actmid = $postActForBbs->getActmid($tid); } $isCheck_hiddenPost = $atcdb['shares'] ? "checked" : ""; $isCheck_anonymous = $atcdb['anonymous'] ? "checked" : ""; } else { $special = $modelid = $pcid = 0; } $theSpecialFlag = false; if ($pcid > 0 || $modelid > 0 || $actmid > 0) { $db_forcetype = 0; $theSpecialFlag = true; } if ($modelid) { //分类主题 L::loadClass('posttopic', 'forum', false);