<!--<?php
include_once PrintEot('left');
print<<<EOT
-->
<!-- <h2 class="h1 mb10"><a href="$admin_file?adminjob=app&admintype=appslist">返回基礎應用列表</a></h2> -->
<!--
EOT;
if(!$action){print <<<EOT
-->
<div class="nav3 mb10">
	<ul class="cc">
		<li class="current"><a href="$basename">基本設置</a></li>
		<li><a href="$basename&action=style">群組分類</a></li>
		<li><a href="$basename&action=class">關聯版塊</a></li>
		<li><a href="$basename&action=colony">群組管理</a></li>
		<li><a href="$basename&action=mergecolony">合並群組</a></li>
		<li><a href="$basename&action=level">群組等級</a></li>
		<li><a href="$basename&action=colonystyle">群組風格</a></li>
		<li><a href="$basename&action=cache">更新緩存</a></li>
		<li><a href="$admin_file?adminjob=apps&admintype=groups_manage" onclick="openNewUrl('groups_manage','群組管理',this.href);return false;">內容管理</a></li>
	</ul>
</div>
<form action="$basename&" method="post">
  <input type="hidden" name="step" value="3">
  <h2 class="h1">基本設置</h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr1 vt">
      <td class="td1">群組</td>
      <td class="td2">
        <div class="list_A list_80">
             <ul class="cc">
                  <li><input type="radio" name="groups_open" value="1" $groups_open_Y>開啟</li>
                <li><input type="radio" name="groups_open" value="0" $groups_open_N>關閉</li>
             </ul>
         </div>
       </td> <td class="td2"><div class="help_a"></div></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">允許創建新群組</td>
      <td class="td2">
      <div class="list_A list_80">
             <ul class="cc">
                  <li><input type="radio" name="config[newcolony]" value="1" $newcolony_Y>開啟</li>
                <li><input type="radio" name="config[newcolony]" value="0" $newcolony_N>關閉</li>
             </ul>
         </div>
		</td><td class="td2"><div class="help_a">開啟後，才可以創建新群組</div></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">創建群組驗證碼</td>
      <td class="td2">
      <div class="list_A list_80">
             <ul class="cc">
                  <li><input type="radio" name="config[groups_gdcheck]" value="1" $groups_gdcheck_Y />開啟</li>
                <li><input type="radio" name="config[groups_gdcheck]" value="0" $groups_gdcheck_N />關閉</li>
             </ul>
         </div>
        </td><td class="td2"><div class="help_a">開啟後，創建群組時需要填寫驗證碼</div></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">發表新帖驗證碼</td>
      <td class="td2">
      <div class="list_A list_80">
             <ul class="cc">
                  <li><input type="radio" name="config[groups_p_gdcheck]" value="1" $groups_p_gdcheck_Y />開啟</li>
                <li><input type="radio" name="config[groups_p_gdcheck]" value="0" $groups_p_gdcheck_N />關閉</li>
             </ul>
         </div>
        </td><td class="td2"><div class="help_a">開啟後，發表新帖時需要填寫驗證碼</div></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">創建群組驗證問題</td>
      <td class="td2">
      <div class="list_A list_80">
             <ul class="cc">
                  <li><input type="radio" name="config[groups_qcheck]" value="1" $groups_qcheck_Y />開啟</li>
                <li><input type="radio" name="config[groups_qcheck]" value="0" $groups_qcheck_N />關閉</li>
             </ul>
         </div>
        </td><td class="td2"><div class="help_a">開啟後，創建群組時需要填寫驗證問題</div></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">發表新帖驗證問題</td>
      <td class="td2">
      <div class="list_A list_80">
             <ul class="cc">
                  <li><input type="radio" name="config[groups_p_qcheck]" value="1" $groups_p_qcheck_Y />開啟</li>
                <li><input type="radio" name="config[groups_p_qcheck]" value="0" $groups_p_qcheck_N />關閉</li>
             </ul>
         </div>
        </td><td class="td2"><div class="help_a">開啟後，發表新帖時需要填寫驗證問題</div></td>
    </tr>
    <!-- <tr class="tr1 vt">
      <td class="td1">創建群組的個數限制</td>
      <td class="td2"><input name="config[allowcreate]" class="input input_wa" value="$o_allowcreate">
        </td>
		<td class="td2"><div class="help_a">每個會員最多能創建群組的個數。0 或 留空 表示沒限制</div></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">加入群組的個數限制</td>
      <td class="td2"><input name="config[allowjoin]" class="input input_wa" value="$o_allowjoin">
        </td>
		<td class="td2"><div class="help_a">每個會員最多能加入群組的個數。0 或 留空 表示沒限制</div></td>
    </tr> -->
    <tr class="tr1 vt">
      <td class="td1">群組標志圖片最大尺寸</td>
      <td class="td2"><input name="config[imgsize]" class="input input_wa" value="$o_imgsize">
        </td>
		<td class="td2"><div class="help_a">單位KB，0或留空 則按<a href="?adminjob=settings&admintype=att" onClick="parent.PW.Dialog({id:'basic',url:'?adminjob=settings&admintype=att',name:'附件設置'});return false;">附件設置</a>配置。<font color="red">&nbsp;注意︰系統限制上傳附件最大尺寸為{$maxuploadsize}</font></div></td>
    </tr>
    <!-- <tr class="tr1 vt"><td>群組標志圖片寬高範圍[像素]</td>
<td><input name="config[imgwidth]" size="8" class="input" value="$o_imgwidth"> 寬
<input name="config[imgheight]" size="8" class="input" value="$o_imgheight"> 高 0 或 留空 表示沒限制</td></tr> -->
    <tr class="tr1 vt">
      <td class="td1">允許創建群組的用戶組</td>
      <td class="td2">$creategroup</td>
	  <td class="td2"><div class="help_a">全不選則允許所有用戶組創建</div></td>
    </tr>
  </table>
  </div>
  <h3 class="h1"><span class="mr20">群組積分獎懲設置</span><span class="linka">注:<b>威望積分</b>支持小數點後一位，其他積分只允許整數！</span></h3>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr2">
      <td class="td2">積分名稱</td>
      <td class="td2">創建群組(-)</td>
      <td class="td2">加入群組(-)</td>
      <td class="td2">創建相冊(-)</td>
      <td class="td2">上傳照片(+)</td>
      <td class="td2">刪除照片(-)</td>
      <!-- <td>發表主題(+)</td>
		<td>發表回復(+)</td>
		<td>刪除主題(-)</td>
		<td>刪除回復(-)</td> -->
    </tr>
<!--
EOT;
$creditset = (array)$creditset;
foreach($credit->cType as $key => $value){print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td2">$value</td>
      <td class="td2"><input name="creditset[Creategroup][$key]" value="{$creditset[Creategroup][$key]}" size="8" class="input" /></td>
      <td class="td2"><input name="creditset[Joingroup][$key]" value="{$creditset[Joingroup][$key]}" size="8" class="input" /></td>
      <td class="td2"><input name="creditset[Createalbum][$key]" value="{$creditset[Createalbum][$key]}" size="8" class="input" /></td>
      <td class="td2"><input name="creditset[Uploadphoto][$key]" value="{$creditset[Uploadphoto][$key]}" size="8" class="input" /></td>
      <td class="td2"><input name="creditset[Deletephoto][$key]" value="{$creditset[Deletephoto][$key]}" size="8" class="input" /></td>
      <!-- <td><input name="creditset[Post][$key]" value="{$creditset[Post][$key]}" size="8" class="input" /></td>
		<td><input name="creditset[Reply][$key]" value="{$creditset[Reply][$key]}" size="8" class="input" /></td>
		<td><input name="creditset[Delete][$key]" value="{$creditset[Delete][$key]}" size="8" class="input" /></td>
		<td><input name="creditset[Deleterp][$key]" value="{$creditset[Deleterp][$key]}" size="8" class="input" /></td> -->
    </tr>
<!--
EOT;
}print <<<EOT
-->
  </table>
  </div>
  <h3 class="h1"><span class="mr20">群組積分流通記錄</span><span class="linka">此功能可以詳細記錄某種積分的流通情況，幫助站長更加清晰地掌握論壇的積分狀況！</span></h3>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr2">
      <td class="td2">積分名稱</td>
      <td class="td2">創建群組</td>
      <td class="td2">加入群組</td>
      <td class="td2">創建相冊</td>
      <td class="td2">上傳照片</td>
      <td class="td2">刪除照片</td>
      <!-- <td>發表主題</td>
		<td>發表回復</td>
		<td>刪除主題</td>
		<td>刪除回復</td> -->
    </tr>
<!--
EOT;
foreach($credit->cType as $key => $value){print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td2">$value</td>
      <td class="td2"><input type="checkbox" name="creditlog[Creategroup][$key]" value="1" {$creditlog[Creategroup][$key]} /></td>
      <td class="td2"><input type="checkbox" name="creditlog[Joingroup][$key]" value="1" {$creditlog[Joingroup][$key]} /></td>
      <td class="td2"><input type="checkbox" name="creditlog[Createalbum][$key]" value="1" {$creditlog[Createalbum][$key]} /></td>
      <td class="td2"><input type="checkbox" name="creditlog[Uploadphoto][$key]" value="1" {$creditlog[Uploadphoto][$key]} /></td>
      <td class="td2"><input type="checkbox" name="creditlog[Deletephoto][$key]" value="1" {$creditlog[Deletephoto][$key]} /></td>
      <!-- <td><input type="checkbox" name="creditlog[Post][$key]" value="1" {$creditlog[Post][$key]} /></td>
		<td><input type="checkbox" name="creditlog[Reply][$key]" value="1" {$creditlog[Reply][$key]} /></td>
		<td><input type="checkbox" name="creditlog[Delete][$key]" value="1" {$creditlog[Delete][$key]} /></td>
		<td><input type="checkbox" name="creditlog[Deleterp][$key]" value="1" {$creditlog[Deleterp][$key]} /></td> -->
    </tr>
<!--
EOT;
}print <<<EOT
-->
  </table>
  </div>
  <div class="mb10 tac">
    <span class="btn"><span><button type="submit">提 交</button></span></span>
   </div>
</form>
<!--
EOT;
}elseif($action=='class'){print <<<EOT
-->
<div class="nav3 mb10">
    <ul class="cc">
		<li><a href="$basename">基本設置</a></li>
		<li><a href="$basename&action=style">群組分類</a></li>
		<li class="current"><a href="$basename&action=class">關聯版塊</a></li>
		<li><a href="$basename&action=colony">群組管理</a></li>
		<li><a href="$basename&action=mergecolony">合並群組</a></li>
		<li><a href="$basename&action=level">群組等級</a></li>
		<li><a href="$basename&action=colonystyle">群組風格</a></li>
		<li><a href="$basename&action=cache">更新緩存</a></li>
		<li><a href="$admin_file?adminjob=apps&admintype=groups_manage" onclick="openNewUrl('groups_manage','群組管理',this.href);return false;">內容管理</a></li>
    </ul>
</div>
<form action="$basename&" method="post">
  <input type="hidden" name="action" value="class" />
  <input type="hidden" name="step" value="2" />
  <h2 class="h1">關聯版塊</h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr2">
      <td width="30">開啟</td>
      <td>關聯版塊別名</td>
      <td width="80">群組個數</td>
    </tr>
<!--
EOT;
foreach($o_classdb as $key => $value){print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td2"><input type="checkbox" name="" disabled /></td>
      <td class="td2">{$forum[$key][name]}（分類）</td>
      <td class="td2">--</td>
    </tr>
    <tbody>
<!--
EOT;
foreach ($value as $k => $v){
$ifcheck = in_array($v,$isclass) ? ' checked' : '';
isset($classdb[$v]['cnsum']) || $classdb[$v]['cnsum'] = 0;
print <<<EOT
-->
      <tr class="tr1 vt">
        <td class="td2"><input type="checkbox" name="selid[]" value="$v"{$ifcheck} /></td>
        <td class="td2"><input type="text" name="cname[$v]" value="{$classdb[$v][cname]}"  class="input input_wa mr5" />(版塊︰{$forum[$v][name]})</td>
        <td class="td2">{$classdb[$v][cnsum]}</td>
      </tr>
<!--
EOT;
}print <<<EOT
-->
    </tbody>
<!--
EOT;
}print <<<EOT
-->
  </table>
  </div>
  <div class="mb10 tac">
    <span class="btn"><span><button type="submit">提 交</button></span></span>
   </div>
</form>
<!--
EOT;
} elseif ($action == 'credit') {print <<<EOT
-->
<div class="nav3 mb10">
    <ul class="cc">
      <li><a href="$basename">基本設置</a></li>
      <li><a href="$basename&action=class">群組分類</a></li>
      <li><a href="$basename&action=colony">群組管理</a></li>
      <li><a href="$basename&action=level">群組等級</a></li>
      <li><a href="$basename&action=cache">更新緩存</a></li>
    </ul>
</div>
<form action="$basename&" method="post">
  <input type="hidden" name="action" value="credit" />
  <input type="hidden" name="fid" value="$fid" />
  <input type="hidden" name="step" value="2" />
  <h2 class="h1"><span class="mr20">積分策略></span><span class="linka">注:<b>威望積分</b>支持小數點後一位，其他積分只允許整數！</span></h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr2">
      <td>積分名稱</td>
      <td>創建群組(-)</td>
      <td>加入群組(-)</td>
      <td>創建相冊(-)</td>
      <td>上傳照片(+)</td>
      <td>刪除照片(-)</td>
      <td>發表主題(+)</td>
      <td>發表回復(+)</td>
      <td>刪除主題(-)</td>
      <td>刪除回復(-)</td>
    </tr>
<!--
EOT;
foreach($credit->cType as $key => $value){print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td2">$value</td>
      <td class="td2"><input name="creditset[Creategroup][$key]" value="{$creditset[Creategroup][$key]}" class="input input_wc" /></td>
      <td class="td2"><input name="creditset[Joingroup][$key]" value="{$creditset[Joingroup][$key]}" class="input input_wc" /></td>
      <td class="td2"><input name="creditset[Createalbum][$key]" value="{$creditset[Createalbum][$key]}" class="input input_wc" /></td>
      <td class="td2"><input name="creditset[Uploadphoto][$key]" value="{$creditset[Uploadphoto][$key]}" class="input input_wc" /></td>
      <td class="td2"><input name="creditset[Deletephoto][$key]" value="{$creditset[Deletephoto][$key]}" class="input input_wc" /></td>
      <td class="td2"><input name="creditset[Post][$key]" value="{$creditset[Post][$key]}" class="input input_wc" /></td>
      <td class="td2"><input name="creditset[Reply][$key]" value="{$creditset[Reply][$key]}" class="input input_wc" /></td>
      <td class="td2"><input name="creditset[Delete][$key]" value="{$creditset[Delete][$key]}" class="input input_wc" /></td>
      <td class="td2"><input name="creditset[Deleterp][$key]" value="{$creditset[Deleterp][$key]}" class="input input_wc" /></td>
    </tr>
<!--
EOT;
}print <<<EOT
-->
  </table>
  </div>
  <div class="mb10 tac">
    <span class="btn"><span><button type="submit">提 交</button></span></span>
   </div>
</form>
<!--
EOT;
}elseif($action=='colony'){print <<<EOT
-->
<div class="nav3 mb10">
    <ul class="cc">
		<li><a href="$basename">基本設置</a></li>
		<li><a href="$basename&action=style">群組分類</a></li>
		<li><a href="$basename&action=class">關聯版塊</a></li>
		<li class="current"><a href="$basename&action=colony">群組管理</a></li>
		<li><a href="$basename&action=mergecolony">合並群組</a></li>
		<li><a href="$basename&action=level">群組等級</a></li>
		<li><a href="$basename&action=colonystyle">群組風格</a></li>
		<li><a href="$basename&action=cache">更新緩存</a></li>
		<li><a href="$admin_file?adminjob=apps&admintype=groups_manage" onclick="openNewUrl('groups_manage','群組管理',this.href);return false;">內容管理</a></li>
    </ul>
</div>
<h2 class="h1">搜索內容</h2>
<form method="POST" action="$basename&action=colony">
<div class="admin_table mb10">
    <table width="100%" cellspacing="0" cellpadding="0">
        <tr class="tr1 vt">
          <td class="td1">關聯版塊</td>
          <td class="td2"><select name="cid" class="select_wa mr20">$options</select></td>
        </tr>
		<tr class="tr1 vt">
          <td class="td1" >所屬分類</td>
          <td class="td2" >
		   <select name="firstgradestyle" id="firstgradestyle" onchange="setSecondstyle(this.value);" class="select_wa mr5">
		    <option value="">不分類</option>
<!--
EOT;
foreach ($o_style_relation as $key => $value){print<<<EOT
-->
			<option value="$key">{$o_styledb[$key]['cname']}</option>
<!--
EOT;
}print<<<EOT
-->
			 </select>
			 <select name="secondgradestyle" id="secondgradestyle" class="select_wa" style="display:none">
             </select>
		  </td>
		</tr>
        <tr class="tr1 vt">
          <td class="td1">等級頭餃</td>
          <td class="td2"><select name="level" class="select_wa mr20"><option></option><option value="-1">普通等級</option>$leveloptions</select></td>
        </tr>
        <tr class="tr1 vt">
          <td class="td1">群組名稱</td>
          <td class="td2"><input name="cname" class="input input_wa mr20" value="$cname">（可使用通配符*）</td>
        </tr>
        <tr class="tr1 vt">
          <td class="td1">創始人</td>
          <td class="td2"><input name="admin" class="input input_wa mr20" value="$admin">（可使用通配符*）</td>
        </tr>
     </table>
 </div>
 <div class="mb10 tac">
    <span class="btn"><span><button type="submit">提 交</button></span></span>
   </div>
</form>
<form action="$basename&action=colony" method="post">
  <input type="hidden" name="step" value="3">
  <h2 class="h1">群組管理</h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr2">
      <td>群組名稱</td>
      <td>創始人</td>
      <td>等級頭餃</td>
      <td>所屬分類</td>
	  <td>關聯版塊</td>
	  <td>版塊中顯示順序</td>
	  <td>顯示在版塊</td>
	  <td>圖文顯示</td>
      <td>操作</td>
    </tr>
<!--
EOT;
if (empty($colonys)) {print <<<EOT
-->
<tr><td class="p10" colspan="9"><div class="admin_tips">啊哦，沒有你要的信息！</div></td></tr>
<!--
EOT;
}else{
foreach($colonys as $value){
$ifcheck = $value['ifshow'] ? ' checked' : '';
$checked3 = $value[ifshowpic] == 1 ? 'checked' : '';
print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td2"><a href="apps.php?q=group&cyid=$value[id]" target="_blank">$value[cname]</a></td>
      <td class="td2"><a href="u.php?username=$value[admin]" target="_blank">$value[admin]</a></td>
      <td class="td2">{$o_groups_level[$value[speciallevel]]}</td>
	  <td class="td2">{$o_styledb[$value[styleid]]['cname']}</td>
      <td class="td2">{$value[classname]}</td>
	  <td class="td2"><input class="input" size="2" name="vieworder[$value[id]]" value="$value[vieworder]" type="text"></td>
	  <td class="td2"><input type="checkbox" name="ifshow[$value[id]]" value="1" {$ifcheck}/> <input type="hidden" name="selid[]" value="$value[id]" /></td>
	  <td class="td2"><input type="checkbox" name="ifshowpic[$value[id]]" value="1" $checked3></td>
      <td class="td2"><a href="$basename&action=editcolony&cyid=$value[id]" class="mr20">[編輯]</a>
      <a href="$basename&action=delcolony&cyid=$value[id]" title="刪除">[刪除]</a>
      <input name="ids[$value[id]]" type="hidden" value="$value[id]"></td>
    </tr>
<!--
EOT;
}}print <<<EOT
-->
  </table>
  </div>
  <div class="cc">$pages</div>
  <div class="mb10 tac">
    <span class="btn"><span><button type="submit">提 交</button></span></span>
  </div>
</form>
<script type="text/javascript" src="js/pw_ajax.js"></script>
<script type="text/javascript">

function setSecondstyle(id) {
	var jsStyle = JSONParse('$jsStyle');
	var jsStyleRelation = JSONParse('$jsStyleRelation');

	if (typeof jsStyle[id] == 'undefined') {
		getObj('secondgradestyle').style.display = 'none';
	} else {
		if (jsStyle[id]['upid'] == '0') {
			if (jsStyleRelation[id].length == 0) {
				getObj('secondgradestyle').style.display = 'none';
			} else {
				getObj('secondgradestyle').style.display = '';
				getObj('secondgradestyle').length = 0;
				
				getObj('secondgradestyle').options.add(new Option('全部', 0));
				
				for (var i = 0; i < jsStyleRelation[id].length; i++) {
					getObj('secondgradestyle').options.add(new Option(jsStyle[jsStyleRelation[id][i]]['cname'], jsStyleRelation[id][i]));
				}
			}
			getObj('firstgradestyle').value = id;
		} else {
			var parentId = jsStyle[id]['upid'];
			getObj('firstgradestyle').value = parentId;
			getObj('secondgradestyle').style.display = '';
			getObj('secondgradestyle').length = 0;
			getObj('secondgradestyle').options.add(new Option('全部', 0));
			for (var i = 0; i < jsStyleRelation[parentId].length; i++) {
				getObj('secondgradestyle').options.add(new Option(jsStyle[jsStyleRelation[parentId][i]]['cname'], jsStyleRelation[parentId][i]));
			}
			getObj('secondgradestyle').value = id;
		}
	}
}
setSecondstyle('$styleid');
</script>
<!--
EOT;
} elseif($action == 'editcolony') {print <<<EOT
-->
<div class="nav3 mb10">
<ul class="cc">
	<li><a href="$basename">基本設置</a></li>
	<li><a href="$basename&action=style">群組分類</a></li>
	<li><a href="$basename&action=class">關聯版塊</a></li>
	<li class="current"><a href="$basename&action=colony">群組管理</a></li>
	<li><a href="$basename&action=mergecolony">合並群組</a></li>
	<li><a href="$basename&action=level">群組等級</a></li>
	<li><a href="$basename&action=colonystyle">群組風格</a></li>
	<li><a href="$basename&action=cache">更新緩存</a></li>
	<li><a href="$admin_file?adminjob=apps&admintype=groups_manage" onclick="openNewUrl('groups_manage','群組管理',this.href);return false;">內容管理</a></li>
</ul>
</div>
<link rel="stylesheet" href="images/post/minieitor/minieitor.css" />
<script type="text/javascript" src="js/mini_editor.js"></script>
<form action="$basename&" method="post" enctype="multipart/form-data">
  <input type="hidden" name="action" value="editcolony" />
  <input type="hidden" name="cyid" value="$cyid" />
  <input type="hidden" name="step" value="3" />

  <h2 class="h1">群組基本信息</h2>
<div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr1 vt">
      <td class="td1">群組名稱 <span class="s1">*</span></td>
      <td class="td2" ><input type="text" class="input input_wa" name="cname" id="cname" value="$colony[cname]" />
        &nbsp;<span id="cname_warn">限 50 字節</span></td>
			<td class="td2"></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1" >創始人</td>
      <td class="td2" ><input type="text" class="input input_wa" name="admin" value="$colony[admin]" /></td>
			<td class="td2"></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1" >群組等級</td>
      <td class="td2" ><select name="speciallevel" class="select_wa"><option value="0">普通等級</option>{$leveloptions}</select></td>
			<td class="td2"></td>
    </tr>
	<tr class="tr1 vt">
      <td class="td1" >所屬分類 <span class="s1">*</span></td>
      <td class="td2" >
		 <select name="firstgradestyle" id="firstgradestyle" onchange="setSecondstyle(this.value);" class="select_wa mr5">
		    <option value="">請選擇分類</option>
<!--
EOT;
foreach ($o_style_relation as $key => $value){print<<<EOT
-->
			<option value="$key">{$o_styledb[$key]['cname']}</option>
<!--
EOT;
}print<<<EOT
-->
		 </select>
		 <select name="secondgradestyle" id="secondgradestyle" class="select_wa" style="display:none"></select>
		 <td class="td2"></td>
	  </td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1" >關聯版塊</td>
      <td class="td2" >
      	<select name="cid" class="select_wa" onchange="onchage();" id="cid">
          $options
        </select>
        </td>
				<td class="td2"><div class="help_a">修改關聯版塊，將同時移動群組所屬帖子到相應版塊，請慎用</div></td>
    </tr>
	<tr class="tr1 vt" id="showforums" style="$cidDisplay">
      <td class="td1" >話題在版塊中顯示</td>
      <td class="td2" >
				<ul class="list_A list_80">
					<li><input type="radio" name="iftopicshowinforum" value="1" $iftopicshowinforum_Y />開啟</li>
					<li><input type="radio" name="iftopicshowinforum" value="0" $iftopicshowinforum_N />關閉</li>
				</ul>
        </td>
				<td class="td2"><div class="help_a">修改此選項，將同時移動群組所屬帖子，請慎用</div></td>
    </tr>
	<tr class="tr1 vt" id="showview" style="$cidDisplay">
      <td class="td1" >顯示視圖形式</td>
      <td class="td2" >
		<ul class="list_A">
			<li><input type="radio" name="viewtype" value="0" {$viewtype_0} > 群組視圖和論壇視圖</li>
			<li><input type="radio" name="viewtype" value="1" {$viewtype_1} > 論壇視圖</li>
			<li><input type="radio" name="viewtype" value="2" {$viewtype_2} > 群組視圖</li>
		</ul>
	  </td>
		<td class="td2"></td>
    </tr>
<script type="text/javascript">
	function onchage() {
		if ( getObj('cid').value != 0) {
			getObj('showforums').style.display = '';
			getObj('showview').style.display = '';
		} else {
			getObj('showforums').style.display = 'none';
			getObj('showview').style.display = 'none';
		}

	}
</script>
    <tr class="tr1 vt">
      <td class="td1" >加入權限</td>
      <td class="td2" ><select name="ifcheck" class="select_wa">
          <option value="2" $ifcheck_2>允許任何人加入該群組</option>
          <option value="1" $ifcheck_1>需要管理員審核才能加入該群組</option>
          <option value="0" $ifcheck_0>不允許任何人加入該群組</option>
        </select>
      </td>
			<td class="td2"></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1" >群組簡介</td>
      <td class="td2" >
    <div class="minieitor_pw cc">
        <ul class="miniUl">
            <li><a href="javascript:" title="插入url鏈接" class="milink_pw" onClick="editor.createLinkBox(this.id);" id="createlinkid" unselectable="on">插入url鏈接</a></li>
            <li><a href="javascript:" title="加粗" class="mistrong_pw" onClick="editor.bold();" id="createb2" unselectable="on">加粗</a></li>
						<li><a href="javascript:" title="加顏色" class="micolor_pw" onClick="editor.createcolor(this.id);" id="createcolorid" unselectable="on">加顏色</a></li>
        </ul>
        <div class="minitextarea">
            <textarea maxlength="200"  id="mini_descrip" name="descrip">{$colony[descrip]}</textarea><input type="hidden" id="board_uid" value="$u">
        <div class="c"></div>
        </div>
				<script type="text/javascript">var editor = new MiniEditor('mini_descrip');</script>
        <div class="c"></div>
    </div>
        <p id="descrip_warn">限 255 字節</p> </td>
				<td class="td2"></td>
    </tr>
		<tr class="tr1 vt">
		<td class="td1" >群組公告</td>
		<td class="td2" >
		<div class="minieitor_pw cc">
        <ul class="miniUl">
            <li><a href="javascript:" title="插入url鏈接" class="milink_pw" onClick="editor2.createLinkBox(this.id);" id="createlinkid2" unselectable="on">插入url鏈接</a></li>
            <li><a href="javascript:" title="加粗" class="mistrong_pw" onClick="editor2.bold();" unselectable="on">加粗</a></li>
						<li><a href="javascript:" title="加顏色" class="micolor_pw" onClick="editor2.createcolor(this.id);" unselectable="on" id="createcolorid2">加顏色</a></li>
        </ul>
        <div class="minitextarea">
            <textarea maxlength="200" id="editor_annouce" name="annouce">{$colony[annouce]}</textarea><input type="hidden" id="board_uid" value="$u">
        <div class="c"></div>
        </div>
				<script type="text/javascript">var editor2 = new MiniEditor('editor_annouce');</script>
        <div class="c"></div>
    </div>
			<p id="annouce_warn">限 50000 字節</p>
		</td>
		<td class="td2"></td>
	</tr>
	<tr class="tr1 vt">
    <td class="td1">群組圖標</td>
    <td class="td2" width="410"><input type="hidden" name="q_1" id="q_1" value="" />
            	<img width="48px" height="48px" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=image);" id="preview_1" src="$colony[cnimg]" class="fr" />
				<!--div id="preview_1" style="width:48px;height:48px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);"></div-->
				<p class="mb5"><input type="file" class="input mr10" id="p_1" name="cnimg_1" accept="image/*" onchange="preview_img(1);" /><a href="javascript:void(0);" onclick="show_image('1','images/g/groupnopic.gif');" >使用默認圖標</a></p>
                <p class="gray">推薦尺寸120px*120px，</p>
            </td>
						<td class="td2">可上傳類型︰
