📄 asp_search_result_clt.~pas
字号:
unit asp_search_result_clt;
{$WARN SYMBOL_PLATFORM OFF}
interface
uses
ComObj, ActiveX, AspTlb, Asp_watch_search_TLB, StdVcl,dm_search,Classes,Variants,Dialogs,SysUtils;
type
Tco_asp_search3 = class(TASPObject, Ico_asp_search3)
private
Fdatamodule:TDataModule1;
protected
procedure OnEndPage; safecall;
procedure OnStartPage(const AScriptingContext: IUnknown); safecall;
procedure Get_search_result; safecall;
procedure get_search; safecall;
procedure adduser; safecall;
procedure deluser; safecall;
procedure deldata; safecall;
procedure set_right; safecall;
procedure addoperator; safecall;
procedure deloperator; safecall;
procedure modipassword; safecall;
procedure search_detail; safecall;
procedure search_user; safecall;
procedure dellog; safecall;
procedure setgl; safecall;
procedure cxqx; safecall;
public
procedure Initialize;override;
destructor Destroy;override;
end;
implementation
uses ComServ,Forms;
procedure Tco_asp_search3.OnEndPage;
begin
inherited OnEndPage;
end;
procedure Tco_asp_search3.OnStartPage(const AScriptingContext: IUnknown);
begin
inherited OnStartPage(AScriptingContext);
end;
procedure Tco_asp_search3.Get_search_result;
var
username,password:olevariant;
begin
username:=request.Form.Item['userid'];
password:=request.Form.Item['t2'];
// if vartostr(username)=vartostr(password) then
// begin
// Response.Write('<p><img border="0" src="image/logo1.jpg" width="256" height="80"> <img border="0" src="image/title.jpg" width="480" height="80"></p>');
// Response.Write('<p align="center"> </p>');
// Response.Write('<p align="center"> </p>');
// Response.Write('<p align="center"><a href="index.htm">口令和密码不能相同,请与系统管理员联系</a></p>');
// end else
// begin
session.Contents.Item['qjh1']:=username;
session.Contents.Item['qjh2']:=password;
Fdatamodule.ClientDataSet1.Close;
Fdatamodule.ClientDataSet1.CommandText:='select userid from userinfo where userid='''+vartostr(username)+''' and userpassword='''+vartostr(password)+'''';
Fdatamodule.ClientDataSet1.Open;
if Fdatamodule.ClientDataSet1.RecordCount<1 then
begin
Response.Write('<p><img border="0" src="image/8420.jpg" width="256" height="80"> <img border="0" src="image/title.jpg" width="480" height="80"></p>');
Response.Write('<p align="center"> </p>');
Response.Write('<p align="center"> </p>');
Response.Write('<p align="center"><a href="net_watch3/index.htm">密码错误,请登入</a></p>');
end else
begin
if trim(vartostr(session.Contents.Item['qjh2']))='123' then
begin
response.Write('<table>');
response.Write('<td width="20%" align="center"><a href="net_watch3/modipassword.htm">修改口令</a></td>');
response.Write('</table>');
end else
begin
Fdatamodule.ClientDataSet2.Close;
Fdatamodule.ClientDataSet2.CommandText:='select opright from opright where userid='''+trim(vartostr(session.Contents.Item['qjh1']))+'''';
Fdatamodule.ClientDataSet2.Open;
if Fdatamodule.ClientDataSet2.FieldByName('opright').AsString='1110000100000' then
begin
response.Write('<p><img border="0" src="image/8420.jpg" width="256" height="80"> <img border="0" src="image/title.jpg" width="480" height="80"></p>');
response.Write('<table border="1" width="100%" bgcolor="#FFCCFF">');
response.Write('<tr>');
response.Write('<td width="20%" align="center"><a href="net_watch3/search1.asp">上网查询</a></td>');
response.Write('<td width="20%" align="center"><a href="net_watch3/modipassword.htm">修改口令</a></td>');
response.Write('</table>');
end else
begin
response.Write('<p><img border="0" src="image/8420.jpg" width="256" height="80"> <img border="0" src="image/title.jpg" width="480" height="80"></p>');
response.Write('<table border="1" width="100%" bgcolor="#FFCCFF">');
response.Write('<tr>');
response.Write('<td width="20%" align="center"><a href="net_watch3/search1.asp">上网查询</a></td>');
response.Write('<td width="20%" align="center"><a href="net_watch3/adduser.htm">新增用户</a></td>');
response.Write('<td width="20%" align="center"><a href="net_watch3/deluser.htm">删除用户</a></td>');
response.Write('<td width="20%" align="center"><a href="net_watch3/deldata14343.asp">过滤数据</a></td>');
response.Write('<td width="20%" align="center"><a href="net_watch3/set_right.htm">设置权限</a></td>');
response.Write('</tr>');
response.Write('<tr>');
response.Write('<td width="20%" align="center"><a href="net_watch3/addoperator.htm">新增操作员</a></td>');
response.Write('<td width="20%" align="center"><a href="net_watch3/deloperator.htm">删除操作员</a></td>');
response.Write('<td width="20%" align="center"><a href="net_watch3/modipassword.htm">修改口令</a></td>');
response.Write('<td width="20%" align="center"><a href="net_watch3/search_user.htm">查询用户</a></td>');
response.Write('<td width="20%" align="center"><a href="net_watch3/dellog1.asp">删除数据</a></td>');
response.Write('</tr>');
response.Write('<tr>');
response.Write('<td width="20%" align="center"><a href="net_watch3/setgl.htm">过滤用户</a></td>');
response.Write('<td width="20%" align="center"><a href="net_watch3/cxqx.htm">查询权限</a></td>');
response.Write('</tr>');
response.Write('</table>');
end;
end;
end;
// end;
end;
destructor Tco_asp_search3.Destroy;
begin
inherited;
Fdatamodule.free;
end;
procedure Tco_asp_search3.Initialize;
begin
inherited;
Fdatamodule:=Tdatamodule1.Create(Forms.Application);
end;
procedure Tco_asp_search3.get_search;
var
s_select:string;
s_sql:string;
s_qx:string;
s_bm_code:string;
s_workno:string;
begin
if vartostr(session.Contents.Item['qjh1'])='' then
begin
Response.Write('<p><img border="0" src="image/8420.jpg" width="256" height="80"> <img border="0" src="image/title.jpg" width="480" height="80"></p>');
Response.Write('<p align="center"> </p>');
Response.Write('<p align="center"> </p>');
Response.Write('<p align="center">您未登入系统,请登入</p>');
end else
begin
Fdatamodule.ClientDataSet2.Close;
Fdatamodule.ClientDataSet2.CommandText:='select opright from opright where userid='''+trim(vartostr(session.Contents.Item['qjh1']))+'''';
Fdatamodule.ClientDataSet2.Open;
if copy(Fdatamodule.ClientDataSet2.fieldbyname('opright').AsString,2,1)='0' then
begin
Response.Write('<p><img border="0" src="image/logo1.jpg" width="256" height="80"> <img border="0" src="image/title.jpg" width="480" height="80"></p>');
Response.Write('<p align="center"> </p>');
Response.Write('<p align="center"> </p>');
Response.Write('<p align="center">您没有权限操作此模块</p>');
end else
begin
session.Contents.Item['cur_id']:=0;
session.Contents.Item['page']:=0;
s_sql:='select qxsign from szcxqx where userid='''+trim(vartostr(session.Contents.Item['qjh1']))+'''';
Fdatamodule.ClientDataSet1.Close;
Fdatamodule.ClientDataSet1.CommandText:=s_sql;
Fdatamodule.ClientDataSet1.Open;
s_qx:=trim(Fdatamodule.ClientDataSet1.fieldbyname('qxsign').AsString);
Fdatamodule.ClientDataSet1.Close;
Fdatamodule.ClientDataSet1.CommandText:='select bm_code from vinternet where workno='''+trim(vartostr(session.Contents.Item['qjh1']))+'''';
Fdatamodule.ClientDataSet1.Open;
s_bm_code:=trim(Fdatamodule.ClientDataSet1.fieldbyname('bm_code').AsString);
Session.Contents.Item['begin_date']:=request.Form.Item['t3'];
Session.Contents.Item['end_date']:=request.Form.Item['t4'];
if s_qx='全' then
begin
s_select:='select a.workno as workno,a.name as name,a.bm_name as bm_name,(sum(b.processingtime)/60000+1) as processingtime ,sum(b.bytesrecvd) as bytesrecvd,sum(b.bytessent) as bytessent';
s_select:=s_select+' from vcontact a,webproxylog1 b,vtmp c where a.workno=b.clientusername and a.workno=c.userid and isgl=''0''';
if trim(vartostr(request.Form.Item['t1']))<>'' then
begin
s_workno:='xg\'+trim(vartostr(request.Form.Item['t1']));
s_select:=s_select+' and a.workno='''+s_workno+'''';
end;
if trim(vartostr(request.Form.Item['t2']))<>'全部部门' then
begin
s_select:=s_select+' and a.bm_code='''+trim(copy(vartostr(request.Form.Item['t2']),1,4))+'''';
end;
if trim(vartostr(request.Form.Item['t3']))<>'' then
s_select:=s_select+' and b.logdate>='''+vartostr(request.Form.Item['t3'])+'''';
if trim(vartostr(request.Form.Item['t4']))<>'' then
s_select:=s_select+' and b.logdate<='''+vartostr(request.Form.Item['t4'])+'''';
s_select:=s_select+' group by a.workno,a.name,a.bm_name';
end else if s_qx='部' then
begin
s_select:='select a.workno as workno,a.name as name,a.bm_name as bm_name,(sum(b.processingtime)/60000+1) as processingtime,sum(b.bytesrecvd) as bytesrecvd,sum(b.bytessent) as bytessent';
s_select:=s_select+' from vcontact a,webproxylog1 b,vtmp c where a.workno=b.clientusername and a.workno=c.userid and c.isgl=''0'' and a.bm_code like '''+copy(s_bm_code,1,1)+'%''';
if trim(vartostr(request.Form.Item['t1']))<>'' then
begin
s_workno:='xg\'+trim(vartostr(request.Form.Item['t1']));
s_select:=s_select+' and a.workno='''+s_workno+'''';
end;
if trim(vartostr(request.Form.Item['t2']))<>'全部部门' then
begin
s_select:=s_select+' and a.bm_code='''+trim(copy(vartostr(request.Form.Item['t2']),1,4))+'''';
end;
if vartostr(request.Form.Item['t3'])<>'' then
s_select:=s_select+' and b.logdate>='''+vartostr(request.Form.Item['t3'])+'''';
if vartostr(request.Form.Item['t4'])<>'' then
s_select:=s_select+' and b.logdate<='''+vartostr(request.Form.Item['t4'])+'''';
s_select:=s_select+' group by a.workno,a.name,a.bm_name';
end else if s_qx='处' then
begin
s_select:='select a.workno as workno,a.name as name,a.bm_name as bm_name,(sum(b.processingtime)/60000+1) as processingtime,sum(b.bytesrecvd) as bytesrecvd,sum(b.bytessent) as bytessent';
s_select:=s_select+' from vcontact a,webproxylog1 b,vtmp c where a.workno=b.clientusername and a.workno=c.userid and c.userid=''0'' and a.bm_code like '''+copy(s_bm_code,1,2)+'%''';
if trim(vartostr(request.Form.Item['t1']))<>'' then
begin
s_workno:='xg\'+trim(vartostr(request.Form.Item['t1']));
s_select:=s_select+' and a.workno='''+s_workno+'''';
end;
if trim(vartostr(request.Form.Item['t2']))<>'全部部门' then
begin
s_select:=s_select+' and a.bm_code='''+trim(copy(vartostr(request.Form.Item['t2']),1,4))+''''
end;
if vartostr(request.Form.Item['t3'])<>'' then
s_select:=s_select+' and b.logdate>='''+vartostr(request.Form.Item['t3'])+'''';
if vartostr(request.Form.Item['t4'])<>'' then
s_select:=s_select+' and b.logdate<='''+vartostr(request.Form.Item['t4'])+'''';
s_select:=s_select+' group by a.workno,a.name,a.bm_name';
end else if s_qx='科' then
begin
s_select:='select a.workno as workno,a.name as name,a.bm_name as bm_name,(sum(b.processingtime)/60000+1) as processingtime,sum(b.bytesrecvd) as bytesrecvd,sum(b.bytessent) as bytessent';
s_select:=s_select+' from vcontact a,webproxylog1 b,vtmp c where a.workno=b.clientusername and a.workno=c.userid and c.isgl=''0'' and a.bm_code like '''+copy(s_bm_code,1,3)+'%''';
if trim(vartostr(request.Form.Item['t1']))<>'' then
begin
s_workno:='xg\'+trim(vartostr(request.Form.Item['t1']));
s_select:=s_select+' and a.workno='''+s_workno+'''';
end;
if trim(vartostr(request.Form.Item['t2']))<>'全部部门' then
begin
s_select:=s_select+' and a.bm_code='''+trim(copy(vartostr(request.Form.Item['t2']),1,4))+'''';
end;
if vartostr(request.Form.Item['t3'])<>'' then
s_select:=s_select+' and b.logdate>='''+vartostr(request.Form.Item['t3'])+'''';
if vartostr(request.Form.Item['t4'])<>'' then
s_select:=s_select+' and b.logdate<='''+vartostr(request.Form.Item['t4'])+'''';
s_select:=s_select+' group by a.workno,a.name,a.bm_name';
end else
begin
Response.Write('<p><img border="0" src="image/logo1.jpg" width="256" height="80"> <img border="0" src="image/title.jpg" width="480" height="80"></p>');
Response.Write('<p align="center"> </p>');
Response.Write('<p align="center"> </p>');
Response.Write('<p align="center">你还未分配查询权限</p>');
end;
Fdatamodule.cds_general1.Close;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -