<!--<?php
include_once PrintEot('m_header');
print <<<EOT
-->
<div class="infobox pr cc">
	<div class="p10">
		<table border="0" class="vt" style="table-layout:fixed; width:100%;">
			<tr>
				<td width="60"><a href="{$basename}q=user&u=$uid"><img src="$faceurl" class="portrait-m"/></a></td>
				<td><p class="pdtb3">
					<span class="b f14 pdr">{$windid}</span> 
					<a href="{$basename}q=user">返回首頁</a></p>
					<div class="tabA" style="position:absolute;bottom:-1px;_bottom:-2px;padding-left:0;width:600px;">
						<ul>
							<li id="type_index"><a href="{$basename}q=groups">我的群組</a></li>
							<li id="type_all"><a href="{$basename}q=groups&a=all">所有群組</a></li>
							<li id="type_create"><a href="{$basename}q=groups&a=create">創建新群組</a></li>
						</ul>
					</div>
				</td>
            </tr>
        </table>
    </div>
</div>
<script language="JavaScript">
function ajaxurl(o) {
	read.obj = o;
	ajax.send(o.href,'',ajax.get);
	return false;
}
setCurrent('type_$a','type_index','current');
</script>
<div class="wrapB cc mt8">
<!--
EOT;
if (empty($a)) {print <<<EOT
-->
	<div class="contentC-main cc">
		<div class="boxB bgB pdD">
			<div class="table-list table-list-B">
<!--
EOT;
if($threaddb){print <<<EOT
-->
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td>標題</td>
					<td>群組</td>
					<td>作者</td>
					<td>最後發言</td>
				</tr>
<!--
EOT;
foreach ($threaddb as $key => $value) {print <<<EOT
-->
				<tr>
					<td><a href="{$basename}q=group&a=read&cyid=$value[colonyid]&tid=$value[tid]" class="blue">$value[subject]</a></td>
					<td><a href="{$basename}q=group&cyid=$value[colonyid]">$value[cname]</a></td>
					<td><a href="{$basename}q=user&uid=$value[authorid]">$value[author]</a></td>
					<td>$value[lastpost]</td>
				</tr>
<!--
EOT;
}print <<<EOT
-->
			</table>$pages
<!--
EOT;
} else {print <<<EOT
-->
			<p>暫無群組最新動態</p>
<!--
EOT;
}print <<<EOT
-->
			</div>
		</div>
	</div>
	<div class="sidebarC cc" style="margin-left:20px;">
<!--
EOT;
if (!empty($apply)) {print <<<EOT
-->
		<h4 class="h5A">
			<span class="b">我申請加入的群組</span>
		</h4>
		<div class="list-dlA list-dlA-C">
			<dl>
<!--
EOT;
foreach ($apply as $key => $value) {print <<<EOT
-->
				<dd class="cc">
					<a href="{$basename}q=group&cyid=$value[id]"><img src="$value[cnimg]" class="fl pdr" width="40" /></a>
					<span class="b blue f14"><a href="{$basename}q=group&cyid=$value[id]">$value[cname]</a></span><br />
					申請時間︰<span class="f10">$value[addtime]</span>
				</dd>
<!--
EOT;
}print <<<EOT
-->
			</dl>
		</div>
<!--
EOT;
}print <<<EOT
-->
		<h4 class="h5A">
			<span class="b">我加入的群組</span>
		</h4>
		<div class="list-dlA list-dlA-C">
			<dl>
<!--
EOT;
if (!empty($group)) {
foreach ($group as $key => $value) {print <<<EOT
-->
				<dd class="cc">
					<a href="{$basename}q=group&cyid=$value[id]"><img src="$value[cnimg]" class="fl pdr" width="40" /></a>
					<span class="b blue f14"><a href="{$basename}q=group&cyid=$value[id]">$value[cname]</a></span><br />
					群主︰$value[admin]
				</dd>
<!--
EOT;
}} else {print <<<EOT
-->
				<dd>您還沒有加入任何群組</dd>
<!--
EOT;
}print <<<EOT
-->
			</dl>
		</div>
	</div>
<!--
EOT;
} elseif ($a == 'all') {print <<<EOT
-->
	<div class="contentC-main cc">
		<div class="boxB bgB pdD">
			<div class="table-list table-list-B">
<!--
EOT;
if (!empty($group)) {
foreach ($group as $key => $value) {print <<<EOT
-->
			<table cellpadding="0" cellspacing="0" width="100%">
				<tr>
					<td class="tac"><a href="{$basename}q=group&cyid=$value[id]"><img src="$value[cnimg]" width="100" /></a></td>
					<td width="70%" valign="top"><a href="{$basename}q=group&cyid=$value[id]" class="f14 b s1 pdr">{$value[cname]}</a><p class="text">分類︰{$o_classdb[$value[classid]]}<br />人數︰<span class="s2">$value[members]</span><br />簡介︰$value[descrip]</p></td>
					<td width="20%" class="tar" style="vertical-align:middle;">
						<a href="{$basename}q=group&cyid=$value[id]">瀏覽此群組</a><br />
					</td>
				</tr>
			</table>
<!--
EOT;
}}print <<<EOT
-->
			</div>
			$pages
		</div>
	</div>
	<div class="sidebarC cc" style="margin-left:20px;">
		<h4 class="h5A">
			<span class="b">群組分類</span>
		</h4>
		<div class="list-F list-fen">
			<ul>
<!--
EOT;
foreach ($o_classdb as $key => $value) {print <<<EOT
-->
				<li><a href="{$basename}q=$q&a=all&cid=$key"><span class="pdr">$value</span><span class="gray1 pdr"></span></a></li>
<!--
EOT;
}print <<<EOT
-->
			</ul>
		</div>
	</div>
<!--
EOT;
} elseif ($a == 'create') {print <<<EOT
-->
	<div class="contentC-main cc">
		<div class="boxB bgB pdD">
			<div class="table-list table-list-B">
				<form action="{$basename}q=$q&a=$a" method="post">
				<input type="hidden" name="step" value="3" />
				<table cellpadding="0" cellspacing="0" width="100%">
					<tr class="h6A"><td colspan="2">創建新群組</td></tr>
					<tr>
						<td width="30%" align="right" class="gray1">名稱</td>
						<td><input type="text" name="cname" /></td>
					</tr>
					<tr>
						<td align="right" class="gray1">描述</td>
						<td><textarea class="txa" name="descrip" style="width:350px;height:70px"></textarea></td>
					</tr>
					<tr>
						<td align="right" class="gray1">分類</td>
						<td>
							<select name="cid">
<!--
EOT;
foreach ($o_classdb as $key => $value) {print <<<EOT
-->
								<option value="$key">$value</option>
<!--
EOT;
}print <<<EOT
-->
							</select>
						</td>
					</tr>
					<tr>
						<td></td>
						<td><input class="bt3" type="submit" value="注冊新群組" /></td>
					</tr>
				</table>
				</form>
			</div>
		</div>
	</div>
	<div class="sidebarC cc" style="margin-left:20px;">
		<h4 class="h5A">
			<span class="b">群組分類</span>
		</h4>
		<div class="list-F list-fen">
			<ul>
<!--
EOT;
foreach ($o_classdb as $key => $value) {print <<<EOT
-->
				<li><a href="{$basename}q=$q&a=all&cid=$key"><span class="pdr">$value</span><span class="gray1 pdr"></span></a></li>
<!--
EOT;
}print <<<EOT
-->
			</ul>
		</div>
	</div>
<!--
EOT;
}print <<<EOT
-->
   <!--  <div class="contentC-side">
    廣告位置
    </div> -->
</div></div>
<!--
EOT;
?>-->