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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<!DOCTYPE html>
<html lang="en">
<include file="Public:header" />
<include file="Public:page_css" />
<script>
$(function(){
$('#managesay_add').ajaxForm({
beforeSubmit: checkForm, // 此方法主要是提交前执行的方法,根据需要设置
success: complete, // 这是提交后的方法
dataType: 'json'
});
function checkForm(){
if( '' == $.trim($('#title').val())){
layer.alert('标题不能为空', {icon: 5}, function(index){
layer.close(index);
$('#title').focus();
});
return false;
}
}
function complete(data){
if(data.status==1){
layer.msg(data.info, {icon: 6,time:1000}, function(index){
layer.close(index);
window.location.href=data.url;
});
}else{
layer.msg(data.info, {icon: 5,time:1000}, function(index){
layer.close(index);
});
return false;
}
}
});
</script>
<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
<include file="Public:nav" />
<div class="row wrapper border-bottom white-bg page-heading">
<div class="col-lg-12">
<h2>经理说</h2>
<ol class="breadcrumb">
<li>
<a href="{:U('Index/index')}"><i class="fa fa-home"></i> 主页</a>
</li>
<li>
<a>经理说</a>
</li>
<li>
<strong>添加数据</strong>
</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>添加数据</h5>
<div class="ibox-tools">
<a class="collapse-link">
<i class="fa fa-chevron-up"></i>
</a>
</div>
</div>
<div class="ibox-content">
<form class="form-horizontal" name="managesay_add" id="managesay_add" method="post" action="__URL__/managesay_add">
<div class="hr-line-dashed"></div>
<div class="form-group">
<label class="col-sm-2 control-label"> 标题</label>
<div class="col-sm-5">
<input type="text" name="title" id="title" placeholder="请输入标题" class="form-control" />
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<label class="col-sm-2 control-label">封面图 </label>
<div class="col-sm-6">
<div style="width: 200px; height: 90px; float: left;">
<input type="hidden" name="listimg" value="" id="listimg_photo" />
<input id="photo_listimg" name="photo_listimg" type="file" multiple="true" value="" />
</div>
<div style="width: 200px; height: 90px; float: left;">
<img id="upload_xiaoimg" class="img-circle" src="" onerror="this.src='__PUBLIC__/Admin/img/touxiang_default.gif'" style="width: 80px;height: 80px" />
</div>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<label class="col-sm-2 control-label">上传视频,音频 </label>
<div class="col-sm-6">
<div style="width: 200px; height: 90px; float: left;">
<input type="hidden" name="path" value="" id="path_photo" />
<input id="photo_path" name="photo_path" type="file" multiple="true" value="" />
</div>
<div style="width: 200px; height: 90px; float: left;">
<img id="upload_xiaoimg" class="img-circle" src="" />
</div>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<label class="col-sm-2 control-label"> 是否首页推荐</label>
<div class="col-sm-5" style="padding-top:5px;">
<input name="is_hot" id="is_hot" value="1" class="js-switch" type="checkbox" />
<span class="lbl"> 默认关闭</span>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<div class="col-sm-4 col-sm-offset-2">
<button class="btn btn-primary" type="submit">保存信息</button>
<a class="btn btn-danger" href="javascript:history.go(-1);">返回</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<include file="Public:footer" />
<js file='__PUBLIC__/Admin/uploadify/jquery.uploadify.min.js' />
<link rel="stylesheet" href="__PUBLIC__/Admin/uploadify/uploadify.css">
</body>
</html>
<script type="text/javascript">
$("#photo_listimg").uploadify({
'swf': '__PUBLIC__/Admin/uploadify/uploadify.swf?t={$nowtime}',
'uploader': '{:U("Upload/persona")}',
'cancelImg': '__PUBLIC__/Admin/uploadify/uploadify-cancel.png',
'buttonText': '上传图片',
'height': 35,
'fileTypeExts': '*.gif;*.jpg;*.png',
'queueSizeLimit': 1,
'onUploadSuccess': function(file, data, response) {
$("#listimg_photo").val(data);
$("#upload_xiaoimg").attr('src', '__ROOT__/Uploads' + data).show();
}
});
//视频
$("#photo_path").uploadify({
'swf': '__PUBLIC__/Admin/uploadify/uploadify.swf?t={$nowtime}',
'uploader': '{:U("Upload/persona")}',
'buttonText': '视频、音频、',
'height': 35,
'fileTypeExts': '*.gif;*.jpg;*.png;*.mp4;*.txt;*.mp3',
'queueSizeLimit': 1,
'onUploadSuccess': function(file, data, response) {
$("#path_photo").val(data);
$("#upload_img3").attr('video', '__ROOT__/Uploads' + data).show();
}
});
</script>
<!-- 下拉CSS样式 -->
<script>
var config = {
'.chosen-select': {},
}
for (var selector in config) {
$(selector).chosen(config[selector]);
}
</script>
<!-- IOS开关样式配置 -->
<script>
var elem = document.querySelector('.js-switch');
var switchery = new Switchery(elem, {
color: '#1AB394'
});
var config = {
'.chosen-select': {},
}
for (var selector in config) {
$(selector).chosen(config[selector]);
}
</script>
</body>
</html>