<?php
error_reporting(0); 
include("../../config/qiantai.php");
session_start();
if(!isset($_SESSION['username'])){echo "<script>alert('请重新登录!')</script><script>top.location.href='/index$dshz'</script>";exit;}
$username=$_SESSION['username'];
$type="where name='$username'";
$user=queryall(user,$type);
$userid=$user['userid'];
if(!$user){echo "<script>alert('请重新登录!')</script><script>top.location.href='/index$dshz'</script>";exit;}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="gb2312">
<title></title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="/2019newui/qiantai/css/x-admin.css" media="all">
<script src="/2019newui/js/jquery.min.js"></script>
<script src="/layui/layui.js" charset="utf-8"></script> 
<script src="/2019newui/js/x-admin.js"></script> 
</head>
<body>
<div class="x-body">
<blockquote class="layui-elem-quote">
<dl class="apps-filter-tr">
<dt><span  class="xb">个人消息</span></dt>
</dl>
<span class="x-right" style="margin-top:-24px;line-height:10px"> <a class="layui-btn-small" style="line-height:10px;margin-top:-2px;float:right"  href="javascript:location.replace(location.href);" title="刷新"><i class="fa fa-refresh"></i></a></span>
</blockquote>
<table class="layui-table">
<thead>
<tr>
<th style="text-align:center;" >标题</th>
<th style="text-align:center;" >时间</th>
</tr>
</thead>
<tbody>
<?php
$query = mysql_query("SELECT * FROM gonggao  where  userid='$userid'");
while($ab = mysql_fetch_array($query)) {
?>  
<tr>
<td style="text-align:center;" >
<?php if($ab[tz]=='未读'){?>
<span class="n"></span>
<?php }?>
<a  onClick="gg('<?php echo $ab[biaoti]?>','<?php echo $ab[neirong]?>','<?php echo $ab[id]?>')"><?php echo $ab[biaoti]?></a>
</td>
<td style="text-align:center;"  onClick="gg('<?php echo $ab[biaoti]?>','<?php echo $ab[neirong]?>','<?php echo $ab[id]?>')"><?php echo $ab[shijian]?></td>
</tr>
<?php }?>
</tbody>
</table>
<script>
layui.use(['form', 'layedit', 'laydate', 'element', 'jquery', 'layer'], function(){
var form = layui.form
,layer   = layui.layer
,layedit = layui.layedit
,element = layui.element
,$= layui.jquery
,laydate = layui.laydate;
});
</script>
<script>
function gg(biaoti,neirong,id){
layer.open({
type: 1,
title: "公告内容",
area: '500px',
shade: 0.8,
id: 'LAY_layuipro',
btn: ['朕已阅'],
moveType: 1,
content: '<div style="padding:15px 20px; text-align:justify; line-height: 22px; text-indent:2em;border-bottom:1px solid #e2e2e2;widht:100%;height:100%;word-wrap: break-word"><p class="layui-red">'+neirong+'</span></p></div>',
success: function(layero){
var btn = layero.find('.layui-layer-btn');
btn.css('text-align', 'center');
btn.on("click",function(){
$.ajax({
type : "post",
url : "/upgg<?php echo $dshz?>",
dataType: "json",  
async: true,
data: {id: id},
timeout: 10000 ,
success : function(data){
},
error:function(){
}
});
location.reload();
});
},
cancel: function(index, layero){
$.ajax({
type : "post",
url : "/upgg<?php echo $dshz?>",
dataType: "json",  
async: true,
data: {id: id},
timeout: 10000 ,
success : function(data){
},
error:function(){
}
});
location.reload();
}
});
}
</script> 

</body>
</html>