<!--<?php
include_once uTemplate::PrintEot('header');
include_once uTemplate::PrintEot('space_appleft');
print <<<EOT
-->
<link rel="stylesheet" href="apps/activity/images/style.css?{$GLOBALS['wind_repair']}" />
<div class="sideD">
	<div class="boxA">
		<h2><span class="mr10">活動</span></h2>
		<div class="p10 cc">
			<div class="navD mb10">
				<ul class="cc">
					<li id="see_fromforum"><a href="{$basename}"><span>來自版塊</span></a></li>
					<li id="see_fromgroup"><a href="{$basename}see=fromgroup"><span>來自群組</span></a></li>
				</ul>
			</div>
			<div class="aa_title">
				<span class="fr">
					<form action="mode.php" method="GET">
					<input type="hidden" name="m" value="o" />
					<input type="hidden" name="q" value="activity" />
					<input type="hidden" name="a" value="$a" />
					<input type="hidden" name="see" value="$see" />
					<input type="hidden" name="uid" value="$uid" />
					<select name="timerange" onchange="submit()">
						$timeSelectHtml
					</select>
<!--
EOT;
if (empty($see)) {
print <<<EOT
-->
					<select name="actmid" onchange="submit()">
						$actmidSelectHtml
					</select>
<!--
EOT;
}else{print<<<EOT
-->
					<select name="type" onchange="submit()">
						<option value="0" $type_0>所有分類</option>
						<option value="1" $type_1>出游</option>
						<option value="2" $type_2>聚餐 </option>
						<option value="3" $type_3>舞會</option>
						<option value="4" $type_4>戶外</option>
						<option value="5" $type_5>燒烤</option>
						<option value="6" $type_6>其他</option>
					</select>
<!--
EOT;
}print <<<EOT
-->
				</form>
			</span>
			<h3>$seeTitle</h3>
			<span class="f14">(共{$count}個)</span>
			</div>
<!--
EOT;
if (!empty($activities)) {
print <<<EOT
-->
<script type="text/javascript" src="js/global.js"></script>
<script type="text/javascript" src="js/app_global.js"></script>
<script type="text/javascript" src="apps/$appdir/js/activitytype.js"></script>
<script type="text/javascript">
function actRecommend(tid, actmid, obj) {
	ajax.send("pw_ajax.php?action=activity&job=recommend&tid="+tid+"&actmid="+actmid,"",function(){
		var rText = ajax.request.responseText.split('\t');
		if (rText[0] == 'success') {
			var isRecommendOrNot;
			if (rText[1] != 1) {
				isRecommendOrNot = '推薦活動';
			} else {
				isRecommendOrNot = '取消推薦';
			}
			obj.title = isRecommendOrNot;
			obj.innerHTML = isRecommendOrNot;
			showDialog('success','操作成功!',2);

		} else if (rText[0] == 'noright') {
			showDialog('error','您沒有推薦活動的權限',2);
			return false;
		} else {
			showDialog('error','操作失敗',2);
			return false;
		}
	});
}
</script>
		<ul class="aa_list aa_my mt10">
<!--
EOT;
foreach ($activities as $key => $value) {print <<<EOT
-->
		<li class="item" id="activity_$key">
			<div class="summary">
				<h4>
					<em>
<!--
EOT;
if (empty($see)) {
print <<<EOT
-->
						<a href="{$basename}a=$a&see=$see&actmid=$value[actmid]">[{$activity_modeldb[$value[actmid]][name]}]</a>
<!--
EOT;
} else {
$activitydb = array(
	'1'=>'出游',
	'2'=>'聚餐 ',
	'3'=>'舞會',
	'4'=>'戶外',
	'5'=>'燒烤',
	'6'=>'其他',
);
print <<<EOT
-->
						<a href="{$basename}a=$a&see=$see&type=$value[type]">[{$activitydb[$value[type]]}]</a>
<!--
EOT;
}print <<<EOT
-->
					</em>
<!--
EOT;
if (empty($see)) {
print <<<EOT
-->
					<a target="_blank" href="read.php?tid=$value[tid]">$value[subject]</a>
<!--
EOT;
} else {
print <<<EOT
-->
					<a target="_blank" href="apps.php?q=group&a=active&job=view&cyid=$value[cid]&id=$value[id]">$value[title]</a>
<!--
EOT;
}print <<<EOT
-->
				</h4>
				<ul class="attr">
					<li>活動時間︰$value[starttime] 至 $value[endtime]</li>
					<li>活動地點︰$value[location]</li>
				</ul>
				<p class="view_more">
<!--
EOT;
if (empty($see)) {
print <<<EOT
-->
					<a target="_blank" href="read.php?tid=$value[tid]">查看活動詳情</a>
<!--
EOT;
} else {
print <<<EOT
-->
					<a target="_blank" href="apps.php?q=group&a=active&job=view&cyid=$value[cid]&id=$value[id]">查看活動詳情</a>
<!--
EOT;
}if (empty($see)) {
	if ($isGM || $SYSTEM['delactive']) {print <<<EOT
-->
					<a class="del" href="javascript:;" onclick="pwConfirm('是否確認刪除', this, function() {delActivity('$value[tid]')})">刪除活動</a>
<!--
EOT;
	}
	if ($isGM || $SYSTEM['recommendactive']) {
		$text = $value['recommend'] ? '取消推薦' : '推薦活動';
print <<<EOT
-->
					<a title="$text" class="recommend" href="javascript:;" onclick="actRecommend('$value[tid]', '$value[actmid]', this);">
					$text
					</a>
<!--
EOT;
	}
}print <<<EOT
-->
				</p>
			</div>
			<div class="others">
				<ul>
					<li>發起人︰
<!--
EOT;
if ($value[authorid]) {
print <<<EOT
-->
						<a target="_blank" href="{$db_userurl}$value[authorid]">$value[author]</a>
<!--
EOT;
} else {
print <<<EOT
-->
						<i>匿名</i>
<!--
EOT;
}
print <<<EOT
-->
					</li>
					<li>報名人數︰$value[signup]</li>
				</ul>
				<p>
					$value[actionButton]
				</p>
			</div>
<!--
EOT;
}print <<<EOT
-->
			</ul>
			<div class="p10 cc">$pages</div>
<!--
EOT;
} else {print <<<EOT
-->
			<div class="p10 f14 tac">沒有活動</div>
<!--
EOT;
}
print <<<EOT
-->
			</div>
		</div>
	</div>
<script type="text/javascript">setCurrent('see_$see','see_fromforum','current');</script>
<!--
EOT;
require_once(uTemplate::printEot('footer'));
?>-->