Ejemplo n.º 1
0
         define('AJAX', 1);
         $posthash = EncodeUrl("{$basename}&action=active&job=del&selid={$id}&ajax=1");
         require_once A_P . 'template/admin_ajax.htm';
         ajax_footer();
     } else {
         S::gp(array('selid', 'urladd'));
         if (isset($_GET['ajax'])) {
             define('AJAX', 1);
         }
         $basename .= "&action={$action}&job=list" . $urladd;
         if (!$selid) {
             adminmsg('operate_error');
         }
         require_once A_P . 'lib/active.class.php';
         $newActive = new PW_Active();
         $newActive->delActive($selid);
         if (defined('AJAX')) {
             echo "ok\t{$selid}";
             ajax_footer();
         } else {
             adminmsg('operate_success');
         }
     }
 } else {
     S::gp(array('page', 'type', 'limit', 'activestate'), 'GP', 2);
     S::gp(array('title', 'cname', 'cadmin', 'createtime_s', 'createtime_e', 'orderway', 'ordertype', 'activestate'));
     $activeState = formSelect('activestate', $activestate, array('-1' => '不限制', '1' => '可以报名', '2' => '人员已满', '3' => '报名已截止', '4' => '活动进行中', '5' => '活动已结束'), 'class="select_wa"');
     $activeTypes = array(1 => '出游', 2 => '聚餐 ', 3 => '舞会', 4 => '户外', 5 => '烧烤', 6 => '其他');
     $activeTypeSelection = formSelect('type', $type, $activeTypes, 'class="select_wa"', '不限制');
     $orderwayTypeSelection = formSelect('orderway', $orderway, array('members' => '报名人数', 'id' => '发布时间'), 'class="select_wa fl mr20"');
     $ascChecked = $ordertype == 'asc' ? 'checked' : '';
Ejemplo n.º 2
0
     define('AJAX', 1);
 }
 S::gp(array('id', 'frombbs'));
 require_once A_P . 'groups/lib/active.class.php';
 $newActive = new PW_Active();
 if (!($active = $newActive->getActiveById($id)) || $active['cid'] != $cyid) {
     Showmsg('data_error');
 }
 if (empty($_POST['step'])) {
     require_once PrintEot('m_ajax');
     ajax_footer();
 } else {
     if ($winduid != $active['uid'] && !$ifadmin) {
         Showmsg('您不是活动的创建者,无权取消!');
     }
     $newActive->delActive($id);
     $weiboService = L::loadClass('weibo', 'sns');
     /* @var $weiboService PW_Weibo */
     $weibo = $weiboService->getWeibosByObjectIdsAndType($id, 'group_active');
     if ($weibo) {
         $weiboService->deleteWeibos($weibo['mid']);
     }
     //activitynum减一
     //$db->update("UPDATE pw_colonys SET activitynum=activitynum-1 WHERE id=" . S::sqlEscape($cyid));
     $colony['activitynum']--;
     updateGroupLevel($colony['id'], $colony);
     if ($frombbs == 1) {
         refreshto("thread.php?cyid={$cyid}&showtype=active", '取消成功!');
     } else {
         refreshto("{$basename}a={$a}&cyid={$cyid}", '取消成功!');
     }