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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
<!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">
    <meta http-equiv="Pragma" content="no-cache" /> 
    <meta http-equiv="Cache-Control" content="no-cache" /> 
    <meta http-equiv="Expires" content="0" />
    
    <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>
    <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>
    <title>后台管理</title>
</head>
 
<body class="body_ifm">
    <div class="infoboxp"> 
        <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">如果你已经注册PHPYUN海报系统账户,请先进行账户验证后,再进行海报配置参数保存。</div>
                <div class="admin_new_tip_list">请先注册PHPYUN海报系统帐户,<a href="http://haibao.phpyun.com" target="_blank" style="color:blue;">点击注册</a>。</div>
            </div>
        </div>
        
        <div class="clear"></div>
        <div style="height:10px;"></div>
 
        <div class="main_tag">
            <div class="tag_box">
                <form action="" method="post" class="layui-form">
                    <table width="100%" class="table_form">
                        <tr>
                            <th width="200" bgcolor="#f0f6fb"><span class="admin_bold">参数说明</span></th>
                            <td bgcolor="#f0f6fb"><span class="admin_bold">参数值</span></td>
                        </tr>
                        <tr class="admin_table_trbg">
                            <th width="200">是否开启:</th>
                            <td> 
                                <div class="layui-form-item">
                                    <div class="layui-input-block">
                                        <div class="layui-input-inline">
                                            <input id="sy_haibao_isopen_1" type="radio" {yun:}if $config.sy_haibao_isopen=='1'{/yun}checked=""{yun:}/if{/yun} lay-filter="isopen" value="1" name="sy_haibao_isopen" title="开启" >
                                            
                                            <input id="sy_haibao_isopen_2" type="radio" {yun:}if $config.sy_haibao_isopen!='1'{/yun}checked=""{yun:}/if{/yun} lay-filter="isopen" value="2" name="sy_haibao_isopen" title="关闭" >
                                        </div>
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr class="admin_table_trbg">
                            <th width="200">帐户:</th>
                            <td>
                                <input id="sy_haibaouserid" name="sy_haibaouserid" type="hidden" value="" >
                                <input class="input-text tips_class" type="text" name="sy_haibaouser" id="sy_haibaouser" value="{yun:}$config.sy_haibaouser{/yun}" size="30" maxlength="255" />  
                            </td>
                        </tr>
                        <tr>
                            <th width="200">密码:</th>
                            <td><input class="input-text tips_class" type="password" name="sy_haibaopw" id="sy_haibaopw" value="{yun:}$config.sy_haibaopw{/yun}" size="30" maxlength="255"/></td>  
                        </tr>
                        <tr class="admin_table_trbg">
                            <th width="200">KEY:</th>
                            <td><input class="input-text tips_class" type="text" name="sy_haibaokey" id="sy_haibaokey" value="{yun:}$config.sy_haibaokey{/yun}" size="50" maxlength="255"/>  
                            <span class="admin_web_tip"> 运营网站加密串</span></td>
                        </tr>
 
                        {yun:}if !$config.sy_haibaouserid{/yun}
                        <tr>
                            <td colspan="2" align="center">
                                <input class="layui-btn layui-btn-normal" id="check" type="button" name="" value="验证" />
                            </td>
                        </tr>
                        {yun:}/if{/yun}
 
                        <tr>
                            <th width="160">海报运营站:</th>
                            <td>
                                <input class="input-text input_text_rp" type="text" name="sy_hburl" id="sy_hburl" value="" disabled="disabled"/>
                            </td>
                        </tr>
                        <tr>
                            <th width="160">海报数量:</th>
                            <td>
                                <input class="input-text input_text_rp" type="text" name="sy_haibaonum" id="sy_haibaonum" value="0" disabled="disabled"/> 条 / 天
                            </td>
                        </tr>
                        <tr>
                            <th width="160">今日剩余海报数量:</th>
                            <td>
                                <input class="input-text input_text_rp" type="text" name="rest_haibaonum" id="rest_haibaonum" value="0" disabled="disabled"/> 条 
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" align="center">
                                <input class="layui-btn layui-btn-normal" id="config" type="button" name="haibaoconfig" value="提交" />
                                &nbsp;&nbsp;
                                <input class="layui-btn layui-btn-normal" type="reset" value="重置" />
                            </td>
                        </tr>
                    </table>
                    <input type="hidden" id="pytoken" name="pytoken" value="{yun:}$pytoken{/yun}">
                </form>
            </div>
        </div>
    </div>
    <script> 
        layui.use(['layer', 'form'], function(){
            var layer = layui.layer
            ,form = layui.form
            ,$ = layui.$;
 
            var sy_seo_rewrite = '{yun:}$config.sy_seo_rewrite{/yun}';
 
            form.on('radio(isopen)', function (data) {
                
                 if(data.value==1 && sy_seo_rewrite!='1'){
                    parent.layer.msg('请先开启网站伪静态!', 2, 9,function(){
                        window.location.reload();
                    });
                };
                form.render(); 
            });
             
        });
 
        $(function(){
            $("#config").click(function(){
                var sy_haibao_isopen    =    $("input[name=sy_haibao_isopen]:checked").val();
                var huser = $("#sy_haibaouser").val();
                var hpw = $("#sy_haibaopw").val();
                var hkey = $("#sy_haibaokey").val();
                if(sy_haibao_isopen == '1'){
                    if(huser==""){
                        parent.layer.msg('请填写账户名称', 2, 8);
                        return false;
                    }
                    if(hpw==""){
                        parent.layer.msg('请填写账户密码', 2, 8);
                        return false;
                    }
                    if(hkey==""){
                        parent.layer.msg('请填写账户key值', 2, 8);
                        return false;
                    }
                }
                loadlayer();
                  $.post("index.php?m=admin_haibao&c=save",{
                    config : $("#config").val(),
                    sy_haibaouser : $("#sy_haibaouser").val(),
                    sy_haibaouserid : $("#sy_haibaouserid").val(),
                    sy_haibao_isopen : $("input[name=sy_haibao_isopen]:checked").val(), 
                    sy_haibaokey :$("#sy_haibaokey").val(),
                    pytoken : $("#pytoken").val(),
                    sy_haibaopw : $("#sy_haibaopw").val(),
                 },function(data,textStatus){
                    parent.layer.closeAll('loading');
                    config_msg(data);
                });
            });
            
            $("#check").click(function(){
                $.post("index.php?m=admin_haibao&c=get_restnum",{
                    pytoken : $("#pytoken").val(),
                    haibaouser : $("#sy_haibaouser").val(),
                    key : $("#sy_haibaokey").val()
                },function(data){
                    if(data){
                        data = eval('('+data+')');
 
                        if(data.mid){
                            $("#sy_haibaouserid").val(data.mid);
                        }else{
                            parent.layer.msg('账号信息填写错误!', 2, 8);
                            return false;
                        }
                        if(data.hbnum){
                            $("#sy_haibaonum").val(data.hbnum);
                        }else{
                            $("#sy_haibaonum").val(0);
                        }
                        if(data.nums){
                            $("#rest_haibaonum").val(data.hbnum-data.nums);
                        }else{
                            $("#rest_haibaonum").val(data.hbnum);
                        }
                        if(data.weburl){
                            $("#sy_hburl").val(data.weburl);
                        }
                    }else{
                        parent.layer.msg('账号信息填写错误!', 2, 8);
                        return false;
                    }
                });
            })
            
            '{yun:}if $config.sy_haibaouserid{/yun}'
                $.post("index.php?m=admin_haibao&c=get_restnum",{
                    pytoken : $("#pytoken").val(),
                    haibaouser : $("#sy_haibaouser").val(),
                    key : $("#sy_haibaokey").val()
                },function(data){
                    if(data){
                        data = eval('('+data+')');
                        if(data.hbnum){
                            $("#sy_haibaonum").val(data.hbnum);
                        }else{
                            $("#sy_haibaonum").val(0);
                        }
 
                        if(data.nums){
                            $("#rest_haibaonum").val(data.hbnum-data.nums);
                        }else{
                            $("#rest_haibaonum").val(data.hbnum);
                        }
                        if(data.mid){
                            $("#sy_haibaouserid").val(data.mid);
                        }
                        if(data.weburl){
                            $("#sy_hburl").val(data.weburl);
                        }
                    }
                });
            '{yun:}/if{/yun}'
        })
    </script>
 </body>
</html>