<!--
EOT;
foreach($cnimg_1 as $key => $value){print<<<EOT
-->
						{$key}:{$value}KB;
<!--
EOT;
}print<<<EOT
-->
						
						</td>
        </tr>
				<tr class="tr1 vt">
            <td class="td1">群組背景</td>
            <td class="td2"><input type="hidden" name="q_2" id="q_2" value="" />
				<p class="mb5"><input type="file" class="input mr10" id="p_2" name="cnimg_2" accept="image/*" onchange="preview_img(2);" /><a href="javascript:void(0);" onclick="show_image('2','images/g/skin_default/preview.jpg');">使用默認背景</a></p>
                <img width="355px" height="75px" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=image);" id="preview_2" src="{$set_banner}" />
            </td>
						<td class="td2">可上傳類型︰
<!--
EOT;
foreach($cnimg_2 as $key => $value){print<<<EOT
-->
						{$key}:{$value}KB;
<!--
EOT;
}print<<<EOT
-->
						</td>
						
        </tr>
  <!--<h2>群組自定義積分設置</h2>
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr3" align="center">
		<td width="25%">積分名稱</td>
		<td>積分單位</td>
		<td>積分說明</td>
		<td><a style="color:blue;cursor:pointer;" onclick="addtbody('cdiymode','cdiybody');">[添加]</a></td>
	</tr>
	<tbody id="cdiymode" style="display:none"><tr class="tr3" align="center">
		<td><input name="cdiy_name[]" size="30" class="input" /></td>
		<td><input name="cdiy_unit[]" size="30" class="input" /></td>
		<td><input name="cdiy_desc[]" size="30" class="input" /></td>
		<td><a style="color:orange;cursor:pointer" onclick="deltbody(this);">[刪除]</a></td>
	</tr></tbody>-->
