-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsystem_basic.php
More file actions
180 lines (179 loc) · 7.7 KB
/
system_basic.php
File metadata and controls
180 lines (179 loc) · 7.7 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
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
<?php
require(dirname(__FILE__)."/include/config_base.php");
require(dirname(__FILE__)."/include/config_rglobals.php");
require_once(dirname(__FILE__)."/include/checklogin.php");
check_grant('system_basic.php',GetCookie('rank'));
if($action=='save')
{
$configfile = dirname(__FILE__)."/include/config_hand.php";
$configfile_bak = dirname(__FILE__)."/include/config_hand_bak.php";
if(!is_writeable($configfile)){
echo "配置文件'{$configfile}'不支持写入,严禁修改系统配置参数!";
exit();
}
$savesql = new DedeSql(false);
foreach($_POST as $k=>$v){
if(preg_match("/^edit___/",$k)){
$v = ${$k};
}else continue;
$k = preg_replace("/^edit___/","",$k);
if(strlen($v) > 250){
showmsg("$k 太长,不能超过250字节",'-1');
exit;
}
$savesql->ExecuteNoneQuery("Update #@__config set `config_value`='$v' where `config_name`='$k' ");
}
$savesql->SetQuery("Select `config_name`,`config_value` From `#@__config` order by `id` asc");
$savesql->Execute();
if($savesql->GetTotalRow()<=0){
$savesql->Close();
ShowMsg("成功保存变量但从数据库读取所有数据时失败,无法更新配置文件!","javascript:;");
exit();
}
@copy($configfile,$configfile_bak);
$fp = @fopen($configfile,'w');
@flock($fp,3);
@fwrite($fp,"<"."?php\r\n") or die("配置文件'{$configfile}'不支持写入,本次操作无效!<a href='system_basic.php'>返回</a>");
while($row = $savesql->GetArray()){
$row['value'] = str_replace("'","\\'",$row['config_value']);
fwrite($fp,"\${$row['config_name']} = '".$row['config_value']."';\r\n");
}
fwrite($fp,"?>");
fclose($fp);
$message="成功修改了系统配置文件config_base.php";
$logindate=getdatetimemk(time());;
$loginip=getip();
$username=str_replace($cfg_cookie_encode,'',$_COOKIE["VioomaUserID"]);
$savesql->Close();
WriteNote($message,$logindate,$loginip,$username);
ShowMsg("成功更改系统配置!","system_basic.php");
exit();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/2019/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
<link href="style/main.css" rel="stylesheet" type="text/css" />
<title><?php echo $cfg_softname;?>系统设置</title>
</head>
<body>
<table width="100%" border="0" id="table_style_all" cellpadding="0" cellspacing="0">
<tr>
<td id="table_style" class="l_t"> </td>
<td> </td>
<td id="table_style" class="r_t"> </td>
</tr>
<tr>
<td> </td>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="2">
<tr>
<td><strong> 系统基本信息设置</strong></td>
</tr><form action="system_basic.php?action=save" method="post">
<tr>
<td bgcolor="#FFFFFF">
<table width="100%" cellspacing="0" cellpadding="0" border="0" id="table_border">
<tr>
<td class="cellcolor" width="50%">公司名称: </td>
<td> <input type="" name="edit___cfg_webname" value="<?php echo $cfg_webname;?>" size="50"/></td></tr>
<tr>
<tr>
<td class="cellcolor">联系地址: </td>
<td> <input type="" name="edit___cfg_address" value="<?php echo $cfg_address;?>" size="50"/></td></tr>
<tr>
<tr>
<td class="cellcolor">联系人姓名: </td>
<td> <input type="" name="edit___cfg_conact" value="<?php echo $cfg_conact;?>" size="20"/></td></tr>
<tr>
<tr>
<td class="cellcolor">联系电话: </td>
<td> <input type="" name="edit___cfg_phone" value="<?php echo $cfg_phone;?>" size="20"/></td></tr>
<tr>
<td class="cellcolor">进销存根路径: <br>(也即进销存的URL,在安装时系统会自动获取.)</td>
<td> <input type="" name="edit___cfg_basehost" value="<?php echo $cfg_basehost;?>" size="50"/></td></tr>
<tr>
<td class="cellcolor">进销存安装目录:<br>(如果是非子目录安装不需要理会) </td>
<td> <input type="" name="edit___cfg_cmspath" value="<?php echo $cfg_cmspath;?>" size="20"/></td></tr>
<tr>
<td class="cellcolor">Cookie加密字符串: <br>(为保证安全,此系统Cookie进行了加密,请设定尽可能复杂的加密字符串)</td>
<td> <input type="" name="edit___cfg_cookie_encode" value="<?php echo $cfg_cookie_encode;?>" size="20"/></td></tr>
<tr>
<td class="cellcolor">登陆保持时间(单位:小时): </td>
<td> <input type="" name="edit___cfg_keeptime" value="<?php echo $cfg_keeptime;?>" size="5"/> 小时</td></tr>
<tr>
<td class="cellcolor">是否启用会员等级: </td>
<td>
<?php
if($cfg_islevel==1)
echo "<input type=\"radio\" name=\"edit___cfg_islevel\" checked value=\"1\">是 <input type=\"radio\" name=\"edit___cfg_islevel\" value=\"0\">否" ;
else
echo "<input type=\"radio\" name=\"edit___cfg_islevel\" value=\"1\">是 <input checked type=\"radio\" name=\"edit___cfg_islevel\" value=\"0\">否";
?></td></tr>
<tr>
<td class="cellcolor">是否按会员等级进行预定打折销售: </td>
<td>
<?php
if($cfg_isdiscount==1)
echo "<input type=\"radio\" name=\"edit___cfg_isdiscount\" checked value=\"1\">是 <input type=\"radio\" name=\"edit___cfg_isdiscount\" value=\"0\">否" ;
else
echo "<input type=\"radio\" name=\"edit___cfg_isdiscount\" value=\"1\">是 <input checked type=\"radio\" name=\"edit___cfg_isdiscount\" value=\"0\">否";
?></td></tr>
<tr>
<td class="cellcolor">是否启用库存报警设置: </td>
<td>
<?php
if($cfg_isalarm==1)
echo "<input type=\"radio\" name=\"edit___cfg_isalarm\" checked value=\"1\">是 <input type=\"radio\" name=\"edit___cfg_isalarm\" value=\"0\">否" ;
else
echo "<input type=\"radio\" name=\"edit___cfg_isalarm\" value=\"1\">是 <input checked type=\"radio\" name=\"edit___cfg_isalarm\" value=\"0\">否";
?></td></tr>
<tr>
<tr>
<td class="cellcolor">是否在打印报表时显示公司详细信息: </td>
<td>
<?php
if($cfg_isshow==1)
echo "<input type=\"radio\" name=\"edit___cfg_isshow\" checked value=\"1\">是 <input type=\"radio\" name=\"edit___cfg_isshow\" value=\"0\">否" ;
else
echo "<input type=\"radio\" name=\"edit___cfg_isshow\" value=\"1\">是 <input checked type=\"radio\" name=\"edit___cfg_isshow\" value=\"0\">否";
?></td></tr>
<tr>
<td class="cellcolor">是否启用员工业务提成功能: </td>
<td>
<?php
if($cfg_way==1)
echo "<input type=\"radio\" name=\"edit___cfg_way\" checked value=\"1\">是 <input type=\"radio\" name=\"edit___cfg_way\" value=\"0\">否" ;
else
echo "<input type=\"radio\" name=\"edit___cfg_way\" value=\"1\">是 <input checked type=\"radio\" name=\"edit___cfg_way\" value=\"0\">否";
?></td></tr>
<tr>
<td class="cellcolor">显示多少条记录/页: </td>
<td> <input type="" name="edit___cfg_record" value="<?php echo $cfg_record;?>" size="5"/> 条/页</td></tr>
<tr>
<td class="cellcolor">数据备份目录: </td>
<td> <input type="" name="edit___cfg_backup_dir" value="<?php echo $cfg_backup_dir;?>" size="20"/> </td></tr>
<tr><td> </td><td><input type="submit" value=" 保存设置 "></td></tr>
</table>
</td>
</tr>
</table>
</td>
<td> </td>
</tr></form>
<tr>
<td id="table_style" class="l_b"> </td>
<td> </td>
<td id="table_style" class="r_b"> </td>
</tr>
</table>
<?php
copyright();
?>
</body>
</html>