<?php TPL::output('global/header.tpl.htm'); ?>

<div class="tny-basic main tny-clear allbg">
	<div class="tny-left lsidebar"> 
		<div class="b_restrain">
			<h3 class="trends-H3  rel content-H3">
				<p class="tny-right p_sx"><a href="account/setting/privacy/#inbox" class="p_set tny-small" title="Message setting">Message setting</a><a href="javascript:;" class="btn-blue2" onClick="$.sQuestions({flgs:1,msg:true}); return false;">Send private messages</a></p>
				Message
			</h3>
			<ul class="pri_letter">
				<?php if ($this->list) { ?>
				<?php foreach($this->list AS $key => $val) { ?>
				<li class="<?php if($val['unread'] > 0){ ?>msg_unread<?php } ?>">

					<a href="people/<?php echo $val['url_token']; ?>" class="addUser"><img src="<?php echo get_avatar_url($val['uid'], 'mid'); ?>" alt="<?php echo $val['user_name']; ?>" title="<?php echo $val['user_name']; ?>"/></a><span class="p_name"> <a href="inbox/read_message/dialog_id-<?php echo $val['dialog_id']; ?>"><?php echo $val['user_name']; ?></a></span>
					<p class="p_txt"><?php echo $val['last_message']; ?></p>
					<p class="p_time"><span class="tny-right"><a href="inbox/read_message/dialog_id-<?php echo $val['dialog_id']; ?>#!contents"><?php if ($val['unread']) { ?>Have <?php echo $val['unread']; ?> A new reply<?php } else { ?>Have <?php echo $val['count']; ?> a dialogue<?php } ?></a> &nbsp; <a href="javascript:;" onclick="if (confirm('Confirm Delete dialog?')) { window.location = GET_BASE_URL + '/inbox/delete_dialog/dialog_id-<?php echo $val['dialog_id']; ?>' }">Delete</a></span><?php echo date('Y-m-d H:i', $val['last_time']); ?></p>
				</li>
				<?php } ?>
				<?php } ?>
			</ul>
			
			<?php echo $this->pagination; ?>
		</div>	
	</div>

	<div class="rsidebar"> 
		<?php TPL::output('block/sidebar_menu.tpl.htm'); ?>	
	</div>
</div>

<?php TPL::output('global/footer.tpl.htm'); ?>
