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
194
195
196
197
198
199
200
201
202
203
204
205
206
<!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>
        <title>后台管理</title>
        <link href="{yun:}$config.sy_weburl{/yun}/js/layui/css/layui.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet">
        <script src="{yun:}$config.sy_weburl{/yun}/js/layui/layui.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
        <script src="{yun:}$config.sy_weburl{/yun}/js/layui/phpyun_layer.js?v={yun:}$config.cachecode{/yun}"></script>
    </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">计划任务是一项使系统在规定时间自动执行某些特定任务的功能。</div>
                        <div class="admin_new_tip_list">管理员可以通过“计划任务”实现自动刷新职位、简历刷新和生成XML操作。计划任务可以设置计划类型按“天、周、月”等方式去执行!</div>
                    </div>
                </div>
                <div class="clear"></div>
 
                <iframe id="supportiframe" name="supportiframe" onload="returnmessage('supportiframe');" style="display:none"></iframe>
                <form action="index.php?m=cron&c=save" method="post" target="supportiframe" class="layui-form">
                    <input type="hidden" name="pytoken" value="{yun:}$pytoken{/yun}">
                    <table width="100%" class="table_form">
                        <tr>
                            <th colspan="2" class="admin_bold_box">
                                <div class="admin_bold">添加计划任务</div>
                            </th>
                        </tr>
                        <tr>
                            <th width="140" class="t_fr">任务名称:</th>
                            <td>
                                <input class="layui-input t_w480" type="text" name="name" id="sy_qqappid" value="{yun:}$row.name{/yun}" size="30"
                                 maxlength="255" placeholder="请输入任务名称"/>
                                <span class="admin_web_tip">如:定期修改职位</span>
                            </td>
                        </tr>
                        <tr>
                            <th width="140" class="t_fr">执行文件:</th>
                            <td>
                                <input class="layui-input t_w480" type="text" name="dir" id="sy_qqappid" value="{yun:}$row.dir{/yun}" size="30"
                                 maxlength="255" placeholder="请输入执行文件或路径"/>
                                <span class="admin_web_tip">执行文件名 如:index.php,文件存放路径/app/include/cron/</span>
                            </td>
                        </tr>
                        <tr>
                            <th width="140" class="t_fr">类型:</th>
                            <td>
                                <div class="layui-input-block">
                                    <input name="type" lay-filter="radio_type" value="1" title="每周" {yun:}if $row.type=="1" || $row.type=='' {/yun} checked {yun:}/if{/yun} type="radio" />
                                    <input name="type" lay-filter="radio_type" value="2" title="每月" {yun:}if $row.type=="2" {/yun} checked {yun:}/if{/yun} type="radio" />
                                    <input name="type" lay-filter="radio_type" value="3" title="每天" {yun:}if $row.type=="3" {/yun} checked {yun:}/if{/yun} type="radio" />
                                    <input name="type" lay-filter="radio_type" value="5" title="每隔N分钟" {yun:}if $row.type=="5" {/yun} checked {yun:}/if{/yun} type="radio" />
                                    <input name="type" lay-filter="radio_type" value="4" title="每隔N秒" {yun:}if $row.type=="4" {/yun} checked {yun:}/if{/yun} type="radio" />
                                </div>
                            </td>
                        </tr>
 
                        <tr id="weektrid" {yun:}if $row.type!='1' && $row{/yun} style="display:none" {yun:}/if{/yun}> 
                            <th width="140" class="t_fr">每周:</th>
                            <td>
                                <div class="layui-input-inline">
                                    <select name="week" id="weekid">
                                        {yun:}foreach from=$arrweek key=k item=v{/yun}
                                        <option value="{yun:}$k+1{/yun}" {yun:}if $row.week==$k{/yun} selected {yun:}/if{/yun}>{yun:}$v{/yun}
                                        </option>
                                        {yun:}/foreach{/yun}
                                    </select>
                                </div>
                            </td>
                        </tr>
 
                        <tr id="monthtrid" {yun:}if $row.type!='2' {/yun} style="display:none" {yun:}/if{/yun}> 
                            <th width="140" class="t_fr">每月:</th>
                            <td>
                                <div class="layui-input-inline fl">
                                    <select name="month" id="monthid">
                                        {yun:}foreach from=$montharr key=k item=v{/yun}
                                        <option value="{yun:}$k+1{/yun}" {yun:}if $row.month==$k{/yun}selected{yun:}/if{/yun}>{yun:}$v{/yun} </option>
                                        {yun:}/foreach{/yun} 
                                    </select> 
                                </div> 
                                <div class="layui-form-mid layui-word-aux" style="margin-left: 20px;">注:选对30日或31日当月无日期,则不执行</div>
                            </td>
                        </tr>
 
                        <tr id="hourtrid" {yun:}if $row.type=='4' || $row.type=='5' {/yun} style="display:none" {yun:}/if{/yun}>
                        <th width="140" class="t_fr">小时:</th>
                            <td>
                                <div class="layui-input-inline">
                                    <select name="hour">
                                        {yun:}foreach from=$hourarr key=k item=v{/yun}
                                        <option value="{yun:}$k{/yun}" {yun:}if $row.hour==$k{/yun}selected{yun:}/if{/yun}>{yun:}$v{/yun} </option>
                                         {yun:}/foreach{/yun} 
                                    </select> 
                                </div> 
                            </td> 
                        </tr>
                        <tr id="minutetrid" {yun:}if $row.type=='4' || $row.type=='5' {/yun} style="display:none" {yun:}/if{/yun}>
                        <th width="140" class="t_fr">分钟:</th>
                            <td>
                                <input class="layui-input t_w480" type="text" name="minute" value="{yun:}$row.minute{/yun}" size="40" maxlength="255" />
                                <span class="admin_web_tip">不填请留空,默认:00</span>
                            </td>
                        </tr>
 
                        <tr id="minutrid" {yun:}if $row.type !='5' {/yun} style="display:none" {yun:}/if{/yun}>
                        <th width="140" class="t_fr">每隔N分钟执行一次:</th>
                        <td>
                            <input class="tty_input t_w480" type="text" name="minu" value="{yun:}$row.minute{/yun}" size="40" maxlength="255" onkeyup="this.value=this.value.replace(/[^0-9]/g,'');" />
                            <span class="admin_web_tip">必填</span>
                        </td>
                        </tr>
 
                        <tr id="secondtrid" {yun:}if $row.type !='4' {/yun} style="display:none" {yun:}/if{/yun}> 
                            <th width="140" class="t_fr">每隔N秒执行一次:</th>
                            <td>
                                <input class="tty_input t_w480" type="text" name="second" value="{yun:}$row.minute{/yun}" size="40" maxlength="255" onkeyup="this.value=this.value.replace(/[^0-9]/g,'');" />
                                <span class="admin_web_tip">必填</span>
                            </td>
                        </tr>
 
                        <tr>
                            <th width="140" class="t_fr">是否启用:</th>
                            <td>
                                <div class="layui-input-inline">
                                    <input lay-skin="switch" name="display_switch" lay-filter="display_switch" {yun:}if $row.display=="1" {/yun}
                                     checked{yun:}/if{/yun} lay-text="是|否" type="checkbox" />
                                    <input type="hidden" name="display" value="{yun:}$row.display{/yun}" />
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <th width="140">&nbsp;</th>
                            <td align="left">
                                <input name="id" value="{yun:}$row.id{/yun}" type="hidden">
                                <input class="tty_sub" type="submit"  value="提交" />&nbsp;&nbsp;
                                <input class="tty_cz" type="reset" value="重置" /></td>
                        </tr>
                    </table>
                </form>
            </div>
 
            <script>
                layui.use(['form', 'layer'], function() {
                    var form = layui.form,
                        layer = layui.layer,
                        $ = layui.$;
 
                    form.on('radio(radio_type)', function(data) {
                        var typeid = data.value;
                        if (typeid == 1) {
                            $("#weektrid").show();
                            $("#monthtrid").hide();
                            $("#hourtrid").show();
                            $("#minutetrid").show();
                            $("#minutrid").hide();
                            $("#secondtrid").hide();
                        } else if (typeid == 2) {
                            $("#monthtrid").show();
                            $("#weektrid").hide();
                            $("#hourtrid").show();
                            $("#minutetrid").show();
                            $("#minutrid").hide();
                            $("#secondtrid").hide();
                        } else if (typeid == 3) {
                            $("#hourtrid").show();
                            $("#minutetrid").show();
                            $("#monthtrid").hide();
                            $("#weektrid").hide();
                            $("#minutrid").hide();
                            $("#secondtrid").hide();
                        } else if (typeid == 5) {
                            $("#monthtrid").hide();
                            $("#weektrid").hide();
                            $("#hourtrid").hide();
                            $("#minutetrid").hide();
                            $("#minutrid").show();
                            $("#secondtrid").hide();
                        }else {
                            $("#monthtrid").hide();
                            $("#weektrid").hide();
                            $("#hourtrid").hide();
                            $("#minutetrid").hide();
                            $("#minutrid").hide();
                            $("#secondtrid").show();
                        }
                    });
 
                    form.on('switch(display_switch)', function(data) {
                        var v = this.checked ? 1 : 2;
                        $("input[name=display]").val(v);
                    });
                });
            </script>
        </div>
    </body>
</html>