<!--<?php
include_once PrintEot('left');print <<<EOT
-->
<div class="mb10"><a href="$admin_file?adminjob=hackcenter">插件中心</a> &raquo; <a href="javascript:;">{$db_hackdb[medal][0]}</a></div>
<!--
EOT;
if(empty($action)){print <<<EOT
-->
<div class="nav3 mb10 ta">
      <ul class="cc">
        <li class="current"><a href="$basename">勋章设置</a></li>
        <li><a href="$basename&action=edit">勋章编辑</a></li>
        <li><a href="$basename&action=add">添加勋章</a></li>
    </ul>
</div>
<div class="admin_info mb10">
    <h3 class="h1">提示信息</h3>
    <div class="legend">
        <ol>
            <li>勋章中心可以向对论坛做出特殊贡献的会员颁发勋章</li>
            <li>开启勋章申请功能后，会员可以自主申请勋章</li>
            <li>勋章图片请放到hack/medal/image文件夹下</li>
            <li>选择图片时，如带有<span class="s1">*</span>则表示该图片已被使用</li>
            <li>如果需要自动回收到期勋章，请到<a href="javascript:;" onclick="parent.PW.Dialog({id:'plantodo',url:'$admin_file?adminjob=plantodo',name:'计划任务'});">计划任务</a>中开启"勋章自动回收"任务</li>
        </ol>
    </div>
</div>
<form action="$basename" method="post">
<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="tr1 vt">
		<td class="td1">勋章功能</td>
		<td class="td2">
        	<ul class="cc list_80 list_A mr10 fl">
             <li><input type="radio" value="1" name="config[md_ifopen]" $ifopen_Y>开启</li>
             <li><input type="radio" value="0" name="config[md_ifopen]" $ifopen_N>关闭</li>
         	</ul>
		</td><td class="td2"><div class="help_a">功能开启后，请到“<a href="javascript:;" onclick="parent.PW.Dialog({id:'navside',url:'$admin_file?adminjob=customnav&admintype=navside&action=footlist&type=foot',name:'顶部底部导航'});">运营工具 ->导航菜单管理 –>顶部底部导航</a>”中设置此插件是否在前台显示
		</div></td>
	</tr>
	<tr class="tr1 vt">
		 <td class="td1">颁发/摘除勋章短消息通知</td>
		 <td class="td2">
         	<ul class="cc list_80 list_A mr10 fl">
             <li><input type="radio" value="1" name="config[md_ifmsg]" $ifmsg_Y>开启</li>
             <li><input type="radio" value="0" name="config[md_ifmsg]" $ifmsg_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_120">
<!--
EOT;
foreach($ltitle as $key => $value){
if($key==1||$key==2)continue;
$num++;
$htm_tr = $num % 4 == 0 ? '' : '';
$g_ck=strpos($md_groups,",$key,")!==false ? 'checked' : '';
print <<<EOT
-->
						<li><input type="checkbox" name="groups[]" value="$key" class="mr5" $g_ck>$value</li>
						$htm_tr
<!--
EOT;
}print <<<EOT
-->
            </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="cc list_80 list_A mr10 fl">
             <li><input type="radio" value="1" name="config[md_ifapply]" $ifapply_Y>开启</li>
             <li><input type="radio" value="0" name="config[md_ifapply]" $ifapply_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_120">
<!--
EOT;
$num=0;
foreach($ltitle as $key => $value){
if($key==1||$key==2)continue;
$num++;
$htm_tr = $num % 4 == 0 ? '' : '';
$g_ck=strpos($md_appgroups,",$key,")!==false ? 'checked' : '';
print <<<EOT
-->
						<li><input type="checkbox" name="appgroups[]" value="$key" class="mr5" $g_ck>$value</li>
						$htm_tr
<!--
EOT;
}print <<<EOT
-->
            </ul>
		</td><td class="td2"><div class="help_a">留空表示不选</div></td>
	</tr>
</table>
</div>
<div class="mb10 tac">
    <span class="btn"><span><button type="submit">提 交</button></span></span>
  </div>
</form>
<!--
EOT;
}elseif($action=='edit'){print <<<EOT
-->
<div class="nav3 mb10 ta">
    <ul class="cc">
        <li><a href="$basename">勋章设置</a></li>
        <li class="current"><a href="$basename&action=edit">勋章编辑</a></li>
        <li><a href="$basename&action=add">添加勋章</a></li>
    </ul>
</div>
<div class="admin_info mb10">
    <h3 class="h1">提示信息</h3>
    <div class="legend">
    	<ol>
        	<li>勋章中心可以向对论坛做出特殊贡献的会员颁发勋章</li>
            <li>开启勋章申请功能后，会员可以自主申请勋章</li>
            <li>勋章图片请放到hack/medal/image文件夹下</li>
            <li>选择图片时，如带有<span class="s1">*</span>则表示该图片已被使用</li>
        </ol>
    </div>
</div>
<form action="$basename&action=edit&" method="post">
<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>ID</td>
            <td>勋章名称</td>
            <td>勋章说明</td>
            <td>图片名称</td>
            <td class="tac">勋章图片</td>
            <td>操作</td>
        </tr>
<!--
EOT;
$num=0;
foreach($medaldb as $key => $value){
$num++;
$id=$value[id];
print <<<EOT
-->
        <tr class="tr1 vt">
            <td class="td2">$num</td>
            <td class="td2"><input class="input input_wc" type="text" name="medal[$id][name]" value="$value[name]"></td>
            <td class="td2"><input type="text" class="input input_wb" name="medal[$id][intro]" value="$value[intro]"></td>
            <td class="td2"><input type="text" class="input input_wc mr5" name="medal[$id][picurl]" id="medal[$id][picurl]" value="$value[picurl]"><a href="javascript:selectImg('medal[$id][picurl]');" >[选图]</a></td>
            <td class="td2 tac"><img src="hack/$hackset/image/$value[picurl]"></td>
            <td class="td2"><a href="$basename&action=del&id=$id" title="删除">[删除]</a></td>
        </tr>
<!--
EOT;
}print <<<EOT
-->
    </table>
</div>
<div class="mb10 tac">
    <span class="btn"><span><button type="submit" name="hello">提 交</button></span></span>
  </div>
</form>
<!--
EOT;
}elseif($action=='add'){print <<<EOT
-->
<div class="nav3 mb10 ta">
    <ul class="cc">
		<li><a href="$basename">勋章设置</a></li>
		<li><a href="$basename&action=edit">勋章编辑</a></li>
		<li class="current"><a href="$basename&action=add">添加勋章</a></li>
	</ul>
</div>
<div class="admin_info mb10">
    <h3 class="h1">提示信息</h3>
    <div class="legend">
    	<ol>
        	<li>勋章中心可以向对论坛做出特殊贡献的会员颁发勋章</li>
            <li>开启勋章申请功能后，会员可以自主申请勋章</li>
            <li>勋章图片请放到hack/medal/image文件夹下</li>
            <li>选择图片时，如带有<span class="s1">*</span>则表示该图片已被使用</li>
        </ol>
    </div>
</div>
<form action="$basename&action=add&" method="post">
<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="tr1 vt">
		<td class="td1">勋章名称</td>
		<td class="td2"><input type="text" class="input input_wa" name="newname"></td>
	</tr>
	<tr class="tr1 vt">
		<td class="td1">勋章说明</td>
		<td class="td2"><input type="text" class="input input_wa" name="newintro"></td>
	</tr>
	<tr class="tr1 vt">
		<td class="td1">图片名称</td>
		<td class="td2"><input type="text" class="input input_wa mr5" name="newpicurl" id="newpicurl" ><a href="javascript:selectImg('newpicurl');" >[选择图片]</a>
</td>
	</tr>
</table>
</div>
<div class="mb10 tac">
    <span class="btn"><span><button type="submit" name="hello">提 交</button></span></span>
  </div>
</form>
<!--
EOT;
}print <<<EOT
-->
<script language="JavaScript">
function IsBrowser(){
	var sAgent = navigator.userAgent.toLowerCase() ;
	if ( sAgent.indexOf("msie") != -1 && sAgent.indexOf("mac") == -1 && sAgent.indexOf("opera") == -1 )
		return "msie" ;
	if ( navigator.product == "Gecko" && !( typeof(opera) == 'object' && opera.postError ) )
		return "gecko";
	if ( navigator.appName == 'Opera')
		return "opera" ;
	if ( sAgent.indexOf( 'safari' ) != -1 )
		return "safari";
	return false ;
}
function selectImg(id){
	var time = new Date();
	var timestamp = time.valueOf();
	if(IsBrowser()=='msie'){
		objts=showModalDialog("$basename&action=selectimg&thisid="+id+"&time="+timestamp,window,'dialogWidth=430px;dialogHeight=415px;help:no;status:no;');
	}else{
		window.open("$basename&action=selectimg&thisid="+id+"&time="+timestamp,"selectimg","width=450,height=410,resizable=no,z-look=yes,alwaysRaised=yes,depended=yes,scrollbars=yes,left=" + (window.screen.width-840)/2 + ",top=" + (window.screen.height-500)/2);
	}
}
</script>
<!--
EOT;
include_once PrintEot('adminbottom');
?>-->