<!--<?php
if (!defined('AJAX')){
include_once PrintEot('left');
}print<<<EOT
-->

<!--
EOT;
if(empty($action)){print <<<EOT
-->
<div class="nav3 mb10 ta">
  <ul class="cc">
    <li class="current"><a href="javascript:;">基本設置</a></li>
    <li><a href="$basename&action=teamList">團隊列表</a></li>
    <li><a href="$basename&action=actionList">團隊考核</a></li>
    <li><a href="$basename&action=sort">獎勵發放</a></li>
  </ul>
</div>
<div class="admin_info mb10">
    <h3 class="h1">友情提示</h3>
    <div class="legend">
    	<ol>
        	<li>方案以綜合評分為考核結果</li>
            <li>綜合評分 = 所有 考核參數 * 考核權重 的和</li>
            <li>如果權值為0，則表示參數不參與考核統計</li>
        </ol>
    </div>
 </div>
<form action="$basename&action=set" method="post">
  <input type="hidden" name="action" value="set" />
  <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" width="390">
        <ul class="cc list_A list_120">
<!--
EOT;
foreach($group as $key=>$value){
$ifcheck = in_array($value['gid'],$team['group']) ? 'checked' : '';
print <<<EOT
-->
            <li>
              <input type="checkbox" name="set[group][]" value="$value[gid]" $ifcheck />$value[grouptitle]
             </li>
<!--
EOT;
}print <<<EOT
-->
         </ul>
        </td><td class="td2"></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">綜合評分
       </td>
      <td class="td2">
     	 <div class="admin_table_b">
              <table cellpadding="0" cellspacing="0">
                  <tr>
                    <td class="s4"  >參數</td>
                    <td class="s4" >權重</td>
                  </tr>
                  <tr>
                    <td>本月管理操作</td>
                    <td><input type="text" class="input input_wc" name="set[param][opr]" value="{$team[param][opr]}" /></td>
                  </tr>
                  <tr>
                    <td>本月發帖數量</td>
                    <td><input type="text" class="input input_wc" name="set[param][post]" value="{$team[param][post]}" /></td>
                  </tr>
                  <tr>
                    <td>本月在線時間[小時]</td>
                    <td><input type="text" class="input input_wc mr5" name="set[param][oltime]" value="{$team[param][oltime]}" /></td>
                  </tr>
                </table>
           </div>
        </td><td class="td2"> <div class="help_a">本方案以綜合評分為考核結果<br />綜合評分 = 所有 考核參數 * 考核權重 的和<br />如果權值為0，則表示參數不參與考核統計</div></td>
    </tr>
    </table>
    </div>
    
 <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
     <h2 class="h1">獎勵方案設置</h2>
      <tr class="tr1 vt">
      <td class="td1">自動發放獎勵功能</td>
      <td class="td2">
      	<ul class="cc list_80 list_A mr10 fl">
             <li><input type="radio" name="ifopen" value="1" $ifopen_Y />開啟</li>
             <li><input type="radio" name="ifopen" value="0" $ifopen_N />關閉</li>
         </ul>
	 </td><td class="td2"><div class="help_a">此功能需到 <a href="javascript:;" onclick="parent.PW.Dialog({id:'plantodo',url:'$admin_file?adminjob=plantodo',name:'計劃任務'});">計劃任務</a> 里設置自動發放的時間</div></td>
    </tr>
     <tr class="tr1 vt">
      <td class="td1">考核合格分</td>
      <td class="td2"><input type="text" class="input input_wa" name="set[eligibility]" value="{$team[eligibility]}" /></td>
	  <td class="td2"><div class="help_a">當綜合評分>=該值時，該管理成員是合格的<br />設為0，則不啟用該功能</div></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">基本獎勵</td>
      <td class="td2" colspan="2">
      	<div class="admin_table_c" style="width:auto;">
     	 <table cellpadding="0" cellspacing="0" width="100%" style="table-layout:fixed;">
         	 <tr>
           		 <td width="80">&nbsp;</td>
<!--
EOT;
foreach($credit->cType as $key=>$c){print <<<EOT
-->
           		 <td>$c</td>
<!--
EOT;
}print <<<EOT
-->
								<td>&nbsp;</td>
         	 </tr>
<!--
EOT;
foreach($group as $key=>$value){print <<<EOT
-->
         	 <tr>
           		 <td class="s4">$value[grouptitle]</td>
<!--
EOT;
foreach($credit->cType as $k=>$c){
print <<<EOT
-->
           		 <td><input type="text" class="input" size="2" name="set[wages][$value[gid]][$k]" value="{$team[wages][$value[gid]][$k]}" /></td>
<!--
EOT;
}print <<<EOT
-->
								<td>&nbsp;</td>
         		 </tr>
<!--
EOT;
}print <<<EOT
-->
        	</table></div>
				</td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">考核獎勵
        </td>
      <td class="td2" colspan="2">
      	<div class="admin_table_c">
          <table cellpadding="0" cellspacing="0">
              <tr>
<!--
EOT;
foreach($credit->cType as $k=>$c){print <<<EOT
-->
           		 <td>$c</td>
<!--
EOT;
}print <<<EOT
-->
         		 </tr>
         		 <tr>
<!--
EOT;
foreach($credit->cType as $k=>$c){print <<<EOT
-->
           		 <td><input type="text" class="input" size="2" name="set[bonus][$k]" value="{$team[bonus][$k]}" /></td>
<!--
EOT;
}print <<<EOT
-->
                 </tr>
             </table>
         </div><div class="help_a">每單位綜合評分獎勵多少積分</div>
        </td>
    </tr>
    </table>
    </div>
   
 <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <h2 class="h1">提醒設置</h2>
    <tr class="tr1 vt">
      <td class="td1">獎勵提醒</td>
      <td class="td2">
     	 <ul class="cc list_80 list_A mr10 fl">
             <li><input type="radio" name="set[ifmsg]" value="1" $ifmsg_Y />開啟</li>
             <li><input type="radio" name="set[ifmsg]" value="0" $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"><input type="text" class="input input_wb" name="set[msgtitle]" value="$team[msgtitle]" /></td>
	  <td class="td2"><div class="help_a"></div></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">短消息內容</td>
      <td class="td2">
      	<div style="width:320px;border:1px solid #ccc;padding:5px 9px;background:#fff;" class="mb5">尊敬的 \$username︰<br />
         感謝你們對 \$db_bbsname 的支持!現特發 \$credit 作為獎勵.<br />
          操作日期 \$time
          </div>
        <textarea name="set[msgdata]" maxlength="200" class="textarea">$team[msgdata]</textarea></td>
		<td class="td2"><div class="help_a">變量參數如下設置︰<br />
        1、\$username => 用戶名<br />
        2、\$db_bbsname => 論壇名<br />
        3、\$credit => 獎勵的積分<br />
        4、\$time => 當前執行的時間<br />
        5、使用方法參考左側</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" name="set[arouse]" value="1" $arouse_Y />開啟</li>
             <li> <input type="radio" name="set[arouse]" value="0" $arouse_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"><textarea name="set[arousemsg]"  class="textarea">$team[arousemsg]</textarea></td>
	  <td class="td2"><div class="help_a">變量參數與短消息一致</div></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">下次執行時間</td>
      <td class="td2">$nexttime</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>
</form>
<!--
EOT;
} elseif($action=='teamList'){
print <<<EOT
-->
<div class="nav3 mb10 ta">
   <ul class="cc">
    <li><a href="$basename">基本設置</a></li>
    <li class="current"><a href="$basename&action=teamList">團隊列表</a></li>
    <li><a href="$basename&action=actionList">團隊考核</a></li>
    <li><a href="$basename&action=sort">獎勵發放</a></li>
    </ul>
</div>
<h2 class="h1">團隊列表</h2>
   <form action="$basename&action=teamList&dataOut=1" method="post" >
 <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 width="180">操作版塊</td>
    </tr>
<!--
EOT;
foreach($userInfo as $key => $value){
$forumName = $value[forumName] ? "<span class='mr10'>$value[forumName]</span>" : "&nbsp;";
print <<<EOT
-->
    <tr class="tr1 vt">
     <td class="td2">$value[uid]</td>
     <td class="td2">$key</td>
     <td class="td2">{$ltitle[$value[groupid]]}</td>
     <td class="td2">$value[regdate]</td>
     <td class="td2">$value[lastvisit]</td>
     <td class="td2">$value[lastpost]</td>
      <td class="td2">
<div class="fl" id="tips_$value[uid]" style="display:none">
	    <div style="position:absolute;margin-top:22px;">
			<div class="popout"><table border="0" cellspacing="0" cellpadding="0"><tbody><tr><td class="bgcorner1"></td><td class="pobg1"></td><td class="bgcorner2"></td></tr><tr><td class="pobg4"></td><td><div class="popoutContent"><div style="width:170px;"><div class="popTop"><a href="javascript:;" class="del_img fr" onclick="closeteam('tips_$value[uid]')">關閉</a>更多版塊</div><p class="s4 cc p10">$value[forumNames]</p></div>
</div></td><td class="pobg2"></td></tr><tr><td class="bgcorner4"></td><td class="pobg3"></td><td class="bgcorner3"></td></tr></tbody></table></div>
		</div>
		</div>
			$forumName
<!--
EOT;
if($value['forumNames']){print <<<EOT
-->
	    <a href="javascript:;" onClick="getObj('tips_$value[uid]').style.display=''">更多</a>
<!--
EOT;
}print <<<EOT
-->
	    </td>
    </tr>
<!--
EOT;
}print <<<EOT
-->
  </table>
    </div>
    <div class="mb10 tac">
    <span class="btn"><span><button type="submit" onfocus="blur();">導出</button></span></span>
  </div>
    </form>
<script type="text/javascript">
function closeteam(obj) {
	getObj(obj).style.display = 'none';
}
</script>
<!--
EOT;
} elseif($action=='actionList'){

print <<<EOT
-->
<script type="text/javascript" src="js/date.js"></script>
<div class="nav3 mb10 ta">
   <ul class="cc">
    <li><a href="$basename">基本設置</a></li>
    <li><a href="$basename&action=teamList">團隊列表</a></li>
    <li class="current"><a href="javascript:;">團隊考核</a></li>
    <li><a href="$basename&action=sort">獎勵發放</a></li>
    </ul>
</div>
  <form action="$basename&action=actionList" method="post" >
  <h2 class="h1">考核搜索</h2>
  <input type="hidden" name="step" value="2">
  <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="fid"  class="select_wa mr20 fl">
          <option value='0'>所有版塊</option>$forumcache</select>
        </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="postStartTime" id="postStartTime" value="$postStartTime" onClick="javascript:ShowCalendar(this.id,1)" /></div><span class="p_lr_10 fl">至</span><div class="input_img fl mr20"><i class="input_time" onclick="this.nextSibling.onclick()" title="選擇時間">選擇時間</i><input type="text" name="postEndTime" id="postEndTime" value="$postEndTime" onClick="javascript:ShowCalendar(this.id,1)" /></div>可只用單個條件
      </td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">用戶名</td>
      <td class="td2"><input type="text" class="input input_wa mr20" name="adminName" value="$adminName"></td>
    </tr>

  </table>
  </div>
  <div class="mb10 tac">
    <span class="mr10"><span class="btn"><span><button type="submit">提 交</button></span></span></span>
  </div>
 </form>
 <form action="$basename&action=actionList" method="post" >
 <input type="hidden" name="step" value="2">
 <input type="hidden" name="sortType" value="{$sortType}">
 <input type="hidden" name="dataOut" value="1">
 <input type="hidden" name="postStartTime" value="{$postStartTime}">
 <input type="hidden" name="postEndTime" value="{$postEndTime}">
 <input type="hidden" name="adminName" value="{$adminName}">
 <input type="hidden" name="fid" value="{$fid}">
  <h2 class="h1">結果列表</h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr2">
      <td>序號</td>
      <td>用戶名</td>
      <td><a href="$baseurl&sortType=highlight$urlAdd"><span>加亮 $sort_a[highlight]</span></a></td>
      <td><a href="$baseurl&sortType=delete$urlAdd"><span>刪除 $sort_a[delete]</span></a></td>
      <td><a href="$baseurl&sortType=credit$urlAdd"><span>評分 $sort_a[credit]</span></a></td>
      <td><a href="$baseurl&sortType=topped$urlAdd"><span>置頂 $sort_a[topped]</span></a></td>

      <td><a href="$baseurl&sortType=edit$urlAdd"><span>編輯 $sort_a[edit]</span></a></td>
      <td><a href="$baseurl&sortType=digest$urlAdd"><span>精華 $sort_a[digest]</span></a></td>
      <td><a href="$baseurl&sortType=copy$urlAdd"><span>復制 $sort_a[copy]</span></a></td>
      <td><a href="$baseurl&sortType=move$urlAdd"><span>移動 $sort_a[move]</span></a></td>
      <td><a href="$baseurl&sortType=down$urlAdd"><span>壓帖 $sort_a[down]</span></a></td>
      <td><a href="$baseurl&sortType=banuser$urlAdd"><span>禁言 $sort_a[banuser]</span></a></td>
      
      <td><a href="$baseurl&sortType=locked$urlAdd"><span>鎖定 $sort_a[locked]</span></a></td>
      <td><a href="$baseurl&sortType=push$urlAdd"><span>提前 $sort_a[push]</span></a></td>
      <td><a href="$baseurl&sortType=unite$urlAdd"><span>合並 $sort_a[unite]</span></a></td>
      <td><a href="$baseurl&sortType=shield$urlAdd"><span>屏蔽 $sort_a[shield]</span></a></td> 
      <td><a href="$baseurl&sortType=remind$urlAdd"><span>提醒 $sort_a[read_remind]</span></a></td>
      <td width="68"><a href="$baseurl&sortType=recycle$urlAdd"><span>還原帖子 $sort_a[recycle]</span></a></td>
      <td width="68"><a href="$baseurl&sortType=deluser$urlAdd"><span>刪除用戶 $sort_a[deluser]</span></a></td>
      <td><a href="$baseurl&sortType=total$urlAdd"><span>總計 $sort_a[total]</span></a></td>   
    </tr>
<!--
EOT;
$i = 0;
foreach($admindb as $key => $value){
$i ++;
$highlight = $value[highlight] ? $value[highlight] : 0;
$delete = $value[delete] ? $value[delete] : 0;
$credit = $value[credit] ? $value[credit] : 0;
$topped = $value[topped] ? $value[topped] : 0;
$edit = $value[edit] ? $value[edit] : 0;
$digest = $value[digest] ? $value[digest] : 0;
$copy = $value[copy] ? $value[copy] : 0;
$move = $value[move] ? $value[move] : 0;
$down = $value[down] ? $value[down] : 0;
$banuser = $value[banuser] ? $value[banuser] : 0;
$locked = $value[locked] ? $value[locked] : 0;
$push = $value[push] ? $value[push] : 0;
$unite = $value[unite] ? $value[unite] : 0;
$shield = $value[shield] ? $value[shield] : 0;
$remind = $value[remind] ? $value[remind] : 0;
$recycle = $value[recycle] ? $value[recycle] : 0;
$deluser = $value[deluser] ? $value[deluser] : 0; 
$total = $value[total] ? $value[total] : 0;
print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td2">$i</td>
      <td class="td2">$key</td>
      <td class="td2">$highlight</td>
      <td class="td2">$delete</td>
      <td class="td2">$credit</td>
      <td class="td2">$topped</td>
      <td class="td2">$edit</td>
      <td class="td2">$digest</td>
      <td class="td2">$copy</td>
      <td class="td2">$move</td>
      <td class="td2">$down</td>
      <td class="td2">$banuser</td>
      <td class="td2">$locked</td>
      <td class="td2">$push</td>
      <td class="td2">$unite</td>
      <td class="td2">$shield</td>
      <td class="td2">$remind</td>
      <td class="td2">$recycle</td>
      <td class="td2">$deluser</td>
      <td class="td2">$total</td>
    </tr>
<!--
EOT;
}print <<<EOT
-->
  </table>
  </div>
  <div class="mb10 tac">
    <span class="btn"><span><button type="submit" onfocus="blur();">導出</button></span></span>
  </div>
  </form>
<!--
EOT;
} elseif($action=='sort'){print <<<EOT
-->
<div class="nav3 mb10 ta">
   <ul class="cc">
    <li><a href="$basename">基本設置</a></li>
    <li><a href="$basename&action=teamList">團隊列表</a></li>
    <li><a href="$basename&action=actionList">團隊考核</a></li>
    <li class="current"><a href="javascript:;">獎勵發放</a></li>
    </ul>
</div>
<form action="$basename&" method="post" onsubmit="return checkForm(this);">
  <input type="hidden" name="action" value="payoff" />
  <h2 class="h1">考核統計</h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr2">
      <td>用戶名</td>
      <td>頭餃</td>
      <td class="tac">管理統計</td>
      <td class="tac">本月發帖</td>
      <td class="tac">本月在線</td>
      <td class="tac">綜合評分</td>
<!--
EOT;
foreach($credit->cType as $k=>$t){print <<<EOT
-->
      <td>$t</td>
<!--
EOT;
}print <<<EOT
-->
    </tr>
<!--
EOT;
foreach($admindb as $key=>$value){print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td2">$key</td>
      <td class="td2">{$ltitle[$value[groupid]]}</td>
      <td class="td2 tac">$value[total]</td>
      <td class="td2 tac">$value[monthpost]</td>
      <td class="td2 tac">$value[monoltime]</td>
      <td class="td2 tac">
<!--
EOT;
if($value['assess']>$team['eligibility']){print <<<EOT
-->
        <span class="s3">$value[assess]</span>
<!--
EOT;
}else{print <<<EOT
-->
        <span class="s1">$value[assess]</span>
        <input type="hidden" name="arouse[]" value="$value[uid]" />
<!--
EOT;
}print <<<EOT
-->
      </td>
<!--
EOT;
foreach($credit->cType as $k=>$t){print <<<EOT
-->
      <td class="td2"><input type="text" class="input" size="1" name="paycredit[$value[uid]][$k]" value="{$value[wages][$k]}" /></td>
<!--
EOT;
}print <<<EOT
-->
    </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">
var ifopen = parseInt('$rt[ifopen]');
function checkForm(obj) {
	if (ifopen==1 && !confirm('您已經開啟自動發放獎勵的程序了，您確定繼續嗎?')) {
		return false;
	}
	return true;
}
</script>
<!--
EOT;
}include_once PrintEot('adminbottom');
?>-->
