<!-- <?php
print <<<EOT
-->
<table width='$tablewidth' cellspacing=0 cellpadding=0 align=center>
<tr><td align=left><img src='$imgpath/$stylepath/index/home.gif' align=absbottom> 
<b><a href='$db_bfn'>$db_bbsname </a> -> <a href="$basename"><font color=black><b>{$cy_name}</b>
<!--
EOT;
if($job=='read'){print <<<EOT
-->
-> <a href="$basename&cyid=$cyid&job=board">{#colony_board}</a>
<!--
EOT;
}print <<<EOT
-->
</td></tr></table><br>

<table cellspacing=1 cellpadding=0 width="$tablewidth" align=center border=0>
<tr>
<td valign="top" width="22%">
<table cellspacing=1 cellpadding=5 width="100%" align=center border=0 $i_table>
<tr class=head><td>{#colony_mycy}</td></tr>
<!--
EOT;
if($mycydb){print <<<EOT
-->
<tr class=f_one><td>
<select name="cyid" onchange="redirect('$basename&cyid='+this.options[this.selectedIndex].value+'&job=view&id='+this.options[this.selectedIndex].value)">
<option></option>
<!--
EOT;
foreach($mycydb as $key => $value){
$selected = $value[id] == $cyid ? 'selected' : '';
print <<<EOT
-->
<option value="$value[id]" $selected>$value[cname]</option>
<!--
EOT;
}print <<<EOT
-->
</select></td></tr>
<!--
EOT;
}if($cn_newcolony){print <<<EOT
-->
<tr><td class=f_one><a href="$basename&job=creat">{#colony_newcy}</a></td></tr>
<!--
EOT;
}print <<<EOT
-->
</table><br>
<!--
EOT;
if($cydb){print <<<EOT
-->
<table cellspacing=1 cellpadding=5 width="100%" align=center border=0 $i_table>
<tr class=head><td>{#colony_info}</td></tr>
<tr class=f_one><td><a href="$basename&cyid=$cyid&job=view&id=$cyid">{#colony_index}</a></td></tr>
<tr class=f_one><td><a href="$basename&cyid=$cyid&job=card">{#colony_card}</a></td></tr>
<tr class=f_one><td><a href="$basename&cyid=$cyid&job=editcard">{#colony_mycard}</a></td></tr>
<tr class=f_one><td><a href="$basename&cyid=$cyid&job=board">{#colony_board}</a></td></tr>
<tr class=f_one><td><a href="$basename&cyid=$cyid&job=donate">{#colony_donate}</a></td></tr>
<tr class=f_one><td><a href="$basename&cyid=$cyid&job=donatelog">{#colony_donatelog}</a></td></tr>
<tr class=f_one><td><a href="$basename&cyid=$cyid&job=quit" onclick="return checkset('{#colony_quitconfirm}')">{#colony_quit}</a></td></tr>
</table>
<br>
<table cellspacing=1 cellpadding=5 width="100%" align=center border=0 $i_table>
<!--
EOT;
if($cydb[ifadmin]=='1'){print <<<EOT
-->
<tr class=head><td>{#colony_admincp}</td></tr>
<tr><td class=f_one><a href="$basename&cyid=$cyid&job=set">{#colony_set}</a></td></tr>
<tr><td class=f_one><a href="$basename&cyid=$cyid&job=member">{#colony_member}</a></td></tr>
<tr class=f_one><td><a href="$basename&cyid=$cyid&job=joinlog">{#colony_joinlog}</a></td></tr>
<!--
EOT;
if($windid==$cydb[admin]){print <<<EOT
-->
<tr><td class=f_one><a href="$basename&cyid=$cyid&job=currency">{#colony_currency}</a></td></tr>
<tr><td class=f_one><a href="$basename&cyid=$cyid&job=currencylog">{#colony_currencylog}</a></td></tr>
<tr><td class=f_one><a href="$basename&cyid=$cyid&job=cancel" onclick="return checkset('{#colony_confirm}')">{#colony_cancel}</a></td></tr>
<!--
EOT;
}}print <<<EOT
-->
</table><br>
<!--
EOT;
}print <<<EOT
-->
</td>

<td valign=top>
<!-- 
EOT;
if (!$job){
print <<<EOT
-->
<table cellspacing=1 cellpadding=4 width="$tablewidth" align=center border=0 $i_table>
<tr class=head><td colspan="8">{#colony_index}</td></tr>
<tr class="cbg" align="center">
<td width="10%">{#colony_logo}</td>
<td>{#colony_name}</td>
<td>{#colony_class}</td>
<td>{#colony_manager}</td>
<td width="10%">{#colony_nums}</td>
<td width="10%">{#currency}</td>
<td width="20%">{#colony_creattime}</td>
<td width="10%">{#colony_join}</td>
</tr>
<!--
EOT;
foreach ($colonydb as $value){print <<<EOT
-->
<tr class=f_one align=center>
<td>
<!--
EOT;
if($value[cnimg]){print <<<EOT
-->
<a href="$basename&cyid=$value[id]&job=view&id=$value[id]"><img src="$imgpath/cn_img/$value[cnimg]" width=50 height=30></a>
<!--
EOT;
}print <<<EOT
-->
</td>
<td><a href="$basename&cyid=$value[id]&job=view&id=$value[id]">$value[cname]</a></td>
<td>$value[classname]</td>
<td>$value[admin]</td>
<td>$value[members]</td>
<td>$value[cmoney]</td>
<td>$value[createtime]</td>
<td><a href="$basename&job=join&id=$value[id]">{#colony_join}</a></td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
&nbsp; $pages
<!-- 
EOT;
}elseif($job=='creat'){print <<<EOT
-->
<form method=post action="$basename&job=creat&step=2&" enctype='multipart/form-data'>
<table cellspacing=1 cellpadding=4 width="$tablewidth" align=center border=0 $i_table>
<tr><td class=head colspan=2>{#colony_newcy}</td></tr>
<tr><td class=f_one colspan=2>{#colony_intro}</td></tr>
<tr><td class=f_one width=50%>{#colony_name}</td>
<td class=f_one width=50%><input type="text" name="cnname" size=50></td></tr>		
<tr><td class=f_one width=50%>{#colony_class}</td>
<td class=f_one width=50%>
<select name="cn_class">
<!--
EOT;
foreach ($classdb as $class){print <<<EOT
-->	
<option value="$class[cid]">$class[cname]
<!--
EOT;
}print <<<EOT
-->
</select></td></tr></table>
<br><center><input type="submit" value="{#submit}"></center></form>
<!-- 
EOT;
}elseif ($job=='view'){
print <<<EOT
-->
<table cellspacing=1 cellpadding=4 width="$tablewidth" align=center border=0 $i_table style='TABLE-LAYOUT: fixed;WORD-WRAP: break-word'>
<tr class=head><td colspan="2">{#colony_index}</td></tr>
<tr class=f_one align=center><td colspan="2">
<!--
EOT;
if($cndb[cnimg]){print <<<EOT
-->
<IMG src="$imgpath/cn_img/$cndb[cnimg]">
<!--
EOT;
}print <<<EOT
-->
<br><br>
[<a href="$basename&job=join&id=$id">{#colony_joincy}</a>]
[<a href="$basename&job=board&cyid=$id">{#colony_enterboard}</a>]
[<a href="$basename&cyid=$id&job=card">{#colony_card}</a>]
</td></tr>
<tr class=f_one><td >{#colony_name}</td><td>$cndb[cname]</td></tr>
<tr class=f_one><td>{#colony_manager}</td>
<td><a href="profile.php?action=show&username=$cndb[admin]">$cndb[admin]</a></td></tr>
<tr class=f_one><td>{#colony_nums}</td><td>$cndb[members]</td></tr>
<tr class=f_one><td>{#currency}</td><td>$cndb[cmoney]</td></tr>
<!-- <tr class=f_one><td>{#colony_level}</td><td>$cndb[levels]</td></tr> -->
<tr class=f_one><td>{#colony_joinmoney}</td><td>$cndb[intomoney] ({#currency})</td></tr>
<tr class=f_one><td>{#colony_creattime}</td><td>$cndb[createtime]</td></tr>
<tr class=f_one><td>{#colony_introduce}</td><td>$cndb[descrip]</td></tr>
<!--
EOT;
if ($cydb[ifadmin]!='-1' || $cndb[annoucesee]){
print <<<EOT
-->
<tr class=f_one><td>{#colony_notice}</td><td>$cndb[annouce]</td></tr>
<!--
EOT;
}print <<<EOT
-->
</table><br>
<!-- 
EOT;
}elseif ($job=='join'){
print <<<EOT
-->
<form method=post action="$basename&job=join&id=$id&">
<input type="hidden" name="step" value="2">
<table cellspacing=1 cellpadding=4 width="$tablewidth" align=center border=0 $i_table>
<tr><td class=head colspan=2>{#colony_setcard}</td></tr>
<tr><td class=f_one colspan=2>{#colony_joinintro}</td></tr>
<tr><td class=f_one width=50%>{#colony_realname}</td>
<td class=f_one width=50%><input type="text" name="realname"></td></tr>
<tr><td class=f_one width=50%>{#gender}</td>
<td class=f_one width=50%>
<select name="gender">
<option value="0">{#unknown}</option>
<option value="1">{#male}</option>
<option value="2">{#female}</option>
</select></td></tr>
<tr><td class=f_one width=50%>{#phone}</td>
<td class=f_one width=50%><input type="text" name="tel" size=50></td></tr>
<tr><td class=f_one width=50%>{#colony_email}</td>
<td class=f_one width=50%><input type="text" name="email" size=50></td></tr>
<tr><td class=f_one width=50%>{#colony_memberintro}</td>
<td class=f_one width=50%><textarea name="introduce" rows="5" cols="50"></textarea></td></tr>
</table>
<br><center><input type="reset" value="{#reset}"><input type="submit" value="{#submit}"></center></form>
<!--
EOT;
}elseif($job=='card'){
print <<<EOT
-->
<table cellspacing=1 cellpadding=4 width="$tablewidth" align=center border=0 $i_table>
<tr class=head><td colspan=4><b>{#colony_card}</b></td></tr>
<tr class=cbg align=center>
<td>{#colony_realname}</td>
<td>{#colony_username}</td>
<td>{#colony_ifadmin}</td>
<td>{#gender}</td>
</tr>
<!--
EOT;
foreach($memberdb as $key => $value){
$ifadmin = $value[ifadmin]==1 ? '{#_yes}' : '{#_no}';
$gender  = $value[gender]==1  ? '{#male}' : ($value[gender]==2 ? '{#female}' : '{#unknown}');
print <<<EOT
-->
<tr class=f_one align=center>
<td><a href="$basename&job=seecard&cyid=$cyid&uid=$value[uid]" title="{#colony_seecard}">$value[realname]</a></td>
<td><a href="profile.php?action=show&uid=$value[uid]">$value[username]</a></td>
<td>$ifadmin</td>
<td>$gender</td>
</tr>
<!-- 
EOT;
}print <<<EOT
-->
</table>
 &nbsp; $pages
<!--
EOT;
}elseif ($job=='editcard'){print <<<EOT
-->
<form method=post action="$basename&job=editcard&cyid=$cyid">
<input type="hidden" name="step" value="2">
<table cellspacing=1 cellpadding=4 width="$tablewidth" align=center border=0 $i_table>
<tr><td class=head colspan=2>{#colony_editcard}</td></tr>
<tr><td class=f_one width=50%>{#colony_realname}</td>
<td class=f_one width=50%><input type="text" name="realname" value="$rt[realname]"></td></tr>
<tr><td class=f_one width=50%>{#gender}</td>
<td class=f_one width=50%>
<select name="gender">
<option value="0" $gender_0>{#unknown}</option>
<option value="1" $gender_1>{#male}</option>
<option value="2" $gender_2>{#female}</option>
</select></td></tr>
<tr><td class=f_one width=50%>{#phone}</td>
<td class=f_one width=50%><input type="text" name="tel" value="$rt[tel]" size=50></td></tr>
<tr><td class=f_one width=50%>{#colony_email}</td>
<td class=f_one width=50%><input type="text" name="email" value="$rt[email]" size=50></td></tr>
<tr><td class=f_one width=50%>{#colony_memberintro}</td>
<td class=f_one width=50%><textarea name="introduce" rows="5" cols="50">$rt[introduce]</textarea></td></tr>
</table>
<br><center><input type="reset" value="{#reset}"><input type="submit" value="{#submit}"></center></form>
<!-- 
EOT;
}elseif ($job=='seecard'){
$gender  = $rt[gender]==1  ? '{#male}' : ($value[gender]==2 ? '{#female}' : '{#unknown}');
print <<<EOT
-->
<table cellspacing=1 cellpadding=4 width="$tablewidth" align=center border=0 $i_table>
<tr><td class=head colspan=2>{#colony_seecard}</td></tr>
<tr class=f_one><td width="20%">{#colony_realname}</td><td>$rt[realname]</td></tr>
<tr class=f_one><td>{#gender}</td><td>$gender</td></tr>
<tr class=f_one><td>{#phone}</td><td>$rt[tel]</td></tr>
<tr class=f_one><td>{#colony_email}</td><td>$rt[email]</td></tr>
<tr class=f_one><td>{#colony_memberintro}</td><td><pre>$rt[introduce]</pre></td></tr>
<!--
EOT;
}elseif($job=='board'){
print <<<EOT
-->	
<table cellspacing=1 cellpadding=4 width="$tablewidth" align=center border=0 $i_table>
	<tr><td class="head" colspan="4">{#colony_board}</td></tr>
	<tr align=center>
		<td class="cbg" width="40%">{#title}</td>
		<td class="cbg" width="20%">{#author}</td>
		<td class="cbg" width="20%">{#lastpost}</td>
		<td class="cbg" width="10%">{#operate}</td>
	</tr>
<!-- 
EOT;
foreach($argudb as $key=>$val){
if(!$val['author']){
$val['author'] = $val['realname'] ? $val['realname'] : $val['username'];
}print <<<EOT
-->
	<tr>
		<td class="f_one">
<!-- 
EOT;
if($rpdb[$val[tid]]){print <<<EOT
-->
			<img src="$imgpath/cn_img/open.gif" onclick="javascript:showrp(rp_$val[tid])">
<!-- 
EOT;
}else{print <<<EOT
-->
			<img src="$imgpath/cn_img/close.gif">
<!-- 
EOT;
}print <<<EOT
-->
			<a href="$basename&cyid=$cyid&job=read&tid=$val[tid]">$val[subject]</a>
		</td>
		<td class="f_one" align=center>$val[author]</td>
		<td class="f_one" align=center>$val[lastpost]</td>
		<td class="f_one" align=center>
<!-- 
EOT;
if ($cydb['uid']==$val['authorid'] || $cydb['ifadmin']=='1'){
print <<<EOT
-->	
			[<a href="$basename&cyid=$cyid&job=editpost&tid=$val[tid]">{#colony_edit}</a>]
			[<a href="$basename&cyid=$cyid&job=delpost&tid=$val[tid]">{#colony_del}</a>]
<!--
EOT;
}print <<<EOT
-->
		</td>
	</tr>
<!-- 
EOT;
if($rpdb[$val[tid]]){print <<<EOT
-->
	<tr id="rp_$val[tid]" name="rp_$val[tid]" style='DISPLAY: none'>
		<td colspan="4"  class="f_one">
			<table cellspacing=0 cellpadding=4 width="100%" align=center border=0 $i_table>
<!-- 
EOT;
foreach($rpdb[$val[tid]] as $key=>$val){print <<<EOT
-->
				<tr>
					<td class="f_one">&nbsp; &nbsp; - 
						<a href="$basename&cyid=$cyid&job=read&tid=$val[tpcid]">$val[subject]</a>
						&nbsp; $val[author] ($val[postdate])
<!-- 
EOT;
if ($cydb['uid']==$val['authorid'] || $cydb['ifadmin']=='1'){
print <<<EOT
-->	
						 &nbsp; &nbsp;
						[<a href="$basename&cyid=$cyid&job=editpost&tid=$val[tid]">{#colony_edit}</a>]
						[<a href="$basename&cyid=$cyid&job=delpost&tid=$val[tid]">{#colony_del}</a>]
<!--
EOT;
}print <<<EOT
-->
					</td>
				</tr>
<!--
EOT;
}print <<<EOT
-->			</table>
		</td>
	</tr>
<!-- 
EOT;
}}print <<<EOT
-->
</table>
 &nbsp; $pages
<br><br>
<form method=post action="$basename&job=post&cyid=$cyid&">
<table width="$tablewidth" cellspacing="1" cellpadding="5" align="center" $i_table>
<tr><td class=head colspan=2><b>{#colony_post}</b></td></tr>
<tr class=f_one><td width="15%">{#title}</td><td><input type="text" name="subject" size='90'></td></tr>
<tr class=f_one><td valign=top>{#content}</td><td><textarea name="content" rows="10" cols="100%"></textarea></td></tr>
</table>
<br><center><input type="submit" value="{#submit}"></center>
</form>
<script language="JavaScript">
function showrp(rp){
	if(rp.style.display != ''){
		rp.style.display = '';
	}else{
		rp.style.display = 'none';
	}
}
</script>
<!-- 
EOT;
}elseif ($job=='read'){print <<<EOT
-->
<table cellspacing=1 cellpadding=4 width="$tablewidth" align=center border=0 $i_table>
	<tr><td class="head">{#colony_board}</td></tr>
</table>
<!-- 
EOT;
$num=($page-1)*$db_perpage;
foreach($agdb as $key=>$val){
$num++;
if(!$val['author']){
$val['author'] = $val['realname'] ? $val['realname'] : $val['username'];
}print <<<EOT
-->

			<table cellspacing=1 cellpadding=3 width="$tablewidth" align=center border=0 $i_table>
				<tr>
					<td class="f_one">
						<div>
							<div style="float:left">$val[subject]</div>
							<div style="float:right"><i>$val[author] &nbsp;$val[postdate] #$num</i></div>
						</div>
						<br><br>
						$val[content]
<!-- 
EOT;
if ($cydb['uid']==$val['authorid'] || $cydb['ifadmin']=='1'){
print <<<EOT
-->	
						<br><br>
						[<a href="$basename&cyid=$cyid&job=editpost&tid=$val[tid]">{#colony_edit}</a>]
						[<a href="$basename&cyid=$cyid&job=delpost&tid=$val[tid]">{#colony_del}</a>]
<!--
EOT;
}print <<<EOT
-->
					</td>
				</tr>
			</table>
			<table><tr><td height=1></td></tr></table>
<!-- 
EOT;
}print <<<EOT
-->
 &nbsp; $pages
<br><br>
<form method=post action="$basename&job=post&cyid=$cyid&tid=$tid&">
<table width="$tablewidth" cellspacing="1" cellpadding="5" align="center" $i_table>
<tr><td class=head colspan=2><b>{#colony_post}</b></td></tr>
<tr class=f_one><td width="15%">{#title}</td><td><input type="text" name="subject" value="Re:$subject" size="90"></td></tr>
<tr class=f_one><td valign=top>{#content}</td><td><textarea name="content" rows="10" cols="100%"></textarea></td></tr>
</table>
<br><center><input type="submit" value="{#submit}"></center>
</form>
<!-- 
EOT;
}elseif ($job=='editpost'){print <<<EOT
-->	
<form method=post action="$basename&cyid=$cyid&job=editpost&tid=$tid&">
<input type="hidden" name="step" value="2">
<table width="$tablewidth" cellspacing="1" cellpadding="5" align="center" $i_table>
<tr><td class=head colspan=2><b>{#colony_post}</b></td></tr>
<tr class=f_one><td width="15%">{#title}</td><td><input type="text" size="90" name="subject" value="$argu[subject]"></td></tr>
<tr class=f_one><td valign=top>{#content}</td><td><textarea name="content" rows="10" cols="100%">$argu[content]</textarea></td></tr>
</table>
<br><center><input type="submit" value="{#submit}"></center>
</form>
<!-- 
EOT;
}elseif ($job=='donate'){print <<<EOT
-->
<form method=post action="$basename&cyid=$cyid&job=donate&">
<input type="hidden" name="step" value="2">
<table width="$tablewidth" cellspacing="1" cellpadding="5" align="center" $i_table>
<tr><td class=head colspan=2>{#colony_donate}</td></tr>
<tr><td class=f_one colspan=2>{#colony_mostdonate}</td></tr>
<tr><td class=f_one width="20%">{#colony_donatenum}</td>
<td class=f_one><input type="text" name="sendmoney" size=30></td></tr></table>
<br><center><input type="submit" value="{#submit}"></center></form>
<!-- 
EOT;
}elseif ($job=='donatelog'){print <<<EOT
-->
<table width="$tablewidth" cellspacing="1" cellpadding="5" align="center" $i_table>
<tr class=head><td colspan=5><b>{#colony_donatelog}</b></div></td></tr>
<tr class="cbg" align="center">
<td width="5%">ID</td>
<td width="15%">{#username}</td>
<td width="*">{#log_descrip}</td>
<td width="15%">{#date}</td>
</tr>
<!--
EOT;
$num=($page-1)*$db_perpage;
foreach($logdb as $key => $value){
$num++;
print <<<EOT
-->
<tr class="f_one" align="center">
<td>$num</td>
<td>$value[username1]</td>
<td><div style='TABLE-LAYOUT: fixed;WORD-WRAP: break-word' align="left">$value[descrip]</div></td>
<td>$value[date]</td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</td></tr></table>
 &nbsp; $pages
<!--
EOT;
}elseif ($job=='set'){
print <<<EOT
-->	
<form method=post action="$basename&job=set&" enctype='multipart/form-data'>
<input type="hidden" name="step" value="2">
<input type="hidden" name="cyid" value="$cyid">
<table cellspacing=1 cellpadding=5 width="$tablewidth" align=center border=0 $i_table>
<tr class=head><td colspan=2>{#colony_set}</td></tr>
<tr><td class=f_one width="40%">{#colony_changename}</td>
<td class=f_one><input type="text" name="cname" value="$cydb[cname]" size=30></td></tr>
<tr><td class=f_one>{#colony_sertclass}</td>
<td class=f_one><select name="classid" value="$cntype">
<option value=""></option>
<!-- 
EOT;
foreach ($classdb as $class){
$thisselect=$class[cid]==$cydb[classid] ? 'selected' : '';
print <<<EOT
-->
<option value="$class[cid]" $thisselect>$class[cname]</option>
<!-- 
EOT;
}print <<<EOT
-->		
</select></td></tr>
<tr><td class=f_one>{#colony_ifopen}</td>
<td class=f_one><input type="radio" name="ifcheck" value="1" $ifcheck_1>{#_yes}<input type="radio" name="ifcheck" value="0" $ifcheck_0>{#_no}</td>
</tr>
<tr><td class=f_one>{#colony_ifnotice}</td>
<td class=f_one><input type="radio" name="annoucesee" value="1" $annoucesee_1>{#_yes}<input type="radio" name="annoucesee" value="0" $annoucesee_0>{#_no}</td>
</tr>
<tr><td class=f_one>{#colony_joinmoney}</td>
<td class=f_one><input type="text" name="intomoney" value="$cydb[intomoney]"></td></tr>
<tr><td class=f_one>{#colony_setlogo}</td>
<td class=f_one><input type="file" name="attachment"></td></tr>
<tr><td class=f_one>{#colony_notice}</td>
<td class=f_one><textarea name="annouce" rows="5" cols="40">$cydb[annouce]</textarea></td></tr>
<tr><td class=f_one>{#colony_introduce}</td>
<td class=f_one><textarea name="descrip" rows="5" cols="40">$cydb[descrip]</textarea></td></tr>
</table>
<br><center><input type="submit" value="{#submit}"><input type="reset" value="{#reset}"></center></form>
<!-- 
EOT;
}elseif($job=='member'){print <<<EOT
-->
<form method=post action="$basename&">
<input type="hidden" name="job" value="member">
<input type="hidden" name="cyid" value="$cyid">
<table cellspacing=1 cellpadding=4 width="$tablewidth" align=center border=0 $i_table>
<tr class="head"><td colspan="8"><b>{#colony_memberlist}</b></td></tr>
<tr class="cbg" align="center">
<td width="5%">ID</td>
<td>{#colony_realname}</td>
<td>{#colony_username}</td>
<td>{#gender}</td>
<td>{#phone}</td>
<td>Email</td>
<td>{#state}</td>
<td width="5%"></td>
</tr>
<!--
EOT;
$num=($page-1)*$db_perpage;
foreach($memberdb as $key => $value){
$gender = $value[gender]==1  ? '{#male}' : ($value[gender]==2 ? '{#female}' : '{#unknown}');
$sate = $value[ifadmin]==1 ? '{#colony_admin}' : ($value[ifadmin]=='-1' ? '{#state_0}' : '{#state_1}');
$num++;
print <<<EOT
-->
<tr class="f_one" align="center">
<td>$num</td>
<td><a href="$basename&job=card&cyid=$cyid&uid=$value[uid]">$value[realname]</a></td>
<td>$value[username]</td>
<td>$gender</td>
<td>$value[tel]</td>
<td>$value[email]</td>
<td>$sate</td>
<td><input type="checkbox" name="selid[]" value="$value[uid]"></td>
</tr>
<!-- 
EOT;
}print <<<EOT
-->
</table>
 &nbsp; $pages
<br><br>
<center>
<!-- 
EOT;
$len=4;
if($windid == $cydb['admin']){
$len=6;
print <<<EOT
-->
<input type="radio" name="action" value="addadmin">{#colony_setadmin}
<input type="radio" name="action" value="deladmin">{#colony_canceladmin}
<!-- 
EOT;
}print <<<EOT
-->
<input type="radio" name="action" value="pass" checked>{#colony_passmember}
<input type="radio" name="action" value="del">{#colony_delmember}
<br><br>
<input type="button" name="chkall" value="{#sel_all}" onclick="CheckAll(this.form,'$len')">
<input type="submit" value="{#submit}">
</center></form>
<!--
EOT;
}elseif($job=='currency'){print <<<EOT
-->
<table width="$tablewidth" cellspacing="1" cellpadding="5" align="center" $i_table>
	<tr><td class="head"><b>{#colony_currency}</b></td></tr>
	<tr><td class="f_one">{#colony_currency_info}</td></tr>
</table>
<br>
<form method="post" action="$basename&job=currency&">
<input type="hidden" name="step" value="2">
<input type="hidden" name="cyid" value="$cyid">
<table width="$tablewidth" cellspacing="1" cellpadding="5" align="center" $i_table>
	<tr><td class="head" colspan="2"><b>{#colony_currency} ({#currency_rate}$cn_rate%)</b></td></tr>
	<tr class="f_one">
		<td width="20%">{#currency_touser}</td>
		<td><input type="text" name="pwuser" size=20></td>
	</tr>
	<tr class="f_one">
		<td>{#currency_paysum}</td>
		<td><input type="text" name="currency" size=20></td>
	</tr>
	<tr class="f_one">
		<td>{#currency_enterpwd}</td>
		<td><input type="password" name="pwpwd" size=20></td>
	</tr>
</table>
<br><center><input type="submit" value="{#submit}"></center></form>
<!-- 
EOT;
}elseif ($job=='currencylog'){print <<<EOT
-->
<table width="$tablewidth" cellspacing="1" cellpadding="5" align="center" $i_table>
<tr class=head><td colspan=5><b>{#colony_currencylog}</b></div></td></tr>
<tr class="cbg" align="center">
<td width="5%">ID</td>
<td width="15%">{#username}</td>
<td width="15%">{#admin}</td>
<td width="*">{#log_descrip}</td>
<td width="20%">{#date}</td>
</tr>
<!--
EOT;
$num=($page-1)*$db_perpage;
foreach($logdb as $key => $value){
$num++;
print <<<EOT
-->
<tr class="f_one" align="center">
<td>$num</td>
<td>$value[username1]</td>
<td>$value[username2]</td>
<td><div style='TABLE-LAYOUT: fixed;WORD-WRAP: break-word' align="left">$value[descrip]</div></td>
<td>$value[date]</td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</td></tr></table>
 &nbsp; $pages
<!-- 
EOT;
}elseif ($job=='joinlog'){print <<<EOT
-->
<table width="$tablewidth" cellspacing="1" cellpadding="5" align="center" $i_table>
<tr class=head><td colspan=5><b>{#colony_joinlog}</b></div></td></tr>
<tr class="cbg" align="center">
<td width="5%">ID</td>
<td width="20%">{#username}</td>
<td width="20%">{#admin}</td>
<td width="*">{#log_descrip}</td>
<td width="20%">{#date}</td>
</tr>
<!--
EOT;
$num=($page-1)*$db_perpage;
foreach($logdb as $key => $value){
$num++;
print <<<EOT
-->
<tr class="f_one" align="center">
<td>$num</td>
<td>$value[username1]</td>
<td>$value[username2]</td>
<td><div style='TABLE-LAYOUT: fixed;WORD-WRAP: break-word' align="left">$value[descrip]</div></td>
<td>$value[date]</td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</td></tr></table>
 &nbsp; $pages
<!-- 
EOT;
}print <<<EOT
-->
</td></tr></table> 
<script language=JavaScript>
function redirect(value){
	if(value!= '') {
		window.location=value;
	}
}
function checkset(chars){
	if(!confirm(chars)){
		return false;
	}
}
function CheckAll(form,len){
	for (var i=0;i<form.elements.length-len;i++){
		var e = form.elements[i];
		e.checked == true ? e.checked = false : e.checked = true;
	}
}
</script>
<!-- 
EOT;
?>-->