<!--{include file="<!--{$oapath}-->public/ins_page.tpl"}-->
<block name="content">
<div class="page-header clearfix">
	<h1 class="col-sm-8">站内消息</h1>
	<div class="col-sm-4">
		<form name="form_search" id="form_search" method="post" class="pull-right">
			<div class="input-group col-20">
				<input class="form-control" type="text" name="keyword" id="keyword">
				<div class="input-group-btn">
					<a class="btn btn-sm btn-primary" onclick="submit_search();"><i class="fa fa-search"></i></a>
				</div>
			</div>
		</form>
	</div>
</div>	<div class="space-8"></div>
	<div class="operate panel panel-default">
		<div class="panel-body">
			<div class="pull-left">

			</div>
			<div class="pull-right">
				<a class="btn btn-sm btn-primary" onclick="add()">发送消息</a>
			</div>
		</div>
	</div>

	<div class="ul_table">
		<hr>
		   <!--{if empty($list)}-->
                             没找到数据
                    <!--{else}-->
             
                        <!--{foreach $list as  $key=>$vo}-->
				<div class="row">
					<div class="col-xs-1">
						<div class="user">
                                                       <!--{if $vo.sender_id==$owner_id}-->
                                                       		<img class="img-thumbnail" src=""  onerror="javascript:this.src='<!--{$oapath}-->Ins/img/no_avatar.jpg'"/>
                                                       <!--{else}-->
                                                                <img class="img-thumbnail" src=""  onerror="javascript:this.src='<!--{$oapath}-->Ins/img/no_avatar.jpg'"/>							
                                                        <!--{/if}--> 							
						</div>
					</div>
					<div class="col-xs-11">
						<div class="<!--{if $vo.unread > '0'}-->bold<!--{/if}--> ">
							 <!--{if $vo.sender_id==$owner_id}-->
								发给 <!--{$vo.receiver_name}-->：<span><!--{$vo.create_time|date_format:'%Y-%m-%d %H:%I:%S'}--></span>								
							 <!--{else}-->
								<!--{$vo.sender_name}-->：<span><!--{$vo.create_time|date_format:'%Y-%m-%d'}--></span>																		
							 <!--{/if}--> 	
						</div>
						<div class="bold">
							<!--{$vo.content}-->
						</div>
						<p>							
							<span class="pull-right">
								   <!--{if $vo.sender_id==$owner_id}-->
									<a href="oa.php?c=Message&a=read&reply_id=<!--{$vo.receiver_id}-->">共<!--{$vo.count}-->条对话</a>
									<a onclick="reply_message(<!--{$vo.receiver_id}-->)">回复</a>
									<a onclick="del_message(<!--{$vo.receiver_id}-->)">删除</a>
							 <!--{else}-->
									<a href="oa.php?c=Message&a=read&reply_id=<!--{$vo.sender_id}-->">共<!--{$vo.count}-->条对话</a>
									<a onclick="reply_message(<!--{$vo.sender_id}-->)">回复</a>
									<a onclick="del_message(<!--{$vo.sender_id}-->)">删除</a>								
							<!--{/if}-->
							</span>
						</p>
					</div>
				</div>
				<hr>
			 <!--{/foreach}-->  
			<div class="pagination">
				<!--{$showpage}-->
			</div>
                            
                         
                        <!--{/if}--> 

	</div>
</block>

					
				</div>
			</div>
		</div>
		<!--<iframe src="{:U('push/client')}" class="push" id="push"></iframe>-->
		<!-- Mainly scripts -->
		<script src="<!--{$oapath}-->Ins/js/jquery-2.1.1.js"></script>
		<script src="<!--{$oapath}-->Ins/js/bootstrap.min.js"></script>
		<script src="<!--{$oapath}-->Ins/js/plugins/metisMenu/jquery.metisMenu.js"></script>
		<script src="<!--{$oapath}-->Ins/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
		<!-- Custom and plugin javascript -->
		<script src="<!--{$oapath}-->Ins/js/inspinia.js"></script>
		<script src="<!--{$oapath}-->Ins/js/common.js"></script>
		<script src="<!--{$oapath}-->Ins/js/plugins/pace/pace.min.js"></script>
                
		<script src="<!--{$oapath}-->Ins/js/plugins/toastr/toastr.min.js"></script>
                <script src="<!--{$oapath}-->Ins/js/plugins/gritter/jquery.gritter.min.js"></script>
                <script src="<!--{$oapath}-->Ins/js/plugins/bootbox/bootbox.min.js"></script>
		<include file="Layout:ins_plugin_js"/>
<block name="js">
	<script type="text/javascript">
		function del_message($reply_id) {
			ui_confirm('确定要删除吗?', function() {
				sendAjax("{:U('del','type=dialogue')}", 'reply_id=' + $reply_id, function(data) {
					if (data.status) {
						ui_alert(data.info, function() {
							location.reload(true);
						});
					}
				});
			});
		}

		function reply_message($reply_id) {
			winopen(fix_url("oa.php?c=Message&a=reply?reply_id=" + $reply_id), 700, 430);
		}

		function add() {
			window.open("oa.php?c=Message&a=add", "_self");
		}

		$(document).ready(function() {
			set_return_url();
		});
	</script>
</block>
	</body>
</html>
