chengkun
2025-04-18 1bb985f32f2efe0f9dd69f3cf29a1c809b1cf96d
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
        <link href="images/reset.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
        <link href="images/system.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
        <link href="images/table_form.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
        <script src="{yun:}$config.sy_weburl{/yun}/js/jquery-1.8.0.min.js?v={yun:}$config.cachecode{/yun}"></script>
        <script src="js/admin_public.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
        <script src="{yun:}$config.sy_weburl{/yun}/js/ueditor/ueditor.config.js?v={yun:}$config.cachecode{/yun}"></script>
        <script src="{yun:}$config.sy_weburl{/yun}/js/ueditor/ueditor.all.min.js?v={yun:}$config.cachecode{/yun}"></script>
        <link href="{yun:}$config.sy_weburl{/yun}/js/layui/css/layui.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet"
         type="text/css" />
        <script src="{yun:}$config.sy_weburl{/yun}/js/layui/layui.js?v={yun:}$config.cachecode{/yun}"></script>
        <script src="{yun:}$config.sy_weburl{/yun}/js/layui/phpyun_layer.js?v={yun:}$config.cachecode{/yun}"></script>
 
        <title>后台管理</title>
        <style>
            .layui-form-item {
                margin-bottom: 0px;
                clear: both;
            }
        </style>
    </head>
    <body class="body_ifm">
        <div class="infoboxp">
 
            <div class="tty-tishi_top">
            <div class="admin_new_tip">
                <a href="javascript:;" class="admin_new_tip_close"></a>
                <a href="javascript:;" class="admin_new_tip_open" style="display:none;"></a>
                <div class="admin_new_tit"><i class="admin_new_tit_icon"></i>操作提示</div>
                <div class="admin_new_tip_list_cont">
                    <div class="admin_new_tip_list">添加公告主要满足运营者发布网站公告需求,针对网站大记事或优惠活动都是可以通过公告形式发布!让用户了解到网站动态!<span style="color: red">公告内容中如提供文档、表格等附件供下载,请从编辑器上传附件,不要从其他地方直接复制。</span></div>
                </div>
            </div>
            <div class="clear"></div>
 
                <iframe id="supportiframe" name="supportiframe" onload="returnmessage('supportiframe');" style="display:none"></iframe>
                <form name="myform" target="supportiframe" action="index.php?m=admin_announcement&c=save" method="post" encType="multipart/form-data"
                 onSubmit="return checkform(this);">
                    <table width="100%" class="table_form" style="background:#fff;">
                        <tr class="admin_table_trbg">
                            <th colspan="4" class="admin_bold_box">
                                <div class="admin_bold">添加公告</div>
                            </th>
                        </tr>
                        <tr>
                            <th width="200">公告标题:</th>
                            <td>
                                <div class="layui-input-block t_w480">
                                    <input type="text" name="title" id="title" lay-verify="required" placeholder="请输入公告标题" value="{yun:}$info.title{/yun}"
                                     size="40" autocomplete="off" class="layui-input">
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <th>使用范围:</th>
                            <td><input type="button" value="{yun:}if $info.did>0{/yun}{yun:}$Dname[$info.did]{/yun}{yun:}elseif $info.did==-1{/yun}全站{yun:}else{/yun}主站{yun:}/if{/yun}"
                                 class="city_news_but t_w480" onClick="add_site('{yun:}$info.did{/yun}','{yun:}$Dname[$info.did]{/yun}');" style="text-align: left;">
                                <input type="hidden" id="did" value="{yun:}$info.did{/yun}" name="did">
                            </td>
                        </tr>
                        <tr class="admin_table_trbg">
                            <th class="t_fr">关 键 词:</th>
                            <td>
                                <div class="layui-input-block t_w480">
                                    <input type="text" name="keyword" id="keyword" lay-verify="required" placeholder="请输入关键词" value="{yun:}$info.keyword{/yun}"
                                     size="50" autocomplete="off" class="layui-input">
                                </div>
                                <span class="admin_web_tip">多关键字,请用,隔开,请不要为空</span>
                            </td>
                        </tr>
 
                        <tr>
                            <th class="t_fr">开始时间:</th>
                            <td>
                                <div class="layui-input-block t_w480">
                                    <input type="text" name="startime" id="startime" lay-verify="required" placeholder="请输入开始时间" value="{yun:}if $info.startime{/yun}{yun:}$info.startime|date_format:'%Y-%m-%d'{/yun}{yun:}/if{/yun}"
                                     size="50" autocomplete="off" class="layui-input">
                                </div>
                                <span class="admin_web_tip">默认当前时间</span>
                            </td>
                        </tr>
 
                        <tr>
                            <th class="t_fr">结束时间:</th>
                            <td>
                                <div class="layui-input-block t_w480">
                                    <input type="text" name="endtime" id="endtime" lay-verify="required" placeholder="请输入结束时间" value="{yun:}if $info.endtime{/yun}{yun:}$info.endtime|date_format:'%Y-%m-%d'{/yun}{yun:}/if{/yun}"
                                     size="50" autocomplete="off" class="layui-input">
                                </div>
                                <span class="admin_web_tip">默认时间为永久</span>
                            </td>
                        </tr>
                        <tr>
                            <th class="t_fr">描  述:</th>
                            <td>
                                <div class="layui-input-block t_w480">
                                    <textarea name="description" placeholder="请输入描述" lay-verify="required" class="layui-textarea"
                                    autocomplete="off">{yun:}$info.description{/yun}</textarea>
                                </div>
                            </td>
                        </tr>
                        <tr class="admin_table_trbg">
                            <th class="t_fr">公告内容: </th>
                            <td>
                                <script id="myEditor" name="content" type="text/plain" style="width:700px;height:300px;">{yun:}$info.content{/yun}</script>
                            </td>
                        </tr>
 
                        <tr>
                            <th>&nbsp;</th>
                            <td align="left">
                                <input type="hidden" name="pytoken" value="{yun:}$pytoken{/yun}">
                                {yun:}if $info.id{/yun}
                                <input type="hidden" name="id" size="40" value="{yun:}$info.id{/yun}" />
                                <input type="hidden" name="lasturl" value="{yun:}$lasturl{/yun}">
                                <input class="layui-btn tty_sub" type="submit" name="update" value="&nbsp;更 新&nbsp;" />
                                {yun:}else{/yun}
                                <input class="layui-btn tty_sub" type="submit" name="add" value="&nbsp;添 加&nbsp;" />
                                {yun:}/if{/yun}
                                <input class="layui-btn tty_cz" type="reset" name="reset" value="&nbsp;重 置 &nbsp;" />
                            </td>
                        </tr>
 
                    </table>
 
                </form>
            </div>
        </div>
        {yun:}include file="$adminstyle/checkdomain.htm"{/yun}
        <script language="javascript">
            layui.use(['layer', 'form', 'laydate'], function() {
                var layer = layui.layer,
                    form = layui.form,
                    laydate = layui.laydate,
                    $ = layui.$;
                
                //定义当前时间
                var nowTime = new Date();
 
                //获取最小值
                let stime = $("input[name='startime']").val();
                let etime = $("input[name='endtime']").val();
 
                //开始时间
                laydate.render({
                    elem: '#startime',
                    value: stime!='' ? stime : nowTime,
                    min: 0
                });
                //结束时间
                laydate.render({
                    elem: '#endtime',
                    value: etime!='' ? etime : '',
                    min: 1
                });
            });
 
            function checkform(myform) {
                if (myform.title.value == "") {
                    parent.layer.msg('请填写公告标题!', 2, 8);
                    myform.title.focus();
                    return (false);
                }
 
                if (myform.keyword.value == "") {
                    parent.layer.msg('请填写公告关键字!', 2, 8);
                    myform.keyword.focus();
                    return (false);
                }
 
                var stime    =    $('#startime').val();
                var etime    =    $('#endtime').val();
 
                if(stime!='' && etime!='' && stime>etime){
                    parent.layer.msg('结束时间必须大于开始时间!', 2,8);return false;
                }
 
 
                if (myform.description.value == "") {
                    parent.layer.msg('请填写公告描述!', 2, 8);
                    myform.description.focus();
                    return (false);
                }
                loadlayer();
            }
 
            var ue = UE.getEditor('myEditor');
        </script>
    </body>
</html>