You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

121 lines
4.8 KiB

<?php
$token = $_REQUEST["token"];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, viewport-fit=cover" />
<title>系統通知</title>
<link rel="stylesheet" href="css/plugins/fontawesome-free/css/all.min.css">
<link rel="stylesheet" href="css/dist/css/adminlte.min.css">
<script src="../css/jquery.min.js"></script>
<script src="../css/bootstrap.min.js"></script>
<style>
.content-wrapper {
background-color: #fff;
}
.col-lg-6 {
padding:8px 0 0 0!important;
}
.card {
height: 97vh;
line-height: 14 px;
font-size: 14px;
}
.card-header {
background-color: #f4f6f9;
padding-left: 16px;
}
.card-body ol {
font-size: 14px;
margin-left: -30px;
}
.nav-pills .nav-link {
color: #446887;
}
h5 svg {
vertical-align: baseline;
}
h5 a {
color: #000;
}
@media screen and (max-width: 992px){
.card {
height: 95vh;
}
}
</style>
</head>
<body>
<div class="wrapper">
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Main content -->
<div class="content">
<div class="container">
<div class="row">
<!-- /.col-md-6 -->
<div class="col-lg-6">
<div class="card">
<div class="card-header">
<h5 class="card-title m-0"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-bell" viewBox="0 0 16 16"><path d="M8 16a2 2 0 0 0 2-2H6a2 2 0 0 0 2 2zM8 1.918l-.797.161A4.002 4.002 0 0 0 4 6c0 .628-.134 2.197-.459 3.742-.16.767-.376 1.566-.663 2.258h10.244c-.287-.692-.502-1.49-.663-2.258C12.134 8.197 12 6.628 12 6a4.002 4.002 0 0 0-3.203-3.92L8 1.917zM14.22 12c.223.447.481.801.78 1H1c.299-.199.557-.553.78-1C2.68 10.2 3 6.88 3 6c0-2.42 1.72-4.44 4.005-4.901a1 1 0 1 1 1.99 0A5.002 5.002 0 0 1 13 6c0 .88.32 4.2 1.22 6z"/></svg>
<a href="/wms/notice-index.php?token=<?php echo $token; ?>" target="_parent">系統通知</a></h5>
<a style="float:right;" href="/wms/notice-delete-all.php?token=<?php echo $token; ?>" target="_parent">全部已讀</a>
</div>
<div class="card-body p-0">
Loading...
</div>
</div>
</div>
<!-- /.col-md-6 -->
</div>
<!-- /.row -->
</div><!-- /.container-fluid -->
</div>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
</div>
<script>
$(document).ready(function() {
here();
var intervalId = window.setInterval(function(){
here();
}, 60000);
});
function here() {
var URL = 'api_getdata.php';
$.ajax({
type: "GET",
data: {p: 'notice', token: '<?php echo $token; ?>'},
url: URL,
success: function (msg) {
var obj = JSON.parse(msg);
var myhtml = '';
if (obj.st == 'ok') {
myhtml += '<ul class="nav nav-pills flex-column">';
for (i=1; i<=Object.keys(obj.content).length; i++) {
if (obj.content[i].kind == '4') {
myhtml += '<li class="nav-item"><a href="/wms/mkt/pricereview_renovate-index.php?function_name=pricereview_renovate&token=<?php echo $token; ?>" class="nav-link" target="_parent">'+obj.content[i].title+'</a></li>';
} else if (obj.content[i].kind == '3') {
myhtml += '<li class="nav-item"><a href="/wms/mkt/pricereview-index.php?function_name=pricereview&token=<?php echo $token; ?>" class="nav-link" target="_parent">'+obj.content[i].title+'</a></li>';
} else if (obj.content[i].kind == '2') {
myhtml += '<li class="nav-item"><a href="/wms/meeting-edit.php?id='+obj.content[i].related_id+'&function_name=meeting&token=<?php echo $token; ?>" class="nav-link" target="_parent">'+obj.content[i].title+'</a></li>';
} else {
myhtml += '<li class="nav-item"><a href="/wms/notice-edit.php?id='+obj.content[i].id+'&token=<?php echo $token; ?>" class="nav-link" target="_parent">'+obj.content[i].title+'</a></li>';
}
}
if (Object.keys(obj.content).length == 6) {
myhtml += '<li class="nav-item"><a href="/wms/notice-index.php?token=<?php echo $token; ?>" class="nav-link" target="_parent">.... 顯示更多</a></li>';
}
myhtml += '</ul>';
$('.card-body').empty().append(myhtml);
}
}
})
}
</script>
</body>
</html>