<!--
EOT;
foreach ($g_credits as $key => $value) {print <<<EOT
-->
<!--  <tr class="tr1 vt" align="center">
    <td class="td2" ><input name="credit_name[$key]" value="{$value[name]}" size="30" class="input" /></td>
    <td class="td2" ><input name="credit_unit[$key]" value="{$value[unit]}" size="30" class="input" /></td>
    <td class="td2" ><input name="credit_desc[$key]" value="{$value[description]}" size="30" class="input" /></td>
    <td class="td2" ><a style="color:orange;cursor:pointer" onclick="deltbody(this);">[刪除]</a></td>
  </tr>-->
<!--
EOT;
}print <<<EOT
-->
  <tbody id="cdiybody"></tbody>
<!--
  <h2 class="h1">群組積分獎懲設置</h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr2">
      <td class="td2">積分名稱</td>
      <td class="td2">加入群組(-)</td>
      <td class="td2">創建相冊(-)</td>
      <td class="td2">上傳照片(+)</td>
      <td class="td2">刪除照片(-)</td>
      <td class="td2">發表主題(+)</td>
      <td class="td2">發表回復(+)</td>
      <td class="td2">刪除主題(-)</td>
      <td class="td2">刪除回復(-)</td>
    </tr> -->
<!--
EOT;
foreach($g_all as $key => $value){print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td2">$value</td>
      <td class="td2"><input name="creditset[Joingroup][$key]" value="{$creditset[Joingroup][$key]}" class="input input_wc" /></td>
      <td class="td2"><input name="creditset[Createalbum][$key]" value="{$creditset[Createalbum][$key]}" class="input input_wc" /></td>
      <td class="td2"><input name="creditset[Uploadphoto][$key]" value="{$creditset[Uploadphoto][$key]}" class="input input_wc" /></td>
      <td class="td2"><input name="creditset[Deletephoto][$key]" value="{$creditset[Deletephoto][$key]}" class="input input_wc" /></td>
      <td class="td2"><input name="creditset[Post][$key]" value="{$creditset[Post][$key]}" class="input input_wc" /></td>
      <td class="td2"><input name="creditset[Reply][$key]" value="{$creditset[Reply][$key]}" class="input input_wc" /></td>
      <td class="td2"><input name="creditset[Delete][$key]" value="{$creditset[Delete][$key]}" class="input input_wc" /></td>
      <td class="td2"><input name="creditset[Deleterp][$key]" value="{$creditset[Deleterp][$key]}" class="input input_wc" /></td>
    </tr>
<!--
EOT;
}print <<<EOT
-->
  </table>
  </div>
  <div class="mb10 tac">
    <span class="btn"><span><button type="submit">保存設置</button></span></span>
   </div>
</form>
<script type="text/javascript" src="js/pw_ajax.js"></script>
<script type="text/javascript">
function addtbody(mode,tbody){
	if (getObj(mode)) {
		var s = getObj(mode).firstChild.cloneNode(true);
		getObj(tbody).appendChild(s);
	}
}
function show_image(id,pic_url) {
	getObj('q_' + id).value = 1;
	getObj('p_' + id).value = "";
	if(is_ie){
		getObj('p_' + id).outerHTML=getObj('p_' + id).outerHTML;
	}
	getObj("preview_" + id).src = pic_url;
}
function deltbody(obj){
	var o = obj.parentNode.parentNode;
	o.parentNode.removeChild(o);
}
addtbody('cdiymode','cdiybody');

function setSecondstyle(id) {
	var jsStyle = JSONParse('$jsStyle');
	var jsStyleRelation = JSONParse('$jsStyleRelation');

	if (typeof jsStyle[id] == 'undefined') {
		getObj('secondgradestyle').style.display = 'none';
	} else {
		if (jsStyle[id]['upid'] == '0') {
			if (jsStyleRelation[id].length == 0) {
				getObj('secondgradestyle').style.display = 'none';
			} else {
				getObj('secondgradestyle').style.display = '';
				getObj('secondgradestyle').length = 0;
				for (var i = 0; i < jsStyleRelation[id].length; i++) {
					getObj('secondgradestyle').options.add(new Option(jsStyle[jsStyleRelation[id][i]]['cname'], jsStyleRelation[id][i]));
				}
			}
			getObj('firstgradestyle').value = id;
		} else {
			var parentId = jsStyle[id]['upid'];
			getObj('firstgradestyle').value = parentId;
			getObj('secondgradestyle').style.display = '';
			getObj('secondgradestyle').length = 0;
			for (var i = 0; i < jsStyleRelation[parentId].length; i++) {
				getObj('secondgradestyle').options.add(new Option(jsStyle[jsStyleRelation[parentId][i]]['cname'], jsStyleRelation[parentId][i]));
			}
			getObj('secondgradestyle').value = id;
		}
	}
}
setSecondstyle('{$colony[styleid]}');

