<?php
if( !defined('ISDVBBS') ){
	header('HTTP/1.0 404 Not Found');
	exit;
}
global $imgurl;
?>
<table class="mainbox tableborder" cellSpacing="0" cellPadding="0" align="center">
	<tr>
		<th width="25%" align="center"><a href="?action=m_pidgin"><?=$lang['tpl.str1']?></a></th>
		<th width="25%" align="center"><a href="?action=m_leave"><?=$lang['tpl.str2']?></a></th>
		<th width="25%" align="center"><a href="?action=m_setup"><?=$lang['tpl.str3']?></a></th>
		<th width="25%" align="center"><a href="?action=paylist"><?=$lang['tpl.str82']?></a></th>
	</tr>
</table>
<br>
<?
if($action=='m_pidgin' or $action==''){//版主事务信息列表
?>
<table class="mainbox tableborder" cellSpacing="0" cellPadding="0" align="center">
	<tr>
		<th width="13%" align="center"><?=$lang['tpl.str4']?></th>
		<th width="17%" align="center"><?=$lang['tpl.str5']?></th>
		<th width="20%" align="center"><?=$lang['tpl.str6']?></th>
		<th width="15%" align="center"><?=$lang['tpl.str7']?></th>
		<th width="10%" align="center"><?=$lang['tpl.str8']?></th>
		<th width="10%" align="center"><?=$lang['tpl.str9']?></th>
		<th width="15%" align="center"><?=$lang['tpl.str10']?></th>
	</tr>
</table>
<?
	$userobj->handlelist();//循环体 BEGIN
	foreach ($userlist as $userarr){
		if(strpos($userarr['userface'],'|')!==false){
			$userface=explode('|',$userarr['userface']);
			$userface=$userface[1];
		}
		else{
			$userface=$userarr['userface'];
		}
		$board_name=$userobj->useratboard($userarr['username']);
		$leaver_count=explode('|',$userobj->leavercount($userarr['username']));
?>
<table class="mainbox tableborder" cellSpacing="0" cellPadding="0" align="center">
	<tr>
		<td width="13%">
			<table border="0" align="left" cellspacing="0" cellpadding="0">
				<tr><td><?=$lang['tpl.str11']?><?if($userobj->username==$userarr['username']){echo '<font color=red>'.$userarr['username'].'</font>';}else{echo $userarr['username'];}?></td></tr>
				<tr><td><?=$lang['tpl.str12']?><img src="<?=strtolower($userface)?>" border="0" width="32" height="32"></td></tr>
				<tr><td><?=$lang['tpl.str13']?><?=$userarr['usertitle']?></td></tr>
			</table>
		</td>
		<td width="17%">
			<table border="0" align="center" cellspacing="0" cellpadding="0">
				<tr><td height="30"><?=$lang['tpl.str14']?><?=$board_name?></td></tr>
				<tr><td><?=$lang['tpl.str']?><?=$userarr['userclass']?></td></tr>
				<tr><td></td></tr>
			</table>
		</td>
		<td width="20%">
			<table border="0" align="center" cellspacing="0" cellpadding="0" width="98%">
				<tr><td colspan="3" style="text-align:center"><?=$lang['tpl.str16']?><?=$userarr['userpost']?>&nbsp;<?=$lang['tpl.str17']?></td></tr>
				<tr><td height="10" colspan="3"></td></tr>
				<tr><td><?=$lang['tpl.str18']?><?=$userarr['usertopic']?>&nbsp;<?=$lang['tpl.str17']?></td><td><?=$lang['tpl.str19']?><?=$userarr['userpost']-$userarr['usertopic']?>&nbsp;<?=$lang['tpl.str17']?></td><td><?=$lang['tpl.str20']?><?=$userarr['userisbest']?>&nbsp;<?=$lang['tpl.str17']?></td></tr>
			</table>
		</td>
		<td width="15%">
			<table border="0" align="center" cellspacing="0" cellpadding="0">
				<tr><td height="30"><?=$lang['tpl.str21']?>
				<?
					if(empty($userobj->endgz_time)){
						echo gmdate('Y-m-d',$userobj->begingz_time+($userobj->gzdays*24*3600)+getUserTimeZoneOffset());
					}
					else{
						echo gmdate('Y-m-d',$userobj->endgz_time+($userobj->gzdays*24*3600)+getUserTimeZoneOffset());
					}
				?>
				</td></tr>
				<tr><td><?=$lang['tpl.str22']?><?=gmdate('Y-m-d H:i',$userarr['lastlogin']+getUserTimeZoneOffset())?></td></tr>
			</table>
		</td>
		<td width="10%">
			<table border="0" align="center" cellspacing="0" cellpadding="0">
				<tr><td height="30"><?=$lang['tpl.str23']?><?=$userarr['userlogins']?>&nbsp;<?=$lang['tpl.str24']?></td></tr>
				<tr><td><?=$lang['tpl.str25']?><?=$userobj->disappearance_days($userarr['lastlogin'])?>&nbsp;<?=$lang['tpl.str26']?></td></tr>
			</table>
		</td>
		<td width="10%">
			<table border="0" align="center" cellspacing="0" cellpadding="0">
				<tr><td height="30"><?=$lang['tpl.str27']?><?=$userobj->maintenance($userarr['username'])?>&nbsp;<?=$lang['tpl.str17']?></td></tr>
				<tr><td><?=$lang['tpl.str28']?><?=$userarr['userpost']?>&nbsp;<?=$lang['tpl.str17']?></td></tr>
			</table>
		</td>
		<td width="15%">
			<table border="0" align="center" cellspacing="0" cellpadding="0">
				<tr><td height="30"><?=$lang['tpl.str29']?><?=$userarr['userep']?>&nbsp;<?=$lang['tpl.str30']?></td></tr>
				<tr><td><?=$lang['tpl.str31']?><?=$userobj->userassess($userarr['username'],$userarr['lastlogin'])?></td></tr>
			</table>
		</td>
	</tr>
	<tr>
		<td colspan="5" class="tablebody2">
		<a href="messanger.php?action=new&touser=<?=urlencode($userarr['username'])?>"><img src="<?=$imgurl?>message.gif" border="0"></a>&nbsp;
		<a href="friendlist.php?action=addF&myFriend=<?=$userarr['username']?>"><img src="<?=$imgurl?>friend.gif" border="0"></a>&nbsp;
		<a href="dispuser.php?id=<?=$userarr['userid']?>"><img src="<?=$imgurl?>profile.gif" border="0"></a>&nbsp;
		<a href="query.php?stype=1&nsearch=3&keyword=<?=$userarr['username']?>&searchdate=ALL"><img src="<?=$imgurl?>find.gif" border="0"></a>
		</td>
		<td colspan="2" class="tablebody2"><?=$lang['tpl.str32']?>&nbsp;<?=$userobj->lv_num?>&nbsp;<?=$lang['tpl.str24']?>&nbsp;&nbsp;&nbsp;<?=$lang['tpl.str33']?>&nbsp;<?=$userobj->lv_days?>&nbsp;<?=$lang['tpl.str26']?></td>
	</tr>
</table>
<table>
	<tr><td height="5"></td></tr>
</table>
<?
	}
//循环体 END
?>
<table width="100%"  border="0" cellspacing="0" cellpadding="0" class="mainbox tableborder">
  <tr>
    <td style="height:30px;">
<?
	if($total!=0){
		$p = new page;
		$p->setall($page,$total,$page_size,$lang['doassess.info5'],$lang['doassess.info6'],'100%','center','biz');
		echo $p->printpage(null,1);
	}
?>
	</td>
  </tr>
</table>
<?
}
elseif($action=='m_leave'){//版主请假
	if($userobj->lv_days>=$userobj->leavemaxdays){
		showmsg($lang['tpl.str81']);
		exit;
	}
?>
<table cellpadding=0 cellspacing=0 class="mainbox tableborder" align="center">
<form name="leaveform" method="post" action="?action=leave">
  <tr height=20>
     <th valign=middle align=center height=25 colspan="3"><?=$lang['tpl.str34']?></th>
  </tr>
  <tr>
	<td class="tablebody2" rowspan="2" align="left" width="40%"><center><b><?=$lang['tpl.str35']?></b></center>
		<ol><li><?=$lang['tpl.str36']?>
		<li><?=$lang['tpl.str37']?>
		<li><?=$lang['tpl.str38']?><?=$leavetimeout?><?=$lang['tpl.str26']?>
		<li><?=$lang['tpl.str39']?>
		<li><?=$lang['tpl.str40']?>
		</ol>	</td>
	<td class="tablebody2" align="center" width="15%"><b><?=$lang['tpl.str41']?></b></td>
    <td class="tablebody2" align="left" width="45%"><textarea rows="8" name="leave_cause" style="width:99%;"></textarea></td>
  </tr>
  <tr>
  <td class="tablebody2" align="center"><b><?=$lang['tpl.str42']?></b></td>
	<td class="tablebody2" align="left">
		<select size="1" name="days">
          <? for ($i=1;$i<=$userobj->leavemaxdays;$i++) {
		  ?>
		  <option value="<?=$i?>"><?=$i?></option>
		  <?}?>
         </select><?=$lang['tpl.str26']?></td>
  </tr>
  <tr>
    <td class="tableborder2" colspan="3" height=10>
      <p align="center"><input type="submit" value=" <?=$lang['tpl.str43']?> " name="B1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      <input type="reset" value=" <?=$lang['tpl.str44']?> " name="B2"></td>
  </tr>
  </form>
</table>
<table cellpadding="0" cellspacing="0" class="mainbox tableborder" align="center">
<tr><th align="center"><?=$lang['doassess.info21']?></th><th align="center"><?=$lang['doassess.info22']?></th><th align="center"><?=$lang['doassess.info23']?></th></tr>
<?
	if(!empty($leavelist)){
		if(is_array($leavelist)){
			foreach($leavelist as $leavearr){
?>
<tr><td align="center"><?=$leavearr['username']?></td><td align="center"><?=$leavearr['days']?></td><td align="center"><?=gmdate('Y-m-d H:i',$leavearr['leavetime']+getUserTimeZoneOffset())?></td></tr>
<?
			}
		}
	}
?>
</table>
<?
}elseif($action=='m_setup'){//管理版主系统设置
	$userobj->usermanageclass();
	if(!empty($pararr)){
		if(is_array($pararr)){
			foreach($pararr as $parlist){
			  $b_para=explode('|||',$parlist['basic_para']);
			  $int_para=explode('|||',$parlist['integral_count']);
			  $o_para=explode('|||',$parlist['other_para']);			
			}
		}
	}
?>
<table cellpadding="0" cellspacing="0" class="mainbox tableborder" align="center" border="0">
<form name="setupform" method="post" action="?action=setup">
	<tr>
		<td align="center" colspan="2" class="tablebody2"><?=$lang['tpl.str45']?>&nbsp;<font color="red"><?=$userobj->username?></font><?=$lang['tpl.str46']?>
		</td>
	</tr>
	<tr>
		<th align="center" colspan="2"><?=$lang['tpl.str47']?></th>
	</tr>
	<tr>
		<td class="tablebody2" style="text-align:left;line-height:30px;padding-left:60px;padding-top:0px;" width="50%">
		<?=$lang['tpl.str48']?>
		<input type="text" name="begingztime" size="15" value="<?=gmdate('Y-m-d ',$parlist['begingztime']+getUserTimeZoneOffset())?>">&nbsp;&nbsp;<?=$lang['tpl.str49']?><br>
		<?=$lang['tpl.str50']?>
		<input type="text" name="gzdays" size="10" value="<?=$b_para[0]?>"><?=$lang['tpl.str26']?><br>
		<?=$lang['tpl.str51']?>
		<input type="text" name="basicgz" size="10" value="<?=$b_para[1]?>"><?=$lang['tpl.str52']?><br>
		<?=$lang['tpl.str53']?>
		<input type="radio" name="msgnotify" value="1" <?if($b_para[2]==1)echo 'checked'?>><?=$lang['tpl.str54']?>&nbsp;&nbsp;<input type="radio" name="msgnotify" value="0" <?if($b_para[2]==0)echo 'checked'?>><?=$lang['tpl.str55']?><br>
		<?=$lang['tpl.str56']?>
		<input type="radio" name="breachofduty" value="1" <?if($b_para[3]==1)echo 'checked'?>><?=$lang['tpl.str54']?>&nbsp;&nbsp;<input type="radio" name="breachofduty" value="0" <?if($b_para[3]==0)echo 'checked'?>><?=$lang['tpl.str55']?>
		</td>
		<td class="tablebody2"  style="text-align:left;line-height:30px;padding-left:60px;padding-top:0px;" width="50%">
		<?=$lang['tpl.str57']?><input type="text" name="pagebznum" size="10" value="<?=$b_para[4]?>"><?=$lang['tpl.str58']?><br>
		<?=$lang['tpl.str59']?><input type="text" name="superaddgz" size="10" value="<?=$b_para[5]?>"><?=$lang['tpl.str52']?><br>
		<?=$lang['tpl.str60']?><input type="text" name="leavemaxdays" size="10" value="<?=$b_para[6]?>"><?=$lang['tpl.str26']?><br>
		<?=$lang['tpl.str61']?><input type="text" name="breachofdutydays" size="10" value="<?=$b_para[7]?>"><?=$lang['tpl.str26']?></td>
	</tr>
	<tr>
		<th align="center" colspan="2"><?=$lang['tpl.str62']?>	</th>
	</tr>
	<tr>
		<td  style="text-align:left;line-height:30px;padding-left:60px;padding-top:0px;" class="tablebody2">
		<?=$lang['tpl.str63']?>
		<input type="radio" name="forumnum" value="1" <?if($int_para[0]==1)echo 'checked'?>><?=$lang['tpl.str54']?>&nbsp;&nbsp;<input type="radio" name="forumnum" value="0" <?if($int_para[0]==0)echo 'checked'?>><?=$lang['tpl.str55']?><br>
		<?=$lang['tpl.str64']?>
		<input type="radio" name="loginnum" value="1" <?if($int_para[1]==1)echo 'checked'?>><?=$lang['tpl.str54']?>&nbsp;&nbsp;<input type="radio" name="loginnum" value="0" <?if($int_para[1]==0)echo 'checked'?>><?=$lang['tpl.str55']?><br>
		<?=$lang['tpl.str65']?>
		<input type="radio" name="vindicatenum" value="1" <?if($int_para[2]==1)echo 'checked'?>><?=$lang['tpl.str54']?>&nbsp;&nbsp;<input type="radio" name="vindicatenum" value="0" <?if($int_para[2]==0)echo 'checked'?>><?=$lang['tpl.str55']?></td>
		<td  style="text-align:left;line-height:30px;padding-left:60px;padding-top:0px;" class="tablebody2">
		<?=$lang['tpl.str66']?>
		<select name="forumnumquotiety">
		<?for ($i=1;$i<=10;$i++){?>
			<option value="<?=$i?>" <?if($int_para[3]==$i)echo 'selected'?>><?=$i?></option>
		<?}?>
		</select><?=$lang['tpl.str67']?><br>
		<?=$lang['tpl.str68']?>
		<select name="loginnumquotiety">
		<?for ($j=1;$j<=10;$j++){?>
			<option value="<?=$j?>" <?if($int_para[4]==$j)echo 'selected'?>><?=$j?></option>
		<?}?>
		</select><?=$lang['tpl.str69']?><br>
		<?=$lang['tpl.str70']?>
		<select name="vindicatenumquotiety">
		<?for ($n=1;$n<=10;$n++){?>
			<option value="<?=$n?>" <?if($int_para[5]==$n)echo 'selected'?>><?=$n?></option>
		<?}?>
		</select><?=$lang['tpl.str69']?>
		</td>
	</tr>
	<tr>
		<th align="center" colspan="2"><?=$lang['tpl.str71']?></th>
	</tr>
	<tr>
		<td class="tablebody2"  style="text-align:left;line-height:30px;padding-left:60px;padding-top:0px;">
		<?=$lang['tpl.str72']?>
		<input type="text" name="baseineigl" size="10" value="<?=$o_para[0]?>"><?=$lang['tpl.str73']?><br>
		<?=$lang['tpl.str74']?>
		<input type="text" name="addmoney" size="10" value="<?=$o_para[1]?>"><?=$lang['tpl.str52']?><br>
		<?=$lang['tpl.str75']?>
		<input type="text" name="addspell" size="10" value="<?=$o_para[2]?>"><?=$lang['tpl.str76']?></td>
		<td class="tablebody2" style="text-align:left;line-height:30px;padding-left:60px;padding-top:0px;">
		<?=$lang['tpl.str77']?>
		<input type="text" name="gzneedspell" size="10" value="<?=$o_para[3]?>"><?=$lang['tpl.str78']?><br>
		<?=$lang['tpl.str79']?>
		<input type="text" name="gzaddexp" size="10" value="<?=$o_para[4]?>"><?=$lang['tpl.str76']?><br>
		<?=$lang['tpl.str80']?>
		<input type="text" name="gzaddcachet" size="10" value="<?=$o_para[5]?>"><?=$lang['tpl.str76']?>
		</td>
	</tr>
	<tr>
		<td colspan="2" bgcolor="#FFFFFF" align="center"><input type="submit" name="submit" value="<?=$lang['tpl.str43']?>">&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" name="set" value="<?=$lang['tpl.str44']?>">
		</th>
	</tr>
	</form>
</table>
<?
}
elseif($action=='paylist'){//版主工资列表
	$userobj->usermanageclass();
?>
<table cellpadding="0" cellspacing="0" class="mainbox tableborder" align="center">
<tr><th align="center"><?=$lang['doassess.info21']?></th><th align="center"><?=$lang['doassess.info24']?></th><th align="center"><?=$lang['doassess.info25']?></th><th align="center"><?=$lang['doassess.info26']?></th><th align="center"><?=$lang['doassess.info27']?></th><th align="center"><?=$lang['doassess.info28']?></th></tr>
<?
	if(!empty($paylist)){
		if(is_array($paylist)){
			foreach($paylist as $payarr){
?>
<tr><td align="center"><?=$payarr['username']?></td><td align="center"><?=$payarr['forum_num']?></td><td align="center"><?=$payarr['login_num']?></td><td align="center"><?=$payarr['vindicate_num']?></td><td align="center"><?=gmdate('Y-m-d H:i',$payarr['paycount_date']+getUserTimeZoneOffset())?></td><td align="center"><?=$payarr['pay_num']?></td></tr>
<?
			}
		}
	}
?>
</table>
<?}?>