<!--<?php
include_once PrintEot('profile_header');
print <<<EOT
-->
<div id="user-main">
	<div class="u-m-bg"></div>
	<div class="u-m-bg-c cc">
		<div class="p10">
			<div class="u-nav-2 cc">
				<ul>
					<li><a style="cursor:pointer" href="profile.php?action=permission" hidefocus="true">權限查看</a></li>
					<li class="current"><a style="cursor:pointer" hidefocus="true">特殊組購買</a></li>
				</ul>
			</div>
			<div class="u-cont-bg-c">
			<table width="100%" height="450">
				<tr><td class="vt">
					<div class="p15">
<!--
EOT;
if (!$job) {print<<<EOT
-->
						<table width="100%" class="mt10 bor-t-c">
							<tr class="user-tr">
								<td>用戶組頭餃</td>
								<td>日價格(積分)</td>
								<td>日價格(RMB)</td>
								<td>最短購買天數</td>
								<td>到期時間</td>
								<td>購買</td>
							</tr>
<!--
EOT;
foreach ($specialdb as $key => $val) {print <<<EOT
-->
							<tr class="user-tr">
								<td>$val[grouptitle]</td>
								<td>{$val[sellprice]} {$val[selltype]}/天</td>
								<td>{$val[rmbprice]} /天</td>
								<td>{$val[selllimit]}</td>
								<td>$val[enddate]</td>
								<td>
<!--
EOT;
if(!$val['startdate'] || $timestamp > $val['startdate'] + $val['days']*86400){print <<<EOT
-->
									<a href="profile.php?action=buy&job=buy&gid=$val[gid]">購買</a>
<!--
EOT;
}else{print <<<EOT
-->
									-
<!--
EOT;
}print <<<EOT
-->
								</td>
							</tr>
<!--
EOT;
}print <<<EOT
-->
						</table>
<!--
EOT;
} elseif ($job == 'buy') {print <<<EOT
-->
						<form method="post" action="profile.php?action=buy&">
						<input type="hidden" name="verify" value="$verifyhash" />
						<input type="hidden" name="job" value="buy" />
						<input type="hidden" name="step" value="2" />
						<input type="hidden" name="gid" value="$gid" />
						<table width="100%" class="mt10 bor-t-c">
							<tr class="user-tr">
								<td>用戶組頭餃</td>
								<td><b>{$rt[grouptitle]}</b><br /><span class="gray">{$rt[sright][sellinfo]}</span></td>
							</tr>
							<tr class="user-tr">
								<td>購買方式</td>
								<td id="checkradio">
<!--
EOT;
if ($rt['sright']['sellprice'] > 0) {print <<<EOT
-->
									<div><input type="radio" name="buymethod" value="0" onclick="showpwd(this.value)" />積分購買 ({$rt[sright][sellprice]} {$rt[sright][selltype]}/天)</div>
<!--
EOT;
}if ($rt['sright']['rmbprice'] > 0) {print <<<EOT
-->
									<div><input type="radio" name="buymethod" value="1" onclick="showpwd(this.value)" />現金購買 ({$rt[sright][rmbprice]} RMB/天)</div>
<!--
EOT;
}print <<<EOT
-->
								</td>
							</tr>
							<tr class="user-tr">
								<td>購買天數</td>
								<td>
									<input class="input" type="text" name="days" size="20" />
									<span class="gray"> {$rt[sright][selllimit]} 天</span>
								</td>
							</tr>
							<tr class="user-tr" id="showpwd" style="display:none">
								<td>請輸入密碼</td>
								<td><input class="input" type="password" name="pwpwd" size="20" /></td>
							</tr>
							<tr class="user-tr">
								<td>將該用戶組頭餃作為</td>
								<td>
									<input type="radio" name="options" value="1" checked />站點顯示頭餃
									<input type="radio" name="options" value="2" />附加頭餃
								</td>
							</tr>
						</table>
						<div class="tac" style=" padding:1em">
							<span class="button"><span><button type="submit">提 交</button></span></span>
						</div>
						</form>
<script>
function checkradio() {
	var radio = getObj('checkradio').getElementsByTagName('input');
	if (radio.length > 0) {
		radio[0].checked = true;
		showpwd(radio[0].value);
	}
}
function showpwd(v) {
	getObj('showpwd').style.display = v == 1 ? 'none' : '';
}
checkradio();
</script>
<!--
EOT;
}print<<<EOT
-->
					</div>
				</td></tr>
			</table>
			</div>
			</form>
		</div>
	</div>
	<div class="u-m-bg"></div>
</div>
<!--
EOT;
?>-->