initCheckTextNum('mini_descrip','descrip_warn',255);
initCheckTextNum('editor_annouce','annouce_warn',50000);
</script>
<!--
EOT;
} elseif ($action == 'mergecolony') {print <<<EOT
-->
<div class="nav3 mb10">
<ul class="cc">
	<li><a href="$basename">基本設置</a></li>
	<li><a href="$basename&action=style">群組分類</a></li>
	<li><a href="$basename&action=class">關聯版塊</a></li>
	<li><a href="$basename&action=colony">群組管理</a></li>
	<li class="current"><a href="$basename&action=mergecolony">合並群組</a></li>
	<li><a href="$basename&action=level">群組等級</a></li>
	<li><a href="$basename&action=colonystyle">群組風格</a></li>
	<li><a href="$basename&action=cache">更新緩存</a></li>
	<li><a href="$admin_file?adminjob=apps&admintype=groups_manage" onclick="openNewUrl('groups_manage','群組管理',this.href);return false;">內容管理</a></li>
</ul>
</div>
<div class="c"></div>

<form action="$basename&action=$action" method="post">
<input type="hidden" name="step" value="3" />
<h2 class="h1">合並群組</h2>
<div class="admin_table mb10">
<table width="100%" cellspacing="0" cellpadding="0">

	<tr class="tr1 vt">
		<td class="td2" colspan="2">說明︰將原群組的所有數據合並到目標群組中，同時刪除原群組的數據</td>
	</tr>
	<tr class="tr1 vt">
		<td class="td1">源群組</td>
		<td class="td2"><input name="fromcname" class="input input_wa" /></td>
	</tr>
	<tr class="tr1 vt">
		<td class="td1">目標群組</td>
		<td class="td2"><input name="tocname" class="input input_wa" /></td>
	</tr>
</table>
</div>
<br />
   <div class="mb10 tac">
    <span class="btn"><span><button type="submit">提交</button></span></span>
   </div>
</form>
<!--
EOT;
}elseif($action=='log'){print <<<EOT
-->
<div class="nav3 mb10">
    <ul class="cc">
      <li><a href="$basename">基本設置</a></li>
      <li><a href="$basename&action=class">群組分類</a></li>
      <li><a href="$basename&action=colony">群組管理</a></li>
      <li><a href="$basename&action=level">群組等級</a></li>
      <li><a href="$basename&action=log">日志管理</a></li>
      <li><a href="$basename&action=cache">更新緩存</a></li>
	  <li><a href="$admin_file?adminjob=apps&admintype=groups_manage" onclick="openNewUrl('groups_manage','群組管理',this.href);return false;">內容管理</a></li>
    </ul>
</div>
<form action="$basename&" method="post">
  <h2 class="h1">描述搜索</h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr2">
      <td class="td1">關鍵字</td>
      <td class="td2"><input name="keyword" class="input input_wa mr20"><span class="bt2"><span><button type="submit" value="提 交">提 交</button></span></span></td>
    </tr>
  </table>
  </div>
</form>
<form action="$basename&" method="post" name="FORM">
  <input type="hidden" name="action" value="log">
  <input type="hidden" name="step" value="del">
  <h2 class="h1">操作記錄</h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr2">
	  <td width="30"><span onclick="CheckAll(document.FORM)" class="cp">全選</span></td>
      <td>類型</td>
      <td>群組</td>
      <td>用戶名</td>
      <td>描述</td>
      <td>日期</td>
    </tr>
<!--
EOT;
if (empty($logdb)) {print <<<EOT
-->
<tr><td class="p10" colspan="6"><div class="admin_tips">啊哦，沒有你要的信息！</div></td></tr>
<!--
EOT;
}else{
foreach($logdb as $value){print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td2"><input type="checkbox" name="selid[]" value="$value[id]"></td>
      <td class="td2">{$lang[logtype][$value[type]]}</td>
      <td class="td2"><a href="hack.php?H_name=colony&cyid=$value[field2]&job=view&id=$value[field2]" target="_blank">$value[field3]</a></td>
      <td class="td2">$value[username1]</td>
      <td class="td2">$value[descrip]</td>
      <td class="td2">$value[timestamp]</td>
    </tr>
<!--
EOT;
}}print <<<EOT
-->
  </table>
  </div>
  <div class="cc">$pages</div>
  <div class="mb10 tac">
	<span class="bt"><span><button type="button" onclick="CheckAll(document.FORM)">全 選</button></span></span>
    <span class="btn"><span><button type="submit">刪除</button></span></span>
   </div>
</form>
<script type="text/javascript">
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;
} elseif ($action == 'level') {print <<<EOT
-->
<div class="nav3">
    <ul class="cc">
        <li><a href="$basename">基本設置</a></li>
        <li><a href="$basename&action=style">群組分類</a></li>
        <li><a href="$basename&action=class">關聯版塊</a></li>
        <li><a href="$basename&action=colony">群組管理</a></li>
        <li><a href="$basename&action=mergecolony">合並群組</a></li>
        <li class="current"><a href="$basename&action=level">群組等級</a></li>
        <li><a href="$basename&action=colonystyle">群組風格</a></li>
        <li><a href="$basename&action=cache">更新緩存</a></li>
		<li><a href="$admin_file?adminjob=apps&admintype=groups_manage" onclick="openNewUrl('groups_manage','群組管理',this.href);return false;">內容管理</a></li>
    </ul>
</div>
<!--
EOT;
if (empty($job)) {print <<<EOT
-->
<div class="nav4 mb10">
    <ul class="cc">
        <li><a href="$basename&action=level&job=upgrade">群組等級提升方案</a></li>
        <li class="current"><a href="$basename&action=level">群組等級</a></li>
        <li><a href="$basename&action=level&job=sort">群組等級統計</a></li>
    </ul>
</div>
<form action="$basename&action=level&" method="post">
	<input type="hidden" name="job" value="add" />
	<input type="hidden" name="ltype" value="common" />
	<h2 class="h1">普通等級編輯</h2>
	<div class="admin_table mb10">
		<table width="100%" cellspacing="0" cellpadding="0">
			<tr class="tr2">
				<td width="15%">ID</td>
				<td width="25%">等級頭餃</td>
				<td width="25%">群組綜合積分</td>
				<td width="40">操作</td>
				<td><br /></td>
			</tr>
<!--
EOT;
$i=0;
foreach ($cnLevel['common'] as $key => $value) {$i++;print <<<EOT
-->
			<tr class="tr1 vt" id="gtr_{$value['id']}">
				<td class="td2">$value[id]</td>
				<td class="td2"><input type="text" class="input" name="ltitle[{$value['id']}]" value="{$value['ltitle']}" /></td>
				<td class="td2">
<!--
EOT;
if($i == 1){print<<<EOT
-->
				<input type="hidden" name="lpoint[{$value['id']}]" value="0" />
<!--
EOT;
}else{print<<<EOT
-->
				<input type="text" class="input" name="lpoint[{$value['id']}]" value="{$value['lpoint']}" />
<!--
EOT;
}print <<<EOT
--></td>
				<td class="td2"><a href="$basename&action=level&job=edit&id={$value['id']}">[編輯]</a></td>
                <td class="td2"><a href="$basename&action=level&job=del&id={$value['id']}" id="glevel_{$value['id']}" onclick="sendmsg(this.href,'',this.id);return false;">[刪除]</a></td>
			</tr>
<!--
EOT;
}print <<<EOT
-->
			<tbody id="clevel_mode" style="display:none"><tr class="tr3 td_bgA">
				<td class="td2"><a href="javascript:" onclick="addtbody('clevel_mode','clevel_body')"><i class="expand expand_c" title="添加">添加</i>添加</a></td>
				<td class="td2"><input type="text" class="input" name="ltitle_add[]" /></td>
				<td class="td2"><input type="text" class="input" name="lpoint_add[]" /></td>
				<td class="td2"><br /></td>
				<td class="td2"><a href="javascript:" onclick="deltbody(this)">[刪除]</a></td>
			</tr></tbody>
			<tbody id="clevel_body"></tbody>
		</table>
	</div>
	<div class="mb10 tac">
	<span class="btn"><span><button type="submit">提 交</button></span></span>
	</div>
</form>
<form action="$basename&action=level&" method="post">
	<input type="hidden" name="job" value="add" />
	<input type="hidden" name="ltype" value="special" />
	<h2 class="h1">特殊等級編輯</h2>
	<div class="admin_table mb10">
		<table width="100%" cellspacing="0" cellpadding="0">
			<tr class="tr2">
				<td width="15%">ID</td>
				<td width="50%">等級頭餃</td>
				<td width="40">操作</td>
				<td><br /></td>
			</tr>
<!--
EOT;
foreach ($cnLevel['special'] as $key => $value) {print <<<EOT
-->
			<tr class="tr1 vt" id="gtr_{$value['id']}">
				<td class="td2">$value[id]</td>
				<td class="td2"><input type="text" class="input" name="ltitle[{$value['id']}]" value="{$value['ltitle']}" /></td>
				<td class="td2"><a href="$basename&action=level&job=edit&id={$value['id']}">[編輯]</a></td>
				<td class="td2"><a href="$basename&action=level&job=del&id={$value['id']}" id="glevel_{$value['id']}" onclick="sendmsg(this.href,'',this.id);return false;">[刪除]</a></td>
			</tr>
<!--
EOT;
}print <<<EOT
-->
			<tbody id="clevel2_mode" style="display:none"><tr class="tr3 td_bgA">
				<td class="td2"><a href="javascript:" onclick="addtbody('clevel2_mode','clevel2_body')"><i class="expand expand_c" title="添加">添加</i>添加</a></td>
				<td class="td2"><input type="text" class="input" name="ltitle_add[]" /></td>
				<td class="td2"><br /></td>
				<td class="td2"><a href="javascript:" onclick="deltbody(this)">[刪除]</a></td>
			</tr></tbody>
			<tbody id="clevel2_body"></tbody>
		</table>
	</div>
	<div class="mb10 tac">
		<span class="btn"><span><button type="submit">提 交</button></span></span>
	</div>
</form>
<script type="text/javascript">
function addtbody(mode,tbody){
	if (getObj(mode)) {
		var s = getObj(mode).firstChild.cloneNode(true);
		getObj(tbody).appendChild(s);
	}
}
function deltbody(obj){
	var o = obj.parentNode.parentNode;
	if (o.parentNode.childNodes.length > 1) {
		o.parentNode.removeChild(o);
	}
}
addtbody('clevel_mode','clevel_body');
addtbody('clevel2_mode','clevel2_body');
</script>
<!--
EOT;
} elseif ($job == 'edit') {print <<<EOT
-->
<div class="nav4 mb10">
    <ul class="cc">
        <li><a href="$basename&action=level&job=upgrade">群組等級提升方案</a></li>
        <li class="current"><a href="$basename&action=level">群組等級</a></li>
        <li><a href="$basename&action=level&job=sort">群組等級統計</a></li>
    </ul>
</div>
<form action="$basename&action=level&" method="post">
	<input type="hidden" name="job" value="edit" />
	<input type="hidden" name="step" value="3" />

	<h2 class="h1">權限設置</h2>
	<div class="admin_table mb10">
		<table width="100%" cellspacing="0" cellpadding="0">
			<tr class="tr1 vt">
				<td class="td1">等級頭餃</td>
				<td class="td2"><select name="id" onchange="location.href='$basename&action=level&job=edit&id=' + this.value" class="select_wa">$options</select></td>
				<td class="td2"><div class="help_a"></div></td>
			</tr>
			<tr class="tr1 vt">
				<td class="td1">最多擁有的相冊數</td>
				<td class="td2"><input type="text" name="config[albumnum]" class="input input_wa" value="{$rt['albumnum']}" /> </td>
				<td class="td2"><div class="help_a">0 或 留空 表示沒限制</div></td>
			</tr>
			<tr class="tr1 vt">
				<td class="td1">單相冊最多可容納圖片數</td>
				<td class="td2"><input type="text" name="config[maxphotonum]" class="input input_wa" value="{$rt['maxphotonum']}" /> </td>
				<td class="td2"><div class="help_a">0 或 留空 表示沒限制</div></td>
			</tr>
			<tr class="tr1 vt">
				<td class="td1">群組容納成員最大值</td>
				<td class="td2"><input type="text" name="config[maxmember]" class="input input_wa" value="{$rt['maxmember']}" /></td>
				<td class="td2"><div class="help_a">0 或 留空 表示沒限制</div></td>
			</tr>
			<tr class="tr1 vt">
				<td class="td1">群主合並群組</td>
				<td class="td2">
                	<ul class="list_A list_80">
                    	<li><input type="radio" name="config[allowmerge]" value="1" $allowmerge_Y />開啟</li>
                        <li><input type="radio" name="config[allowmerge]" value="0" $allowmerge_N />關閉</li>
                    </ul>
                </td>
				<td class="td2"><div class="help_a">開啟後，群主可以合並群組</div></td>
			</tr>
			<tr class="tr1 vt">
				<td class="td1">群主轉讓群組</td>
				<td class="td2">
                	<ul class="list_A list_80">
                    	<li><input type="radio" name="config[allowattorn]" value="1" $allowattorn_Y />開啟</li>
                        <li><input type="radio" name="config[allowattorn]" value="0" $allowattorn_N />關閉</li>
                    </ul>
                </td>
				<td class="td2"><div class="help_a">開啟後，群主可以轉讓群組</div></td>
			</tr>
			<tr class="tr1 vt">
				<td class="td1">群主解散群組</td>
				<td class="td2">
                	<ul class="list_A list_80">
                    	<li><input type="radio" name="config[allowdisband]" value="1" $allowdisband_Y />開啟</li>
                        <li><input type="radio" name="config[allowdisband]" value="0" $allowdisband_N />關閉</li>
                    </ul>
                </td>
				<td class="td2"><div class="help_a">開啟後，群主可以結算群組</div></td>
			</tr>
			<tr class="tr1 vt">
				<td class="td1">群組風格主題</td>
				<td class="td2">
                	<ul class="list_A list_80">
                    	<li><input type="radio" name="config[allowstyle]" value="1" $allowstyle_Y />開啟</li>
                        <li><input type="radio" name="config[allowstyle]" value="0" $allowstyle_N />關閉</li>
                    </ul>
                </td>
				<td class="td2"><div class="help_a"></div></td>
			</tr>
		</table>
	</div>

	<h2 class="h1">話題管理功能</h2>
	<div class="admin_table mb10">
		<table width="100%" cellspacing="0" cellpadding="0">
			<tr class="tr1 vt">
				<td class="td1">刪除</td>
				<td class="td2">
                	<ul class="list_A list_80">
                    	<li><input type="radio" name="config[topicadmin][del]" value="1" $ta_del_Y />開啟</li>
                        <li><input type="radio" name="config[topicadmin][del]" value="0" $ta_del_N />關閉</li>
                    </ul>
                 </td>
				 <td class="td2"><div class="help_a">開啟後，群主可以刪除話題</div></td>
			</tr>
			<tr class="tr1 vt">
				<td class="td1">加亮</td>
				<td class="td2">
                	<ul class="list_A list_80">
                    	<li><input type="radio" name="config[topicadmin][highlight]" value="1" $ta_highlight_Y />開啟</li>
                        <li><input type="radio" name="config[topicadmin][highlight]" value="0" $ta_highlight_N />關閉</li>
                    </ul>
                </td>
				<td class="td2"><div class="help_a">開啟後，群主可以加亮話題</div></td>
			</tr>
			<tr class="tr1 vt">
				<td class="td1">鎖帖</td>
				<td class="td2">
                	<ul class="list_A list_80">
                    	<li><input type="radio" name="config[topicadmin][lock]" value="1" $ta_lock_Y />開啟</li>
                        <li><input type="radio" name="config[topicadmin][lock]" value="0" $ta_lock_N />關閉</li>
                    </ul>
                </td>
				<td class="td2"><div class="help_a">開啟後，群主可以鎖定話題</div></td>
			</tr>
			<tr class="tr1 vt">
				<td class="td1">提前</td>
				<td class="td2">
                	<ul class="list_A list_80">
                    	<li><input type="radio" name="config[topicadmin][pushtopic]" value="1" $ta_pushtopic_Y />開啟</li>
                        <li><input type="radio" name="config[topicadmin][pushtopic]" value="0" $ta_pushtopic_N />關閉</li>
                    </ul>
                </td>
				<td class="td2"><div class="help_a">開啟後，群主可以將話題提前</div></td>
			</tr>
			<tr class="tr1 vt">
				<td class="td1">壓帖</td>
				<td class="td2">
                	<ul class="list_A list_80">
                    	<li><input type="radio" name="config[topicadmin][downtopic]" value="1" $ta_downtopic_Y />開啟</li>
                        <li><input type="radio" name="config[topicadmin][downtopic]" value="0" $ta_downtopic_N />關閉</li>
                    </ul>
                </td>
				<td class="td2"><div class="help_a">開啟後，群主可以將話題壓帖</div></td>
			</tr>
			<tr class="tr1 vt">
				<td class="td1">置頂</td>
				<td class="td2">
                	<ul class="list_A list_80">
                    	<li><input type="radio" name="config[topicadmin][toptopic]" value="1" $ta_toptopic_Y />開啟</li>
                        <li><input type="radio" name="config[topicadmin][toptopic]" value="0" $ta_toptopic_N />關閉</li>
                    </ul>
                </td>
				<td class="td2"><div class="help_a">開啟後，群主可以置頂話題</div></td>
			</tr>
			<tr class="tr1 vt">
				<td class="td1">精華</td>
				<td class="td2">
                	<ul class="list_A list_80">
                    	<li><input type="radio" name="config[topicadmin][digest]" value="1" $ta_digest_Y />開啟</li>
                        <li><input type="radio" name="config[topicadmin][digest]" value="0" $ta_digest_N />關閉</li>
                    </ul>
                </td>
				<td class="td2"><div class="help_a">開啟後，群主可以將話題設置為精華</div></td>
			</tr>
		</table>
	</div>

	<h2 class="h1">設置功能模塊</h2>
	<div class="admin_table mb10">
		<table width="100%" cellspacing="0" cellpadding="0">
			<tr class="tr2">
				<td class="td2">開啟</td>
				<td class="td2">順序</td>
				<td class="td2">別名</td>
				<td class="td2">功能名稱</td>
			</tr>
			<tr class="tr1 vt">
				<td class="td2"><input type="checkbox" name="config[modeset][thread][ifopen]" value="1" $modesetThreadOpen /></td>
				<td class="td2"><input type="text" name="config[modeset][thread][vieworder]" value="{$modeset['thread']['vieworder']}" class="input" size="5" /></td>
				<td class="td2"><input type="text" name="config[modeset][thread][title]" value="{$modeset['thread']['title']}" class="input" /></td>
				<td class="td2">話題</td>
			</tr>
			<tr class="tr1 vt">
				<td class="td2"><input type="checkbox" name="config[modeset][write][ifopen]" value="1" $modesetWriteOpen /></td>
				<td class="td2"><input type="text" name="config[modeset][write][vieworder]" value="{$modeset['write']['vieworder']}" class="input" size="5" /></td>
				<td class="td2"><input type="text" name="config[modeset][write][title]" value="{$modeset['write']['title']}" class="input" /></td>
				<td class="td2">新鮮事</td>
			</tr>
			<tr class="tr1 vt">
				<td class="td2"><input type="checkbox" name="config[modeset][active][ifopen]" value="1" $modesetActiveOpen /></td>
				<td class="td2"><input type="text" name="config[modeset][active][vieworder]" value="{$modeset['active']['vieworder']}" class="input" size="5" /></td>
				<td class="td2"><input type="text" name="config[modeset][active][title]" value="{$modeset['active']['title']}" class="input" /></td>
				<td class="td2">活動</td>
			</tr>
			<tr class="tr1 vt">
				<td class="td2"><input type="checkbox" name="config[modeset][galbum][ifopen]" value="1" $modesetGalbumOpen /></td>
				<td class="td2"><input type="text" name="config[modeset][galbum][vieworder]" value="{$modeset['galbum']['vieworder']}" class="input" size="5" /></td>
				<td class="td2"><input type="text" name="config[modeset][galbum][title]" value="{$modeset['galbum']['title']}" class="input" /></td>
				<td class="td2">相冊</td>
			</tr>
			<tr class="tr1 vt">
				<td class="td2"><input type="hidden" name="config[modeset][member][ifopen]" value="1" /></td>
				<td class="td2"><input type="text" name="config[modeset][member][vieworder]" value="{$modeset['member']['vieworder']}" class="input" size="5" /></td>
				<td class="td2"><input type="text" name="config[modeset][member][title]" value="{$modeset['member']['title']}" class="input" /></td>
				<td class="td2">成員</td>
			</tr>
		</table>
	</div>

	<h2 class="h1">群首頁模塊布局</h2>
	<div class="admin_table mb10">
		<table width="100%" cellspacing="0" cellpadding="0">
			<tr class="tr2">
				<td class="td2">顯示</td>
				<td class="td2">順序</td>
				<td class="td2">顯示數量</td>
				<td class="td2">功能名稱</td>
			</tr>
			<tr class="tr1 vt">
				<td class="td2"><input type="checkbox" name="config[layout][thread][ifopen]" value="1" $layoutThreadOpen /></td>
				<td class="td2"><input type="text" name="config[layout][thread][vieworder]" value="{$layout['thread']['vieworder']}" class="input" size="5" /></td>
				<td class="td2"><select name="config[layout][thread][num]"><option value="5"{$layoutThreadNum_5}>5</option><option value="10"{$layoutThreadNum_10}>10</option><option value="15"{$layoutThreadNum_15}>15</option><option value="20"{$layoutThreadNum_20}>20</option><option value="30"{$layoutThreadNum_30}>30</option></select></td>
				<td class="td2">話題</td>
			</tr>
			<tr class="tr1 vt">
				<td class="td2"><input type="checkbox" name="config[layout][write][ifopen]" value="1" $layoutWriteOpen /></td>
				<td class="td2"><input type="text" name="config[layout][write][vieworder]" value="{$layout['write']['vieworder']}" class="input" size="5" /></td>
				<td class="td2"><select name="config[layout][write][num]"><option value="5"{$layoutWriteNum_5}>5</option><option value="10"{$layoutWriteNum_10}>10</option><option value="15"{$layoutWriteNum_15}>15</option><option value="20"{$layoutWriteNum_20}>20</option><option value="30"{$layoutWriteNum_30}>30</option></select></td>
				<td class="td2">新鮮事</td>
			</tr>
			<tr class="tr1 vt">
				<td class="td2"><input type="checkbox" name="config[layout][active][ifopen]" value="1" $layoutActiveOpen /></td>
				<td class="td2"><input type="text" name="config[layout][active][vieworder]" value="{$layout['active']['vieworder']}" class="input" size="5" /></td>
				<td class="td2"><select name="config[layout][active][num]"><option value="4"{$layoutActiveNum_4}>4</option><option value="8"{$layoutActiveNum_8}>8</option><option value="12"{$layoutActiveNum_12}>12</option><option value="16"{$layoutActiveNum_16}>16</option><option value="20"{$layoutActiveNum_20}>20</option></select></td>
				<td class="td2">活動</td>
			</tr>
			<tr class="tr1 vt">
				<td class="td2"><input type="checkbox" name="config[layout][galbum][ifopen]" value="1" $layoutGalbumOpen /></td>
				<td class="td2"><input type="text" name="config[layout][galbum][vieworder]" value="{$layout['galbum']['vieworder']}" class="input" size="5" /></td>
				<td class="td2"><select name="config[layout][galbum][num]"><option value="5"{$layoutGalbumNum_5}>5</option><option value="10"{$layoutGalbumNum_10}>10</option><option value="15"{$layoutGalbumNum_15}>15</option><option value="20"{$layoutGalbumNum_20}>20</option><option value="25"{$layoutGalbumNum_25}>25</option></select></td>
				<td class="td2">相冊照片</td>
			</tr>
		</table>
	</div>
	<div class="mb10 tac">
		<span class="btn"><span><button type="submit">提 交</button></span></span>
	</div>
</form>
<!--
EOT;
} elseif ($job == 'upgrade') {print <<<EOT
-->
<div class="nav4 mb10">
    <ul class="cc">
        <li class="current"><a href="$basename&action=level&job=upgrade">群組等級提升方案</a></li>
        <li><a href="$basename&action=level">群組等級</a></li>
        <li><a href="$basename&action=level&job=sort">群組等級統計</a></li>
    </ul>
</div>
<form action="$basename&action=level&" method="post">
	<input type="hidden" name="job" value="upgrade" />
	<input type="hidden" name="step" value="3" />
	<h2 class="h1">積分方案</h2>
	<div class="admin_table mb10">
		<table width="100%" cellspacing="0" cellpadding="0">
			<tr class="tr2">
				<td class="td1">積分因素</td>
				<td class="td2">系數</td>
			</tr>
			<tbody id ="group_creditset">
			<tr class="tr1 vt">
				<td class="td1">主題數</td>
				<td class="td2"><input type="text" class="input" name="upgrade[tnum]" value="{$o_groups_upgrade['tnum']}" onchange="calculateCredit()" /></td>
			</tr>
			<tr class="tr1 vt">
				<td class="td1">回復數</td>
				<td class="td2"><input type="text" class="input" name="upgrade[pnum]" value="{$o_groups_upgrade['pnum']}" onchange="calculateCredit()" /></td>
			</tr>
			<tr class="tr1 vt">
				<td class="td1">成員數</td>
				<td class="td2"><input type="text" class="input" name="upgrade[members]" value="{$o_groups_upgrade['members']}" onchange="calculateCredit()" /></td>
			</tr>
			<tr class="tr1 vt">
				<td class="td1">相冊數</td>
				<td class="td2"><input type="text" class="input" name="upgrade[albumnum]"  value="{$o_groups_upgrade['albumnum']}" onchange="calculateCredit()" /></td>
			</tr>
			<tr class="tr1 vt">
				<td class="td1">圖片數</td>
				<td class="td2"><input type="text" class="input" name="upgrade[photonum]" value="{$o_groups_upgrade['photonum']}" onchange="calculateCredit()" /></td>
			</tr>
			<tr class="tr1 vt">
				<td class="td1">新鮮事數</td>
				<td class="td2"><input type="text" class="input" name="upgrade[writenum]" value="{$o_groups_upgrade['writenum']}" onchange="calculateCredit()" /></td>
			</tr>
			<tr class="tr1 vt">
				<td class="td1">活動數</td>
				<td class="td2"><input type="text" class="input" name="upgrade[activitynum]" value="{$o_groups_upgrade['activitynum']}" onchange="calculateCredit()" /></td>
			</tr>
			</tbody>

		</table>
		<table width="100%" cellspacing="0" cellpadding="0">
			<tr class="tr1 vt">
				<td class="td2 s3" colspan="2">群組綜合積分 = <span id="show_creditset"></span></td>
			</tr>
		</table>
	</div>
	<div class="mb10 tac">
		<span class="btn"><span><button type="submit">提 交</button></span></span>
	</div>
</form>
<script type="text/javascript">
function mathRound(v,e) {
	var t=1;
	for (;e>0;t*=10,e--);
	for (;e<0;t/=10,e++);
	return Math.round(v*t)/t;
}
function calculateCredit() {
	var trs = getObj('group_creditset').getElementsByTagName('tr');
	var html = '';
	for (var i = 0; i < trs.length; i++) {
		var v = mathRound(trs[i].getElementsByTagName('input')[0].value, 2);
		if (v != 0) {
			html += (html ? ' + ' : '') + trs[i].getElementsByTagName('td')[0].innerHTML + '*' + v;
		}
	}
	getObj('show_creditset').innerHTML = html;
}
calculateCredit();
</script>
<!--
EOT;
} elseif ($job == 'sort') {print <<<EOT
-->
<div class="nav4 mb10">
    <ul class="cc">
        <li><a href="$basename&action=level&job=upgrade">群組等級提升方案</a></li>
        <li><a href="$basename&action=level">群組等級</a></li>
        <li class="current"><a href="$basename&action=level&job=sort">群組等級統計</a></li>
	</ul>
</div>
<h2 class="h1">等級統計</h2>
<div class="admin_table mb10">
	<table width="100%" cellspacing="0" cellpadding="0">
<!--
EOT;
foreach ($o_groups_level as $key => $value) {
$num = isset($o_groups_levelneed[$key]) ? $commomGroup[$key] : $specialGroup[$key];
$num || $num = 0;
print <<<EOT
-->
		<tr class="tr1 vt">
			<td class="td2" width="200">$value</td>
			<td class="td2" width="80"><a href="$basename&action=colony&level=$key">$num(個)</a></td>
			<td class="td2"><a href="$basename&action=colony&level=$key">查看</a></td>
		</tr>
<!--
EOT;
}print <<<EOT
-->
	</table>
</div>
<!--
EOT;
}} elseif ($action == 'colonystyle') {print <<<EOT
-->
<div class="nav3 mb10">
	<ul class="cc">
		<li><a href="$basename">基本設置</a></li>
		<li><a href="$basename&action=style">群組分類</a></li>
		<li><a href="$basename&action=class">關聯版塊</a></li>
		<li><a href="$basename&action=colony">群組管理</a></li>
		<li><a href="$basename&action=mergecolony">合並群組</a></li>
		<li><a href="$basename&action=level" >群組等級</a></li>
		<li class="current"><a href="$basename&action=colonystyle">群組風格</a></li>
		<li><a href="$basename&action=cache">更新緩存</a></li>
		<li><a href="$admin_file?adminjob=apps&admintype=groups_manage" onclick="openNewUrl('groups_manage','群組管理',this.href);return false;">內容管理</a></li>
	</ul>
</div>

<form action="$basename&action=colonystyle" method='post'>
<input type="hidden" name="step" value="2">
<div class="admin_info mb10">
	<h3 class="h1">群組風格說明</h3>
	<div class="legend">
		<ul>
			<li>添加風格:請上傳你的群組風格文件夾至目錄images/g/下</li>
			<li>啟用風格:在相應的風格下添加群組風格的自定義名稱，點擊提交即可啟用</li>
		</ul>
	</div>
</div>
<h2 class="h1">群組風格設置</h2>
<div class="admin_table mb10">
	<table width="100%" cellspacing="0" cellpadding="0">
		<tr class="tr1">
			<td class="td1"><span class="xia2">風格目錄名</span></td>
			<td class="td2">風格自定義名稱</td>
		</tr>
<!--
EOT;
foreach ($array as $kk => $vv) {print <<<EOT
-->
		<tr class="tr3">
			<td class="td1"><span class="xia2">{$vv}</span></td>
			<td class="td2">
				<input type="hidden" name="name[]" value="{$vv}" />
				<input name="style_name[]" class="input input_wa" value="{$names[$vv]}" />
			</td>
		</tr>
<!--
EOT;
}print <<<EOT
-->
	</table>
</div>
<div class="mb10 tac">
	<span class="btn"><span><button type="submit">提 交</button></span></span>
</div>
</form>
<!--
EOT;
} elseif ($action == 'cache'){print <<<EOT
-->
<div class="nav3 mb10">
<ul class="cc">
	<li><a href="$basename">基本設置</a></li>
	<li><a href="$basename&action=style">群組分類</a></li>
	<li><a href="$basename&action=class">關聯版塊</a></li>
	<li><a href="$basename&action=colony">群組管理</a></li>
	<li><a href="$basename&action=mergecolony">合並群組</a></li>
	<li><a href="$basename&action=level">群組等級</a></li>
	<li><a href="$basename&action=colonystyle">群組風格</a></li>
	<li class="current"><a href="$basename&action=cache">更新緩存</a></li>
	<li><a href="$admin_file?adminjob=apps&admintype=groups_manage" onclick="openNewUrl('groups_manage','群組管理',this.href);return false;">內容管理</a></li>
</ul>
</div>
  <h2 class="h1">緩存更新</h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <form action="$basename&" method="post">
    	<input type="hidden" name="action" value="setting">
    	<input type="hidden" name="step" value="updatecache">
      <tr class="tr1 vt">
        <td class="td1">更新分類管理</td>
        <td class="td2"><span class="bt2"><span><button type="submit" value="提 交">提 交</button></span></span></td>
		 <td class="td2"><div class="help_a">  </div></td>
      </tr>
    </form>
    <form action="$basename&" method="post">
      <input type="hidden" name="action" value="cache">
      <input type="hidden" name="step" value="updatecache">
      <tr class="tr1 vt">
        <td class="td1">更新群組分類統計數</td>
        <td class="td2"><span class="bt2"><span><button type="submit" value="提 交">提 交</button></span></span></td>
		 <td class="td2"><div class="help_a">當群組分類統計不準確時，可用此功能重新統計</div></td>
      </tr>
    </form>
     <form action="$basename&" method="post">
      <input type="hidden" name="action" value="thread">
      <input type="hidden" name="step" value="updatecache">
      <tr class="tr1 vt">
        <td class="td1">更新群組話題統計數</td>
        <td class="td2">
        <input type="text" onclick="this.value=''" value="請輸入群組ID" name="cyid" class="input input_wa" id="cyid">
        <span class="bt2"><span>
        <button type="submit" value="提 交">提 交</button></span></span></td>
		 <td class="td2"><div class="help_a">當群組話題數統計不準確時，可用此功能重新統計</div></td>
      </tr>
    </form>
    <!--<form action="$basename&" method="post" onsubmit="if(confirm('此功能將刪除沒有進行分類的群組，刪除後不能再恢復。若只是修改群組分類，請到“群組管理”處修改分類。 請確定是否清除？')){ return true;} else {return false;}">
    --> <!--input type="hidden" name="action" value="cache">
      <!--input type="hidden" name="step" value="delcolony">
     <!--  <tr class="tr1 vt">
        <td class="td1">清除沒有分類的群組</td>
        <td class="td2"><span class="bt2"><span><button type="submit" value="提 交">提 交</button></span></span></td>
		 <td class="td2"><div class="help_a">此功能將刪除沒有進行分類的群組，刪除後不能再恢復!若只是修改群組分類，請到<a href="$basename&action=colony" class="xia">群組管理</a> 處修改分類 </div></td>
      </tr> -->
      </table>
  </div>
<!--
EOT;
}elseif($action == 'argument'){print <<<EOT
-->
<div class="nav3 mb10">
	<ul class="cc">
		<li class="current"><a href="$basename&action=argument">帖子管理</a></li>
		<li><a href="$basename&action=album">相冊管理</a></li>
		<li><a href="$basename&action=photos">照片管理</a></li>
		<li><a href="$basename&action=write">新鮮事管理</a></li>
		<li><a href="$basename&action=active">群活動管理</a></li>
	</ul>
</div>

<script type="text/javascript" src="js/date.js"></script>
<form action="$basename&action=argument" method="post" name="FORM">
  <h2 class="h1">帖子搜索</h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr1 vt">
      <td class="td1">關鍵字</td>
      <td class="td2"><input name="keyword" class="input input_wa mr20 fl" value="$keyword">
        $keywordTypeSelection
        <ul class="cc list_80 fl list_A">
          <li><input type="checkbox" name="ckkeyword" value="1" $ckkeywordChecked>精確匹配</li>
        </ul>
      </td>
      <td class="td2"><!--關鍵字: (可使用通配符 "*")--></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">類型</td>
      <td class="td2">$searchTypeSelection
        <span id="table_1" style="display:none;">$threadTableSelection</span>
        <span id="table_2" style="display:none;">$postTableSelection</span>
      </td>
      <td class="td2"><!--類型:--></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">用戶名</td>
      <td class="td2"><input name="author" class="input input_wa mr20 fl" value="$author">
     		<ul class="cc list_80 fl list_A">
                <li><input type="checkbox" name="ckauthor" value="1" $ckauthorChecked />精確匹配</li>
            </ul>
        </td>
        <td class="td2"><!--作 者: (可使用通配符 "*")--></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">關聯版塊 </td>
      <td class="td2">
        $colonySelection
      </td>
      <td class="td2"><!--群組分類:--></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">群組名稱</td>
      <td class="td2"><input type="text" name="cname" value="$cname"  class="input input_wa"></td>
      <td class="td2"><!--群組名稱: (可使用通配符 "*")--></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">發表日期</td>
      <td class="td2">
      <div class="input_img fl"><i onclick="this.nextSibling.onclick()" class="input_time" title="選擇時間">選擇時間</i><input type="text" name="postdate_s" value="$postdateStartString" id="postdate_s" onclick="javascript:ShowCalendar(this.id)"></div><span class="p_lr_10 fl">至</span><div class="input_img fl"><i class="input_time" onclick="javascript:ShowCalendar('postdate_e')"  title="選擇時間">選擇時間</i> <input type="text" name="postdate_e" id="postdate_e" value="$postdateEndString" onclick="javascript:ShowCalendar(this.id)"></div>
       </td>
        <td class="td2"><!--發表日期: (格式 yyyy-mm-dd)--></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">排序</td>
      <td class="td2">$orderTypeSelection
        <ul class="cc list_80 fl list_A">
            <li><input type="radio" name="sc" value="ASC" $ascChecked />正序</li>
            <li><input type="radio" name="sc" value="DESC" $descChecked />倒序</li>
         </ul>
        </td>
        <td class="td2"><!--排序:--></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">每頁顯示條數 </td>
      <td class="td2"><input name="perpage" class="input input_wa" value="$perpage"></td>
      <td class="td2"><!--每頁顯示條數--></td>
    </tr>
  </table>
  </div>
  <div class="mb10 tac">
    <span class="btn"><span><button type="submit">提 交</button></span></span>
  </div>
</form>
<script type="text/javascript">
function seltable(v) {
	getObj('table_1').style.display = (v == 1) ? '' : 'none';
	getObj('table_2').style.display = (v == 2) ? '' : 'none';
}
seltable(document.FORM.ttype.value);
</script>
<form action="$basename&action=argument" method="post" name="FORM1">
  <input type="hidden" name="step" value="delete" />
  <input type="hidden" name="ttype" value="$ttype" />
  <input type="hidden" name="ttable" value="$ttable" />
  <input type="hidden" name="ptable" value="$ptable" />
  <h2 class="h1">文章列表</h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr2 vt td_bgB">
      <td width="30"><span onclick="CheckAll(document.FORM1)" class="cp">全選</span></td>
      <td>標 題</td>
      <td>作 者</td>
      <td>所屬群組</td>
      <td>發表日期</td>
      <td>類型</td>
    </tr>
<!--
EOT;
if (empty($argumentdb)) {print <<<EOT
-->
<tr><td class="p10" colspan="6"><div class="admin_tips">啊哦，沒有你要的信息！</div></td></tr>
<!--
EOT;
}else{
foreach($argumentdb as $value){
$j_lang = isset($value['pid']) ? '回復' : '主題';
print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td2"><input type="checkbox" name="delid[]" value="$value[delid]"></td>
      <td class="td2"><a href="apps.php?q=group&cyid=$value[cyid]&a=read&tid=$value[tid]" target="_blank">$value[subject]</a></td>
      <td class="td2"><a href="{$db_userurl}$value[authorid]" target="_blank">$value[author]</a></td>
      <td class="td2"><a href="apps.php?q=group&cyid=$value[cyid]" target="_blank">$value[cname]</a></td>
      <td class="td2">$value[postdate]</td>
      <td class="td2">$j_lang</td>
    </tr>
<!--
EOT;
}}print <<<EOT
-->
  </table>
  </div>
  <div class="cc">$pages</div>
  <div class="mb10 tac">
	<span class="bt"><span><button type="button" onclick="CheckAll(document.FORM1)">全 選</button></span></span>
    <span class="btn"><span><button type="submit" >刪除</button></span></span>
   </div>
</form>

<!--
EOT;
} elseif ($action == 'album') {print <<<EOT
-->
<div class="nav3 mb10">
    <ul class="cc">
      <li><a href="$basename&action=argument">帖子管理</a></li>
      <li class="current"><a href="$basename&action=album">相冊管理</a></li>
      <li><a href="$basename&action=photos">照片管理</a></li>
	  <li><a href="$basename&action=write">新鮮事管理</a></li>
	  <li><a href="$basename&action=active">群活動管理</a></li>
    </ul>
</div>
<!--
EOT;
if ($job == 'edit'){print <<<EOT
-->
<form action="$basename&action=album&job=edit" method="post">
  <input type="hidden" name="step" value="2">
  <input type="hidden" name="aid" value="$aid">
  <input type="hidden" name="url_cname" value="$cname">
  <input type="hidden" name="url_aname" value="$aname">
  <input type="hidden" name="url_owner" value="$owner">
  <input type="hidden" name="url_cid" value="$cid">
  <input type="hidden" name="url_crtime_s" value="$crtime_s">
  <input type="hidden" name="url_crtime_e" value="$crtime_e">
  <input type="hidden" name="url_lasttime_s" value="$lasttime_s">
  <input type="hidden" name="url_lasttime_e" value="$lasttime_e">
  <input type="hidden" name="url_private" value="$private">
  <input type="hidden" name="url_lines" value="$lines">
  <input type="hidden" name="url_orderway" value="$orderway">
  <input type="hidden" name="url_ordertype" value="$ordertype">
  <input type="hidden" name="url_page" value="$page">
  <h2 class="h1">相冊編輯</h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr1 vt">
      <td class="td1">相冊名稱</td>
      <td class="td2"><input class="input input_wa" name="aname" value="$album[aname]" ></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">相冊描述</td>
      <td class="td2"><textarea name="aintro" cols="30"  class="textarea">$album[aintro]</textarea></td>
    </tr>
    <tr class="tr1 vt">
        <td class="td1">可見度</td>
        <td class="td2">
        <select name="private" class="select_wa">
        <option value="0" $private_0>全站可見</option>
        <option value="1" $private_1>僅成員可見</option></select>
        </td>
    </tr>
  </table>
  </div>
  <div class="mb10 tac">
    <span class="btn"><span><button type="submit" name="chkall" onclick="CheckAll(this.form)">提 交</button></span></span>
    <span class="bt"><span><button type="button" onclick="javascript:history.go(-1);">返 回</button></span></span>
   </div>
</form>
<!--
EOT;
}else{print <<<EOT
-->
<script type="text/javascript" src="js/date.js"></script>
<form action="$basename&action=album&" method="post">
  <h2 class="h1">相冊搜索</h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr1 vt">
      <td class="td1">相冊名稱</td>
      <td class="td2"><input type="text" name="aname" value="$aname" class="input input_wa"></td>
      <td class="td2"><!--相冊名稱（可使用通配符“*”）--></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">關聯版塊</td>
      <td class="td2">$colonySelection</td>
      <td class="td2">&nbsp;</td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">群組名稱</td>
      <td class="td2">
        <input type="text" name="cname" value="$cname" class="input input_wa">
      </td>
      <td class="td2"><!--群組名稱（可使用通配符“*”）--></td>
    </tr>

    <tbody id="advanceSearchBody" style="display:$searchDisplay;">
    <tr class="tr1 vt">
      <td class="td1">創建時間</td>
      <td class="td2">
      <div class="input_img fl"><i onclick="this.nextSibling.onclick()" class="input_time" title="選擇時間">選擇時間</i><input type="text" name="crtime_s" value="$crtimeStartString" id="crtime_s" onclick="javascript:ShowCalendar(this.id)"></div><span class="p_lr_10 fl">至</span><div class="input_img fl"><i class="input_time" onclick="javascript:ShowCalendar('crtime_e')" title="選擇時間">選擇時間</i><input type="text" name="crtime_e" id="crtime_e" value="$crtimeEndString" onclick="javascript:ShowCalendar(this.id)"></div>
        </td>
        <td class="td2">&nbsp;</td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">最後更新日期</td>
      <td class="td2">
      <div class="input_img fl"><i onclick="this.nextSibling.onclick()" class="input_time" title="選擇時間">選擇時間</i><input type="text" name="lasttime_s" id="lasttime_s" value="$lasttimeStartString" onclick="javascript:ShowCalendar(this.id)"></div><span class="p_lr_10 fl">至</span><div class="input_img fl"><i class="input_time" onclick="javascript:ShowCalendar('lasttime_e')"  title="選擇時間">選擇時間</i><input type="text" name="lasttime_e" id="lasttime_e" value="$lasttimeEndString" onclick="javascript:ShowCalendar(this.id)"></div>
        </td>
        <td class="td2">&nbsp;</td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">可見度</td>
      <td class="td2">$privateSelection</td>
        <td class="td2">&nbsp;</td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">排序</td>
      <td class="td2">$orderwaySelection
          <ul class="cc list_80 fl list_A">
             <li><input type="radio" name="ordertype" value="asc" $ascChecked>正序</li>
             <li><input type="radio" name="ordertype" value="desc" $descChecked>倒序</li>
           </ul>
        </td>
        <td class="td2">&nbsp;</td>
    </tr>
    </tbody>

    <tr class="tr1 vt">
      <td class="td1">每頁顯示個數</td>
      <td class="td2"><input type="text" name="lines" value="$lines" class="input input_wa"></td>
      <td class="td2">&nbsp;</td>
    </tr>
  </table>
  </div>
  <div class="mb10 tac">
    <span class="mr10"><span class="btn"><span><button type="submit">提 交</button></span></span></span>
    <a href="javascript:;" id="advanceSearchButton">高級搜索<input type="hidden" id="searchDisplay" name="searchDisplay" value="$searchDisplay"></a>
   </div>
</form>
<script type="text/javascript">
getObj('advanceSearchButton').onclick = function() {
	displayElementConflict('advanceSearchBody','advanceSearchButton');
	if(getObj('searchDisplay')){
		getObj('searchDisplay').value = getObj('advanceSearchBody').style.display;
	}
};
function displayElementConflict(elementId,buttonId,isDisplay) {
	if (undefined == isDisplay && typeof buttonId === 'string') {
		getObj(elementId).style.display = getObj(elementId).style.display == 'none' ? '' : 'none';
		getObj(buttonId).innerHTML = getObj(elementId).style.display == ''? '簡單搜索' : '高級搜索';
	} else {
		getObj(elementId).style.display = isDisplay ? '' : 'none';
	}
}
</script>

<form action="$basename&action=album&" method="post" name="FORM">
  <input type="hidden" name="job" value="delete">
  <input type="hidden" name="cname" value="$cname">
  <input type="hidden" name="aname" value="$aname">
  <input type="hidden" name="owner" value="$owner">
  <input type="hidden" name="cid" value="$cid">
  <input type="hidden" name="crtime_s" value="$crtime_s">
  <input type="hidden" name="crtime_e" value="$crtime_e">
  <input type="hidden" name="lasttime_s" value="$lasttime_s">
  <input type="hidden" name="lasttime_e" value="$lasttime_e">
  <input type="hidden" name="private" value="$private">
  <input type="hidden" name="lines" value="$lines">
  <input type="hidden" name="orderway" value="$orderway">
  <input type="hidden" name="ordertype" value="$ordertype">
  <input type="hidden" name="page" value="$page">
  <h2 class="h1">相冊列表</h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr2">
      <td width="30"><span onclick="CheckAll(document.FORM)" class="cp">全選</span></td>
      <td>相冊名</td>
      <td>所屬群組</td>
      <td>創始人</td>
      <td width="90">創建時間</td>
      <td width="90">最後更新時間</td>
      <td width="60">可見度</td>
      <td width="36">照片數</td>
      <td width="90">操作</td>
    </tr>
<!--
EOT;
if (empty($albumdb)) {print <<<EOT
-->
<tr><td class="p10" colspan="9"><div class="admin_tips">啊哦，沒有你要的信息！</div></td></tr>
<!--
EOT;
}else{
foreach ($albumdb as $key => $album) {
if(!$album['aname'])continue;
print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td2"><input type="checkbox" name="selid[]" value="$album[aid]"></td>
      <td class="td2"><a href="apps.php?q=galbum&a=album&cyid=$album[ownerid]&aid=$album[aid]" target="_blank" title="$album[aname]">$album[s_aname]</a></td>
      <td class="td2"><p class="lh_18"><a href="apps.php?q=group&cyid=$album[ownerid]" target="_blank" title="$album[cname]">$album[cname]</a></p></td>
      <td class="td2"><a href="u.php?username=$album[admin]" target="_blank">$album[admin]</a></td>
      <td class="td2">$album[crtime]</td>
      <td class="td2">$album[lasttime]</td>
      <td class="td2">
<!--
EOT;
if ($album['private'] == 0) {print <<<EOT
-->
        全站可見
<!--
EOT;
}elseif($album['private'] == 1) {print <<<EOT
-->
        僅成員可見
<!--
EOT;
}print <<<EOT
-->
      </td>
      <td class="td2">$album[photonum]</td>
      <td class="td2"><a href="$basename&action=album&job=edit&aid=$album[aid]$urladd&page=$page" class="mr10">[編輯]</a>
      <a href="$basename&action=photos&job=list&aid=$album[aid]">[管理]</a></td>
    </tr>
<!--
EOT;
}}print <<<EOT
-->
  </table>
  </div>
  <div class="cc">$pages</div>
  <div class="mb10 tac">
	<span class="bt"><span><button type="button" onclick="CheckAll(document.FORM)">全 選</button></span></span>
    <span class="btn"><span><button type="submit" >刪除</button></span></span>
   </div>
</form>


<!--
EOT;
}}elseif($action == 'photos'){print<<<EOT
-->
<div class="nav3 mb10">
    <ul class="cc">
      <li><a href="$basename&action=argument">帖子管理</a></li>
      <li><a href="$basename&action=album">相冊管理</a></li>
      <li class="current"><a href="$basename&action=photos">照片管理</a></li>
	  <li><a href="$basename&action=write">新鮮事管理</a></li>
	  <li><a href="$basename&action=active">群活動管理</a></li>
    </ul>
</div>

<script type="text/javascript" src="js/date.js"></script>
<form action="$basename&action=photos&" method="post">
  <h2 class="h1">照片搜索</h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr1 vt">
      <td class="td1">關聯版塊</td>
      <td class="td2">$colonySelection</td>
      <td class="td2">&nbsp;</td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">群組名稱</td>
      <td class="td2"><input type="text" name="cname" value="$cname" class="input input_wa"></td>
      <td class="td2"><!--群組名稱（可使用通配符“*”）--></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">所屬相冊名稱</td>
      <td class="td2"><input type="text" name="aname" value="$aname" class="input input_wa"></td>
      <td class="td2"><!--所屬相冊名稱（可使用通配符“*”）--></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">用戶名</td>
      <td class="td2"><input type="text" name="uploader" value="$uploader" class="input input_wa"></td>
      <td class="td2"><!--作者名稱（可使用通配符“*”）--></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">描述</td>
      <td class="td2"><input type="text" name="pintro" value="$pintro" class="input input_wa"></td>
      <td class="td2"><!--描述（可使用通配符“*”）--></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">上傳日期</td>
      <td class="td2">
      	<div class="input_img fl"><i onclick="this.nextSibling.onclick()" class="input_time" title="選擇時間">選擇時間</i><input type="text" name="uptime_s" value="$uptimeStartString" id="uptime_s" onclick="javascript:ShowCalendar(this.id)"></div><span class="p_lr_10 fl">至</span><div class="input_img fl"><i class="input_time" onclick="javascript:ShowCalendar('uptime_e')"  title="選擇時間">選擇時間</i> <input type="text" name="uptime_e" id="uptime_e" value="$uptimeEndString" onclick="javascript:ShowCalendar(this.id)"></div>
       </td>
        <td class="td2"><!--上傳日期--></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">排序</td>
      <td class="td2">$orderwaySelection
        	<ul class="cc list_80 fl list_A">
                <li><input type="radio" name="ordertype" value="asc" $ascChecked />正序</li>
                <li><input type="radio" name="ordertype" value="desc" $descChecked />倒序</li>
            </ul>
        </td>
        <td class="td2">&nbsp;</td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">每頁顯示張數</td>
      <td class="td2"><input type="text" name="lines" value="$lines" class="input input_wa"></td>
      <td class="td2">&nbsp;</td>
    </tr>
  </table>
  </div>
  <div class="mb10 tac">
    <span class="btn">
		<span>
			<button type="submit">提 交</button>
		</span>
	</span>
   </div>
</form>

<style>
.admin_appimg li{float:left;width:150px;height:200px;line-height:18px;}
.admin_appimg li img{width:100px;height:100px;padding:5px;border:1px solid #ccc;background:#fff;margin-bottom:3px;}
</style>
<form action="$basename&action=photos&" method="post" name="FORM">
  <input type="hidden" name="job" value="delete">
  <input type="hidden" name="aid" value="$aid">
  <input type="hidden" name="cid" value="$cid">
  <input type="hidden" name="aname" value="$aname">
  <input type="hidden" name="cname" value="$cname">
  <input type="hidden" name="pintro" value="$pintro">
  <input type="hidden" name="uptime_s" value="$uptime_s">
  <input type="hidden" name="uptime_e" value="$uptime_e">
  <input type="hidden" name="orderway" value="$orderway">
  <input type="hidden" name="ordertype" value="$ordertype">
  <input type="hidden" name="lines" value="$lines">
  <input type="hidden" name="page" value="$page">
  <h2 class="h1 mb10">照片列表</h2>
  <div class="mb10">
<!--
EOT;
if (empty($cnpho)) {print <<<EOT
-->
<div class="admin_tips">啊哦，沒有你要的信息！</div>
<!--
EOT;
}else{print <<<EOT
-->
    <ul class="admin_appimg">
<!--
EOT;
foreach ($cnpho as $key => $photo) {print <<<EOT
-->
      <li> <a href="apps.php?q=galbum&a=view&pid=$photo[pid]&cyid=$photo[ownerid]" target="_blank"><img src="$photo[path]" border="0" width="100" height="100" title="$photo[aname]"/> </a>
        <p class="lh_18">所屬群組:<a href="apps.php?q=group&cyid=$photo[ownerid]" target="_blank" title="$photo[cname]">$photo[cname]</a></p>
        <p class="lh_18">所屬相冊:<a href="$basename&action=photos&job=list&aid=$photo[aid]" title="$photo[aname]">$photo[s_aname]</a></p>
        <!-- <p>
			<a href="$admin_file?adminjob=mode&admintype=o_comments&job=list&type=photo&typeid=$photo[pid]">照片評論（$photo[c_num]）</a></p> -->
        <p>選中
          <input type="checkbox" name="selid[]" value="$photo[pid]">
        </p>
      </li>
<!--
EOT;
}print <<<EOT
-->
    </ul>
<!--
EOT;
}print <<<EOT
-->
  </div>
  <div class="c"></div>
  <div class="cc">$pages</div>
  <div class="mb10 tac">
    <span class="bt"><span><button type="button" name="chkall" onclick="CheckAll(this.form)">全 選</button></span></span>
    <span class="btn"><span><button type="submit" >刪 除</button></span></span>
   </div>
</form>

<!--
EOT;
} elseif ($action=='style'){print <<<EOT
-->
<script type="text/javascript">
function addSubType(id) {
	var inputs = getObj('t_sub_mode').getElementsByTagName('input');
	inputs[0].name = "new_t_sub_view_db\["+id+"\]\[\]";
	inputs[1].name = "new_t_sub_db\["+id+"\]\[\]";
	var s = getObj('t_sub_mode').firstChild.cloneNode(true);
	getObj('t_sub_body_'+id).appendChild(s);
}
</script>
<div class="nav3 mb10">
	<ul class="cc">
		<li><a href="$basename">基本設置</a></li>
		<li class="current"><a href="$basename&action=style">群組分類</a></li>
		<li><a href="$basename&action=class">關聯版塊</a></li>
		<li><a href="$basename&action=colony">群組管理</a></li>
		<li><a href="$basename&action=mergecolony">合並群組</a></li>
		<li><a href="$basename&action=level">群組等級</a></li>
		<li><a href="$basename&action=colonystyle">群組風格</a></li>
		<li><a href="$basename&action=cache">更新緩存</a></li>
		<li><a href="$admin_file?adminjob=apps&admintype=groups_manage" onclick="openNewUrl('groups_manage','群組管理',this.href);return false;">內容管理</a></li>
	</ul>
</div>
<div class="c"></div>
<h2 class="h1">添加群組分類</h2>
<form action="$basename&" method="post">
<input type="hidden" name="action" value="style" />
<input type="hidden" name="job" value="addstyle" />
<div class="admin_table mb10">
	<table width="100%" cellspacing="0" cellpadding="0">
		<tr class="tr1 vt">
        	<td class="td1">分類名稱</td>
			<td class="td2">
				<input name="cname" class="input_wa input mr5" value="">
				<span class="bt2">
					<span><button value="提 交" type="submit">提 交</button></span>
				</span>
			</td>
		</tr>
	</table>
</div>
</form>
<form action="$basename&" method="post">
<input type="hidden" name="action" value="style" />
<input type="hidden" name="step" value="2" />
<h3 class="h1">群組分類</h3>
<div class="admin_table mb10">
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr2 vt td_bgB">
		<td width="30">開啟</td>
		<td>分類名稱</td>
		<td>群組個數</td>
    <td>刪除分類</td>
	</tr>
<!--
EOT;
foreach($firstGradeStyleIds as $id){
$ifcheck = $openStyles[$id] ? ' checked' : '';
print <<<EOT
-->
	<tr class="tr1 vt">
		<td class="td2"><input type="checkbox" name="selid[]" value="$id" {$ifcheck} /></td>
		<td class="td2"><input type="text" name="cname[$id]" value="{$allStyles[$id]['cname']}" class="input_wa input mr10" /><a href="javascript:;" onclick="addSubType({$id})">添加二級分類</a></td>
		<td class="td2">{$allStyles[$id]['csum']}</td>
        <td class="td2"><input type="checkbox" name="delid[]" value="$id" /></td>
	</tr>
<!--
EOT;
foreach($secondGradeStyles[$id] as $subId => $style){
$ifcheck2 = $openStyles[$subId] ? ' checked' : '';
print <<<EOT
-->
	<tr class="tr1 vt">
		<td class="td2"><input type="checkbox" name="selid[]" value="$style[id]" {$ifcheck2} /></td>
		<td class="td2"><i class="lower"></i><input type="text" size="1" name="vieworder[$style[id]]" value="$style[vieworder]" class="input mr10" />
		<input type="text" name="cname[$style[id]]" size="30" value="{$style['cname']}" class="input" /></td>
		<td class="td2">{$style['csum']}</td>
		<td class="td2"><input type="checkbox" name="delid[]" value="$style[id]" /></td>
    </tr>
<!--
EOT;
}print <<<EOT
-->
	<tr>
		<td colspan="4">
			<div id="t_sub_body_{$id}"></div>
		</td>
	</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
</div>
<div id="t_sub_mode" style="display:none"><div><table width="100%"><tr class="tr1 vt"><td class="td2" width="30">&nbsp;</td><td class="td2" colspan="4"><i class="lower"></i><input type="text" class="input mr10" size="1" name="new_t_sub_view_db"><input type="text" class="input" size="30" value="" name="new_t_sub_db" /></td></tr></table></div></div>
<div class="mb10 tac">
<span class="btn">
	<span>
		<button type="submit">提 交</button>
	</span>
</span>
</div>
</form>
<!--
EOT;
} elseif ($action =='write') {print <<<EOT
-->
<div class="nav3 mb10">
	<ul class="cc">
		<li><a href="$basename&action=argument" >帖子管理</a></li>
		<li><a href="$basename&action=album">相冊管理</a></li>
		<li><a href="$basename&action=photos">照片管理</a></li>
		<li class="current"><a href="$basename&action=write">新鮮事管理</a></li>
		<li><a href="$basename&action=active">群活動管理</a></li>
	</ul>
</div>

<script type="text/javascript" src="js/date.js"></script>
<form method="POST" action="$basename&action=write">
  <h2 class="h1">記錄搜索</h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr1 vt">
      <td class="td1">新鮮事內容</td>
      <td class="td2"><input type="text" name="content" value="$content" class="input input_wa"></td>
      <td class="td2" width="500">記錄內容（可使用通配符“*”）</td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">用戶名</td>
      <td class="td2"><input type="text" name="username" value="$username" class="input input_wa"></td>
      <td class="td2">作者名稱（可使用通配符“*”）</td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">關聯版塊 </td>
      <td class="td2">
        $colonySelection
      </td>
      <td class="td2"><!--群組分類:--></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">群組名稱</td>
      <td class="td2"><input type="text" name="cname" value="$cname"  class="input input_wa"></td>
      <td class="td2"><!--群組名稱: (可使用通配符 "*")--></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">發表日期</td>
      <td class="td2">
      	<div class="input_img fl"><i onclick="this.nextSibling.onclick()" class="input_time" title="選擇時間">選擇時間</i><input type="text" name="postdate_s" value="$postdateStartString" id="postdate_s" onclick="javascript:ShowCalendar(this.id)"></div><span class="p_lr_10 fl">至</span><div class="input_img fl"><i class="input_time" onclick="javascript:ShowCalendar('postdate_e')"  title="選擇時間">選擇時間</i><input type="text" name="postdate_e" id="postdate_e" value="$postdateEndString" onclick="javascript:ShowCalendar(this.id)"></div>
        </td>
        <td class="td2">&nbsp;</td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">順序</td>
      <td class="td2"><span class="cc  fl"></span>
     		 <ul class="cc list_80 list_A mr20 fl">
                	<li><input type="radio" name="ordertype" value="asc" $ascChecked>正序</li>
                    <li><input type="radio" name="ordertype" value="desc" $descChecked>倒序</li>
             </ul>發表時間
        </td>
        <td class="td2">&nbsp;</td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">每頁顯示條數</td>
      <td class="td2"><input type="text" name="lines" value="$lines" class="input input_wa"></td>
      <td class="td2">&nbsp;</td>
    </tr>
  </table>
  </div>
  <div class="mb10 tac">
    <span class="btn"><span><button type="submit">提 交</button></span></span>
   </div>
</form>

<form action="$basename&action=$action&" method="post" name="FORM">
<input type="hidden" name="job" value="del" />
<input type="hidden" name="step" value="3" />
<input type="hidden" name="urladd" value="$url_add" />
<h2 class='h1'>新鮮事列表</h2>
<div class="admin_table mb10">
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr2 vt td_bgB">
	  <td width="30"><span onclick="CheckAll(document.FORM)" class="cp">全選</span></td>
      <td>內容</td>
      <td>所屬群組</td>
      <td>作者</td>
      <td>發表時間</td>
      <td>來源</td>
      <td>評論數</td>
	</tr>
<!--
EOT;
if (empty($writedb)) {print <<<EOT
-->
<tr><td class="p10" colspan="6"><div class="admin_tips">啊哦，沒有你要的信息！</div></td></tr>
<!--
EOT;
}else{
$db_blogsource = array('web'=>'網頁','signature'=>'個性簽名','other'=>'其他');
foreach ($writedb as $key => $write) {
if(!$write['content'])continue;
print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td2"><input type="checkbox" name="selid[]" value="$write[id]"></td>
      <td class="td2">$write[s_content]</td>
      <td class="td2"><a href="apps.php?q=group&cyid=$write[cyid]" target="_blank">$write[cname]</a></td>
      <td class="td2"><a href="{$db_userurl}$write[uid]" target="_blank">$write[username]</a></td>
      <td class="td2">$write[postdate]</td>
      <td class="td2">群組</td>
      <td class="td2">
<!--
EOT;
if ($write['c_num'] > 0) {print <<<EOT
-->
        <a href="$admin_file?adminjob=mode&admintype=o_comments&job=list&type=write&typeid=$write[id]">$write[c_num]</a>
<!--
EOT;
} else {print <<<EOT
-->
        0
<!--
EOT;
}print <<<EOT
-->
      </td>
    </tr>
<!--
EOT;
}}print<<<EOT
-->
  </table>
  </div>
<div class="cc">$pages</div>
<div class="mb10 tac">
	<span class="bt"><span><button type="button" onclick="CheckAll(document.FORM)">全 選</button></span></span>
	<span class="btn"><span><button type="submit" >刪除</button></span></span>
</div>
</form>

<!--
EOT;
} elseif ($action =='active') {print <<<EOT
-->
<div class="nav3 mb10">
<ul class="cc">
	<li><a href="$basename&action=argument" >帖子管理</a></li>
	<li><a href="$basename&action=album">相冊管理</a></li>
	<li><a href="$basename&action=photos">照片管理</a></li>
	<li><a href="$basename&action=write">新鮮事管理</a></li>
	<li class="current"><a href="$basename&action=active">群活動管理</a></li>
</ul>
</div>

<script type="text/javascript" src="js/date.js"></script>
<form method="post" action="{$basename}&action=$action">
<h2 class="h1">活動搜索</h2>
<div class="admin_table mb10">
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr1 vt">
		<td class="td1">活動名稱</td>
		<td class="td2"><input type="text" name="title" value="$title" class="input input_wa" /></td>
	</tr>
	<tr class="tr1 vt">
		<td class="td1">活動狀態</td>
		<td class="td2">
			$activeState
		</td>
	</tr>
	<tr class="tr1 vt">
		<td class="td1">活動類型</td>
		<td class="td2">
			$activeTypeSelection
		</td>
	</tr>

	<tr class="tr1 vt">
		<td class="td1">所屬群組 </td>
		<td class="td2"><input type="text" name="cname" value="$cname" class="input input_wa" />&nbsp;&nbsp;可使用通配符“*”</td>
	</tr>
	<tr class="tr1 vt">
		<td class="td1">發布者</td>
		<td class="td2"><input type="text" name="cadmin" value="$cadmin" class="input input_wa" />&nbsp;&nbsp;可使用通配符“*”</td>
	</tr>
	<tr class="tr1 vt">
		<td class="td1">發布日期</td>
		<td class="td2">
		<div class="input_img fl"><i onclick="this.nextSibling.onclick()" class="input_time" title="選擇時間">選擇時間</i><input type="text" name="createtime_s" value="$createtime_s" id="createtime_s" onclick="javascript:ShowCalendar(this.id)"></div><span class="p_lr_10 fl">至</span><div class="input_img fl"><i class="input_time" onclick="javascript:ShowCalendar('createtime_e')"  title="選擇時間">選擇時間</i> <input type="text" name="createtime_e" id="createtime_e" value="$createtime_e" onclick="javascript:ShowCalendar(this.id)"></div>
		</td>
	</tr>
	<tr class="tr1 vt">
		<td class="td1">排序</td>
		<td class="td2">
		$orderwayTypeSelection
		<ul class="cc list_80 fl list_A">
            <li><input type="radio" name="ordertype" value="asc" $ascChecked />正序</li>
            <li><input type="radio" name="ordertype" value="desc" $descChecked />倒序</li>
         </ul>
		</td>
	</tr>
	<tr class="tr1 vt">
		<td class="td1">每頁顯示條數</td>
		<td class="td2"><input type="text" name="limit" value="$limit" class="input input_wa" size="5"></td>
	</tr>
</table>
</div>
<br />
<div class="mb10 tac">
	<span class="btn"><span><button type="submit">提 交</button></span></span>
</div>
</form>
<form action="$basename&action=$action&" method="post" name="FORM">
<input type="hidden" name="job" value="del" />
<input type="hidden" name="step" value="3" />
<input type="hidden" name="urladd" value="$url_add" />
<h2 class='h1'>活動列表</h2>
<div class="admin_table mb10">
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr2 vt td_bgB">
		<td width="30"><span onclick="CheckAll(document.FORM)" class="cp">全選</span></td>
		<td>活動名稱</td>
		<td width="110">所屬群組</td>
		<td width="60">活動類型</td>
		<td width="80">活動狀態</td>
		<td width="90">發布者</td>
		<td width="110">發布時間</td>
	</tr>
<!--
EOT;
if (empty($activedb)) {print <<<EOT
-->
<tr><td class="p10" colspan="7"><div class="admin_tips">啊哦，沒有你要的信息！</div></td></tr>
<!--
EOT;
}else{
foreach ($activedb as $key => $value) {print <<<EOT
-->
	<tr class="tr1 vt">
		<td class="td2"><input type="checkbox" name="selid[]" value="$value[id]" /></td>
		<td class="td2"><p class="lh_18"><a href="apps.php?q=group&a=active&job=view&cyid=$value[cid]&id=$value[id]" target="_blank">{$value[title]}</a></p></td>
		<td class="td2"><a href="apps.php?q=group&cyid=$value[cid]" target="_blank">{$colonys[$value['cid']]}</a></td>
		<td class="td2">{$activeTypes[$value['type']]}</td>
		<td class="td2">
<!--
EOT;
if ($timestamp > $value['endtime']) {print <<<EOT
-->
		<span class="gray">活動已結束</span>
<!--
EOT;
} elseif ($timestamp > $value['deadline'] && $timestamp > $value['begintime']) {print <<<EOT
-->
		<span class="s3">活動進行中</span>
<!--
EOT;
} elseif ($timestamp > $value['deadline']) {print <<<EOT
-->
		<span class="s1">報名已截止</span>
<!--
EOT;
} elseif ($value['limitnum'] && $value['members'] >= $value['limitnum']) {print <<<EOT
-->
		<span class="s1">人員已滿</span>
<!--
EOT;
} else {print <<<EOT
-->
		<span class="s3">可以報名</span>
<!--
EOT;
}print <<<EOT
-->
		</td>
		<td class="td2">{$users[$value['uid']]}</td>
		<td class="td2">{$value['createtime']}</td>
	</tr>
<!--
EOT;
}}print <<<EOT
-->
</table>
</div>
<div class="cc">$pages</div>
<div class="mb10 tac">
	<span class="bt"><span><button type="button" onclick="CheckAll(document.FORM)">全 選</button></span></span>
	<span class="btn"><span><button type="submit" >刪除</button></span></span>
</div>
</form>

<!--
EOT;
}
include_once PrintEot('adminbottom');
?>-->
