-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCreateInform.html
More file actions
executable file
·104 lines (94 loc) · 3.75 KB
/
CreateInform.html
File metadata and controls
executable file
·104 lines (94 loc) · 3.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>新增新闻</title>
<link rel='icon' href='pics/logo.jpg' type='image/x-ico' />
<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- 可选的Bootstrap主题文件(一般不用引入) -->
<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="http://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="http://cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link href="custom_css/index.css" rel="stylesheet">
</head>
<body>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="http://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
<script src="http://cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script>
function createInform() {
var inform_title = $("#inform_title").val();
var inform_content = $("#inform_content").val();
if(inform_title.length < 0) {
alert("新闻标题不能为空");
} else if(inform_content.length < 0) {
alert("新闻内容不能为空");
}
$.post("http://localhost/uml/public/index/informmanager/createInform",
{"inform_title":inform_title,"inform_content":inform_content, "user_id":localStorage['uml_user_id']},
function(data,status){
datajson = eval("(" + data + ")")
if (datajson['type']) {
console.log(datajson['inform']);
alert(datajson['message']);
} else {
alert(datajson['message']);
}
});
}
$(document).ready(function(){
$("#username").text(localStorage['uml_user_name']);
var now_url = $('#logout_url').attr("href")+localStorage['uml_user_id'];
$('#logout_url').attr("href",now_url);
});
</script>
<div id="header" class="row">
<div class ="col-md-7">
</div>
<div class ="col-md-2">
<div class ="col-md-4">
<h3>hello,</h3>
</div>
<div class="col-md-8">
<h3 id="username">anonymous</h3>
</div>
</div>
<div class ="col-md-2">
<div class="col-md-2">
</div>
<div class="col-md-10">
<h3><a id="logout_url" href="http://localhost/uml/public/index/login/logout/userid/">退出登录</a></h3>
</div>
</div>
</div>
<div id="content" class="form-horizontal">
<div class="form-group">
<label for="inform_title" class="col-xs-1 control-label">通知标题</label>
<div class="col-xs-10">
<textarea class="form-control" id="inform_title" name="inform_title"></textarea>
</div>
</div>
<div class="form-group">
<label for="inform_content" class="col-xs-1 control-label">通知内容</label>
<div class="col-xs-10">
<textarea class="form-control" rows="23" id="inform_content" name="inform_content"></textarea>
</div>
</div>
<div class="form-group">
<div class="col-xs-1"></div>
<button type="submit" class="btn btn-default col-xs-10" id="inform_submit" onclick="createInform()">
提交
</button>
</div>
</div>
<div id="footer">
</div>
</body>
</html>