<!--<?php
if($action=='leaveword'){print <<<EOT
-->
<form action="pw_ajax.php?action=$action" method="post" onsubmit="return false;">
<input type="hidden" name="verify" value="$verifyhash" />
<div style="width:360px;">
	<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><span class="adel cp" onclick="closep();">關閉</span>樓主留言</div>
	<table width="100%">
		<tr>
			<td class="p10">
			<textarea onkeydown="ajax.quickpost(event,this.form)" name="atc_content" class="textareaA">{$rt[leaveword]}</textarea></td>
		</tr>
		<tr style="display:none;">
			<td width="70">消息通知:</td>
			<td><label class="mr20"><input type="radio" name="ifmsg" value="1" checked />開啟</label><label><input type="radio" name="ifmsg" value="0" />關閉</label></td>
		</tr>
</table>
<input type="hidden" name="step" value="2" />
<input type="hidden" name="tid" value="$tid" />
<input type="hidden" name="pid" value="$pid" />
<div class="popBottom"><span class="btn2"><span><button type="button" name="ajaxsubmit" onclick="ajax.submit(this.form,worded);">提 交</button></span></span></div>
</div>
</form>
<!--
EOT;
}elseif($action=='favor'){print <<<EOT
-->
<div style="width:150px;">
	<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><span class="adel cp" onclick="closep();">關閉</span>選擇分類</div>
	<table width="100%">
<!--
EOT;
foreach($typeid as $key=>$value){
if ($key == '0') {
print <<<EOT
-->
		<tr><td><a onclick="favor('0');" href="javascript:">默認分類</a></td></tr>
<!--
EOT;
} else {print <<<EOT
-->
		<tr><td><a onclick="favor('$key');return false;" href="javascript:">$value</a></td></tr>
<!--
EOT;
}}print <<<EOT
-->
	</table>
</div>
<!--
EOT;
}elseif($action=='relatetag'){print <<<EOT
-->
<div class="popTop cc" style="cursor:move" onmousedown="read.move(event);"><span class="fl w">標簽:$tagname</span><span class="adel cp" onclick="closep();">關閉</span></div>
<table cellspacing="0" cellpadding="5" width="100%">
	<tr><td>
	<ul class="pw_ulB" style="padding:0 10px 0 0;">
<!--
EOT;
foreach($readdb as $key=>$value){print <<<EOT
-->
	<li style=""><a href="read.php?tid=$value[tid]" class="a6">$value[subject]</a></li>
<!--
EOT;
}print <<<EOT
-->
	</ul></td></tr>
</table>
<div class="popBottom cc"><a class="s7 fr" href="link.php?action=tag&tagname=$tagname">更多內容</a></div>
<!--
EOT;
}elseif($action=='draft'){print <<<EOT
-->
<div style="width:450px;">
	<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><span class="adel cp" onclick="closep();">關閉</span>草稿箱</div>
	<table width="100%">
<!--
EOT;
$i=($page-1)*$db_showperpage;
foreach($drdb as $key=>$value){
$i++;
print <<<EOT
-->
		<tr>
			<td class="p10"><textarea class="textareaA mr10">{$value[content]}</textarea> <img style="cursor:pointer" src="$imgpath/post/c_editor/insert.gif" onclick="draft.insert(this)" alt="插入" title="插入" /> <img style="cursor:pointer" src="$imgpath/post/c_editor/save.gif" onclick="draft.update(this,'$value[did]')" alt="保存" title="保存" /> <img style="cursor:pointer" src="$imgpath/post/c_editor/del.gif" alt="刪除" onclick="draft.del('$value[did]','$page')" title="刪除" /></td>
		</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<!--
EOT;
if($maxpage>1){print <<<EOT
-->
		<div class="popBottom cc">
<!--
EOT;
if($page>1){print <<<EOT
-->
		<a class="fl cp" onclick="draft.prev('$page');">上一頁</a>
<!--
EOT;
}if($page<$maxpage){print <<<EOT
-->
		<a class="cp fr" onclick="draft.next('$page');">下一頁</a>
<!--
EOT;
}print <<<EOT
-->
		</div>
<!--
EOT;
}print <<<EOT
-->
</div>
<!--
EOT;
}if($action=='login'){print <<<EOT
-->
<a href="u.php"><img src="$faceurl" onmouseout="clearTimeout(mt);read.close();"  onmouseover="mt=setTimeout('read.open(\'showface\',\'sf\',\'4\');',700);" style="float:left; margin-top:.4em;width:40px;height:40px;"/></a>
						<div style="padding:0 0 0 1em;margin:0 0 0 45px">
							<span id="sf" style="position:absolute; *margin:0 0 0 -.5em;"></span> <span class="user-infotwo" id="showface" style="display:none"> <span class="user-infoWraptwo"> <span class="co"></span>
							<a href="profile.php?action=modify&info_type=face" target="_blank">更換頭像</a><br />
							UID: $winduid <br />
							$db_rvrcname: <span class="s2 f10">$userrvrc $db_rvrcunit</span><br />
							$db_moneyname: <span class="s3 f10">$winddb[money] $db_moneyunit</span><br />
							$db_creditname: <span class="s3 f10">$winddb[credit] $db_creditunit</span><br />
							<span class="gray f10"> 最後登錄 {$lastlodate}<br />
							登錄IP: $onlineip<br />
							</span> </span> </span>
						</div>
						<div style="margin-left:50px; line-height:180%">
						<div class="fl" style="width:100%">
							<div class="gray" style="float:left;clear:right"><span class="fl">等級:$gp_grouptitle, 帖子: $winddb[postnum], <a href="apps.php?q=article" class="link5">我的主題</a> <a href="apps.php?q=article&see=post" class="link5">我的回復</a>&nbsp;</span><div class="fl" style="margin:.4em 1em 0 0"><a class="dropB" id="td_u">更多</a></div><span class="fl">
<!--
EOT;
if (SCR == 'index' && ($groupid == 3 || $groupid == 4)) {print <<<EOT
-->
								<a style="cursor:pointer" onclick="if (typeof MgMode == 'function') {mgm.showMenu(this);} else {KSHBJ=this;loadjs('js/mgmode.js');}">可視化布局</a>
<!--
EOT;
}if($db_replysitemail && getstatus($winddb['userstatus'],6)){print <<<EOT
-->
							| <a id="newrp" onclick="sendmsg('pw_ajax.php','action=newrp',this.id)" style="cursor:pointer;" class="s3">您的帖子有人回復</a>
<script>
function newrp() {
	ajax.guide();
	ajax.send('pw_ajax.php','action=newrp',function(){
		if (ajax.request.responseText.indexOf('<') != -1) {
			read.menu.innerHTML = ajax.request.responseText;
		} else {
			closep();
			getObj('newrp').parentNode.removeChild(getObj('newrp'));
		}
	});
}
</script>
<!--
EOT;
}print <<<EOT
-->
							</span></div>
<!--
EOT;
if($_G[allowhonor]){print <<<EOT
-->						<div class="c"></div>
							<span id="honor">
<!--
EOT;
if($winddb['honor']){print <<<EOT
-->
									{$winddb[honor]}
<!--
EOT;
}else{print <<<EOT
-->
您還沒有設置個性簽名
<!--
EOT;
}print <<<EOT
-->
							</span>
							<a id="sethonor" onclick="sendmsg('pw_ajax.php','action=honor',this.id)" class="gray" style="cursor:pointer">編輯</a>
							<div class="c"></div>
<script>
function honor() {
	var str = ajax.request.responseText.split("\t");
	if (str[0] == 'success') {
		getObj('honor').innerHTML = '&nbsp;' + (str[1] ? str[1] : '您還沒有設置個性簽名') + '&nbsp;';
	} else {
		ajax.guide();
	}
}
</script>
<!--
EOT;
}print <<<EOT
-->

						</div></div>
	<split />
<!--
EOT;
if($groupid=='guest'){print <<<EOT
-->
							<a href="$loginurl" style="color:#c3e4f5">登錄</a> &nbsp;<a href="$regurl" style="color:#c3e4f5" rel="nofollow">注冊</a>
<!--
EOT;
}else{print <<<EOT
-->
							<a href="u.php" style="color:#fff; font-weight:700">$windid</a> <a id="td_msg" href="message.php?type=sms" target="_blank">
<!--
EOT;
if($winddb[newpm]>0 && $_G[maxmsg]>0){print <<<EOT
-->
								<img src="$imgpath/pwicon/meg.gif" align="absmiddle"/>
<!--
EOT;
} else {print <<<EOT
-->
								<img src="$imgpath/pwicon/meg-read.gif" align="absmiddle"/>
<!--
EOT;
}print <<<EOT
-->
							</a>
							<a href="profile.php" style="color:#c3e4f5" target="_blank">設置</a> <a href="$loginouturl" style="color:#c3e4f5">退出</a>
<!--
EOT;
}print <<<EOT
-->
	<split />
	<li id="h_index"><a href="$db_bbsurl">討論區</a></li>
<!--
EOT;
if($winduid){
if($db_menu){
print <<<EOT
-->
	<li id="h_profile"><a id="td_profile" style="cursor:pointer;" onmouseover="read.open('menu_profile','td_profile');">用戶中心</a></li>
<!--
EOT;
}else{print <<<EOT
-->
	<li id="h_profile"><a id="td_profile" href="profile.php" target="_blank">用戶中心</a></li>
<!--
EOT;
}}if($_G[allowsort]){
if($db_menu){
print <<<EOT
-->
	<li id="h_sort"><a style="cursor:pointer;" id="td_sort" onmouseover="read.open('menu_sort','td_sort');">統計排行</a></li>
<!--
EOT;
}else{print <<<EOT
-->
	<li id="h_sort"><a id="td_sort" href="sort.php" rel="nofollow">統計排行</a></li>
<!--
EOT;
}}if($_G[allowmember]){print <<<EOT
-->
	<li id="h_member"><a href="member.php">會員</a></li>
<!--
EOT;
}if($_G['show']){print <<<EOT
-->
	<li id="h_show"><a href="show.php">展區</a></li>
<!--
EOT;
}if($db_iftag){print <<<EOT
-->
	<li id="h_job"><a href="link.php?action=taglist">標簽</a></li>
<!--
EOT;
}print <<<EOT
-->
	<li id="h_push"><a href="push.php?fid=$fid">推薦</a></li>
	<li id="h_search"><a href="searcher.php">搜索</a></li>
	<li id="h_hack"><a style="cursor:pointer;" id="td_hack" onmouseover="read.open('menu_hack','td_hack');">社區服務</a></li>
<!--
EOT;
foreach($db_hackdb as $key=>$hack){
if($hack[2]=='2' && file_exists(R_P."hack/$key/index.php")){print <<<EOT
-->
	<li><a href="hack.php?H_name=$hack[1]">$hack[0]</a></li>
<!--
EOT;
}}if($db_ifbookinfo){
$rawbbsname=rawurlencode($db_bbsname);
$rawbbsurl=rawurlencode($db_bbsurl);
$rawuser=rawurlencode($windid);
$pushurl="http://push.phpwind.net/book.php?tocharset=$db_charset&bbsname=$rawbbsname&bbsurl=$rawbbsurl&user=$rawuser";
if($tid){
$rawtitle=rawurlencode($subject);
print <<<EOT
-->
	<li><a href="$pushurl&tid=$tid&title=$rawtitle" target="_blank">訂閱本帖更新</a></li>
<!--
EOT;
}elseif($fid){
$rawforumname=rawurlencode($forumname);
print <<<EOT
-->
	<li><a href="$pushurl&fid=$fid&forumname=$rawforumname" target="_blank">訂閱本版更新</a></li>
<!--
EOT;
}else{print <<<EOT
-->
	<li><a href="$pushurl" target="_blank">訂閱全站新帖</a></li>
<!--
EOT;
}}if(CkInArray($windid,$manager) || $SYSTEM['allowadmincp']){print <<<EOT
-->
	<li><a href="$db_adminfile" target="_blank">系統設置</a></li>
<!--
EOT;
}}elseif($action=='msg'){print <<<EOT
-->
<div style="width:440px;">
<form action="pw_ajax.php?action=$action" method="post" onsubmit="return false;">
<input type="hidden" name="verify" value="$verifyhash" />
<input type="hidden" name="step" value="2" />
<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><span class="adel cp" onclick="closep();">關閉</span>發送消息</div>
<table class="vt" width="100%">
	<tbody>
	<tr><td width="15%">用戶</td><td><input type="text" class="input input_wb" name="pwuser" value="$reinfo[username]" /></td></tr>
	<tr><td>標題</td><td><input type="text" class="input input_wb" name="msg_title" maxlength="100" value="$subject" /></td></tr>
<!--
EOT;
if($db_gdcheck & 8){
$checkCode = L::loadClass('checkcode', 'site');
$checkCodeString = $checkCode->getCheckCodeTemplate();
print <<<EOT
-->
	<tr><td>驗證碼</td><td>
$checkCodeString
	<input class="input" onfocus="showgd();" type="text" name="gdcode" size="8" />
	<span id="ckcode" style="display:none;"></span>
	</td></tr>
<!--
EOT;
}if(($db_ckquestion & 8) && $db_question){
$qkey = array_rand($db_question);
if($db_imagequestion){
	$question = '<img id="ckquestion" src="ckquestion.php?q='.$qkey.'&t='.$timestamp.'" align="top">';
}else{
	$question = $qkey<0 ? getMachineQuestion_1() :  $db_question[$qkey];
}
$q_a = $question.($showq && $qkey>0?" &nbsp;（答案︰".$db_answer[$qkey] . '）' : '');
print <<<EOT
-->
	<!--
	<tr><td>驗證問題︰</td>
		<td><input class="input" type="text" name="qanswer" /><input type="hidden" name="qkey" value="$qkey" /> 問題$q_a</td></tr>
	 -->
<!--
EOT;
}print <<<EOT
-->
	<tr><td>內容</td><td><textarea name="atc_content" onkeydown="ajax.quickpost(event,this.form)" class="textareaA">$atc_content</textarea></td></tr>
	</tbody>
</table>
<script type="text/javascript">
msg_ajax = function(fp){
	if(fp['msg_title'].value == ""){
		ajax.showError('標題不能為空。');return false;
	}
	if(fp['atc_content'].value == ""){
		ajax.showError('內容不能為空。');return false;
	}
	ajax.submit(fp);
}

</script>
<div class="popBottom"><span class="btn2"><span><button type="button" name="ajaxsubmit" onclick="msg_ajax(this.form)">提 交</button></span></span></div>
</form>
</div>
<!--
EOT;
}elseif($action=='usetool'){print <<<EOT
-->
<div style="width:200px;">
<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><span class="adel cp" onclick="closep();">關閉</span>道具中心</div>
<table width="100%">
<!--
EOT;
foreach($tooldb as $key=>$value){print <<<EOT
-->
<tr>
	<td><a class="cp" onclick="usetool('{$value[0][id]}')" title="{$value[0][descrip]}">{$value[0][name]}({$value[0][nums]})</a></td>
	<td>
<!--
EOT;
if($value[1][name]){print <<<EOT
-->
		<a class="cp" onclick="usetool('{$value[1][id]}')" title="{$value[1][descrip]}">{$value[1][name]}({$value[1][nums]})</a>
<!--
EOT;
}print <<<EOT
-->
	</td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<div class="popBottom"><a href="profile.php?action=toolcenter" target="_blank" class="s4">購買道具</a></div>
</div>
<!--
EOT;
}elseif($action=='usertool'){print <<<EOT
-->
<div style="width:200px;">
<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><span class="adel cp" onclick="closep();">關閉</span>道具中心</div>
<table width="100%">
<!--
EOT;
foreach($tooldb as $key=>$value){print <<<EOT
-->
<tr>
	<td><a class="cp" onclick="usertool('$uid','{$value[0][id]}')" title="{$value[0][descrip]}">{$value[0][name]}({$value[0][nums]})</a></td>
	<td>
<!--
EOT;
if($value[1][name]){print <<<EOT
-->
		<a class="cp" onclick="usertool('$uid','{$value[1][id]}')" title="{$value[1][descrip]}">{$value[1][name]}({$value[1][nums]})</a>
<!--
EOT;
}print <<<EOT
-->
	</td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<div class="popBottom"><a href="profile.php?action=toolcenter" target="_blank" class="s4">購買道具</a></div>
</div>
<!--
EOT;
}elseif($action=='extend'){
if($type=='pwcode'){print <<<EOT
-->
<div class="p10">
<!--
EOT;
foreach($code as $key=>$value){print <<<EOT
-->
<span class="cp" id="wy_$value[name]" title="$value[title]" onclick="this.className='button';upcode(this.id,'$value[param]');"><img style="width:20px;height:20px;background:url($imgpath/post/c_editor/$value[icon]) 0 0 no-repeat;" src="$imgpath/blank.gif" /><span style="display:none">$value[descrip]</span></span>
<!--
EOT;
}print <<<EOT
-->
</div>
<!--
EOT;
}else{
if(!$setform){print <<<EOT
-->
<ul class="menuList tac">
<!--
EOT;
foreach($setformdb as $key=>$value){print <<<EOT
-->
<li><a href="javascript:;" onclick="showform('$value[id]');return false;">$value[name]</a></li>
<!--
EOT;
}print <<<EOT
-->
</ul>
<!--
EOT;
}else{print <<<EOT
-->
<div>
<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><span class="cp adel" onclick="closep();read.obj=null;">關閉</span>$setform[name]</div>
<div style="width:260px">
<table width="100%" id="formstyle">
<!--
EOT;
foreach($setform[value] as $k=>$v){print <<<EOT
-->
<tr><td width="60">$v[0]</td><td><!--
EOT;
if($v[1]){
$s=explode(',',$v[1]);
print <<<EOT
--><select class="select_wa"><!--
EOT;
foreach($s as $k1=>$v1){print <<<EOT
--><option value="$v1">$v1</option><!--
EOT;
}print <<<EOT
--></select><!--
EOT;
}else{print <<<EOT
--><input type="text" class="input input_wa"/><!--
EOT;
}print <<<EOT
--></td></tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<div class="popBottom"><span class="btn2"><span><button type="button" onclick="insertform('$setform[name]');">提 交</button></span></span><span class="bt2"><span><button type="button" onclick="closep();read.obj=null;">取消</button></span></span></div>
</div>
<!--
EOT;
}}}elseif($action=='sharelink'){print <<<EOT
-->
<div style="width:260px">
<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><span class="cp adel" onclick="closep();">關閉</span>友情鏈接申請</div>
<form action="pw_ajax.php?action=$action" method="post" onsubmit="return false;">
<input type="hidden" name="verify" value="$verifyhash" />
<table width="100%">
	<tr>
		<td>站點名稱 <font color="#FF0000">*</font></td>
		<td><input title="站點名稱" name="linkname" class="input input_wa"></td>
	</tr>
	<tr>
		<td>站點URL <font color="#FF0000">*</font></td>
		<td><input title="站點URL" name="linkurl" value="http://" class="input input_wa"></td>
	</tr>
	<tr>
		<td>聯系方式</td>
		<td><input title="聯系方式" name="username" class="input input_wa"></td>
	</tr>
	<tr>
		<td>站點說明</td>
		<td><input title="站點說明" name="linkdescrip" class="input input_wa"></td>
	</tr>
	<tr>
		<td>站點LOGO</td>
		<td><input title="站點LOGO" name="linklogo" class="input input_wa"></td>
	</tr>
</table>
<input type="hidden" name="step" value="2" />
<div class="popBottom"><span class="btn2"><span><button type="button" onclick="ajax.submit(this.form);">提 交</button></span></span></div>
</form>
</div>
<!--
EOT;
}elseif($action=='newrp'){print <<<EOT
-->
<div style="width:500px;">
<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><span class="cp adel" onclick="closep();">關閉</span>回復提醒</div>
<table width="100%">
<tr class="tr2 tac">
	<td width="20%">版塊名稱</td>
	<td>標題</td>
	<td width="20%">回復時間</td>
	<td width="6%">刪</td>
</tr>
<!--
EOT;
foreach($replydb as $key=>$val){print <<<EOT
-->
<tr class="tr3">
	<td><a href="thread.php?fid=$val[fid]" target="_blank">$val[fname]</a></td>
	<td class="tal"><a href="read.php?tid=$val[tid]" target="_blank">$val[subject]</a></td>
	<td><a>$val[lastpost]</a></td>
	<td><img src="$imgpath/post/c_editor/del.gif" style="cursor:pointer" onclick="ajax.send('pw_ajax.php','action=delnewrp&tid=$val[tid]',newrp);" /></td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
</div>
<!--
EOT;
}elseif($action=='showface'){print <<<EOT
-->
<div class="mb10">
<!--
EOT;
if ($pre_page && $pre_page < $page) {print <<<EOT
-->
	<a onclick="showSystemIcon($pre_page);" href="javascript:;" class="mr20">上一頁</a>
<!--
EOT;
}
if ($next_page && $next_page > $page) {print <<<EOT
-->
	<a onclick="showSystemIcon($next_page);" href="javascript:;">下一頁</a>
<!--
EOT;
}print <<<EOT
-->
</div>
<div class="profileFace">
	<ul class="cc">
<!--
EOT;
if (empty($imgname_array)) {print <<<EOT
-->
		<li style="width:100%;">已是最後一頁</li>
<!--
EOT;
} else {
foreach ($imgname_array as $key => $value) {print <<<EOT
-->
		<li onclick="showimage('$imgpath','$value')"><img src='$imgpath/face/$value' width="50" height="50" class="img"></li>
<!--
EOT;
}
}print <<<EOT
-->
	</ul>
</div>
<!--
EOT;
}elseif($action=='modify'){
if (!$isKmd || $checkkmd) {
print <<<EOT
-->
<div style="width:450px;">
<form action="ajax.php?action=$action&ajax=1" method="post" onsubmit="return false;">
<input type="hidden" name="verify" value="$verifyhash" />
<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><span class="cp adel" onclick="closep();">關閉</span>編輯帖子</div>
<div style="display: none;" class="wrongTip"></div>
<table width="100%" class="vt">
	<tr><td width="60">作者:</td><td>$atcdb[author]</td></tr>
	<tr><td>標題:</td><td><input class="input input_wb" type="text" name="atc_title" value="$atc_title" /></td></tr>
	<tr><td>內容</td><td>
		<textarea name="atc_content" onkeydown="ajax.quickpost(event,this.form)" class="textareaA" style="height:120px;">$atc_content</textarea>
	</td></tr>
<!--
EOT;
if(($db_gdcheck & 4) && (!$db_postgd || $winddb['postnum'] < $db_postgd)){
$checkCode = L::loadClass('checkcode', 'site');
$checkCodeString = $checkCode->getCheckCodeTemplate();
print <<<EOT
-->
	<tbody><tr><td>驗證碼︰</td>
		<td>
$checkCodeString
<input class="input" type="text" name="gdcode" onfocus="showgd();" size="6" tabindex="2" maxlength="4" />
<span id="ckcode" style="display:none;"></span>
</td></tr></tbody>
<!--
EOT;
}if(($db_ckquestion & 4) && (!$postq || $winddb[postnum] < $postq) && $db_question){
$qkey = array_rand($db_question);
if($db_imagequestion){
	$question = '<img id="ckquestion" src="ckquestion.php?q='.$qkey.'&t='.$timestamp.'" align="top">';
}else{
	$question = $qkey<0 ? getMachineQuestion_1() :  $db_question[$qkey];
}
$q_a = $question.($showq && $qkey>0?" &nbsp;（答案︰".$db_answer[$qkey] . '）' : '');
print <<<EOT
-->
	<tbody><tr><td>驗證問題︰</td>
		<td><span class="fl">{$q_a}</span><input class="input fl" type="text" size="5" name="qanswer" /><input type="hidden" name="qkey" value="$qkey" /></td></tr></tbody>
<!--
EOT;
}print <<<EOT
-->
</table>
<input type="hidden" name="step" value="2" />
<input type="hidden" name="fid" value="$fid" />
<input type="hidden" name="tid" value="$tid" />
<input type="hidden" name="pid" value="$pid" />
<input type="hidden" value="$article" name="article" />
<input type="hidden" value="1" name="atc_convert" />
<div class="popBottom"><span class="btn2"><span><button type="button" name="ajaxsubmit" onclick="ajax.send(this.form.getAttribute('action'),this.form,edited);">提 交</button></span></span><span class="bt2"><span><button type="button" onclick="window.location.href='post.php?action=modify&fid=$fid&tid=$tid&pid=$pid&article=$article'">進入高級模式</button></span></span></div>
</form>
</div>
<!--
EOT;
} elseif ($isKmd == 1 && !$checkkmd) {print <<<EOT
-->
<div style="width:400px;">
	<div class="popTop"><a onclick="closep();" href="javascript:;" class="adel">關閉</a><strong>友情提醒</strong></div>
	<div class="mb10">
		<div class="spaceTip s5" style="margin:10px 10px 0 10px;">編輯推廣中的孔明燈帖將扣除 $db_kmd_deducttime 小時的推廣時間，確認要編輯嗎？</div>
	</div>
	<div class="popBottom"><span class="btn2"><span><button type="button" onclick="sendmsg('ajax.php?action=modify&fid=$fid&tid=$tid&pid=$pid&article=$article&checkkmd=1', '', '$objid');" >確定</button></span></span><span class="bt2"><span><button onclick="closep();" type="button">取消</button></span></span></div>
</div>
<!--
EOT;
}}elseif($action=='quote'){print <<<EOT
-->
<div style="width:450px">
<form action="post.php?" method="post" name="quoteFORM" onsubmit="return checkpost(document.quoteFORM);">
<input type="hidden" name="verify" value="$verifyhash" />
<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><span class="cp adel" onclick="closep();">關閉</span>引用帖子</div>
<table class="vt" width="100%">
	<tr><td width="70">標題</td><td><input class="input input_wb" type="text" name="atc_title" value="$atc_title" /></td></tr>
<!--
EOT;
if(($db_gdcheck & 4) && (!$db_postgd || $winddb['postnum'] < $db_postgd)){
$checkCode = L::loadClass('checkcode', 'site');
$checkCodeString = $checkCode->getCheckCodeTemplate();
print <<<EOT
-->
	<tbody><tr><td>驗證碼︰</td>
		<td>
$checkCodeString
<input class="input" type="text" name="gdcode" onfocus="showgd();" size="6" tabindex="2" maxlength="4" />
<span id="ckcode" style="display:none;"></span>
</td></tr></tbody>
<!--
EOT;
}if(($db_ckquestion & 4) && (!$postq || $winddb[postnum] < $postq) && $db_question){
$qkey = array_rand($db_question);
if($db_imagequestion){
	$question = '<img id="ckquestion" src="ckquestion.php?q='.$qkey.'&t='.$timestamp.'" align="top">';
}else{
	$question = $qkey<0 ? getMachineQuestion_1() :  $db_question[$qkey];
}
$q_a = $question.($showq && $qkey>0?" &nbsp;（答案︰".$db_answer[$qkey] . '）' : '');
print <<<EOT
-->
	<tbody><tr><td>驗證問題︰</td>
		<td>{$q_a}<input class="input" size="3" type="text" name="qanswer" /><input type="hidden" name="qkey" value="$qkey" /></td></tr></tbody>
<!--
EOT;
}print <<<EOT
-->
	<tr><td>內容</td><td>
		<textarea name="atc_content" onkeydown="ajax.quickpost(event,this.form)" class="textareaA" style="height:120px;">$atc_content</textarea>
	</td></tr>
</table>
<input type="hidden" value="2" name="step" />
<input type="hidden" value="$pid" name="pid" />
<input type="hidden" name="replytouser" value="$replytouser" />
<input type="hidden" value="$action" name="action" />
<input type="hidden" value="$fid" name="fid" />
<input type="hidden" value="$tid" name="tid" />
<input type="hidden" value="1" name="ajax">
<input type="hidden" name="iscontinue" value="0">
<input type="hidden" value="$article" name="article" />
<input type="hidden" value="1" name="atc_usesign" />
<input type="hidden" value="1" name="atc_convert" />
<input type="hidden" value="cn0zz" name="_hexie" id="_hexiequote" />
<div class="popBottom"><span class="btn2"><span><button type="submit" name="Submit">提 交</button></span></span><span class="bt2"><span><button type="button" onclick="window.location.href='post.php?action=quote&fid=$fid&tid=$tid&pid=$pid&article=$article&page=$page#breadCrumb'">進入高級模式</button></span></span></div>
</form>
</div>
<script>
<!--
EOT;
$tmpVerify = GetVerify($onlineip.$GLOBALS['winddb']['regdate'].$fid.$tid);print <<<EOT
-->
setTimeout(function(){getObj('_hexiequote').value='$tmpVerify';},500);
</script>
<!--
EOT;
}elseif($action=='honor'){print <<<EOT
-->
<form action="pw_ajax.php?action=$action" method="post" onsubmit="return false;">
<input type="hidden" name="verify" value="$verifyhash" />
<input type="hidden" name="step" value="3" />
<table width="250" cellspacing="0" cellpadding="5">
	<tr><th class="h" colspan="2" style="cursor:move" onmousedown="read.move(event);"><span class="adel" onclick="closep();">close</span>個性簽名編輯</th></tr>
	<tr><td align="center"><textarea name="content" style="width:95%;height:60px">{$winddb[honor]}</textarea></td></tr>
</table><ul><li style="text-align:center;padding:4px 0;"><input type="button" class="btn" onclick="ajax.submit(this.form,honor);" value=" 提 交 " /></li></ul></form>
<!--
EOT;
}elseif($action=='readlog'){print <<<EOT
-->
<div class="popTop cc"><span class="fl w">最近瀏覽的帖子</span><span class="adel cp" onclick="closep();">關閉</span></div>
<table class="z">
<!--
EOT;
foreach($readb as $key=>$val){
$i=$key+1;
print <<<EOT
-->
<tr class="tr3 tac">
	<td class="tal"><a href="read.php?tid=$val[tid]">$val[subject]</a></td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<!--
EOT;
}elseif($action=='threadlog'){print <<<EOT
-->
<div class="popTop cc"><span class="fl w">最近瀏覽的版塊</span><span class="adel cp" onclick="closep();">關閉</span></div>
<table class="z">
<!--
EOT;
foreach($threaddb as $key=>$value){print <<<EOT
-->
<tr class="tr3"><td><a href="thread.php?fid=$key">$value</a></td></tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<!--
EOT;
}elseif($action=='mgmode'){print <<<EOT
-->
<div id="mgmode">
<table border="0" cellspacing="0" cellpadding="0"><tbody><tr><td class="bgcorner1"></td><td class="pobg1"></td><td class="bgcorner2"></td></tr><tr><td class="pobg4"></td><td><div class="popoutContent">
<div class="popTop cc"><span class="fl mr10 w">可視化布局</span><span class="adel cp" onclick="closep();">關閉</span></div>
	<table width="120" class="z">
<!--
EOT;
if($rightset['setforum']){print <<<EOT
-->
		<tr class="tr3"><td><a class="cp" onclick="mf = new mgm.forder();" title="可視化修改版塊布局">版塊排序</a></td></tr>
		<tr class="tr3"><td><a class="cp" onclick="mf = new mgm.fsetname();" title="點擊版塊名稱進行修改">版塊名稱修改</a></td></tr>
<!--
EOT;
}if($rightset['setstyles']){print <<<EOT
-->
		<tr class="tr3"><td><a class="cp" onclick="mf = new mgm.style();" title="前台可視化修改風格">風格設置</a></td></tr>
<!--
EOT;
}print <<<EOT
-->
	</table>
</div></td><td class="pobg2"></td></tr><tr><td class="bgcorner4"></td><td class="pobg3"></td><td class="bgcorner3"></td></tr></tbody></table>
</div>
<!--
EOT;
}elseif($action=='setstyle'){print <<<EOT
--><div style="width:550px;">
<form action="pw_ajax.php?action=$action" method="post" onsubmit="return false;">
<input type="hidden" name="verify" value="$verifyhash" />
<div class="popTop"><span class="adel cp" onclick="closep();">關閉</span>風格設置</div>
<table id="mgmode" width="100%" class="mb5">
	<tr>
		<td valign="top" style="padding:0;">
			<table class="z">
			<tr class="tr2">
				<td colspan="2">整體風格設置</td>
			</tr>
			<tr class="tr3">
				<td width="50%">表格寬度</td>
				<td><input class="input" type="text" name="set[tablewidth]" value="$tablewidth" onblur="mf.setcss(this);" /></td>
			</tr>
			<tr class="tr3">
				<td>頭部和尾部表格寬度</td>
				<td><input class="input" type="text" name="set[mtablewidth]" value="$mtablewidth" onblur="mf.setcss(this);" /></td>
			</tr>
			<tr class="tr3">
				<td>全局背景顏色</td>
				<td><input class="input" type="text" name="set[bgcolor]" value="$bgcolor" onblur="mf.setcss(this);" /></td>
			</tr>
			<tr class="tr3">
				<td>全局鏈接顏色</td>
				<td><input class="input" type="text" name="set[linkcolor]" value="$linkcolor" onblur="mf.setcss(this);" /></td>
			</tr>
			<tr class="tr3">
				<td>表格外邊框顏色</td>
				<td><input class="input" type="text" name="set[tablecolor]" value="$tablecolor" onblur="mf.setcss(this);" /></td>
			</tr>
			<tr class="tr3">
				<td>表格內邊框顏色</td>
				<td><input class="input" type="text" name="set[tdcolor]" value="$tdcolor" onblur="mf.setcss(this);" /></td>
			</tr>
			</table>
		</td>
		<td valign="top" style="padding:0;">
			<table class="z">
			<tr class="tr2"><td colspan="2">表格樣式顏色設置</td></tr>
			<tr class="tr3">
				<td>表格標題欄顏色</td>
				<td><input class="input" type="text" name="set[headcolor]" value="$headcolor" onblur="mf.setcss(this);" /></td>
			</tr>
			<tr class="tr3">
				<td>表格標題欄下邊框顏色</td>
				<td><input class="input" type="text" name="set[headborder]" value="$headborder" onblur="mf.setcss(this);" /></td>
			</tr>
			<tr class="tr3">
				<td>標題欄主要字體鏈接顏色</td>
				<td><input class="input" type="text" name="set[headfontone]" value="$headfontone" onblur="mf.setcss(this);" /></td>
			</tr>
			<tr class="tr3">
				<td>標題欄次要字體鏈接顏色</td>
				<td><input class="input" type="text" name="set[headfonttwo]" value="$headfonttwo" onblur="mf.setcss(this);" /></td>
			</tr>
			<tr class="tr3">
				<td>表格副標題欄顏色</td>
				<td><input class="input" type="text" name="set[cbgcolor]" value="$cbgcolor" onblur="mf.setcss(this);" /></td>
			</tr>
			<tr class="tr3">
				<td>表格副標題欄下邊框顏色</td>
				<td><input class="input" type="text" name="set[cbgborder]" value="$cbgborder" onblur="mf.setcss(this);" /></td>
			</tr>
			<tr class="tr3">
				<td>表格副標題欄字體顏色</td>
				<td><input class="input" type="text" name="set[cbgfont]" value="$cbgfont" onblur="mf.setcss(this);" /></td>
			</tr>
			<tr class="tr3">
				<td>論壇列表顏色一</td>
				<td><input class="input" type="text" name="set[forumcolorone]" value="$forumcolorone" onblur="mf.setcss(this);" /></td>
			</tr>
			<tr class="tr3">
				<td>論壇列表顏色二</td>
				<td><input class="input" type="text" name="set[forumcolortwo]" value="$forumcolortwo" onblur="mf.setcss(this);" /></td>
			</tr>
			</table>
		</td>
	</tr>
</table>
<input type="hidden" name="step" value="2" />
<input type="hidden" name="setskin" value="$skin" />
<div class="popBottom"><span class="btn2"><span><button type="button" name="ajaxsubmit" onclick="ajax.submit(this.form,mf.submit);">提 交</button></span></span></div></form>
</div>
<!--
EOT;
}elseif($action=='addfriend'){print <<<EOT
-->
<form action="pw_ajax.php?action=$action" method="post" onsubmit="return false;">
<input type="hidden" name="verify" value="$verifyhash" />
<input type="hidden" name="job" value="add" />
<input type="hidden" name="step" value="2" />
<input type="hidden" name="touid" value="$friend[uid]" />
<!--
EOT;
if ($reload) {print <<<EOT
-->
<input type="hidden" name="reload" value="1" />
<!--
EOT;
}print <<<EOT
-->
<div style="width:300px;">
	<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><a class="adel" onclick="closep();" href="javascript:;">關閉</a>好友驗證信息</div>
	<p class="p10">你確定要加{$friend[username]}為好友嗎？</p>
<table id="mgmode" width="100%">
	<tr class="vt">
		<td width="80" class="tac">
		<a href="javascript:;"><img src="$faceurl" width="44" height="44" class="mb5" /></a><p>$friend[username]</p></td>
		<td>
<!--
EOT;
if ($friendcheck == 1){print <<<EOT
-->
			<div class="mb10"><div class="mb5">發送請求信息</div>
			<input class="input input_wa" type="text" name="checkmsg" /></div>
<!--
EOT;
}print <<<EOT
-->
			<div class="mb10"><select name="friendtype" id="friendtype" style="margin-right:3px;width:100px;">
				<option value="0">不分組</option>
<!--
EOT;
foreach ($types as $key => $value){print <<<EOT
-->
				<option value="$key">$value</option>
<!--
EOT;
}print <<<EOT
-->
			</select> <a style="cursor:pointer;" onclick="addFriendType();">增加分組</a></div>
			<span style="display:none;" id="typeinputbox"><input name="typename" id="typename" class="input" style="width:92px;"><span class="bt2"><span><button type="button" onclick="submitAddFriendType()" name="addtypebutton">添加</button></span></span></span>
		</td>
	</tr>
</table>
<div class="popBottom"><span class="btn2"><span><button type="button" name="ajaxsubmit" onclick="ajax.submit(this.form);">提 交</button></span></span></div>
</div>
</form>
<script>

function addFriendType(){
	var typeinputbox = getObj('typeinputbox');
	if (typeinputbox.style.display == 'none') {
		typeinputbox.style.display = '';
	} else {
		typeinputbox.style.display = 'none';
	}
}

function submitAddFriendType(){
	var typeinputbox = getObj('typeinputbox');
	var typenamebox = getObj('typename');
	var typename = typenamebox.value;
	var typename_length = typename.length;
	if (typename_length < 1) {
		showDialog('error','好友分類名稱的長度為1∼20','2');
		return false;
	} else if (typename_length >= 20) {
		showDialog('error','好友分類名稱的長度為1∼20','2');
		return false;
	}
	ajax.send('pw_ajax.php?action=addfriendtype&','typename='+typename,function(){
		var rText = ajax.request.responseText.split('\t');	
		if (rText[0] == 'success') {
			var friendtype = getObj('friendtype');
			friendtype.options.add(new Option(rText[2],rText[1]))
			var select_length = friendtype.options.length;
			friendtype.options[select_length-1].selected = 'selected';
			typenamebox.value = '';
			typeinputbox.style.display = 'none';
		} else {
			showDialog('error',rText);
		}
	});
}
</script>
<!--
EOT;
} elseif ($action =='addattention') {
$callback = '';
if ($recommend) {
$callback = ', recommendAddattention';
print <<<EOT
-->
<script type="text/javascript" id="recommendAddattention">
function recommendAddattention() {
	var responseText = ajax.request.responseText;
	if (responseText.match('操作成功!')) {
		var o = read.obj;
		if (o.tagName.toLowerCase() == 'a' && o.href.match('addattention')) {
			o.parentNode.parentNode.style.display = 'none';
		}
	} else {
		ajax.guide();
	}
}
</script>
<!--
EOT;
}print <<<EOT
-->
<form action="pw_ajax.php?action=$action&touid=$touid" onsubmit="return false;" method="post">
	<input type="hidden" name="step" value="2" />
	<input type="hidden" name="recommend" value="$recommend" />
    <input type="hidden" name="verify" value="$verifyhash" />
	<div style="width:200px;">
		<div class="p10 b f14">您確定要關注{$member['username']}嗎？</div>
		<div class="popBottom">
		<span class="btn2"><span><button type="button" onclick="ajax.submit(this.form{$callback})">確定</button></span></span>
		<span class="bt2"><span><button type="button" onclick="closep();">取消</button></span></span>
		</div>
	</div>
</form>
<!--
EOT;
} elseif ($action =='delattention') {print <<<EOT
-->
<form action="pw_ajax.php?action=$action&touid=$touid" onsubmit="return false;" method="post">
	<input type="hidden" name="step" value="2" />
    <input type="hidden" name="verify" value="$verifyhash" />
	<div style="width:200px;">
		<div class="p10 b f14">您確定要取消對{$member['username']}關注嗎？</div>
		<div class="popBottom">
		<span class="btn2"><span><button type="button" onclick="ajax.submit(this.form)">確定</button></span></span>
		<span class="bt2"><span><button type="button" onclick="closep();">取消</button></span></span>
		</div>
	</div>
</form>
<!--
EOT;
} elseif ($action == 'pushto') {print<<<EOT
-->
<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><span class="adel cp" onclick="closep();">關閉</span>推送位置選擇</div>
	<table width="100%" class="z">
<!--
EOT;
$id=0;
foreach ($pushs as $key => $value){
if($id == '0'){print<<<EOT
-->
		<tr class="tr3">
<!--
EOT;
}$id++;print<<<EOT
-->
		<td><a onclick="return sendurl(this,1,'push')" href="mawhole.php?action=push&pushto=$value[id]&fid=$fid&seltid=$seltid" >$value[name]</a></td>
<!--
EOT;
if($id == 2){$id=0;print<<<EOT
-->
		</tr>
<!--
EOT;
}}print<<<EOT
-->
	</table>
<!--
EOT;
}elseif ($action == 'debate') {print<<<EOT
--><div style="width:430px;">
<form action="pw_ajax.php?action=debate" method="post" onsubmit="return false;">
<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><span class="adel cp" onclick="closep();">關閉</span>結束辯論，裁判點評</div>
<table width="100%" class="z vt mb5">
	<tr class="tr3">
		<td width="60">辯論結果:</td>
		<td>
<!--
EOT;
if($debate[judge]==1){print<<<EOT
-->
正方勝(支持數: $debate[obvote] 辯手:$debate[obposts])
<!--
EOT;
}elseif($debate[judge]==2){print<<<EOT
-->
平局
<!--
EOT;
}elseif($debate[judge]==3){print<<<EOT
-->
反方勝(支持數: $debate[revote] 辯手:$debate[reposts])
<!--
EOT;
}else{print<<<EOT
-->
			<p class="mb5"><label><input type="radio" name="judge" value="1" />正方勝(支持數:$debate[obvote]&nbsp;辯手:$debate[obposts])</label></p>
			<p class="mb5"><label><input type="radio" name="judge" value="2" checked/>平局</label></p>
			<p class="mb5"><label><input type="radio" name="judge" value="3" />反方勝(支持數:$debate[revote]&nbsp;辯手:$debate[reposts])</label></p>
<!--
EOT;
}print<<<EOT
-->
		</td>
	</tr>
	<tr class="tr3">
		<td>最佳辯手:</td>
		<td>
<!--
EOT;
if($debate[debater]){print<<<EOT
-->
			<a href="u.php?username=$debate[debater]" target="_blank">$debate[debater]</a>
<!--
EOT;
}else{print<<<EOT
-->
			<input class="input input_wa" id="debater" type="text" name="debater">
			<select onchange="if(this.value)getObj('debater').value=this.value;" class="select_wa">
			<option value="">推薦辯手(支持數)</option>
<!--
EOT;
foreach($debater as $val){print<<<EOT
-->
			<option value="$val[username]">$val[username]($val[vote])</option>
<!--
EOT;
}print<<<EOT
-->
			</select>
<!--
EOT;
}print<<<EOT
-->
		</td>
	</tr>
	<tr class="tr3">
		<td>裁判點評:</td>
		<td><textarea class="textareaA" name="umpirepoint">$debate[umpirepoint]</textarea></td>
	</tr>
</table>
<input type="hidden" name="verify" value="$verifyhash" />
<input type="hidden" name="step" value="2" />
<input type="hidden" name="do" value="judge" />
<input type="hidden" name="tid" value="$tid" />
<div class="popBottom"><span class="btn2"><span><button type="button" name="ajaxsubmit" onclick="ajax.submit(this.form);">提 交</button></span></span></div>
</form></div>
<!--
EOT;
} elseif ($action == 'readmessage') {print <<<EOT
-->
<table cellspacing="0" cellpadding="5" width="450px">
	<tbody>
	<tr><th class="h" colspan="2" style="cursor:move" onmousedown="read.move(event);"><span class="adel" onclick="closep();">close</span>
<!--
EOT;
if ($type == 'personal') {print <<<EOT
-->
	個人消息
<!--
EOT;
} elseif ($type == 'system') {print <<<EOT
-->
	系統消息
<!--
EOT;
} elseif ($type == 'public') {print <<<EOT
-->
	群發消息
<!--
EOT;
}print <<<EOT
-->
	</th></tr>
	<tr><td width="20%">發件人:</td><td> $msginfo[username]</td></tr>
	<tr><td>標題</td><td> $msginfo[title]</td></tr>
	<tr><td>時間:</td><td> $msginfo[mdate]</td></tr>
	<tr><td>內容</td><td> $msginfo[content]</td></tr>
	<tr><td>選項: </td><td>
<!--
EOT;
if ($type == 'personal') {print <<<EOT
-->

	<!-- [<a href="message.php?action=chatlog&withuid=$msginfo[withuid]" target="_blank">通信記錄</a>] -->
	<!-- [<a style="cursor:pointer;" onclick="sendmsg('pw_ajax.php?action=unread&mid=$msginfo[mid]')">標記未讀</a>] -->
	<!-- [<a style="cursor:pointer;" onclick="sendmsg('pw_ajax.php?action=msg&remid=$msginfo[mid]')">回復</a>] -->
	<!-- [<a style="cursor:pointer;" onclick="sendmsg('pw_ajax.php?action=msg&transmit=$msginfo[mid]')">轉發</a>] -->
	<!-- [<a style="cursor:pointer;" onclick="sendmsg('pw_ajax.php?action=delmessage&type=$type&delid=$msginfo[mid]')">刪除</a>] -->

<!--
EOT;
} elseif ($type == 'system'){print <<<EOT
-->
	[<a style="cursor:pointer;" onclick="sendmsg('pw_ajax.php?action=delmessage&type=$type&delid=$msginfo[mid]')">刪除</a>]
<!--
EOT;
} elseif ($type == 'public'){print <<<EOT
-->
	[<a style="cursor:pointer;" onclick="sendmsg('pw_ajax.php?action=delmessage&type=$type&delid=$msginfo[mid]')">刪除</a>]
<!--
EOT;
}print <<<EOT
-->
	</td></tr>
	</tbody>
</table>
<!--
EOT;
} elseif ($action == 'report') {
$sendtitle = $type == 'topic' ? '發信息通知版主' : '發信息通知站方';
print <<<EOT
-->
<form action="pw_ajax.php?action=$action" method="post" onsubmit="return false;">
<input type="hidden" name="verify" value="$verifyhash" />
<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><span class="adel cp" onclick="closep();">刪除</span>{$ch_type}舉報</div>
<div class="p10">
	<div class="mb10">感謝您能一起協助我們管理站點，我們會盡快處理您的舉報內容！</div>
	<div class="mb5"><textarea id="reason" name="reason" class="textareaA"></textarea></div>
	<div><label><input type="checkbox"  name="ifsendmessage" checked value="1"/>{$sendtitle}</label></div>
</div>
<input type="hidden" name="step" value="2" />
<input type="hidden" name="tid" value="$tid" />
<input type="hidden" name="pid" value="$pid" />
<input type="hidden" name="type" value="$type" />

<div class="popBottom"><span class="btn2"><span><button type="button" onclick="ajax.submit(this.form);">提 交</button></span></span></div>
</form>
<!--
EOT;
} elseif ($action == 'showfriends') {print <<<EOT
-->
<form action="pw_ajax.php?action=showfriends&" onsubmit="return false;" method="POST">
	<input type="hidden" name="step" value="2" />
	<div class="fri-list pr">
		<div class="fri-top" style="cursor:move" onmousedown="read.move(event);">
			<span class="fr">
				<select name="friendtype" onchange="showFriendList(this.value);">
					<option value="-1">全部好友</option>
<!--
EOT;
foreach ($friendtype as $key => $value) {print <<<EOT
-->
					<option value="$key">$value[name]</option>
<!--
EOT;
}print <<<EOT
-->
				</select>
			</span>
			<span class="bt2"><span><button type="submit" name="Submit" onclick="CheckAll(this.form)">全選</button></span></span>
			<span class="btn2"><span><button type="submit" name="Submit" onclick="ajax.submit(this.form,$recall)">確定</button></span></span>
			<span class="bt2"><span><button type="button" onclick="closep();">取消</button></span></span>
		</div>
	<div class="fri-bot" id="friendlist">
	<ul class="list-wid cc listC">
<!--
EOT;
foreach ($friendtype as $key => $value) {print <<<EOT
-->
						<div id="ftid_$value[ftid]">
<!--
EOT;
foreach ($frienddb[$value[ftid]] as $k => $v) {print <<<EOT
-->
							<li><input type="checkbox" name="selid[]" value="$v[uid]"> $v[username]</li>
<!--
EOT;
}print <<<EOT
-->
						</div>
<!--
EOT;
}print <<<EOT
-->
	</ul>
</div>
</div>
</form>
<script type="text/javascript" src="js/core/friendlist.js"></script>
<!--
EOT;
}elseif ($action == 'showcard') {print <<<EOT
-->
<div class="pop-card" id="cardmenu_$info[uid]" onmouseover="clearTimeout(userCard.t2);" onmouseout="movecard(event,this.id);">
	<div class="pop-card-bg">
		<div class="pop-card-info">
			<dl class="cc">
				<dt><img src="$info[icon]" class="card-face" /></dt>
				<dd>
					<p class="card-title cc"><a href="{$db_userurl}$info[uid]" class="fl b">$info[username]</a>
<!--
EOT;
if($db_showonline && checkOnline($info['thisvisit'])){print <<<EOT
-->
					<span class="card-online" title="在線">在線</span>
<!--
EOT;
}else{print<<<EOT
-->
					<span class="card-offline" title="離線">離線</span>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
if ($winduid != $uid) {
	if ($info[isMyAttention]) {print <<<EOT
-->
			<a href="javascript:;" onclick="pwConfirm('是否取消關注？',this,function(){Attention.del('{$info[uid]}')})" title="取消關注" class="fr add_following">關注中</a>
<!--
EOT;
	} else {print <<<EOT
-->
			<a href="javascript:;" onclick="Attention.add(this,'{$info['uid']}',0)" class="add_follow fr">加關注</a>
<!--
EOT;
	}
} print <<<EOT
-->
					</p>
					<p class="gray2"><span class="mr20">級別︰{$info[memtitle]}</span></p>
					<p class="card-write">
<!--
EOT;
if($info['honor']){print<<<EOT
-->
						<span class="mr20">$info[honor]</span><!--<span class="gray2">- $write[posttime]</span>-->
<!--
EOT;
}else{print<<<EOT
-->
						<span class="mr20">暫無簽名</span>
<!--
EOT;
}print<<<EOT
-->
					</p>
         	<p class="fr">
<!--
EOT;
if(isset($db_hackdb['blog'][2]) && $db_hackdb['blog'][2] && $bg_ifopen){print <<<EOT
-->
					<a href="$bg_blogurl/blog.php?bbsuid=$info[uid]" target="_blank" class="card-blog" title="個人博客">個人博客</a>
<!--
EOT;
}print <<<EOT
-->
					<!--<a href="{$db_userurl}$info[uid]" class="card-profile" title="個人資料">個人資料</a>-->
<!--
EOT;
if($groupid!='guest' && isset($db_hackdb['toolcenter']) && $db_toolifopen){print <<<EOT
-->
					<a href="javascript:;" class="card-magic" title="使用道具" onclick="sendmsg('pw_ajax.php?action=usertool&uid=$info[uid]','','sf_$info[lou]')" style="cursor:pointer">使用道具</a>
<!--
EOT;
}if($info['oicq']){print <<<EOT
-->
					<a title="QQ:$info[oicq]" href="http://wpa.qq.com/msgrd?V=1&Uin=$info[oicq]&Site=$db_bbsname&Menu=yes" target="_blank" class="card-qq">QQ</a>
<!--
EOT;
}if ($info['aliww']) {print <<<EOT
-->
					<a title="阿里旺旺:$info[aliww]" href="http://amos.im.alisoft.com/msg.aw?uid=$info[aliww]&site=cntaobao" target="_blank" class="card-ww">淘寶旺旺</a>
<!--
EOT;
}if($winduid){print <<<EOT
-->
					<a href="javascript:;" onclick="sendmsg('pw_ajax.php?action=msg&touid=$info[uid]');" class="card-mail" title="發送消息">發送消息</a>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
if ($winduid != $uid) {
	if($info[ismyfriend] && $winduid){print <<<EOT
-->
					<a href="javascript:;" onclick="sendmsg('pw_ajax.php?action=addfriend&touid=$info[uid]')" class="card-fri">加為好友</a>
<!--
EOT;
	}else{print <<<EOT
-->
					<a href="javascript:;" onclick="pwConfirm('是否確認解除？',this,function(){delFriend('$info[uid]')});" class="card-fri-out">解除好友</a>
<!--
EOT;
}}print <<<EOT
-->
           </p>
				</dd>
			</dl>
		</div>
		<div class="card-app">
			<div class="p10">
				<p class="mb10"><span class="mr20">他的朋友︰<a href="{$db_userurl}$info[uid]">{$info[f_num]}</a></span>&nbsp;&nbsp;&nbsp;
				<span class="mr20">來訪︰<a href="{$db_userurl}$info[uid]">{$info[visits]}</a></span>&nbsp;&nbsp;&nbsp;
				<span>訪問過︰<a href="{$db_userurl}$info[uid]">{$info[tovisits]}</a></span></p>
				<p class="b">
					<a href="apps.php?q=weibo&uid=$info[uid]">新鮮事</a><!--
EOT;
if($info['appcount']['owrite']){print <<<EOT
--><span class="card-new">new</span>
<!--
EOT;
}print <<<EOT
-->
					&nbsp;&nbsp;<a href="apps.php?q=diary&uid=$info[uid]">日志</a><!--
EOT;
if($info['appcount']['diary']){print <<<EOT
--><span class="card-new">new</span>
<!--
EOT;
}print <<<EOT
-->
					&nbsp;&nbsp;<a href="apps.php?q=photos&uid=$info[uid]">相冊</a><!--
EOT;
if($info['appcount']['photo']){print <<<EOT
--><span class="card-new">new</span>
<!--
EOT;
}print <<<EOT
-->
					&nbsp;&nbsp;<a href="apps.php?q=article&uid=$info[uid]">帖子</a><!--
EOT;
if($info['appcount']['topic']){print <<<EOT
--><span class="card-new">new</span>
<!--
EOT;
}print <<<EOT
-->
					&nbsp;&nbsp;<a href="apps.php?q=groups&uid=$info[uid]">群組</a><!--
EOT;
if($info['appcount']['group']){print <<<EOT
--><span class="card-new">new</span>
<!--
EOT;
}print <<<EOT
-->
				</p>
			</div>
			<div class="card-app-bot cc">
<!--
EOT;
if($info['app']){print<<<EOT
-->
				<span id="t_typedb" class="card-bot-icon">
<!--
EOT;
$i = 1;
foreach($info['app'] as $val){
$i++;
$appurl = "apps.php?id=$val[appid]";
if ($val[ifshow]) {print <<<EOT
-->
				<a href="$appurl"><img src="{$db_server_url}/images/icon/s{$val[appid]}.png" title="{$appsdb[$val[appid]][name]}" align="absmiddle" /></a>
<!--
EOT;
}else{print<<<EOT
-->
				<a href="$appurl"><img src="{$db_server_url}/images/icon/s_{$val[appid]}.png" title="{$appsdb[$val[appid]][name]}" align="absmiddle" /></a>
<!--
EOT;
}}print<<<EOT
-->
				</span>
<!--
EOT;
if($i > $db_maxnum){print<<<EOT
-->
				<span class="card-right-down fr" title="下一頁" onclick="showTypeTab($db_maxnum,$db_maxnum,'a');">下一頁</span>
				<span class="card-left-down fr" title="上一頁" onclick="showTypeTab(-$db_maxnum,$db_maxnum,'a');" >上一頁</span>
<!--
EOT;
}}print<<<EOT
-->
			</div>
		</div>
<!--
EOT;
if($info['appinfo']){print<<<EOT
-->
		<div class="card-content p10" style="/*display:none;*/">
<!--
EOT;
$i=0;
foreach ($info['appinfo'] as $key => $value) {
if($i>=2) continue;
$i++;
if ($key == 'cardtopic') {print<<<EOT
-->
			<p class="card-title">帖子︰<a href="read.php?tid=$value[tid]" target="_blank" class="mr20">{$value[subject]}</a><span class="gray2">$value[postdate_s]</span></p>
			<p>{$value[content]}</p>
<!--
EOT;
if ($value['attimages']) {print<<<EOT
-->
			<ul class="card-photo cc">
<!--
EOT;
foreach ($value['attimages'] as $v) {print<<<EOT
-->
				<li><a href="read.php?tid=$value[tid]" target="_blank"><img src="$v" /></a></li>
<!--
EOT;
}print<<<EOT
-->
			</ul>
<!--
EOT;
}print<<<EOT
-->
			<div class="card-cont-hr"></div>
<!--
EOT;
} elseif ($key == 'carddiary'){print<<<EOT
-->
			<p class="card-title">日志︰<a href="apps.php?q=diary&uid=$value[uid]&a=detail&did=$value[did]" target="_blank" class="mr20">{$value[subject]}</a><span class="gray2">$value[postdate_s]</span></p>
			<p>{$value[content]}</p>
<!--
EOT;
if ($value['attimages']) {print<<<EOT
-->
			<ul class="card-photo cc">
<!--
EOT;
foreach ($value['attimages'] as $v) {print<<<EOT
-->
				<li><a href="apps.php?q=diary&uid=$value[uid]&a=detail&did=$value[did]" target="_blank"><img src="$v" /></a></li>
<!--
EOT;
}print<<<EOT
-->
			</ul>
<!--
EOT;
}print<<<EOT
-->
			<div class="card-cont-hr"></div>
<!--
EOT;
} elseif ($key == 'cardphoto') {print<<<EOT
-->
			<p class="card-title">照片︰<a href="apps.php?q=photos&uid={$value[uid]}&a=album&aid={$value[aid]}" class="mr20">《{$value[aname]}》</a><span class="gray2">{$value[postdate_s]}</span></p>
			<ul class="card-photo cc">
<!--
EOT;
foreach ($value['photo'] as $photo) {print<<<EOT
-->
				<li><a href="apps.php?q=photos&uid=$value[uid]&a=view&pid=$photo[pid]"><img src="$photo[path]" /></a></li>
<!--
EOT;
}print<<<EOT
-->
			</ul>
			<div class="card-cont-hr"></div>
<!--
EOT;
}elseif($value[type]=='write'){print<<<EOT
-->
			<span class="mr20">記錄︰{$value[value][content]}</span><span class="gray2">$k</span>
			<div class="card-cont-hr"></div>
<!--
EOT;
}}print<<<EOT
-->
		</div>
<!--
EOT;
}print<<<EOT
-->
	</div>
</div>
<!--
EOT;
print <<<EOT
-->
<script>
function showTypeTab(p, n, tag){
	var o = getObj('t_typedb');
	var f = o.getElementsByTagName(tag);
	var s = 0;
	for(i=0;i<f.length;i++)
		if(f[i].style.display != "none"){s = i;break;}
	s += p;
	if(s<0 || s>f.length)return;
	for(i=0;i<f.length;i++){
		if(i>=s && i<s+n){
			f[i].style.display = "inline";
		} else{
			f[i].style.display = "none";
		}
	}
	return;
}
function delFriend(u){
	ajax.send('apps.php?q=ajax&a=delfriend&u='+u,'',function(){
		var rText = ajax.request.responseText.split('|');
		if (rText[0] == 'success') {
			showDialog('success','操作成功!',1);
		} else {
			ajax.guide();
		}
	});
}
if (typeof(HTMLElement) != "undefined") {
	HTMLElement.prototype.contains = function(obj) {
		while (obj!=null && typeof(obj.tagName) != "undefind"){
			if (obj == this)  return true;
			obj = obj.parentNode;
		}
		return false;
	};
}
function movecard(theEvent, id){
	if (theEvent){
		if (is_ie) {
			if (document.getElementById(id).contains(event.toElement)) {
				return false;
			}
		} else {
			if (document.getElementById(id).contains(theEvent.relatedTarget)) {
				return false;
			}
		}
	}
	try{userCard.menu.close();}catch(e){}
}
verifyhash = "$verifyhash";
</script>
<!--
EOT;
}elseif($action == 'asearch'){
if($modelid){print<<<EOT
-->
<form action="thread.php?fid=$fid&modelid=$modelid" method="post">
<!--
EOT;
}elseif($pcid){print<<<EOT
-->
<form action="thread.php?fid=$fid&pcid=$pcid" method="post">
<!--
EOT;
}else{print<<<EOT
-->
<form action="thread.php?fid=$fid&actmid=$actmid&allactmid=$allactmid" method="post">
<!--
EOT;
}
print<<<EOT
-->
<input type="hidden" name="topicsearch" value="1">
<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><span class="adel" onclick="closep();">close</span>高級搜索</div>
<table width="350px" cellspacing="0" cellpadding="5">
<!--
EOT;
$vieworder_mark = 0;
foreach($asearchdb as $key => $value){
if($vieworder_mark != 0 && $vieworder_mark != $value['vieworder']){print<<<EOT
-->

<!--
EOT;
}
if ($value['vieworder'] == 0) {
if($actmid || $allactmid){print<<<EOT
print<<<EOT
-->
					<tr><td width="30%">{$value[name][0]}︰</td><td style="padding-right:10px;">{$value[name][1]}$value[searchhtml]{$value[name][2]}</td></tr>
<!--
EOT;
}else{print<<<EOT
-->
					<tr><td width="30%">$value[name1]︰</td><td style="padding-right:10px;">$value[searchhtml]$value[name2]</td></tr>
<!--
EOT;
}}else{
if($vieworder_mark != $value['vieworder']){
if($actmid || $allactmid){print<<<EOT
print<<<EOT
-->
					<tr><td width="30%">{$value[name][0]}︰</td><td style="padding-right:10px;">{$value[name][1]}$value[searchhtml]{$value[name][2]}
<!--
EOT;
}else{print<<<EOT
-->
					<tr><td width="30%">$value[name1]︰</td><td style="padding-right:10px;">$value[searchhtml]$value[name2]
<!--
EOT;
}}else{
if($actmid || $allactmid){print<<<EOT
-->
					{$value[name][0]}{$value[name][1]}$value[searchhtml]{$value[name][2]}
<!--
EOT;
}else{print<<<EOT
-->
					$value[name1]$value[searchhtml]$value[name2]
<!--
EOT;
}}}
$vieworder_mark = $value['vieworder'];
}
if($vieworder_mark != 0){print<<<EOT
-->
				</td></tr>
<!--
EOT;
}print<<<EOT
-->
</table>
<div class="popBottom"><span class="btn2"><span><button type="submit">搜索</button></span></span></div>
</form>
<!--
EOT;
}elseif($action == 'pcjoin'){print<<<EOT
-->
<form action="pw_ajax.php?action=$action" method="post" onsubmit="return false;">
<input type="hidden" name="verify" value="$verifyhash" />
<input type="hidden" name="tid" value="$tid">
<!--
EOT;
if($thelast != '1'){
if($isU){
if($fieldvalue['limitnum']){
	$limitnum = "還剩{$morenum}";
}else{
	$limitnum = '無限制';
}
if ($pcid == '2') {
	$signjoin = '活動報名';
} elseif ($pcid == '1') {
	$signjoin = '團購報名';
}
print<<<EOT
--><div style="width:380px;">
<input type="hidden" name="step" value="1">
<input type="hidden" name="pcid" value="$pcid">
<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><span class="adel cp" onclick="closep();">關閉</span>$signjoin</div>
<table width="100%" class="z mb5">
	<tr class="tr2"><td colspan="2">說明︰帶<span class="s1">*</span>為必填選項</td></tr>
<!--
EOT;
if($pcid == '2'){print<<<EOT
-->
	<tr class="tr3"><td width="80">報名人數︰<span class="s1">*</span></td><td><input type="text" name="nums" class="input input_wa"> 人({$limitnum})</td></tr>
<!--
EOT;
}elseif($pcid == '1'){print<<<EOT
-->
	<tr class="tr3"><td>購買數量︰<span class="s1">*</span></td><td><input type="text" name="nums" class="input input_wa"> 個({$limitnum})</td></tr>
<!--
EOT;
}print<<<EOT
-->
	<tr class="tr3"><td width="80">真實姓名︰<span class="s1">*</span></td><td><input type="text" name="name" class="input input_wa"></td></tr>
	<tr class="tr3"><td>手機︰<span class="s1">*</span></td><td><input type="text" name="mobile" class="input input_wa"></td></tr>
	<tr class="tr3"><td>電話︰</td><td><input type="text" name="phone" class="input input_wa"></td></tr>
	<tr class="tr3"><td>地址︰</td><td><input type="text" name="address" class="input input_wa"></td></tr>
<!--
EOT;
if($pcid == '1'){print<<<EOT
-->
	<tr class="tr3"><td>郵編︰</td><td><input type="text" name="zip" class="input input_wa"></td></tr>
	<tr class="tr3"><td>給賣家留言︰</td><td><textarea name="message" class="textareaA" style="width:150px;"></textarea>
	<br />可選項，可以告訴賣家你對商品的特殊要求，如尺寸、顏色等</td></tr>
<!--
EOT;
}print<<<EOT
-->
	<tr class="tr3"><td>匿名︰</td><td><label><input type="checkbox" name="extra" value="1" checked>&nbsp;僅發起人可見</label></td></tr>
</table>
<div class="popBottom">
<!--
EOT;
if($payway==1){print<<<EOT
-->
	<span class="btn2"><span><button type="button" name="ajaxsubmit" onclick="ajax.submit(this.form);">下一步</button></span></span>
<!--
EOT;
}elseif($payway==2){print<<<EOT
-->
	<span class="btn2"><span><button type="button" name="ajaxsubmit" onclick="ajax.submit(this.form);">確認報名</button></span></span>
<!--
EOT;
}print<<<EOT
-->
</div>
</div>
<!--
EOT;
}else{print<<<EOT
-->
<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><span class="adel cp" onclick="closep();">關閉</span>報名</div>
<div class="p10">對不起，發起人限制只有其好友可報名，是否加他為好友？</div>
<div class="popBottom"><span class="btn2"><span><button type="button" onclick="sendmsg('pw_ajax.php?action=addfriend&touid=$authorid','',this.id);">加為好友</button></span></span></div>
<!--
EOT;
}}elseif($thelast == '1'){print<<<EOT
-->
<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><span class="adel cp" onclick="closep();">關閉</span>支付金額</div>
<table width="100%" class="z mb5">
<!--
EOT;
if($pcid == '2'){print<<<EOT
-->
	<tr class="tr3"><td>需付費用 {$deposit} 元/人，你的報名人數為 {$nums} 人</td></tr>
<!--
EOT;
}elseif($pcid == '1'){print<<<EOT
-->
	<tr class="tr3"><td>需付費用 {$deposit} 元/個，你的購買數量為 {$nums} 個</td></tr>
<!--
EOT;
}print<<<EOT
-->
	<tr class="tr3"><td>共計經費︰{$totalcash}元</td></tr>
<!--
EOT;
if($payway==2){print<<<EOT
-->
	<tr class="tr3"><td>注︰此次交易為現金支付，請及時聯系賣家確認支付方式。</td></tr>
<!--
EOT;
}print<<<EOT
-->
</table>
<div class="popBottom">
<!--
EOT;
if($payway==1){print<<<EOT
-->
	<a href="$alipayurl">去支付寶支付</a>
<!--
EOT;
}print<<<EOT
-->
	<span><span><button type="button" onclick="pc_join();" name="ajaxsubmit">關閉</button></span></span>
</div>
<!--
EOT;
}}elseif($action == 'pcmember'){print<<<EOT
-->
<div id="g_info" style="margin:10px 0;">
<!--
EOT;
if(empty($memberdb)){print <<<EOT
-->
<div style="padding:8px 15px;margin:0;" class="f12 blockquote">暫時沒有報名記錄!</div>
<!--
EOT;
}else{print <<<EOT
-->
<div class="t">
<table width="100%" class="f12">
	<tr>
		<td colspan="7" class="h">
<!--
EOT;
if($jointype==1 || $jointype==2){print<<<EOT
-->
			<span class="fr"><a href="job.php?action=pcexport&tid=$tid&pcid=$pcid">導出報名信息</a>&nbsp;&nbsp;&nbsp;<a id="pcsendmsg" href="javascript:;" onclick="sendmsg('pw_ajax.php?action=pcsendmsg&tid=$tid&pcid=$pcid','',this.id);">+群發消息</a></span>
<!--
EOT;
}print<<<EOT
-->
			<b>
<!--
EOT;
if($isviewright){
if($pcid == '2'){print<<<EOT
-->
			報名人數共計{$sum}人，已支付經費數︰{$paysum}人
<!--
EOT;
}elseif($pcid == '1'){print<<<EOT
-->
			購買數量共計{$sum}個，已支付經費數︰{$paysum}個
<!--
EOT;
}}else{
if($pcid == '2'){print<<<EOT
-->
			報名人數共計{$sum}人
<!--
EOT;
}elseif($pcid == '1'){print<<<EOT
-->
			購買數量共計{$sum}個
<!--
EOT;
}}print<<<EOT
-->
			</b>
		</td>
	</tr>
<!--
EOT;
if($isviewright){print<<<EOT
-->
	<tr class="tr2">
		<td>用戶</td>
		<td>手機</td>
<!--
EOT;
if($pcid == '2'){print<<<EOT
-->
		<td>報名人數</td>
<!--
EOT;
}elseif($pcid == '1'){print<<<EOT
-->
		<td>購買數量</td>
<!--
EOT;
}print<<<EOT
-->
		<td>費用</td>
		<td>支付情況</td>
		<td>操作</td>
	</tr>
<!--
EOT;
foreach($memberdb as $val){
if($val[ifpay]==1){
	$ifpay='已支付';
}else{
	$ifpay='未支付';
}
if ($jointype == 3) {
	$mobile = $val['extra'] && $winduid!=$val[uid] ? '保密' : $val['mobile'];
	$val[username] = $val['extra'] && $winduid!=$val[uid] ? '匿名' : $val[username];
	$touidurl = $val['extra'] && $winduid!=$val[uid] ? 'javascript:;' : "{$db_userurl}$val[uid]";
} else {
	$mobile = $val['mobile'];
	$touidurl = "{$db_userurl}$val[uid]";
}
print <<<EOT
-->
	<tr class="tr3">
		<td><a href="$touidurl">$val[username]</a>
<!--
EOT;
if ($jointype == 1 || $jointype == 2) {print<<<EOT
-->
		<a href="javascript:;" id="message" onclick="sendmsg('pw_ajax.php?action=msg&touid=$val[uid]','','message')"><img src="$imgpath/email.gif" align="absmiddle"></a>
<!--
EOT;
}print<<<EOT
-->
		</td>
		<td>$mobile</td>
		<td>$val[nums]</td>
		<td>$val[totalcash]</td>
		<td>$ifpay</td>
		<td>
			<a href="javascript:;" id="pcshow_$val[pcmid]" onclick="sendmsg('pw_ajax.php?action=pcshow&pcmid=$val[pcmid]&tid=$tid&pcid=$val[pcid]','',this.id)">詳情</a>
<!--
EOT;
if ($jointype == 1) {
if(!$val[ifpay]){
if ($winduid!=$val[uid]) {
print <<<EOT
-->
			<a href="javascript:;" id="pcpay_$val[pcmid]" onclick="sendmsg('pw_ajax.php?action=pcpay&pcmid=$val[pcmid]&pcid=$val[pcid]&tid=$tid&jointype=$jointype&payway=$payway','',this.id)">確認支付</a>
<!--
EOT;
}print<<<EOT
-->
			<a href="javascript:;" onclick="if (confirm('確認刪除嗎')) {pc_del('$val[pcmid]','$val[pcid]','$jointype','$payway')}">刪除</a>
<!--
EOT;
}}
if($winduid==$val[uid] && !$ifend){
if($val[ifpay]==1){print<<<EOT
-->
			<a id="ifpay_1_$val[pcmid]" href="javascript:;" onclick="sendmsg('pw_ajax.php?action=pcmodify&pcmid=$val[pcmid]&pcid=$val[pcid]&jointype=$jointype&tid=$tid&ifpay=1&payway=$payway','',this.id);">修改</a>
<!--
EOT;
}else{
if($payway == 1 && $val[totalcash] > 0){print<<<EOT
-->
			<a id="alipay_$val[pcmid]" href="javascript:;" class="s1" onclick="sendmsg('pw_ajax.php?action=pcalipay&pcmid=$val[pcmid]&pcid=$val[pcid]&tid=$tid&pcid=$val[pcid]','',this.id);">馬上支付</a>
<!--
EOT;
}print<<<EOT
-->
			<a id="ifpay_0_$val[pcmid]" href="javascript:;" onclick="sendmsg('pw_ajax.php?action=pcmodify&pcmid=$val[pcmid]&pcid=$val[pcid]&jointype=$jointype&tid=$tid&ifpay=0&payway=$payway','',this.id);">修改</a>
<!--
EOT;
}}print<<<EOT
-->
		</td>
	</tr>
<!--
EOT;
}print <<<EOT
-->
	<tr>
		<td colspan="7" style="padding:5px;">$pages</td>
	</tr>
	<tr>
		<td colspan="7" style="height:8px;">
		</td>
	</tr>
<!--
EOT;
}print<<<EOT
-->
</table>
</div>
<!--
EOT;
}print <<<EOT
-->
</div>
<!--
EOT;
}elseif($action == 'pcmodify'){print<<<EOT
-->
<form action="pw_ajax.php?action=$action" method="post" onsubmit="return false;">
<input type="hidden" name="verify" value="$verifyhash" />
<input type="hidden" name="tid" value="$tid">
<input type="hidden" name="pcid" value="$pcid">
<input type="hidden" name="pcmid" value="$pcmid">
<input type="hidden" name="jointype" value="$jointype">
<input type="hidden" name="ifpay" value="$ifpay">
<input type="hidden" name="payway" value="$payway">
<input type="hidden" name="step" value="2">
<div style="width:340px;">
<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><span class="adel cp" onclick="closep();">關閉</span>編輯信息</div>
<table width="100%" class="z mb5">
	<tr class="tr2"><td colspan="2">說明:帶<span class="s1">*</span>為必填選項</td></tr>
<!--
EOT;
if(!$ifpay){
if($pcid == '2'){print<<<EOT
-->
	<tr class="tr3"><td width="80">報名人數:<span class="s1">*</span></td><td><input type="text" name="nums" class="input input_wa" value="$rt[nums]"> 人</td></tr>
<!--
EOT;
}elseif($pcid == '1'){print<<<EOT
-->
	<tr class="tr3"><td>購買數量︰<span class="s1">*</span></td><td><input type="text" name="nums" class="input input_wa" value="$rt[nums]"> 個</td></tr>
<!--
EOT;
}}print<<<EOT
-->
	<tr class="tr3"><td width="80">真實姓名︰<span class="s1">*</span></td><td><input type="text" name="name" class="input input_wa" value="$rt[name]"></td></tr>
	<tr class="tr3"><td>手機︰<span class="s1">*</span></td><td><input type="text" name="mobile" class="input input_wa" value="$rt[mobile]"></tr>
	<tr class="tr3"><td>電話︰</td><td><input type="text" name="phone" class="input input_wa" value="$rt[phone]"></tr>
	<tr class="tr3"><td>地址︰</td><td><input type="text" name="address" class="input input_wa" value="$rt[address]"></td></tr>
<!--
EOT;
if($pcid == '1'){print<<<EOT
-->
	<tr class="tr3"><td>郵編︰</td><td><input type="text" name="zip" class="input input_wa" value="$rt[zip]"></td></tr>
	<tr class="tr3"><td>給賣家留言︰</td><td><textarea name="message" class="textareaA" style="width:150px;">$rt[message]</textarea>
	<br />選項，可以告訴賣家你對商品的特殊要求，如尺寸、顏色等</td></tr>
<!--
EOT;
}print<<<EOT
-->
	<tr><td>匿名︰</td><td><label><input type="checkbox" name="extra" value="1" $checked>&nbsp;僅發起人可見</label></td></tr>
</table>
<div class="popBottom"><span class="btn2"><span><button type="button" name="ajaxsubmit" onclick="ajax.submit(this.form,pc_modify);">提交</button></span></span></div>
</div>
</form>
<!--
EOT;
}elseif($action == 'pcalipay'){print<<<EOT
-->
<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><span class="adel cp" onclick="closep();">關閉</span>支付金額</div>
<table width="100%" class="mb5 z">
<!--
EOT;
if($pcid == '2'){print<<<EOT
-->
	<tr class="tr3"><td>需付費用 {$deposit} 元/人，你的報名人數為 {$nums} 人</td></tr>
<!--
EOT;
}elseif($pcid == '1'){print<<<EOT
-->
	<tr class="tr3"><td>需付費用 {$deposit} 元/個，你的購買數量為 {$nums} 個</td></tr>
<!--
EOT;
}print<<<EOT
-->
	<tr class="tr3"><td>共計經費︰{$totalcash}元</td></tr>
</table>
<div class="popBottom"><a href="$alipayurl">去支付寶支付</a></div>
<!--
EOT;
}elseif($action=='pcsendmsg'){print <<<EOT
--><div style="width:400px;">
<form action="pw_ajax.php?action=$action" method="post" onsubmit="return false;">
<input type="hidden" name="verify" value="$verifyhash" />
<input type="hidden" name="step" value="2" />
<input type="hidden" name="tid" value="$tid" />
<input type="hidden" name="pcid" value="$pcid" />
<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><span class="adel cp" onclick="closep();">關閉</span>群發短消息</div>
<table width="100%">
	<tr class="tr3"><td>標題</td><td><input type="text" class="input input_wb" name="subject" maxlength="100" /></td></tr>
	<tr class="tr3"><td>內容</td><td><textarea name="atc_content" class="textareaA"></textarea></td></tr>
</table>
<div class="popBottom"><span class="btn2"><span><button type="button" name="ajaxsubmit" onclick="ajax.submit(this.form);">提 交</button></span></span></div>
</form></div>
<!--
EOT;
}elseif($action == 'pcpay'){print<<<EOT
--><div style="width:300px;">
<form action="pw_ajax.php?action=$action" method="post" onsubmit="return false;">
<input type="hidden" name="verify" value="$verifyhash" />
<input type="hidden" name="step" value="2" />
<input type="hidden" name="pcmid" value="$pcmid" />
<input type="hidden" name="pcid" value="$pcid" />
<input type="hidden" name="tid" value="$tid" />
<input type="hidden" name="jointype" value="$jointype" />
<input type="hidden" name="payway" value="$payway" />
<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><span class="adel cp" onclick="closep();">關閉</span>支付金額</div>
<div class="p15">
	<p class="mb5">該用戶目前是未支付狀態，如果你確認用戶已經通過其他的方式支付了費用，請點擊“確認”，否則，請點擊“取消”。</p>
	確認後不可撤銷，請慎重操作！
</div>
<div class="popBottom">
	<span class="btn2"><span><button type="button" name="ajaxsubmit" onclick="ajax.submit(this.form,pc_modify);">確認</button></span></span>
	<span class="bt2"><span><button type="button" onclick="closep();">取消</button></span></span>
</div>
</form>
<!--
EOT;
}elseif($action == 'pcshow'){
if($pcmember[ifpay]==1){
	$ifpay='<span class="s3">已支付</span>';
}else{
	$ifpay='<span class="s1">未支付</span>';
}
if ($pcmember['extra'] && !$isadminright && $pcmember['uid']!=$winduid) {
	$phone = $mobile = $address = $name = $zip = '保密';
	$username = '匿名';
} else {
	$phone		= $pcmember['phone'];
	$mobile		= $pcmember['mobile'];
	$address	= $pcmember['address'];
	$name		= $pcmember['name'];
	$zip		= $pcmember['zip'];
	$username	= $pcmember['username'];
}
print<<<EOT
--><div style="width:300px;">
<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><span class="adel cp" onclick="closep();">關閉</span>{$username}的報名信息</div>
<table width="100%" class="z mb5">
<!--
EOT;
if($pcid == '2'){print<<<EOT
-->
	<tr class="tr3"><td width="80">報名人數︰</td><td>$pcmember[nums]</td></tr>
<!--
EOT;
}elseif($pcid == '1'){print<<<EOT
-->
	<tr class="tr3"><td>購買數量︰</td><td>$pcmember[nums]</td></tr>
<!--
EOT;
}print<<<EOT
-->
	<tr class="tr3"><td width="80">費用︰</td><td>$pcmember[totalcash]</td></tr>
	<tr class="tr3"><td>真實姓名︰</td><td>$name</td></tr>
	<tr class="tr3"><td>手機︰</td><td>$mobile</td></tr>
	<tr class="tr3"><td>電話︰</td><td>$phone</td></tr>
	<tr class="tr3"><td>地址︰</td><td>$address</td></tr>
<!--
EOT;
if($pcid == '1'){print<<<EOT
-->
	<tr class="tr3"><td>郵編︰</td><td>$zip</td></tr>
<!--
EOT;
if($isadminright || $pcmember['uid'] == $winduid){print<<<EOT
-->
	<tr class="tr3"><td>給賣家留言︰</td><td>$pcmember[message]</td></tr>
<!--
EOT;
}}print<<<EOT
-->
	<tr class="tr3"><td>支付情況︰</td><td>$ifpay</td></tr>
</table>
</div>
<!--
EOT;
} elseif ($action == 'pingpage') {
	foreach ($ping_db as $pingdata) {
print <<<EOT
-->
<!-- splitTr --><!-- pingId:{$pingdata['id']} -->
<!-- split -->
{$pingdata['name']}
<!-- split -->
<b class="s2">{$pingdata['point']}</b>
<!-- split -->
{$pingdata['pingtime']}
<!-- split -->
{$pingdata['record']}
<!-- split -->
<!--
EOT;
		if ($admincheck || ($_G['markable'] && $pingdata['pinger'] == $windid)) {
			$pidstr = $pid ? $pid : 'tpc';
print <<<EOT
-->
&nbsp;<a style="display:none;" class="adel" id="pingDel_{$pingdata['id']}" href="javascript:void(0);" onclick="delPingLog('$fid', '$tid', '$pidstr', '{$pingdata['id']}')">close</a>
<!--
EOT;
		}
print <<<EOT
-->

<!--
EOT;
	}
	if (!count($ping_db) || ($page >= $total)) {
print <<<EOT
-->
								<!-- __pingPageOver__ -->
<!--
EOT;
	}
} elseif ($action == 'clearpinglog') {
print <<<EOT
-->
<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><span class="adel cp" onclick="closep();">關閉</span>清空我的評分動態</div>
<!--
EOT;
	if ($user_has_ping) {
print <<<EOT
-->
<div class="p10"><p class="mb5">你確定要刪除在本樓的所有評分動態嗎？</p><a target="_blank" href="operate.php?action=showping&fid=$fid&tid=$tid&selid=$pid" class="s2">我想撤消評分</a></div>
<div class="popBottom">
	<span class="btn2"><span><button type="button" id="delMyAllPingLog" onclick="closep();setTimeout(function(){sendmsg('pw_ajax.php?action=doclearpinglog','fid=$fid&tid=$tid&pid=$pid',this.id);},200);">確認</button></span></span>
	<span class="bt2"><span><button type="button" onclick="closep();">取消</button></span></span>
</div>
<!--
EOT;
	} else {
print <<<EOT
-->
<div class="p10"><p class="mb5">你還沒有對此樓進行評分哦∼</p><a target="_blank" href="operate.php?action=showping&tid=$tid&pid=$pid" class="s2">我要評分</a></div>
<div class="popBottom"><span class="bt2"><span><button type="button" onclick="closep();">取消</button></span></span></div>
<!--
EOT;
	}
print <<<EOT
-->
<!--
EOT;
} elseif ($action == 'showuserbinding') {print <<<EOT
-->
<div style="padding:0 5px 5px 0;width:312px;">
<div class="menu_userlist">
<h5>帳號切換</h5>
<ul class="cc">
<!--
EOT;
foreach ($arr as $key => $value) {print <<<EOT
-->
	<li onclick="userBinding.change('$value[uid]')"><a onclick="return false;" href="javascript:;" hidefocus="false">$value[username]</a></li>
<!--
EOT;
}print <<<EOT
-->
</ul>
</div>
</div>
<!--
EOT;
} elseif ($action == 'showrandcolonys') {print <<<EOT
-->
<ul>
<!--
EOT;
foreach($randColonys as $key => $value) {print<<<EOT
-->
	<li>
		<a href="apps.php?q=group&cyid={$value[id]}" target="_blank"><img class="fl" src="{$value[cnimg]}" width="64" height="64" /></a>
		<h4><a href="apps.php?q=group&cyid={$value[id]}"  target="_blank">{$value[cname]}</a></h4>
		<p>{$value[descrip]}</p>
	</li>
<!--
EOT;
}print<<<EOT
-->
</ul>
<!--
EOT;
}elseif ($action == 'activity'){
if($job == 'upload'){print<<<EOT
-->
<form action="pw_ajax.php?action=activity&job=upload&actmid=$actmid" method="post" onsubmit="return false;" enctype="multipart/form-data">
<table width="300px" height="100px" cellspacing="0" cellpadding="5">
	<tr><td>主圖上傳︰<input type="file" value="" class="input" name="act_picture"></td></tr>
	<tr><td align="center"><input class="btn" name="step" type="hidden" value="2"><input class="btn" onclick="ajax.submit(this.form, callback)" type="submit" value="提交"><input class="btn" type="button" value="關閉" onclick="closep();"></td></tr>
</table>
</form>
<script>
var db_ifftp = '$db_ifftp';
var db_ftpweb = '$db_ftpweb';
var attachpath;
if (db_ifftp == 1 && db_ftpweb) {
	attachpath = '$db_ftpweb';
} else {
	attachpath = '$attachpath';
}
function callback(){
	var str = ajax.request.responseText.split("\t");
	if (str[0] == 'success') {
		//showDialog('success','上傳成功！',2);
		for(var i=1; i<=5; i++){
			var element_name = "act[picture" + i +"]";
			var element_value = document.getElementsByName(element_name)[0].value;
			if (element_value != ""){
				continue;
			} else {
				document.getElementsByName(element_name)[0].value = str[1];
				getObj("img_picture_" +i).children[0].src = attachpath + "/" + str[1] ;
				getObj("img_picture_" +i).style.display = "";
				getObj("img_picture_0").style.display = "none";
				break;
			}
		}
	} else if (str[0] == 'error') {
		showDialog('error','請上傳文件',3);
	} else {
		showDialog('error','上傳失敗！請確認圖片大小及格式正確',3);
	}
}
</script>
<!--
EOT;
}elseif($job=='memberlist'){print<<<EOT
-->
<div id="g_info" style="margin:10px 0;">
<!--
EOT;
if(!$count){print <<<EOT
-->
<span class="aa_tip mt10"><img src="$imgpath/activity/alert.png" align="absmiddle" /> <strong>暫時沒有報名記錄!</strong></span>
<!--
EOT;
}else{print <<<EOT
-->
<div class="t">
<table width="100%" class="f12">
	<tr>
		<td colspan="7" class="h">
<!--
EOT;
if ($isAdminright) {
print <<<EOT
-->
			<span class="fr">
				<a href="job.php?action=activity&job=export&tid=$tid&actmid=$actmid">導出報名信息</a>&nbsp;&nbsp;&nbsp;
				<a id="sendmsg" href="javascript:;" onclick="sendmsg('pw_ajax.php?action=activity&job=sendmsg&tid=$tid&actmid=$actmid&authorid=$authorid','',this.id);">+群發消息</a>
			</span>
<!--
EOT;
}print <<<EOT
-->
			<b>報名人數共計{$orderMemberNums}人
<!--
EOT;
if(!$isFree){print<<<EOT
-->
			，已支付人數︰{$payMemberNums}人
<!--
EOT;
}print <<<EOT
-->
			</b>
		</td>
	</tr>
<!--
EOT;
if ($winduid) {
print <<<EOT
-->
	<tr class="tr2">
		<td class="tal">用戶</td>
		<td>手機</td>
		<td>報名人數</td>
		<td class="tal">費用(元)</td>
		<td>創建時間</td>
		<td>
<!--
EOT;
if(!$isFree){
print <<<EOT
-->支付
<!--
EOT;
}print <<<EOT
-->狀態</td>
		<td>操作</td>
	</tr>
<!--
EOT;
foreach($memberlistdb as $value){
if($value[ifpay]==0){
	$ifpay='未支付';
}elseif($value[ifpay]==3){
	$ifpay='費用關閉';
}else{
	$ifpay='已支付';
}
$value[rowspannum] = $value[rowspannum] + 1;
print <<<EOT
-->
	<tr class="tr3">
<!--
EOT;
if (!$isAdminright && $value[uid] != $winduid && $value[ifanonymous]) {
print <<<EOT
-->
		<td rowspan="$value[rowspannum]">
			<a href="javascript:;">匿名</a>
		</td>
		<td rowspan="$value[rowspannum]">保密</td>
<!--
EOT;
}else{print <<<EOT
-->
		<td rowspan="$value[rowspannum]">
			<a href="{$db_userurl}$value[uid]">$value[username]</a>
			<a href="javascript:;" id="message" onclick="sendmsg('pw_ajax.php?action=msg&touid=$value[uid]','','message')"><img src="$imgpath/email.gif"></a>
		</td>
<!--
EOT;
if ($isAdminright || $value[uid] == $winduid) {
print <<<EOT
-->
		<td rowspan="$value[rowspannum]">$value[mobile]</td>
<!--
EOT;
}else{
$beforenum = substr($value[mobile],0,5);
$lastnum = substr($value[mobile],-3);
if($value[mobile]){
print<<<EOT
-->
		<td rowspan="$value[rowspannum]">{$beforenum}****{$lastnum}</td>
<!--
EOT;
}else{print<<<EOT
-->
		<td rowspan="$value[rowspannum]"></td>
<!--
EOT;
}
}
}print <<<EOT
-->
		<td rowspan="$value[rowspannum]">$value[signupmember]</td>
		<td class="bl1">
<!--
EOT;
if(!$value[isadditional]){print <<<EOT
-->
		$value[totalcash]
<!--
EOT;
}else{print <<<EOT
-->

		$value[totalcash]&nbsp;<span class="s3">(追加)</span>
<!--
EOT;
}print <<<EOT
-->
		</td>
		<td>$value[signuptime]</td>
<!--
EOT;
if(!$isFree){
print <<<EOT
-->
		<td>$ifpay</td>
<!--
EOT;
}else{
if($value[ifpay]==3){
	$ifFreepay='關閉';
}else{
	$ifFreepay='正常';
}
print <<<EOT
-->
		<td>$ifFreepay</td>
<!--
EOT;
}print <<<EOT
-->
		<td class="a_option">
<!--
EOT;
if(!$value[isadditional] && !$value[isrefund] && ($isAdminright || $value[uid] == $winduid)){print <<<EOT
-->
			<a href="javascript:;" id="detailshow_$value[actuid]" onclick="sendmsg('pw_ajax.php?action=activity&job=detailshow&actmid=$actmid&actuid=$value[actuid]&authorid=$authorid&tid=$tid&fid=$fid&paymethod=$paymethod','',this.id)">詳情</a>
<!--
EOT;
}print <<<EOT
-->

<!--
EOT;
if ($endtimeStatus > 0) {
if ($authorid == $winduid && $value[ifpay] == 0) {
if(!$isFree){
print <<<EOT
-->
			<a href="javascript:;" id="confirmpay_$value[actuid]" onclick="sendmsg('pw_ajax.php?action=activity&job=confirmpay&actuid=$value[actuid]&actmid=$actmid&authorid=$authorid&tid=$tid','',this.id)">確認支付</a>
<!--
EOT;
}print <<<EOT
-->
			<a href="javascript:;" id="close_$value[actuid]" onclick="sendmsg('pw_ajax.php?action=activity&job=close&tid=$tid&actuid=$value[actuid]&paymethod=$paymethod','',this.id)">關閉</a>
<!--
EOT;
}if ($value[uid] == $winduid && !$value[isadditional] && $value[ifpay] != 3) {
print <<<EOT
-->
			<a id="detailmodify_$value[actuid]" href="javascript:;" onclick="sendmsg('pw_ajax.php?action=activity&job=modify&actuid=$value[actuid]&actmid=$actmid&tid=$tid','',this.id);">修改</a>
<!--
EOT;
}if ($paymethod == 1 && !$isFree) {
if ($value[ifpay] == 0 && $value[uid] == $winduid && !$iscancel) {
print <<<EOT
-->
			<a id="alipay_$value[actuid]" href="javascript:;" class="s1" onclick="sendmsg('pw_ajax.php?action=activity&job=toalipay&actuid=$value[actuid]&actmid=$actmid&tid=$tid&signuper=$value[uid]','',this.id);">立即支付</a>
<!--
EOT;
}elseif ($authorid != $winduid && $value[ifpay] == 0 && $value[uid] != $winduid && !$iscancel && (!$value[ifanonymous] || $isAdminright)) {print <<<EOT
-->
			<a id="alipay_$value[actuid]" href="javascript:;" class="s1" onclick="sendmsg('pw_ajax.php?action=activity&job=toalipay&actuid=$value[actuid]&actmid=$actmid&tid=$tid&signuper=$value[uid]','',this.id);">幫TA支付</a>
<!--
EOT;
}if ($authorid == $winduid && $value[ifpay] == 1) {
print <<<EOT
-->
			<a id="alipay_$value[actuid]" href="javascript:;" class="s1" onclick="sendmsg('pw_ajax.php?action=activity&job=refund&actuid=$value[actuid]&actmid=$actmid&tid=$tid&authorid=$authorid','',this.id);">退款</a>
<!--
EOT;
}if($authorid == $winduid && !$iscancel && !$value[isadditional]){print <<<EOT
-->
			<a id="alipay_$value[actuid]" href="javascript:;" class="s1" onclick="sendmsg('pw_ajax.php?action=activity&job=additional&tid=$tid&actmid=$actmid&actuid=$value[actuid]&authorid=$authorid','',this.id);">追加費用</a>
<!--
EOT;
}}}print <<<EOT
-->

		</td>
	</tr>
<!--
EOT;
if($paymethod==1 && !$isFree){
foreach($refundmemberlistdb[$value[actuid]] as $refund){
print <<<EOT
-->
	<tr class="tr3">
		<td class="bl1">$refund[totalcash]&nbsp;<span class="s1">(退款)</span></td>
		<td>$refund[signuptime]</td>
		<td>已退款</td>
		<td>&nbsp;</td>
	</tr>
<!--
EOT;
}
foreach($addmemberlistdb[$value[actuid]] as $val){
if($val[ifpay]==0){
	$ifpay='未支付';
}elseif($val[ifpay]==3){
	$ifpay='費用關閉';
}else{
	$ifpay='已支付';
}
print <<<EOT
-->
	<tr class="tr3">
		<td class="bl1">$val[totalcash]&nbsp;<span class="s3">(追加)</span></td>
		<td>$val[signuptime]</td>
		<td>$ifpay</td>
		<td class="a_option">
<!--
EOT;
if ($endtimeStatus > 0) {
if ($authorid == $winduid && $val[ifpay] == 0) {
print <<<EOT
-->
			<a href="javascript:;" id="confirmpay_$val[actuid]" onclick="sendmsg('pw_ajax.php?action=activity&job=confirmpay&actuid=$val[actuid]&authorid=$authorid&tid=$tid','',this.id)">確認支付</a>
			<a href="javascript:;" id="close_$val[actuid]" onclick="sendmsg('pw_ajax.php?action=activity&job=close&tid=$tid&actuid=$val[actuid]&paymethod=$paymethod','',this.id)">關閉</a>
<!--
EOT;
}
if ($val[uid] == $winduid && $val[ifpay] == 0 && !$iscancel) {
print <<<EOT
-->
			<a id="alipay_$val[actuid]" href="javascript:;" class="s1" onclick="sendmsg('pw_ajax.php?action=activity&job=toalipay&actuid=$val[actuid]&actmid=$actmid&tid=$tid&signuper=$val[uid]','',this.id);">立即支付</a>
<!--
EOT;
}elseif ($authorid != $winduid && $val[ifpay] == 0 && $val[uid] != $winduid && !$iscancel && (!$val[ifanonymous] || $isAdminright)) {print <<<EOT
-->
			<a id="alipay_$val[actuid]" href="javascript:;" class="s1" onclick="sendmsg('pw_ajax.php?action=activity&job=toalipay&actuid=$val[actuid]&actmid=$actmid&tid=$tid&signuper=$val[uid]','',this.id);">幫TA支付</a>
<!--
EOT;
}if ($authorid == $winduid && $val[ifpay] == 1) {
print <<<EOT
-->
			<a id="alipay_$val[actuid]" href="javascript:;" class="s1" onclick="sendmsg('pw_ajax.php?action=activity&job=refund&actuid=$val[actuid]&actmid=$actmid&tid=$tid&authorid=$authorid','',this.id);">退款</a>
<!--
EOT;
}}print <<<EOT
-->
		</td>
	</tr>
<!--
EOT;
foreach($refundmemberlistdb[$val[actuid]] as $ref){
print <<<EOT
-->
	<tr class="tr3">
		<td class="bl1">$ref[totalcash]&nbsp;<span class="s1">(退款)</span></td>
		<td>$ref[signuptime]</td>
		<td>已退款</td>
		<td>&nbsp;</td>
	</tr>
<!--
EOT;
}}}}
if ($pages) {
print <<<EOT
-->
	<tr>
		<td colspan="7" style="padding:5px;">$pages</td>
	</tr>
<!--
EOT;
}}print<<<EOT
-->
</table>
</div>
<!--
EOT;
}print <<<EOT
-->
</div>
<!--
EOT;
}elseif($job == 'signup'){
if($thelast != '1'){
if($isU){
$limitnum = '';
if($theMoreNum){
	$limitnum = "還可報名{$theMoreNum}人";
}
print<<<EOT
-->
<form action="pw_ajax.php?action=$action&job=$job&" method="post" onsubmit="return false;">
<input type="hidden" name="verify" value="$verifyhash" />
<input type="hidden" name="tid" value="$tid">
<input type="hidden" name="step" value="2">
<input type="hidden" name="actmid" value="$actmid">
<input type="hidden" name="authorid" value="$authorid">
<table width="100%" cellspacing="0" cellpadding="5">
<tbody>
	<tr>
		<th onmousedown="read.move(event);" style="cursor: move; font-weight:bold;" colspan="2" class="h"><span class="adel" onclick="closep();">close</span>活動報名</th>
	</tr>
	<tr>
		<td style="padding:0; width:456px;">
			<div class="aa_alert410" style="padding:0; width:100%">
			<table class="reg_infos" cellpadding="0" cellspacing="0">
				<tr><td class="tar"></td><td><span>說明︰帶<span class="s1">*</span>為必填選項</span></td></tr>
				<tr>
					<tr>
						<td width="90" class="tar"><span style="color:red">*</span>報名人數︰</td>
						<td>
<!--
EOT;
if($signupType){
foreach($signupType as $key => $value){print<<<EOT
-->
						$value&nbsp;<input type="text" name="signup[]" class="input mr10" size="3" onblur="messageCheck('1','signupnumCheck');" />
<!--
EOT;
}}else{print<<<EOT
-->
						<input type="text" name="signup[]" class="input mr10" style="color:#999" size="3" onblur="messageCheck('1','signupnumCheck');" />
<!--
EOT;
}print<<<EOT
-->
					&nbsp;<span id="signupnumCheck">{$limitnum}</span></td>
					</tr>
					<tr>
						<td class="tar"><span style="color:red">*</span>稱呼︰</td>
						<td><input type="text" name="nickname" id="nickname" class="input" size="25" value="$memberdb[nickname]" onblur="messageCheck('2','nicknameCheck');" >&nbsp;<span id="nicknameCheck"></span></td>
					</tr>
					<tr>
						<td class="tar"><span style="color:red">*</span>手機︰</td>
						<td><input type="text" name="mobile" id="mobile" class="input" size="25" value="$memberdb[mobile]" onblur="messageCheck('3','mobileCheck');">&nbsp;<span id="mobileCheck"></span></td>
					</tr>
					<tr>
						<td class="tar">電話︰</td>
						<td><input type="text" class="input" name="telephone" size="25" /></td>
					</tr>
					<tr>
						<td class="tar">地址︰</td>
						<td><input type="text" class="input" name="address" id="address" value="" size="55" onblur="messageCheck('4','addressCheck');"/>&nbsp;<span id="addressCheck"></span></td>
					</tr>
					<tr class="vt">
						<td class="tar">備注︰</td>
						<td><textarea name="message" style="width:210px; height:70px;"></textarea></td>
					</tr>
					<tr>
						<td class="tar">匿名︰</td>
						<td><input type="checkbox" name="ifanonymous" value="1" checked /> 僅發起人可見 </td>
					</tr>
				</tr>
			</table>
			<div class="tac">
<!--
EOT;
if($paymethod==1){print<<<EOT
-->
				<input type="button" class="btn" name="ajaxsubmit" id="ajaxsubmit" onclick="messageCheck(this.form,'all');" value="下一步" />
<!--
EOT;
}elseif($paymethod==2){print<<<EOT
-->
				<input type="button" class="btn" name="ajaxsubmit" id="ajaxsubmit" onclick="messageCheck(this.form,'all');" value="確認報名" />
<!--
EOT;
}print<<<EOT
-->
			</div>
			</div>
		</td>
	</tr>
</tbody>
</table>
</form>
<script>
function messageCheck(frm,checkid) {
	setTimeout(function(){
		var message = '';
		var submitdisabled = false;
		var theMoreNum = parseInt('$theMoreNum');

		if (objCheck(getObj('signupnumCheck')) && (checkid == 'all' || checkid == 'signupnumCheck')) {
			var signupnum = 0;
			var signup = document.getElementsByName('signup[]');

			for (i = 0; i < signup.length; i++) {
				if (signup[i].value.match(/^[+]?\d+$/) == null && signup[i].value) {
					message = '<font color="red">報名人數輸入有誤，請重新輸入</font>';
					submitdisabled = true;
				}
				signupnum += signup[i].value - "0";
			}
			if (message == '') {
				signupnum = parseInt(signupnum);
				if (signupnum <= 0) {
					message = '<font color="red">請輸入報名人數</font>';
					submitdisabled = true;
				} else if (signupnum > 65000) {
					message = '<font color="red">您輸入的人數過大，請重新輸入</font>';
					submitdisabled = true;
				} else if (signupnum > theMoreNum) {
					message = '<font color="red">您的報名人數已超過總人數，請重新輸入</font>';
					submitdisabled = true;
				} else if (signupnum) {
					if (theMoreNum) {
						var num = theMoreNum - signupnum;
						message = '還可報名'+num+'人';
					} else {
						message = '';
					}
				} else {
					message = '<font color="red">報名人數輸入有誤，請重新輸入</font>';
					submitdisabled = true;
				}
			}
			getObj('signupnumCheck').innerHTML = message;
		}
		if (objCheck(getObj('nicknameCheck')) && (checkid == 'all' || checkid == 'nicknameCheck')) {
			if (getObj('nickname').value == '') {
				message = '<font color="red">請輸入稱呼</font>';
				submitdisabled = true;
			} else {
				message = '';
			}
			getObj('nicknameCheck').innerHTML = message;
		}
		if (objCheck(getObj('mobileCheck')) && (checkid == 'all' || checkid == 'mobileCheck')) {
			if (getObj('mobile').value == '') {
				message = '<font color="red">請輸入手機號碼</font>';
				submitdisabled = true;
			} else if (getObj('mobile').value.match(/^1(3|5|8)\d{9}$/) == null && getObj('mobile').value) {
				message = '<font color="red">輸入手機號碼有誤，請重新輸入</font>';
				submitdisabled = true;
			} else {
				message = '';
			}
			getObj('mobileCheck').innerHTML = message;
		}
		if (objCheck(getObj('addressCheck')) && (checkid == 'all' || checkid == 'addressCheck')) {
			if (getObj('address').value.match(/^[-\+]?\d+$/) != null && getObj('address').value) {
				message = '<font color="red">地址不能為全數字，請重新輸入</font>';
				submitdisabled = true;
			} else {
				message = '';
			}
			getObj('addressCheck').innerHTML = message;
		}

		if (submitdisabled == false && checkid == 'all') {
			ajax.submit(frm);
		} else {
			return false;
		}
	},100);
}
</script>
<!--
EOT;
}else{print<<<EOT
-->
<table width="100%" cellspacing="0" cellpadding="5">
	<tr>
		<th class="h" colspan="3" style="cursor:move" onmousedown="read.move(event);"><span class="adel" onclick="closep();">close</span>報名限制</th>
	</tr>
	<tr><td>對不起，發起人限制只有其好友可報名，是否加他為好友？<a href="javascript:;" style="cursor: pointer;" onclick="sendmsg('pw_ajax.php?action=addfriend&touid=$authorid','',this.id);" title="加為好友">+加為好友</a></td></tr>
</table>
<!--
EOT;
}}elseif($thelast == '1'){print<<<EOT
-->
<table width="100%" cellspacing="0" cellpadding="5">
<tbody>
	<tr>
		<th onmousedown="read.move(event);" style="cursor: move; font-weight:bold;" colspan="2" class="h"><span onclick="loadMemberList();" class="adel">close</span>支付費用</th>
	</tr>
	<tr>
		<td style="padding:0; width:456px;">
			<form action="act_alipay_push.php?action=confirm_aa_detail_payment&" method="post" target="_blank">
			<input type="hidden" name="verify" value="$verifyhash" />
			<input type="hidden" name="actuid" value="$actuid" />
			<input type="hidden" name="fromuid" value="-1" />
			<input type="hidden" name="actmid" value="$actmid" />
			<input type="hidden" name="tid" value="$tid" />
			<div class="aa_alert410" style="padding:0; width:100%">
			<table class="reg_infos" cellpadding="0" cellspacing="0">
				<tr>
					<td width="95" class="tar">活動費用︰</td>
					<td>$fees</td>
				</tr>
				<tr>
					<td width="95" class="tar">報名人數︰</td>
<!--
EOT;
if($signupdetail){print<<<EOT
-->
					<td>{$signupdetail}，總計 {$totalsignupnums} 人</td>
<!--
EOT;
}else{print<<<EOT
-->
					<td>總計 {$totalsignupnums} 人</td>
<!--
EOT;
}print<<<EOT
-->
				</tr>
				<tr>
					<td width="95" class="tar">共計費用︰</td>
					<td>{$totalcash}元</td>
				</tr>
<!--
EOT;
if($paymethod==2){print<<<EOT
-->
				<tr class="s3 last-tr">
					<td width="95" class="tar">注意︰</td>
					<td>此次活動為現金支付，請及時聯系活動發起者確認支付</td>
				</tr>
<!--
EOT;
}print<<<EOT
-->
			</table>
			<div class="tac">
<!--
EOT;
if($paymethod==1 && !$isFree){print<<<EOT
-->
				<input type="submit" class="btn" value="去支付寶付款" />&nbsp;
<!--
EOT;
}print<<<EOT
-->
				<input type="button" class="btn" name="ajaxsubmit" onclick="loadMemberList();" value="關閉" />
			</div>
		</div>
		</form>
		</td>
	</tr>
</tbody>
</table>
<!--
EOT;
}}elseif($job == 'detailshow'){
if($detailinfo[ifpay]==0){
	$ifpay='<span class="s3">(未支付)</span>';
}elseif($detailinfo[ifpay]==3){
	$ifpay='<span class="gray">(費用關閉)</span>';
}else{
	$ifpay='<span class="gray">(已支付)</span>';
}
print<<<EOT
-->
<table width="100%" cellspacing="0" cellpadding="5">
<tbody>
	<tr>
		<th onmousedown="read.move(event);" style="cursor: move; font-weight:bold;" colspan="2" class="h"><span class="adel" onclick="closep();">close</span><strong class="s3">{$detailinfo[username]}</strong>的報名信息︰</th>
	</tr>
	<tr>
		<td style="padding:0; width:456px;"><div class="aa_alert410" style="padding:0; width:100%">
			<table class="reg_infos" cellpadding="0" cellspacing="0">
				<tr>
					<td width="90" class="tar">報名人數︰</td>
					<td>$detailinfo[signupmember]</td>
				</tr>
				<tr>
					<td class="tar">稱呼︰</td>
					<td>$detailinfo[nickname]</td>
				</tr>
				<tr>
					<td class="tar">手機︰</td>
					<td>$detailinfo[mobile]</td>
				</tr>
				<tr>
					<td class="tar">電話︰</td>
					<td>$detailinfo[telephone]</td>
				</tr>
				<tr>
					<td class="tar">地址︰</td>
					<td>$detailinfo[address]</td>
				</tr>
				<tr>
					<td class="tar">備注︰</td>
					<td>$detailinfo[message]</td>
				</tr>
				<tr>
					<td class="tar">費用︰</td>
					<td>
<!--
EOT;
if(!$isFree){print<<<EOT
-->
					<span class="b s3">$detailinfo[totalcash]</span>元 {$ifpay}
<!--
EOT;
if ($authorid == $winduid && $detailinfo[ifpay] == 0 && $endtimeStatus > 0) {
print <<<EOT
-->
					&nbsp;<a href="javascript:;" style="color:#1b72af;text-decoration:underline;" onclick="sendmsg('pw_ajax.php?action=activity&job=confirmpay&actuid=$detailinfo[actuid]&actmid=$actmid&authorid=$authorid&tid=$tid','',this.id)">確認支付</a>
<!--
EOT;
}}else{print <<<EOT
-->
					免費
<!--
EOT;
}print <<<EOT
-->
					</td>
				</tr>
<!--
EOT;
if ($addmemberlistdb && !$isFree) {
print <<<EOT
-->
				<tr class="vt">
					<td class="tar">追加費用︰</td>
					<td>
<!--
EOT;
foreach($addmemberlistdb as $add){
if($add[ifpay]==0){
	$ifpay='<span class="s3">(未支付)</span>';
}elseif($add[ifpay]==3){
	$ifpay='<span class="gray">(費用關閉)</span>';
}else{
	$ifpay='<span class="gray">(已支付)</span>';
}
print <<<EOT
-->
					<p><span class="b s3">$add[totalcash]</span>元 {$ifpay}
<!--
EOT;
if ($authorid == $winduid && $add[ifpay] == 0 && $endtimeStatus > 0) {
print <<<EOT
-->
					&nbsp;<a href="javascript:;" style="color:#1b72af;text-decoration:underline;" onclick="sendmsg('pw_ajax.php?action=activity&job=confirmpay&actuid=$add[actuid]&actmid=$actmid&authorid=$authorid&tid=$tid','',this.id)">確認支付</a>
<!--
EOT;
}print <<<EOT
-->
					</p>
<!--
EOT;
}print <<<EOT
-->
					</td>
				</tr>
<!--
EOT;
}
if ($refundmemberlistdb && !$isFree) {
print <<<EOT
-->
				<tr>
					<td class="tar">退款︰</td>
					<td>
<!--
EOT;
foreach($refundmemberlistdb as $refund){
print <<<EOT
-->
						<p><span class="b s3">$refund[totalcash]</span>元 <span class="gray">(已退款)</span></p>
<!--
EOT;
}print <<<EOT
-->
					</td>
				</tr>
<!--
EOT;
}print <<<EOT
-->
			</table>
		</div></td>
	</tr>
</tbody>
</table>
<!--
EOT;
}elseif($job == 'modify'){
$limitnum = '';
if($theMoreNum){
	$limitnum = "還可報名{$theMoreNum}人";
}print<<<EOT
-->
<form action="pw_ajax.php?action=$action&job=$job&" method="post" onsubmit="return false;">
<input type="hidden" name="verify" value="$verifyhash" />
<input type="hidden" name="tid" value="$tid">
<input type="hidden" name="actmid" value="$actmid">
<input type="hidden" name="actuid" value="$actuid">
<input type="hidden" name="ownernums" value="$ownernums">
<input type="hidden" name="step" value="2">
<table width="100%" cellspacing="0" cellpadding="5">
<tbody>
	<tr>
		<th onmousedown="read.move(event);" style="cursor: move; font-weight:bold;" colspan="2" class="h"><span class="adel" onclick="closep();">close</span>報名修改</th>
	</tr>
	<tr>
		<td style="padding:0; width:456px;">
			<div class="aa_alert410" style="padding:0; width:100%">
			<table class="reg_infos" cellpadding="0" cellspacing="0">
				<tr><td class="tar"></td><td><span>說明︰帶<span class="s1">*</span>為必填選項</span></td></tr>
				<tr>
					<table width="100%">
					<tr>
						<td width="90" class="tar"><span style="color:red">*</span>報名人數︰</td>
						<td>
<!--
EOT;
if($signupinfo['ifpay'] != 0){
foreach($signupType as $key => $value){print<<<EOT
-->
							$value&nbsp;{$signupinfo[signupdetail][$key]}人&nbsp;<input type="hidden" name="signup[]" class="input" size="3" value="{$signupinfo[signupdetail][$key]}" />
<!--
EOT;
}}else{
if($signupType){
foreach($signupType as $key => $value){print<<<EOT
-->
							$value&nbsp;<input type="text" name="signup[]" class="input" size="3" value="{$signupinfo[signupdetail][$key]}" onblur="messageCheck('1','signupnumCheck');"/>
<!--
EOT;
}}else{print<<<EOT
-->
							&nbsp;<input type="text" name="signup[]" class="input" size="3" value="{$signupinfo[signupnum]}" onblur="messageCheck('1','signupnumCheck');"/>
<!--
EOT;
}}print<<<EOT
-->
						&nbsp;<span id="signupnumCheck">{$limitnum}</span></td>
					</tr>
					<tr>
						<td class="tar"><span style="color:red">*</span>稱呼︰</td>
						<td><input type="text" name="nickname" id="nickname" class="input" value="$signupinfo[nickname]" onblur="messageCheck('2','nicknameCheck');" >&nbsp;<span id="nicknameCheck"></span></td>
					</tr>
					<tr>
						<td class="tar"><span style="color:red">*</span>手機︰</td>
						<td><input type="text" name="mobile" id="mobile" class="input" value="$signupinfo[mobile]" onblur="messageCheck('3','mobileCheck');">&nbsp;<span id="mobileCheck"></span></td>
					</tr>
					<tr>
						<td class="tar">電話︰</td>
						<td><input type="text" name="telephone" class="input" value="$signupinfo[telephone]"></td>
					</tr>
					<tr>
						<td class="tar">地址︰</td>
						<td><input type="text" name="address" id="address" class="input" value="$signupinfo[address]" onblur="messageCheck('4','addressCheck');">&nbsp;<span id="addressCheck"></span></td>
					</tr>
					<tr>
						<td class="tar">備注︰</td>
						<td><textarea name="message" style="width:200px;height:45px;" class="input">$signupinfo[message]</textarea></td>
					</tr>
					<tr>
						<td class="tar">匿名︰</td>
						<td><input type="checkbox" name="ifanonymous" value="1" $checked>&nbsp;(僅發起人可見)</td>
					</tr>
					</table>
				</tr>
			</table>
			<div class="tac">
				<input type="button" class="btn" name="ajaxsubmit" onclick="messageCheck(this.form,'all');" value="提 交" />
			</div>
			</div>
		</td>
	</tr>
</tbody>
</table>
</form>
<script>
function messageCheck(frm,checkid) {
	setTimeout(function(){
		var message = '';
		var submitdisabled = false;
		var theMoreNum = parseInt('$theMoreNum');
		var ownernums = parseInt('$ownernums');

		if (objCheck(getObj('signupnumCheck')) && (checkid == 'all' || checkid == 'signupnumCheck')) {
			var signupnum = 0;
			var signup = document.getElementsByName('signup[]');

			for (i = 0; i < signup.length; i++) {
				if (signup[i].value.match(/^[+]?\d+$/) == null && signup[i].value) {
					message = '<font color="red">報名人數輸入有誤，請重新輸入</font>';
					submitdisabled = true;
				}
				signupnum += signup[i].value - "0";
			}
			if (message == '') {
				signupnum = parseInt(signupnum);
				if (signupnum <= 0) {
					message = '<font color="red">請輸入報名人數</font>';
					submitdisabled = true;
				} else if (signupnum > 65000) {
					message = '<font color="red">您輸入的人數過大，請重新輸入</font>';
					submitdisabled = true;
				} else if (signupnum > theMoreNum + ownernums) {
					message = '<font color="red">您的報名人數已超過總人數，請重新輸入</font>';
					submitdisabled = true;
				} else if (signupnum) {
					if (theMoreNum) {
						var num = theMoreNum - signupnum + ownernums;
						message = '還可報名'+num+'人';
					} else {
						message = '';
					}
				} else {
					message = '<font color="red">報名人數輸入有誤，請重新輸入</font>';
					submitdisabled = true;
				}
			}
			getObj('signupnumCheck').innerHTML = message;
		}
		if (objCheck(getObj('nicknameCheck')) && (checkid == 'all' || checkid == 'nicknameCheck')) {
			if (getObj('nickname').value == '') {
				message = '<font color="red">請輸入稱呼</font>';
				submitdisabled = true;
			} else {
				message = '';
			}
			getObj('nicknameCheck').innerHTML = message;
		}
		if (objCheck(getObj('mobileCheck')) && (checkid == 'all' || checkid == 'mobileCheck')) {
			if (getObj('mobile').value == '') {
				message = '<font color="red">請輸入手機號碼</font>';
				submitdisabled = true;
			} else if (getObj('mobile').value.match(/^1(3|5|8)\d{9}$/) == null && getObj('mobile').value) {
				message = '<font color="red">輸入手機號碼有誤，請重新輸入</font>';
				submitdisabled = true;
			} else {
				message = '';
			}
			getObj('mobileCheck').innerHTML = message;
		}
		if (objCheck(getObj('addressCheck')) && (checkid == 'all' || checkid == 'addressCheck')) {
			if (getObj('address').value.match(/^[-\+]?\d+$/) != null && getObj('address').value) {
				message = '<font color="red">地址不能為全數字，請重新輸入</font>';
				submitdisabled = true;
			} else {
				message = '';
			}
			getObj('addressCheck').innerHTML = message;
		}

		if (submitdisabled == false && checkid == 'all') {
			ajax.submit(frm,signupModify);
		} else {
			return false;
		}
	},100);
}
</script>
<!--
EOT;
}elseif($job == 'confirmpay'){print<<<EOT
-->
<form action="pw_ajax.php?action=$action&job=$job&" method="post" onsubmit="return false;">
<input type="hidden" name="verify" value="$verifyhash" />
<input type="hidden" name="step" value="2" />
<input type="hidden" name="actuid" value="$actuid" />
<input type="hidden" name="authorid" value="$authorid" />
<input type="hidden" name="tid" value="$tid" />
<table width="100%" cellspacing="0" cellpadding="5">
<tbody>
	<tr>
		<th onmousedown="read.move(event);" style="cursor: move; font-weight:bold;" colspan="2" class="h"><span class="adel" onclick="closep();">close</span>確認支付</th>
	</tr>
	<tr>
		<td><div class="aa_alert410">
			<p>用戶︰<span class="mr20">$memberdb[username]</span> 共計費用︰<span>$memberdb[totalcash]元</span></p>
			<p class="gray">該用戶目前是<span class="s3">未支付狀態</span>，如果您確認用戶已經通過其他的方式支付了費用，請點擊“確定”，否則請點擊“取消”。<br />確認後不可撤消，請慎重操作！</p>
			<div class="tac">
				<input type="button" class="btn" name="ajaxsubmit" onclick="ajax.submit(this.form,signupModify);" value="確認" />
				<input type="button" class="bt" onclick="closep();" value="取消" />
			</div>
		</div></td>
	</tr>
</tbody>
</table>
</form>
<!--
EOT;
}elseif($job=='close'){print <<<EOT
-->
<form action="pw_ajax.php?action=$action&job=$job&" method="post" onsubmit="return false;">
<input type="hidden" name="verify" value="$verifyhash" />
<input type="hidden" name="step" value="2" />
<input type="hidden" name="actuid" value="$actuid" />
<input type="hidden" name="paymethod" value="$paymethod" />
<input type="hidden" name="tid" value="$tid" />
<table width="100%" cellspacing="0" cellpadding="5">
<tbody>
	<tr>
		<th onmousedown="read.move(event);" style="cursor: move; font-weight:bold;" colspan="2" class="h"><span class="adel" onclick="closep();">close</span>提示</th>
	</tr>
	<tr>
		<td>
			<div class="aa_alert220">
<!--
EOT;
if($isadditional){print<<<EOT
-->
				<p><img src="$imgpath/activity/icon_loss.png" align="absmiddle" class="mr10" />確定關閉該筆費用嗎？</p>
<!--
EOT;
}else{print<<<EOT
-->
				<p>您將從本活動中關閉該條報名記錄。<br />確定關閉嗎？</p>
<!--
EOT;
}print<<<EOT
-->
				<div class="tac">
					<input type="button" class="btn" name="ajaxsubmit" onclick="ajax.submit(this.form,signupClose);" value="確定" />
					<input type="button" class="bt" name="ajaxsubmit" onclick="closep();" value="取消" />
				</div>
			</div>
		</td>
	</tr>
</tbody>
</table>
</form>
<!--
EOT;
}elseif($job=='sendmsg'){print <<<EOT
-->
<form action="pw_ajax.php?action=$action&job=$job&" method="post" onsubmit="return false;">
<input type="hidden" name="verify" value="$verifyhash" />
<input type="hidden" name="step" value="2" />
<input type="hidden" name="tid" value="$tid" />
<input type="hidden" name="actmid" value="$actmid" />
<input type="hidden" name="authorid" value="$authorid" />
<table cellspacing="0" cellpadding="0" width="440">
	<tbody>
	<tr><th class="h" colspan="2" style="cursor:move" onmousedown="read.move(event);"><span class="adel" onclick="closep();">close</span>群發短消息</th></tr>
	<tr><td align="center">標題</td><td><input type="text" class="input" name="subject" maxlength="100" size="50"/></td></tr>
	<tr><td align="center">內容</td><td><textarea name="atc_content" rows="8" style="width:330px"></textarea></td></tr>
	</tbody>
</table>
<ul><li style="text-align:center;padding:4px 0;"><input type="button" class="btn" name="ajaxsubmit" onclick="ajax.submit(this.form);" value="提 交" /></li></ul>
</form>
<!--
EOT;
}elseif($job=='refund'){
if($thelast != '1'){print <<<EOT
-->
<form action="pw_ajax.php?action=$action&job=$job&" method="post" onsubmit="return false;">
<input type="hidden" name="verify" value="$verifyhash" />
<input type="hidden" name="step" value="2" />
<input type="hidden" name="actuid" value="$actuid" />
<input type="hidden" name="authorid" value="$authorid" />
<input type="hidden" name="actmid" value="$actmid" />
<input type="hidden" name="tid" value="$tid" />
<table width="100%" cellspacing="0" cellpadding="5">
<tbody>
	<tr>
		<th onmousedown="read.move(event);" style="cursor: move; font-weight:bold;" colspan="2" class="h"><span class="adel" onclick="closep();">close</span>退款</th>
	</tr>
	<tr>
		<td><div class="aa_alert410">
			<p><img src="$imgpath/activity/alert.png" align="absmiddle" class="mr10" />您可以在參與者付款後的1個月內進行退款</p>
			<table class="add_cost" cellpadding="0" cellspacing="0">
				<tr>
					<td width="95" class="tar"><span class="s3">*</span>&nbsp;我要給TA退款︰</td>
					<td><span class="mr5">$memberdb[username] </span><input type="text" class="input mr5" name="cost" id="costvalue" size="3" style="color:#999" onblur="messageCheck('1','personalcost');"/><span class="mr5">元</span> <span class="gray">(最多{$morecost}元)</span></td>
				</tr>
				<tr class="vt">
					<td class="tar"><span class="s3">*</span>&nbsp;退款原因︰</td>
					<td><textarea name="reason" style="width:225px; height:80px; color:#666" class="gray" id="reason" onblur="messageCheck('2','reason');" onkeydown="checkAdditionalReasonLength();" title="請輸入您的退款原因或費用說明，最多128個字"></textarea><br /><span id="wordtip"></span></td>
				</tr>
				<tr>
					<td class="tar"></td>
					<td><span id="reasonhtml"></span><span id="personalcost"></span></td>
				</tr>
			</table>
			<div class="tac">
				<input type="button" id="ajaxsubmit" class="btn" name="ajaxsubmit" onclick="messageCheck(this.form,'all');" value="退款" />
			</div>
		</div></td>
	</tr>
</tbody>
</table>
</form>
<script>
function messageCheck(frm,checkid) {
	setTimeout(function(){
		var submitdisabled = false;
		var reasonShow = true;
		var morecost = '$morecost';
		var message = '';

		if (objCheck(getObj('personalcost'))) {
			var thecost = getObj('costvalue').value - "0";
			var costtest = /^(([1-9]\d*)|0)(\.\d{0,2})?$/;
			if (!costtest.test(thecost) || thecost == 0){
				message = '<font color="red">退款費用必須為整數或小數，小數點後不超過2位</font>';
				submitdisabled = true;
				reasonShow = false;
			} else if (thecost > morecost) {
				message = '<font color="red">退款費用不得高于最多費用︰'+morecost+'元</font>';
				submitdisabled = true;
				reasonShow = false;
			} else if (thecost) {
				message = '退款費用<span class="b s3" id="">'+getObj('costvalue').value+'</span>元</span>';
			} else {
				message = '';
			}
		}
		if (getObj('reason').value == '' && reasonShow == true && (checkid == 'all' || checkid == 'reason')) {
			message = '<font color="red">請輸入您的退款原因或費用說明，最多128個字</font>';
			submitdisabled = true;
		}
		getObj('personalcost').innerHTML = message;

		if (submitdisabled == false && checkid == 'all') {
			ajax.submit(frm);
		} else {
			return false;
		}

	},100);
}

function checkAdditionalReasonLength(){
	setTimeout(function(){
		getObj('ajaxsubmit').disabled = false;
		var l = strlen(getObj('reason').value);
		if(l < 128 && l > 0) {
			getObj('wordtip').innerHTML='剩余'+(128-l)+'個字節';
			getObj('wordtip').style.backgroundColor='#fffeed';
			getObj('wordtip').style.display='inline';
		} else if (l == 128) {
			getObj('wordtip').innerHTML='已經達到最大字數限制';
			getObj('wordtip').style.backgroundColor='#ffd9d9';
			getObj('wordtip').style.display='inline';
		} else if (l >= 128) {
			getObj('wordtip').innerHTML='已經超過最大字數限制！';
			getObj('wordtip').style.backgroundColor='#ff9999';
			getObj('wordtip').style.display='inline';
			getObj('ajaxsubmit').disabled = true;
		} else {
			getObj('wordtip').style.display='none';
		}
	},100);
}
</script>
<!--
EOT;
}elseif($thelast == '1'){print<<<EOT
-->
<div style="width:356px;">
	<div class="popTop" onmousedown="read.move(event);" style="cursor: move;">
		<span onclick="loadMemberList();" class="adel cp">關閉</span>
		支付費用
	</div>
	<form action="act_alipay_push.php?action=refund_aa_payment&" method="post" target="_blank">
	<input type="hidden" name="verify" value="$verifyhash" />
	<input type="hidden" name="actuid" value="$actuid" />
	<input type="hidden" name="actmid" value="$actmid" />
	<input type="hidden" name="tid" value="$tid" />
	<div class="aa_alert410" style="padding:0; width:100%">
	<table class="reg_infos" cellpadding="0" cellspacing="0">
		<tr>
			<td width="105" class="tar">您的退款金額為︰</td>
			<td>$cost 元</td>
		</tr>
		<tr class="s3 last-tr">
			<td width="105" class="tar">注意︰</td>
			<td>確定需要退款嗎？</td>
		</tr>
	</table>
	</div>
	<div class="popBottom">
		<span class="btn2" onclick="closep();"><span><button type="submit">確認去退款</button></span></span>
		<span class="bt2" onclick="closep();"><span><button type="button" name="ajaxsubmit">關閉</button></span></span>
	</div>
</form>
</div>
<!--
EOT;
}}elseif($job=='additional'){print <<<EOT
-->
<form action="pw_ajax.php?action=$action&job=$job&" method="post" onsubmit="return false;">
<input type="hidden" name="verify" value="$verifyhash" />
<input type="hidden" name="step" value="2" />
<input type="hidden" name="actuid" value="$actuid" />
<input type="hidden" name="tid" value="$tid" />
<input type="hidden" name="more" value="$more" />
<table width="100%" cellspacing="0" cellpadding="5">
<tbody>
	<tr>
		<th onmousedown="read.move(event);" style="cursor: move; font-weight:bold;" colspan="2" class="h"><span class="adel" onclick="closep();">close</span>追加費用</th>
	</tr>
<!--
EOT;
if(empty($more)){print <<<EOT
-->
	<tr>
		<td><div class="aa_alert410">
			<p><img src="$imgpath/activity/alert.png" align="absmiddle" class="mr10" />您可以追加一定的費用，每人2000元以內</p>
			<table class="add_cost" cellpadding="0" cellspacing="0">
				<tr>
					<td width="85" class="tar"><span class="s3">*</span>&nbsp;我要追加TA︰</td>
					<td><a href="javascript:;" class="fr" onclick="sendmsg('pw_ajax.php?action=activity&job=additional&tid=$tid&actuid=$actuid&authorid=$authorid&more=1','',this.id);">批量追加費用》</a><span class="mr5">$memberdb[username] </span><input type="text" class="input mr5" name="totalcost" id="costvalue" size="3"  onblur="messageCheck('1','personalcost');"/>元</td>
				</tr>
				<tr class="vt">
					<td class="tar"><span class="s3">*</span>&nbsp;追加原因︰</td>
					<td><textarea name="additionalreason" style="width:225px; height:80px; color:#666" class="gray" id="reason" onblur="messageCheck('2','reason');" onkeydown="checkAdditionalReasonLength();" title="請輸入您的追加原因或費用說明，最多250個字"></textarea><br /><span id="wordtip"></span></td>
				</tr>
				<tr>
					<td class="tar"></td>
					<td><span id="personalcost"></span></td>
				</tr>
			</table>
			<div class="tac">
				<input type="button" id="ajaxsubmit" class="btn" name="ajaxsubmit" onclick="messageCheck(this.form,'all');" value="追加費用" />
			</div>
<script>
function messageCheck(frm,checkid) {
	setTimeout(function(){
		var submitdisabled = false;
		var reasonShow = true;
		var message = '';

		if (objCheck(getObj('personalcost'))) {
			var thecost = getObj('costvalue').value - "0";
			var costtest = /^(([1-9]\d*)|0)(\.\d{0,2})?$/;
			if (!costtest.test(thecost) || thecost == 0){
				message = '<font color="red">追加費用必須為整數或小數，小數點後不超過2位</font>';
				submitdisabled = true;
				reasonShow = false;
			} else if (thecost > 2000) {
				message = '<font color="red">單人單筆費用不能超過2000元</font>';
				submitdisabled = true;
				reasonShow = false;
			} else if (thecost) {
				message = '費用<span class="b s3" id="">'+getObj('costvalue').value+'</span>元</span>';
			} else {
				message = '';
			}
		}
		if (getObj('reason').value == '' && reasonShow == true && (checkid == 'all' || checkid == 'reason')) {
			message = '<font color="red">請輸入您的退款原因或費用說明，最多128個字</font>';
			submitdisabled = true;
		}
		getObj('personalcost').innerHTML = message;

		if (submitdisabled == false && checkid == 'all') {
			ajax.submit(frm,additional);
		} else {
			return false;
		}

	},100);
}
</script>
<!--
EOT;
}elseif($more==1){print <<<EOT
-->
	<tr>
		<td><div class="aa_alert410 add_more_cost">
			<p><img src="$imgpath/activity/alert.png" align="absmiddle" />您可以追加一定的費用，每人2000元以內</p>
			<p><em class="s3">*</em>我要追加TA們費用︰
				<select name="selectvalue" id="selectvalue" class="mr5" style="color:#999;" onchange="calculateCost();">
					<option value="personal">每人</option>
					<option value="total">總共</option>
				</select>
				<input type="text" class="input" name="totalcost" id="costvalue" size="4" style="color:#999" onblur="calculateCost();" onkeydown="calculateCost();" /> 元
			</p>
			<div class="name_list">
				<ul id="newmemberhtml">
<!--
EOT;
foreach($memberlist as $key => $value){
print<<<EOT
-->
					<li>
						<input type="checkbox" name="uids[]" id="box_$key" value="$key" onclick="messageCheck('1','totalcostHtml');" checked/>&nbsp;<label for="name1">$value</label> &nbsp;<input type="text" name="cost_[$key]" id="$key" class="input" size="4" style="color:#999" onblur="messageCheck('1','totalcostHtml');"/> <span> &nbsp;元</span>
					</li>
<!--
EOT;
}print <<<EOT
-->
				</ul>
			</div>
			<p><input type="text" class="input mr5 gray" value="請輸入社區ID" id="newid" onfocus="Checktext(this,1);" onblur="Checktext(this,1);" size="25" style="color:#999" />
			<button class="aa_btn_add" onclick="addNewMember();">添加新成員</button>
				<br /><span id="errordesc"></span>
			</p>
			<p><em class="s3">*</em>追加原因︰<span id="wordtip"></span><br />
				<textarea name="additionalreason" class="gray" style="width:242px; height:80px; color:#999" id="reason" onblur="messageCheck('2','reason');" onkeydown="checkAdditionalReasonLength();" title="請輸入您的追加原因或費用說明，最多250個字"></textarea>
			</p>
			<p class="tac" id="totalcostHtml"></p>
			<div class="tac">
				<input type="button" id="ajaxsubmit" class="btn" name="ajaxsubmit" onclick="messageCheck(this.form,'all');" value="追加費用" />
			</div>
<script>
function addNewMember() {
	var username = getObj('newid').value;
	var elements = document.getElementsByTagName('input');

	ajax.send("pw_ajax.php?action=activity&job=addnewmember",'username=' + username+'&tid='+'$tid',function(){
		var rText = ajax.request.responseText.split('\t');
		if (rText[0] == 'success') {
			for (var i = 0,len = elements.length; i < len; i++) {
				if (elements[i].name.indexOf('uids') != -1) {
					if (elements[i].value == rText[1]) {
						getObj('errordesc').innerHTML = '<font color="red">用戶名已在報名列表中</font>';
						return false;
					}
				}
			}
			var aidsel = getObj('newmemberhtml');
			var option = elementBind('li');
			option.innerHTML = '<input type="checkbox" name="uids[]" id="box_'+rText[1]+'" value="'+rText[1]+'" onclick="calculateOtherCost();" checked/>&nbsp;<label for="name1">'+rText[2]+'</label> &nbsp;<input type="text" name="cost_['+rText[1]+']" id="'+rText[1]+"\" class=\"input\" size=\"4\" style=\"color:#999\" onblur=\"messageCheck('1','totalcostHtml');\" /> <span> &nbsp;元</span>";
			aidsel.insertBefore(option,null);
			getObj('errordesc').innerHTML = '';
		} else if (rText[0] == 'authorerror') {
			getObj('errordesc').innerHTML = '<font color="red">無法添加自己</font>';
			return false;
		} else if (rText[0] == 'exist') {
			getObj('errordesc').innerHTML = '<font color="red">用戶名已在報名列表中</font>';
			return false;
		} else if (rText[0] == 'error') {
			getObj('errordesc').innerHTML = '<font color="red">用戶名不存在或為空</font>';
			return false;
		} else {
			getObj('errordesc').innerHTML = '<font color="red">非法操作</font>';
			return false;
		}
	});
}

function calculateCost() {
	setTimeout(function(){
		var thecost = getObj('costvalue').value - "0";
		var costtest = /^(([1-9]\d*)|0)(\.\d{0,2})?$/;
		var totalcost = 0;//總額
		var message = '';

		if (thecost != '' && !costtest.test(thecost)){
			getObj('totalcostHtml').innerHTML = '<font color="red">追加費用必須為整數或小數，小數點後不超過2位</font>';
			getObj('ajaxsubmit').disabled = true;
			return false;
		}
		var elements = document.getElementsByTagName('input');
		var count = 0;//選中個數

		for (var i = 0,len = elements.length; i < len; i++) {
			if (elements[i].name.indexOf('uids') != -1 && elements[i].checked == true) {
				count ++;
			}
		}
		for (var i = 0,len = elements.length; i < len; i++) {
			if (elements[i].name.indexOf('cost_') != -1 && getObj('box_'+elements[i].id).checked == true) {
				if (getObj('selectvalue').value == 'personal' && thecost) {//每個人
					elements[i].value = thecost;
					if (thecost > 2000) {
						message = '<font color="red">單人單筆費用不能超過2000元</font>';
						getObj('ajaxsubmit').disabled = true;
					}
				} else if (getObj('selectvalue').value == 'total' && thecost) {//總共
					elements[i].value = (thecost/count).toFixed(2) - "0";
					if (elements[i].value > 2000) {
						message = '<font color="red">單人單筆費用不能超過2000元</font>';
						getObj('ajaxsubmit').disabled = true;
					}
				}
			}
		}
		if (message) {
			getObj('totalcostHtml').innerHTML = message;
			return false;
		}

		if (getObj('selectvalue').value == 'personal') {//每個人
			totalcost = count*thecost;
		} else if (getObj('selectvalue').value == 'total') {//總共
			totalcost = thecost;
		}
		getObj('totalcostHtml').innerHTML = '共<span class="b s3">'+count+'</span>人，總額<span class="b s3">'+totalcost.toFixed(2)+'</span>元';
		if (totalcost && totalcost == 0) {
			getObj('totalcostHtml').innerHTML = '<font color="red">追加費用必須為整數或小數，小數點後不超過2位</font>';
			getObj('ajaxsubmit').disabled = true;
		} else if (!totalcost) {
			getObj('totalcostHtml').innerHTML = '';
		} else {
			getObj('ajaxsubmit').disabled = false;
		}
	},100);
}

function messageCheck(frm,checkid) {
	setTimeout(function(){
		var costtest = /^(([1-9]\d*)|0)(\.\d{0,2})?$/;
		var totalcost = 0;//總額
		var count = 0;//選中個數
		var tempcost;
		var submitdisabled = false;
		var reasonShow = true;
		var message = '';

		if (objCheck(getObj('totalcostHtml'))) {
			var elements = document.getElementsByTagName('input');
			for (var i = 0,len = elements.length; i < len; i++) {
				if (elements[i].name.indexOf('uids') != -1 && elements[i].checked == true) {
					count ++;
				} else if (elements[i].name.indexOf('cost_') != -1 && getObj('box_'+elements[i].id).checked == true) {
					tempcost = elements[i].value - "0";
					if (tempcost != '' && !costtest.test(tempcost)){
						message = '<font color="red">追加費用必須為整數或小數，小數點後不超過2位</font>';
						reasonShow = false;
					} else if (tempcost > 2000) {
						message = '<font color="red">單人單筆費用不能超過2000元</font>';
						reasonShow = false;
					}
					if (message == '') {
						totalcost += tempcost;
					}
				}
			}

			if (message) {
				submitdisabled = true;
			} else if (totalcost == 0) {
				message = '<font color="red">追加費用必須為整數或小數，小數點後不超過2位</font>';
				submitdisabled = true;
				reasonShow = false;
			} else {
				message = '共<span class="b s3">'+count+'</span>人，總額<span class="b s3">'+totalcost.toFixed(2)+'</span>元';
			}
		}
		if (getObj('reason').value == '' && reasonShow == true && (checkid == 'all' || checkid == 'reason')) {
			message = '<font color="red">請輸入您的退款原因或費用說明，最多128個字</font>';
			submitdisabled = true;
		}
		getObj('totalcostHtml').innerHTML = message;

		if (submitdisabled == false && checkid == 'all') {
			ajax.submit(frm,additional);
		} else {
			return false;
		}
	},100);
}
</script>
<!--
EOT;
}print <<<EOT
-->
		</div></td>
	</tr>
</tbody>
</table>
</form>
<script>
function Checktext(obj,id){
	if (obj.className.indexOf('gray')!=-1) {
		obj.value = '';
		obj.className = obj.className.replace('gray', 'black');
	} else if (obj.value == '') {
		if (id == 1) {
			obj.value = '請輸入社區ID';
		} else if (id == 2) {
			obj.value = '請輸入您的追加原因或費用說明，最多250 個字';
		}

		if (obj.className.indexOf('black') == -1) {
			obj.className += ' gray';
		} else {
			obj.className = obj.className.replace('black', 'gray');
		}
	}
}

function checkAdditionalReasonLength(){
	setTimeout(function(){
		getObj('ajaxsubmit').disabled = false;
		var l = strlen(getObj('reason').value);
		if(l < 250 && l > 0) {
			getObj('wordtip').innerHTML='剩余'+(250-l)+'個字節';
			getObj('wordtip').style.backgroundColor='#fffeed';
			getObj('wordtip').style.display='inline';
		} else if (l == 250) {
			getObj('wordtip').innerHTML='已經達到最大字數限制';
			getObj('wordtip').style.backgroundColor='#ffd9d9';
			getObj('wordtip').style.display='inline';
		} else if (l >= 250) {
			getObj('wordtip').innerHTML='已經超過最大字數限制！';
			getObj('wordtip').style.backgroundColor='#ff9999';
			getObj('wordtip').style.display='inline';
			getObj('ajaxsubmit').disabled = true;
		} else {
			getObj('wordtip').style.display='none';
		}
	},100);
}
</script>
<!--
EOT;
}elseif($job == 'toalipay'){print<<<EOT
-->
<form action="act_alipay_push.php?action=confirm_aa_detail_payment&" method="post" target="_blank">
<input type="hidden" name="verify" value="$verifyhash" />
<input type="hidden" name="actuid" value="$actuid" />
<input type="hidden" name="fromuid" value="$fromuid" />
<input type="hidden" name="actmid" value="$actmid" />
<input type="hidden" name="tid" value="$tid" />
<table width="100%" cellspacing="0" cellpadding="5">
<tbody>
	<tr>
		<th onmousedown="read.move(event);" style="cursor: move; font-weight:bold;" colspan="2" class="h"><span class="adel" onclick="closep();">close</span>支付費用</th>
	</tr>
	<tr>
		<td style="padding:0; width:330px;">
		<div class="aa_alert410" style="padding:0; width:100%">
			<table class="reg_infos" cellpadding="0" cellspacing="0">
<!--
EOT;
if($signupdetail){print <<<EOT
-->
				<tr>
					<td width="95" class="tar">需付費用︰</td>
					<td>$fees</td>
				</tr>
				<tr>
<!--
EOT;
if($fromuid=='-1'){print <<<EOT
-->
					<td width="95" class="tar">您的報名人數︰</td>
<!--
EOT;
}else{print <<<EOT
-->
					<td width="95" class="tar">TA的報名人數︰</td>
<!--
EOT;
}print <<<EOT
-->
					<td>$signupdetail</td>
				</tr>
				<tr>
					<td width="95" class="tar">共計費用︰</td>
					<td>{$totalcash}元</td>
				</tr>
<!--
EOT;
}else{print <<<EOT
-->
				<tr>
<!--
EOT;
if($fromuid=='-1'){print <<<EOT
-->
					<td width="95" class="tar">追加費用︰</td>
<!--
EOT;
}else{print <<<EOT
-->
					<td width="95" class="tar">TA的追加費用︰</td>
<!--
EOT;
}print <<<EOT
-->
					<td>{$totalcash}元</td>
				</tr>
				<tr>
					<td width="95" class="tar">追加理由︰</td>
					<td>$additionalreason</td>
				</tr>
<!--
EOT;
}print <<<EOT
-->
				<tr class="s3 last-tr">
					<td class="tar" colspan="2">費用將直接轉到發起人賬戶，請確認活動的真實性!</td>
				</tr>
			</table>
			<div class="tac">
<!--
EOT;
if($fromuid=='-1'){print <<<EOT
-->
				<input type="submit" class="btn" value="去支付寶付款" onclick="closep();"/>
<!--
EOT;
}else{print <<<EOT
-->
				<input type="submit" class="btn" value="去支付寶幫TA付款" onclick="closep();"/>
<!--
EOT;
}print <<<EOT
-->
			</div>
		</div>
		</td>
	</tr>
</tbody>
</table>
</form>
<!--
EOT;
}} elseif ($action == 'download') {print <<<EOT
-->
<div style="width:300px;">
	<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><a class="adel" onclick="closep();" href="javascript:;">關閉</a>提示
    </div>
	<div class="p10">
<!--
EOT;
	if ($msg !== true) {
		$msg_info = getLangInfo('msg', $msg);print <<<EOT
 -->
		$msg_info
<!--
EOT;
	} else {
		if ($downloadServer->ifdown == 1) {print <<<EOT
-->
		版塊下載附件需花費︰{$downloadServer->downloadmoney} {$credit->cType[$downloadServer->uploadcredit]}<br />
<!--
EOT;
		}
		if ($downloadServer->attach['needrvrc'] && $downloadServer->attach['special'] == '2') {print <<<EOT
-->	
		該附件售價︰{$downloadServer->attach[needrvrc]}{$credit->cType[$downloadServer->attach[ctype]]}，
<!--
EOT;
			if ($downloadServer->ifsale == 1) {print <<<EOT
-->
			您目前的{$credit->cType[$downloadServer->attach[ctype]]}︰{$GLOBALS[usercredit]}<br />
<!--
EOT;
			} elseif ($downloadServer->ifsale == 2) {print <<<EOT
-->
			您已經支付過<br />
<!--
EOT;
			} else {print <<<EOT
-->
			管理員和作者，無需扣除積分<br />
<!--
EOT;
			}
		}print <<<EOT
-->
		您確定要下載嗎？
<!--
EOT;
	}print <<<EOT
-->
	</div>
	<div class="popBottom">
<!--
EOT;
	if ($msg === true) { print <<<EOT
-->
    	<span class="btn2"><span><button type="button" onclick="javascript: location.href='job.php?action=download&aid=$aid&mt=$mt';closep();">確定</button></span></span>
<!--
EOT;
	}print <<<EOT
-->
    	<span class="bt2"><span><button type="button" onclick="closep();">取消</button></span></span>
    </div>
</div>
<!--
EOT;
} elseif ($action == 'attachbuy') {print <<<EOT
-->
<!--
EOT;
	if ($type == 'record') { print <<<EOT
-->
<div style="width:420px;">
	<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><a class="adel" onclick="closep();" href="javascript:;">關閉</a>附件購買記錄
    </div>
    <div class="p10">
		<table width="100%">
<!--
EOT;
if (!$buy) {print <<<EOT
-->
			<tr class="tr3 vt">
				<td class="td2">還沒有人買過此附件</td>
			</tr>
<!--
EOT;
} else {print <<<EOT
-->
			<tr class="tr2">
				<td width="120">用戶名</td>
				<td width="90">金額</td>
				<td>時間</td>
			</tr>
<!--
EOT;
foreach ($buy as $value) {print <<<EOT
-->
			<tr class="tr3 vt">
				<td class="td2"><a href="{$db_userurl}{$value[uid]}" target="_blank">{$value[username]}</a></td>
				<td class="td2">{$value[cost]}{$value[ctype]}</td>
				<td class="td2 f10">{$value[createdtime]}</td>
			</tr>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
}print <<<EOT
-->
		</table>
		<div class="cc">$pages</div>
	</div>
	<div class="popBottom">
		<span class="bt2"><span><button type="button" name="ajaxsubmit" onclick="closep();">關閉</button></span></span>
	</div>
</div>
<!--
EOT;
	} elseif ($type == 'download') {print <<<EOT
-->
	<div style="width:300px;">
	<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><a class="adel" onclick="closep();" href="javascript:;">關閉</a>提示
    </div>
    <form action="job.php?action=attachbuy&type=download&aid=$aid" method="post">
    <input type="hidden" name="verify" value="$verifyhash" />
	<input type="hidden" name="step" value="2" />
    <div class="p10">
<!--
EOT;
    if ($msg == 'job_attach_error') {print <<<EOT
 -->
		附件不存在
<!--
EOT;
	} elseif ($msg == 'forum_purview_erro') {print <<<EOT
-->
		版塊權限限制，無權限下載附件
<!--
EOT;
	} elseif ($msg == 'notenough') {print <<<EOT
-->
        您的積分不足，需要充值。
        <div class='cc'></div>
        下載附件需扣除︰{$creditdata['needrvrc']}<br />您的當前積分︰{$creditdata['usercredit']}
<!--
EOT;
	} elseif ($msg == 'specialAttach') {print <<<EOT
-->
		本附件為特殊附件，游客不能下載！

<!--
EOT;
	} elseif ($msg == 'pass') {print <<<EOT
-->
        下載附件需扣除︰{$creditdata['needrvrc']}，您確定要下載嗎？
        <div class='cc'></div>
        您的當前積分︰{$creditdata['usercredit']}
<!--
EOT;
	} elseif ($msg =='forumpass') {print <<<EOT
-->
		 下載附件需扣除︰{$creditdata['needrvrc']}<br />
         版塊下載附件需扣除︰{$creditdata['downloadmoney']}<br />
<!--
EOT;
	if($creditdata['totalMoney']) {print <<<EOT
-->
		共需要<b style="color:#F00">{$creditdata['totalMoney']}</b><br />
<!--
EOT;
	}print <<<EOT
-->
        <div class='cc'></div>
        您的當前積分︰{$creditdata['usercredit']}
<!--
EOT;
    } elseif($msg == 'forumnotenough') {print <<<EOT
-->
		 您的積分不足，需要充值。<br />
         
		 下載附件需扣除︰{$creditdata['needrvrc']}<br />
         版塊下載附件需扣除︰{$creditdata['downloadmoney']}<br />
<!--
EOT;
	if($creditdata['totalMoney']) {print <<<EOT
-->
		共需要<b style="color:#F00">{$creditdata['totalMoney']}</b><br />
<!--
EOT;
	}print <<<EOT
-->
        <div class='cc'></div>
        您的當前積分︰{$creditdata['usercredit']}
<!--
EOT;
	} elseif ($msg == 'payment') {print <<<EOT
-->
		 已經支付過，你要繼續下載嗎？
<!--
EOT;
	} elseif ($msg == 'undefined_action') {print <<<EOT
-->
		非法操作,請返回
<!--
EOT;
	} elseif ($msg == 'ifadmin') {print <<<EOT
-->
		管理員和作者，無需扣除積分，請下載
<!--
EOT;
}print <<<EOT
-->
    </div>
    <div class="popBottom">

<!--
EOT;
if ($msg == 'notenough' || $msg == 'forumnotenough') {print <<<EOT
-->
	<span class="btn2"><span><button type="button" onclick="window.open ('userpay.php?action=buy')";>充值</button></span></span>
<!--
EOT;
} elseif ($msg == 'pass' || $msg == 'payment' || $msg == 'ifadmin' || $msg == 'forumpass') { print <<<EOT
-->

    	<span class="btn2"><span><button type="button" onclick="javascript: location.href = 'job.php?action=attachbuy&type=download&aid=$aid&step=2';closep();">確定</button></span></span>
<!--
EOT;
}print <<<EOT
-->
    	<span class="bt2"><span><button type="button" onclick="closep();">取消</button></span></span>
    </div>
	</form>


</div>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
} elseif ($action == 'pwschools'){print <<<EOT
-->
<!--
EOT;
$xuexiaokudaxiao = $type > 2 ? 'position:relative;width:355px;_height:313px;' : 'position:relative;width:585px;_height:313px;';
print <<<EOT
-->
<div class="pr" style="$xuexiaokudaxiao">
<!--[if IE 6]>
<iframe frameborder='0' style='position:absolute;top:0;width:100%;height:340px;filter:Alpha(opacity=0);_filter:Alpha(opacity=0);opacity:.0;'></iframe>
<![endif]-->
<div style="_position:absolute;_width:100%;">
	<div class="popTop" style="cursor:move" onmousedown="read.move(event);"><a href="javascript://" class="adel" onclick="closep();">關閉</a>學校資料庫</div>
	<div class="p10 cc" style="*height:230px;*overflow:hidden;">
	<script type="text/javascript">
		function getSchools(areaid,type){
			obj = getObj('schools');
			ajax.send("pw_ajax.php?action=pwschools&job=getschools&areaid="+areaid+"&type="+type,"",function(){
				var rText = ajax.request.responseText,s = 0;
				if (rText == '[]') {
					for (var z = obj.length -1; z >= 0; --z) {
						obj.remove(z);
					}
				} else {
					schoolData = JSONParse(rText);
					for (i in schoolData) {
						obj.options[s] = new Option(schoolData[i].schoolname, schoolData[i].schoolid);s++;
					}
				}
			});
		}
		function selectSchool(){
			var obj = getObj('schools');
			var sid = "{$sid}";
			try{
				var schoolNameObj = getObj('schoolname_' + sid);
				var schoolIdObj = getObj('schoolid_' + sid);
				schoolIdObj.value = obj.options[obj.selectedIndex].value;
				schoolNameObj.value = obj.options[obj.selectedIndex].text;
				closep();
				if (typeof(checkField) == 'function') checkField(schoolNameObj);
			} catch(e){
			}
		}
	</script>
		
		<span>
<!--
EOT;
if($type > 2){print <<<EOT
-->
		<select size="15" style="width:100px;margin:0 10px 0 0;padding:0;;" id="province" onchange="getSchools(this.value, '$type');"></select>
<!-- 
EOT;
}else{print <<<EOT
-->
		<select size="15" style="width:100px;margin:0 10px 0 0;padding:0;" id="province" onchange="changeSubArea(this.value, 'city');"></select>
		<select id="city" size="15" style="width:100px;margin:0 10px 0 0;padding:0;" onchange="changeSubArea(this.value, 'area');"></select>
		<select id="area" size="15" style="width:100px;margin:0 10px 0 0;padding:0;" onchange="getSchools(this.value,'$type');"></select>
<!--
EOT;
}print <<<EOT
-->
		</span>
		<select size="15" style="width:140px;margin:0;" id="schools" onchange="selectSchool()"></select>
	</div>
	<div class="popBottom"><span class="bt2"><span><button type="button" onclick="closep();">關閉</button></span></span></div>
</div>
</div>
<script>
addAreas(0, 'province', '-1', 0);
</script>
<!--
EOT;
}
?>-->