This repository has been archived on 2026-06-20. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
EDT/admin/debug/set_sm.php
T
wsh5485 7e47ce238b chore: 添加多个图片和资源文件
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
2025-06-15 13:04:37 +08:00

136 lines
4.2 KiB
PHP

<?php
//-------------------------------------------------------设置扫描入场
require "../config.php";
include "../../tmpl/config.php";
require THIS_FILE_ROOT."/include/function.php";
require THIS_FILE_ROOT."/include/db_mysql.php";
//require THIS_FILE_ROOT."/include/page.class.php";
error_reporting(E_ERROR | E_WARNING | E_PARSE);
//-------------------------------register global
$magic_quotes_gpc = get_magic_quotes_gpc();
$register_globals = @ini_get('register_globals');
if(!$register_globals || !$magic_quotes_gpc) {
@extract(daddslashes($_POST));
@extract(daddslashes($_GET));
}
//-------------------------------mysql connect
$msg="";
$db=new DB_Sql;
$db->connect($dbhost,$dbuser,$dbpw,$dbname,"p");
$is_submit=$_POST["is_submit"];
$col_name=$_POST["col_name"];
$q="select count(*) 'num' from ".$table_pre."plugin_session_ewm";
$m=get_db_msg($q);
$msg="目前现场有".$m["num"]."";
if($is_submit=="y"){
$q="truncate table ".$table_pre."plugin_session_ewm;";
$db->query($q);
$msg="设置成功!";
}
//if($_a=="volume_allow"){
// $arr_ip1=explode(".",$ip1);
// $arr_ip2=explode(".",$ip2);
// $ip_end_str1=end($arr_ip1);
// $ip_end_str2=end($arr_ip2);
// $ip_con=$arr_ip1[0].".".$arr_ip1[1].".".$arr_ip1[2];
// $n=0;
// for($i=$ip_end_str1;$i<=$ip_end_str2;$i++){
// $ip=$ip_con.".".$i;
// $add_date=date("Y-m-d H:i:s");
// $q="insert into ".$table_pre."plugin_session_ewm (flag,ip,add_date) values ('','".$ip."','".$add_date."');";
// $db->query($q);
// $n++;
// }
// $msg="已允许".$n."个ip";
//}
if($_a=="volume_allow"){
$n=0;
for($i=1;$i<=255;$i++){
$ip=$ip1.".".$i;
$check=get_db_msg("select id from ".$table_pre."plugin_session_ewm where ip='".$ip."'");
if(!$check["id"]){
$add_date=date("Y-m-d H:i:s");
$q="insert into ".$table_pre."plugin_session_ewm (flag,ip,add_date) values ('','".$ip."','".$add_date."');";
$db->query($q);
$n++;
}
}
$msg="已允许".$ip1."网段的".$n."个ip";
}
if($_a=="volume_del"){
$n=0;
for($i=1;$i<=255;$i++){
$ip=$ip1.".".$i;
$check=get_db_msg("select id from ".$table_pre."plugin_session_ewm where ip='".$ip."'");
if($check["id"]){
$q="delete from ".$table_pre."plugin_session_ewm where ip='".$ip."';";
$db->query($q);
$n++;
}
}
$msg="已删除".$ip1."网段的".$n."个ip";
}
?>
<!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/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>设置扫描入场</title>
<style>
BODY{
font-family:宋体;FONT-SIZE:12px;margin:0px;padding:0px;
}
a,a:link,a:visited,a:active {
text-decoration:none;COLOR: #0000ff;FONT-SIZE:12px;
}
a:hover {
TEXT-DECORATION: underline;COLOR: #aaaa9f;FONT-SIZE:12px;
}
body,input,td,select,div,li,ul,textarea,form {
font-family:宋体;
FONT-SIZE:12px;
}
.wrong{
color:#ff0000;font-weight:bold;
}
</style>
<script>
function ok(){
var a=confirm("确认执行吗?");
if(a==true){
document.form1.submit();
}
}
function deel_allow(){
var ip1=document.getElementById("ip1").value;
var url="set_sm.php?_a=volume_allow&ip1="+ip1;
window.location.href=url;
}
function deel_del(){
var ip1=document.getElementById("ip1").value;
var url="set_sm.php?_a=volume_del&ip1="+ip1;
window.location.href=url;
}
</script>
</head>
<body>
<br />
<table width="80%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#cccccc">
<form name="form1" action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
<input type="hidden" name="is_submit" value="y">
<tr>
<td align="center" bgcolor="#f0f0f0"><b>设置扫描入场</b></td>
</tr>
<tr>
<td align="center" bgcolor="#f0f0f0"><input type="button" value="刷新" onclick="window.location.href='<?php echo $_SERVER["PHP_SELF"]; ?>';"> <input type="button" value="一键设置所有客户出门" onclick="ok();"><input type="text" id="ip1" value="192.168.1"><input type="button" value="批量允许该网段" onclick="deel_allow();"><input type="button" value="批量删除该网段" onclick="var a=confirm('确认批量删除该网段吗?');
if(a==true){deel_del();}"></td>
</tr>
<?php
if($msg){
echo "<tr><td align=\"left\" bgcolor=\"#ffffff\" valign=\"top\" style=\"line-height:150%;\">".$msg."</td></tr>";
}
?>
</form>
</table>
</body>
</html>