📄 admin.au3
字号:
GUICtrlSetBkColor(-1, 0xCAE1FF)
GUICtrlCreateLabel("路由器用户:", 23, 82, 76, 17)
GUICtrlCreateLabel("路由器密码:", 23, 110, 76, 17)
$xr_user_input = GUICtrlCreateInput(IniRead("config.ini","路由器登陆配置","用户名",""), 104, 77, 137, 20)
$xr_pass_input = GUICtrlCreateInput(_pass_mm(IniRead("config.ini","路由器登陆配置","密码",""),1), 105, 105, 137, 20,$ES_PASSWORD)
$Test_Button = GUICtrlCreateButton("测试", 258, 107, 49, 17, $BS_FLAT)
GUICtrlSetBkColor(-1, 0xCAE1FF)
GUICtrlCreateGroup("用户设置 ", 20, 136, 293, 136)
GUICtrlCreateLabel("用户名:", 46, 162, 52, 17)
$Xiugai_user_input = GUICtrlCreateInput("", 104, 158, 137, 20,$ES_READONLY)
GUICtrlCreateLabel("新密码:", 46, 186, 52, 17)
$User_Pass_1 = GUICtrlCreateInput("", 104, 183, 137, 20,$ES_PASSWORD)
GUICtrlCreateLabel("新密码:", 46, 212, 52, 17)
$User_Pass_2 = GUICtrlCreateInput("", 104, 208, 137, 20,$ES_PASSWORD)
GUICtrlCreateLabel("重复密码", 250, 212, 52, 16)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("新密码", 250, 186, 40, 16)
GUICtrlSetColor(-1, 0xFF0000)
$Xiugai_pass_Button = GUICtrlCreateButton("确定修改", 80, 240, 57, 17)
GUICtrlSetBkColor(-1, 0xCAE1FF)
$Tianjia_user_Button = GUICtrlCreateButton("添加用户", 199, 240, 57, 17)
GUICtrlSetBkColor(-1, 0xCAE1FF)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup(" 软件自动更新 ", 20, 279, 294, 65)
$Progress_updata = GUICtrlCreateProgress(39, 315, 256, 9)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button7 = GUICtrlCreateButton("检测更新", 341, 312, 81, 25)
GUICtrlSetBkColor(-1, 0xCAE1FF)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
GUISetBkColor (0xCAE1FF)
GUICtrlSetData($Xiugai_user_input,$var)
#EndRegion ### END Koda GUI section ###
While 1
$msg_SZ = GUIGetMsg()
Select
Case $msg_SZ = $GUI_EVENT_CLOSE
GUIDelete($Sezhi_gui)
WinActivate("系统设置")
GUISetState(@SW_ENABLE, $Form1_1)
ExitLoop
Case $msg_SZ = $Test_Button
$xr_user = GUICtrlRead ($xr_user_input)
$xr_pass = GUICtrlRead ($xr_pass_input)
if $xr_user<> "" and $xr_pass <> "" then
IniWrite ("config.ini","路由器登陆配置","用户名",$xr_user)
IniWrite ("config.ini","路由器登陆配置","密码",_pass_mm($xr_pass,0))
_login_xr()
Else
MsgBox(64,"提示:","用户名和密码不能为空")
EndIf
Case $msg_SZ = $Xiugai_pass_Button
$Xiugai_user= GUICtrlRead ($Xiugai_user_input)
$Xiugai_pass1= GUICtrlRead ($User_Pass_1)
$Xiugai_pass2= GUICtrlRead ($User_Pass_2)
if $Xiugai_user = "" or $Xiugai_pass1 ="" or $Xiugai_pass2 ="" Then
MsgBox(64,"提示:","您要修改的用户名和密码不能为空!")
Else
if $Xiugai_pass1 = $Xiugai_pass2 then
$conn = ObjCreate("ADODB.Connection")
$RS = ObjCreate("ADODB.Recordset")
$conn.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & $datadir& ";Jet Oledb:Database Password="&$acc_pwd)
$RS.ActiveConnection = $conn
$update = 'UPDATE S_user SET user_pass="' & $Xiugai_pass1 & '" where user_name="' & $Xiugai_user & '"'
$conn.Execute($update)
$conn.close
MsgBox(64,"提示:","恭喜,密码修改成功,下次登陆请使用新密码!")
Else
MsgBox(64,"提示:","两次输入的用户密码不同,请重新输入!")
EndIf
EndIf
Case $msg_SZ = $Tianjia_user_Button
_add_user_gui()
EndSelect
WEnd
EndFunc
Func _xufei($var);续费窗口
$Xufei_gui = GUICreate("客户续费 - "&$var, 300, 147)
GUICtrlCreateGroup("", 4, 0, 289, 141)
GUICtrlCreateLabel("客户名称:", 16, 18, 64, 17)
$Input_xufei_name = GUICtrlCreateInput($var, 80, 14, 201, 21)
GUICtrlCreateLabel("续费金额:", 16, 48, 64, 17)
$Input_xufei_1 = GUICtrlCreateInput("", 80, 44, 30, 20,$ES_NUMBER)
GUICtrlCreateLabel("元", 112, 48, 16, 17)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("包月:", 135, 48, 38, 17)
$Input_xufei_2 = GUICtrlCreateInput("", 175, 44, 25, 20,$ES_NUMBER)
GUICtrlCreateLabel("月", 200, 48, 16, 17)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("开户时间:", 16, 78, 64, 17)
GUICtrlCreateLabel("到期时间:", 16, 108, 64, 17)
$Date1_xufei = GUICtrlCreateDate(_Date_z( _GUICtrlListView_GetItemText($ListView1, _GUICtrlListView_GetNextItem($ListView1), 3),1), 80, 75, 121, 20)
$Date2_xufei = GUICtrlCreateDate(_Date_z( _GUICtrlListView_GetItemText($ListView1, _GUICtrlListView_GetNextItem($ListView1), 4),1), 80, 105, 121, 20)
$Button_xufei_1 = GUICtrlCreateButton("自动计算", 224, 45, 56, 19)
GUICtrlSetBkColor(-1, 0xCAE1FF)
$Button_xufei_2 = GUICtrlCreateButton("确 定", 216, 80, 65, 41)
GUICtrlSetBkColor(-1, 0xCAE1FF)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
GUISetBkColor (0xCAE1FF)
While 1
$msg_xf = GUIGetMsg()
Select
Case $msg_xf = $GUI_EVENT_CLOSE
GUIDelete($Xufei_gui)
WinActivate("客户续费 - "&$var)
GUISetState(@SW_ENABLE, $Form1_1)
ExitLoop
Case $msg_xf = $Button_xufei_1
GUICtrlSetData($Date2_xufei,_Date_z( _GUICtrlListView_GetItemText($ListView1, _GUICtrlListView_GetNextItem($ListView1), 4),1))
$xufei_1 = GUICtrlRead($Input_xufei_1)
$xufei_2 = GUICtrlRead($Input_xufei_2)
if $xufei_2 ="" then
$xufei_2 = Floor($xufei_1/50)
GUICtrlSetData($Input_xufei_2,$xufei_2)
EndIf
$jieshu_date = _Date_z(GUICtrlRead($Date2_xufei),1)
GUICtrlSetData($Date2_xufei,_Calculation($xufei_2,$jieshu_date))
Case $msg_xf = $Button_xufei_2
$xufei_name = GUICtrlRead($Input_xufei_name)
$jieshu_Date = GUICtrlRead($Date2_xufei)
$xufei_amount = GUICtrlRead($Input_xufei_1)
if $xufei_amount <>"" or $xufei_name<>"" then
if $jieshu_Date <> _GUICtrlListView_GetItemText($ListView1, _GUICtrlListView_GetNextItem($ListView1), 4) then
$conn = ObjCreate("ADODB.Connection")
$RS = ObjCreate("ADODB.Recordset")
$conn.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & $datadir& ";Jet Oledb:Database Password="&$acc_pwd)
$RS.ActiveConnection = $conn
$RS.Open ('Select * From S_data where ' & "Name" & ' = '& '"' & $xufei_name & '"')
While (Not $RS.eof And Not $RS.bof)
$Amount_data_name = $RS.Fields (10).value
$RS.movenext
WEnd
$Amount_data_name = $xufei_amount+$Amount_data_name
$update = 'UPDATE S_data SET Date2="' & $jieshu_Date & '",State="' & "正常" & '",Amount="' & $Amount_data_name & '" where Name="' & $xufei_name & '"'
$conn.Execute($update)
$RS.close
$conn.close
_SQL_LOG($xufei_name,$Date_time,$login_user,$xufei_amount,"续费")
MsgBox (64,"客户『"&$xufei_name&"』续费成功","续费金额: "&$xufei_amount&" 元"&@CR &"总 金 额: "& $Amount_data_name &" 元"&@CR&"到期时间:"&$jieshu_Date)
GUIDelete($Xufei_gui)
WinActivate("客户续费 - "&$var)
GUISetState(@SW_ENABLE, $Form1_1)
_sql()
ExitLoop
Else
MsgBox(32,"提示:","请点击计算到期时间按钮,计算新的到期时间!")
endif
Else
MsgBox(32,"提示:","用户名称和续费金额不能为空!")
EndIf
EndSelect
WEnd
EndFunc
Func _Calculation($var,$jieshu_date)
$sNewDate = _DateAdd( 'm',$var, $jieshu_date)
Return $sNewDate
EndFunc
Func _log_gui($var)
if $var <> "" Then
$log_gui = GUICreate("续费记录查看 用户:"&$var, 504, 310)
$Edit_log = GUICtrlCreateList("", 6, 8, 489, 249,$ES_AUTOVSCROLL)
GUICtrlSetColor(-1, 0xFF0000)
$Qingchu = GUICtrlCreateButton("清空记录", 16, 272, 89, 25, 0)
GUICtrlSetBkColor(-1, 0xCAE1FF)
$Fanhui = GUICtrlCreateButton("返回主窗口", 392, 272, 89, 25, 0)
GUICtrlSetBkColor(-1, 0xCAE1FF)
GUISetState(@SW_SHOW)
GUISetBkColor (0xCAE1FF)
$conn = ObjCreate("ADODB.Connection")
$RS = ObjCreate("ADODB.Recordset")
$conn.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & $datadir& ";Jet Oledb:Database Password="&$acc_pwd)
$RS.ActiveConnection = $conn
$RS.Open ('Select * From S_log where ' & "name" & ' = '& '"' & $var & '"')
While (Not $RS.eof And Not $RS.bof)
GUICtrlSetData($Edit_log,$RS.Fields (3).value & "-> 客户:"&$RS.Fields (0).value &" 时间:"& $RS.Fields (1).value &" 金额:"&$RS.Fields (4).value&"元 操作:"&$RS.Fields (2).value &@CRLF,1 )
$RS.movenext
WEnd
$RS.close
GUICtrlSetData($Edit_log,"记录搜索完成")
While 1
$msg_log = GUIGetMsg()
Select
Case $msg_log = $GUI_EVENT_CLOSE
GUIDelete($log_gui)
WinActivate("续费记录查看 客户:"&$var)
GUISetState(@SW_ENABLE, $Form1_1)
ExitLoop
Case $msg_log = $Qingchu
if _delete_log($var,1) = 0 then
GUICtrlSetData($Edit_log,"")
GUICtrlSetData($Edit_log,"客户:"&$var&" 缴费记录清楚成功!")
EndIf
Case $msg_log = $Fanhui
GUIDelete($log_gui)
WinActivate("续费记录查看 客户:"&$var)
GUISetState(@SW_ENABLE, $Form1_1)
ExitLoop
EndSelect
WEnd
EndIf
EndFunc
Func _add_user_gui()
if StringStripWS($User_Authority,8)= "管理员" then
$Add_user_gui = GUICreate("添加新用户", 256, 141)
GUICtrlCreateGroup("", 8, 3, 238, 130)
GUICtrlCreateLabel("添加用户:", 26, 24, 64, 17)
$Add_user_Input1 = GUICtrlCreateInput("", 93, 19, 129, 20)
GUICtrlCreateLabel("用户密码:", 26, 51, 64, 17)
GUICtrlCreateLabel("重复密码:", 26, 77, 64, 17)
$Add_pass_input1 = GUICtrlCreateInput("", 93, 46, 129, 20,$ES_PASSWORD)
$Add_pass_input2 = GUICtrlCreateInput("", 93, 73, 129, 20,$ES_PASSWORD)
GUICtrlCreateLabel("录属权限:", 26, 104, 64, 17)
$ADD_User_combo = GUICtrlCreateCombo("管理员", 93, 100, 73, 25)
GUICtrlSetData(-1, "浏览用户")
$ADD_User_Button = GUICtrlCreateButton("添 加", 182, 101, 50, 20, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetBkColor (0xCAE1FF)
GUISetState(@SW_SHOW)
While 1
$msg_ADD = GUIGetMsg()
Select
Case $msg_ADD = $GUI_EVENT_CLOSE
GUIDelete($Add_user_gui)
WinActivate("添加新用户")
GUISetState(@SW_ENABLE, $Form1_1)
ExitLoop
Case $msg_ADD = $ADD_User_Button
Local $Add_user_name_data
IF GUICtrlRead($Add_user_Input1) = "" or GUICtrlRead($Add_pass_Input1) = "" Then
MsgBox(64,"提示:","请输入添加的用户名或密码")
Else
If GUICtrlRead($Add_pass_Input1) = GUICtrlRead($Add_pass_Input2) Then
$add_user_combo_data = GUICtrlRead($ADD_User_combo)
$add_user_name = StringStripWS(GUICtrlRead($Add_user_Input1),8)
$conn = ObjCreate("ADODB.Connection")
$RS = ObjCreate("ADODB.Recordset")
$conn.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & $datadir& ";Jet Oledb:Database Password="&$acc_pwd)
$RS.ActiveConnection = $conn
$RS.Open ('Select * From S_user where ' & "user_name" & '=' & '"' & $add_user_name & '"')
While (Not $RS.eof And Not $RS.bof)
$Add_user_name_data = $RS.Fields (3).value
$RS.movenext
WEnd
if $Add_user_name_data <> $add_user_name then
$update = 'insert into S_user (Authority,user_name,user_pass) values ("' & $add_user_combo_data & '","' & $add_user_name & '","' & GUICtrlRead($Add_pass_Input1) & '")'
$conn.Execute($update)
$RS.close
$conn.close
MsgBox(64,"恭喜","添加『"&$add_user_combo_data&"』"&" <"&GUICtrlRead($Add_user_Input1) &">成功!")
GUIDelete($Add_user_gui)
WinActivate("添加新用户")
GUISetState(@SW_ENABLE, $Form1_1)
ExitLoop
Else
MsgBox(64,"提示:","添加的用户名已经存在!")
endif
Else
MsgBox(64,"提示:","重复密码错误,请重新输入")
EndIf
EndIf
EndSelect
WEnd
Else
MsgBox(16,"错误","对不起,您不是管理员,无权操作!")
EndIf
EndFunc
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -