<? if(!defined('UC_ROOT')) exit('Access Denied');?>
<? include $this->gettpl('header_client');?>
<? include $this->gettpl('pm_nav');?>

<div class="ucinfo">
<form method="post" action="index.php?m=pm_client&a=delete&folder=<?=$folder?>&filter=<?=$filter?>&<?=$extra?>">
<input type="hidden" name="formhash" value="<?=FORMHASH?>" />
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="pmlist">
<? $pmrange = 0;?>
<? if($pmlist) { ?>
	<? if($filter != 'announcepm') { ?>
		<tr class="ctrlbar">
			<td class="sel"><input type="checkbox" name="chkall" onclick="checkall(this.form, 'delete')" /></td>
			<td class="ava"><button name="pmsend" type="submit">删除</button></td>
			<td class="pef"></td>
			<td class="">
				<? if($folder != 'newbox' && $multipage) { ?><?=$multipage?><? } ?>
			</td>
		</tr>
	<? } ?>
	<? foreach((array)$pmlist as $pm) {?>
		<tr<? if($folder != 'newbox' && $pm['newstatus'] == 1) { ?> class="onset"<? } ?>>
			<td class="sel"><? if($filter != 'announcepm') { ?><input type="checkbox" name="delete[]" value="<?=$pm['pmid']?>" /><? } ?></td>
			<? if($filter != 'announcepm' && $folder != 'savebox') { ?>
				<td class="ava">
				<? if($pm['avataruid']) { ?><img src="avatar.php?uid=<?=$pm['avataruid']?>&size=small" /><? } ?>
				</td>
				<td class="per">
				<? if($folder == 'inbox' || $folder == 'announcebox') { ?>
					<? if($pm['msgfromid']) { ?><?=$pm['msgfrom']?><? } else { ?><b>系统消息</b><? } ?>
				<? } elseif($folder == 'newbox') { ?>
					<? if($pm['newstatus'] == 1) { ?><? if($pm['msgfromid']) { ?><?=$pm['msgfrom']?><? } else { ?><b>系统消息</b><? } ?><? } else { ?><?=$pm['msgto']?><? } ?>
				<? } else { ?>
					<?=$pm['msgto']?>
				<? } ?>
				<p><?=$pm['daterangetext']?> <? if($pm['daterange'] <= 3) { ?><?=$pm['datelinetime']?><? } else { ?><?=$pm['dateline']?><? } ?></p>
				</td>
				<td class="title"><h2>
				<? if($folder == 'newbox') { ?>
					<? if($pm['newstatus'] == 1) { ?>
						<a class="boldtext" href="index.php?m=pm_client&a=view&pmid=<?=$pm['pmid']?>&folder=inbox&filter=<?=$filter?>&from=newbox&<?=$extra?>" id="pm_view_<?=$pm['pmid']?>"><?=$pm['subject']?></a>
					<? } else { ?>
						<a class="boldtext" href="index.php?m=pm_client&a=view&pmid=<?=$pm['pmid']?>&folder=outbox&filter=<?=$filter?>&from=newbox&<?=$extra?>" id="pm_view_<?=$pm['pmid']?>"><?=$pm['subject']?></a>
					<? } ?>
				<? } else { ?>
					<a <? if($pm['newstatus']) { ?>class="boldtext" <? } ?>href="index.php?m=pm_client&a=view&pmid=<?=$pm['pmid']?>&folder=<?=$folder?>&filter=<?=$filter?>&<?=$extra?>" id="pm_view_<?=$pm['pmid']?>"><?=$pm['subject']?></a>
				<? } ?></h2>
				<p><?=$pm['message']?></p>
			<? } else { ?>
				<td colspan="3" class="savetitle"><h2>
					<? if($folder == 'savebox') { ?>
						<a href="index.php?m=pm_client&a=send&pmid=<?=$pm['pmid']?>&do=savebox&folder=savebox&<?=$extra?>"><?=$pm['subject']?></a>
					<? } else { ?>
						<a href="index.php?m=pm_client&a=view&pmid=<?=$pm['pmid']?>&folder=<?=$folder?>&filter=<?=$filter?>&<?=$extra?>" id="pm_view_<?=$pm['pmid']?>"><?=$pm['subject']?></a>
					<? } ?>
					<em>[<?=$pm['dateline']?>]</em></h2>
					<p><?=$pm['message']?></p>
			<? } ?>
			</td>
		</tr>
	<? } ?>
	</tbody>
	<? if($filter != 'announcepm') { ?>
		<tfoot>
			<tr class="ctrlbar">
				<td class="sel"><input type="checkbox" onclick="this.form.chkall.click()" /></td>
				<td class="ava"><button onclick="this.form.pmsend.click()" type="button">删除</button></td>
				<td class="pef"></td>
				<td class="">
					<? if($folder != 'newbox' && $multipage) { ?><?=$multipage?><? } ?>
				</td>
			</tr>
		</tfoot>
	<? } ?>
	</table>
<? } else { ?>
	<tr>
		<td colspan="4">没有短消息</td>
	</tr>
	</table>
<? } ?>
</form>
</div>

<? include $this->gettpl('footer_client');?>