⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hx_system.asp

📁 带OA办公的动态源码网站
💻 ASP
📖 第 1 页 / 共 4 页
字号:
		   LogAppointment=Session(prefix&"LOGAppointment")
		   Logdepartment=Session(prefix&"LOGdepartment")
	  end select	  
   End Sub
	Function HX_OutAttendanceDuty(DutyType)
	   if HX_IsNUM(DutyType) then
	     select case DutyType
		   case 1
		     HX_OutAttendanceDuty="上班"
		   case 2
		     HX_OutAttendanceDuty="下班" 
		 end select	 
	   end if
	End Function
	Function HX_NotifyFlag(NotifyFlag)
	  if HX_ISNUM(NotifyFlag) then
	    select case NotifyFlag
		  case 0:HX_NotifyFlag="普通"
		  case 1:HX_NotifyFlag="重要"
		  case 2:HX_NotifyFlag="加急"
		end select  
	  end if
	End Function
	Function HX_OutWorkFlowType(FlowType)
	   if HX_IsNUM(FlowType) then
	     ColumnName="":tablename="HX_WorkFlowType":Orderby=" order by WS_WTID desc"
         set Ourtyrs=WS_S.HX_SetRSD(ColumnName,tablename,Orderby)
          if Ourtyrs.recordcount>0 then
		    HX_OutWorkFlowType=Ourtyrs("WS_WorkFlowTypeName")
		  end if      
	   end if
	End Function
    Sub HX_OutEnrolFlag(flag)
	   if HX_IsNUM(flag) then
	     select case flag
		   case 0
		     response.write "领导尚未批示"
		   case 1
		     response.write "领导已批准"
		   case 2
		     response.write "领导未批准" 
		 end select	 
	   end if
	End Sub
'判断是否登录
    Function HX_ISLogin()
	    WS_S.HX_LoginCheck
	    HX_ISLogin=True
	    IF ISNULL(LOGINUSERNAME) OR LOGINUSERNAME="" OR ISNULL(LOGINPASSWORD) OR LOGINPASSWORD="" THEN
           HX_ISLogin=False
        ELSE
           LOGINPASSWORDMD5=MD5(LOGINPASSWORD)
           ORderby=" where WS_UserName='"&LOGINUSERNAME&"' and WS_PassWord='"&LOGINPASSWORDMD5&"'": HX_Conn dir
           SET RS=WS_S.HX_SetRSD("","HX_CompanyUser",ORderby)
           IF RS.RECORDCOUNT<=0 THEN
             HX_ISLogin=False
		   Else
		     HX_ISLogin=True	 
           END IF
         Call WS_S.HX_RSClose(RS)  
        END IF
	End Function	
'用户权限
    Sub HX_UserJurisdiction()
	
	End sub		
'注销登录	
	Sub HX_LoginOut()
	  if request("online")<>"wsoas" then
	    if HX_ISNUM(request.Cookies(prefix)("LOGINUSERID")) then
		  HX_conn dir
		  conn.execute("delete from HX_Online where WS_Userid="&request.Cookies(prefix)("LOGINUSERID"))
		end if
	  end if	
	Response.Cookies(prefix)("LOGINUSERID")=""
       	Response.Cookies(prefix)("LOGINUSERNAME")=""
        Response.Cookies(prefix)("LOGINPASSWORD")=""
		Response.Cookies(prefix)("WS_Appointment")=""
		session.Abandon()	
	End Sub
	
'在线人员HX_OutOnline(type),stype为0时显示人数,1时显示具体人员
    Function HX_OutOnline(stype)
        if HX_isnum(stype) then
		  ColumnName="WS_Userid,WS_Name,WS_Viewip,WS_Lasttime,WS_Staus":tablename="HX_Online":Orderby=" order by WS_Lasttime desc"
		  set onliners=HX_SetRSD(ColumnName,tablename,Orderby)
		   select case stype
		      case 0			  
			    HX_OutOnline=onliners.recordcount
			  case 1
		        if onliners.recordcount<=0 then
				   response.write "<table width='85' border='0' cellspacing='1' cellpadding='3'><tr><td align=center>无人在线</td></tr></table>" 
				else 
				   response.write "<table width='85' border='0' cellspacing='1' cellpadding='3'>"
                     do until onliners.eof
					    HX_OutUserInfo(onliners("WS_Userid"))
						 if onliners("WS_Userid")=cint(loginuid)  then
			               myoutname="<font color=red title='自己' onclick=""if (confirm('你想自己给自己发消息吗?')) show('"&onliners("WS_Userid")&"');"">"&onliners("WS_Name")&"</font>"
			             else
			               myoutname=onliners("WS_Name")
			             end if
	                    response.write "<tr><td  class='face' onMouseDown=this.className='face-2' onMouseUp=this.className='face-1' onMouseOver=this.className='face-1' onMouseOut=this.className='face' style='CURSOR:hand;' onDblClick=""show('"&onliners("WS_Userid")&"');"" title=""双击给 ["&Outdepartment&" "&OutAppointment&" "&onliners("WS_Name")&"] 发短消息!!! &#10;目前状态:"&HX_OutStaus(onliners("WS_Staus"))&"&#10;用户IP:"&onliners("WS_Viewip")&"&#10;上线时间:"&onliners("WS_Lasttime")&"""><img src='../hximages/websms/userface.gif' align='absmiddle' id='WSOA"&onliners("WS_Userid")&"' name='WSOA"&onliners("WS_Userid")&"'> "&myoutname&"</td></tr>"
                     onliners.movenext
                     loop
                   response.write "</table>" 
		        end if
			 case 2
			  ColumnName="WS_Staus":tablename="HX_Online":Orderby=" where WS_Userid="&loginuid
		      set onliners=HX_SetRSD(ColumnName,tablename,Orderby)
			  if onliners.recordcount>0 then  HX_OutOnline=onliners(0)  else  HX_OutOnline=0
		   end select 
		   HX_RSClose(onliners)  
		else
          HX_OutOnline=0
		end if
    End Function
	Function HX_OutStaus(str)
	  if HX_ISNUM(str) then
	    select case str
		  case 0:HX_OutStaus="联机"
		  case 1:HX_OutStaus="忙碌"
		  case 2:HX_OutStaus="离开"
		end select  	  
	  end if
	End Function
'全部人员HX_OutListMember
    Function HX_OutListMember()
	   ColumnName="":tablename="HX_CompanyUser":Orderby=" where WS_leave=False order by WS_Uid desc"
       set Ourusers=WS_S.HX_SetRSD(ColumnName,tablename,Orderby)
        if Ourusers.recordcount>0 then
	      response.write "<table width='85' border='0' cellspacing='1' cellpadding='3'>"
          do until Ourusers.eof
			HX_OutUserInfo(Ourusers("WS_Uid"))
			if Ourusers("WS_Uid")=cint(loginuid)  then
			  myoutname="<font color=red title='自己'>"&Ourusers("WS_Name")&"</font>"
			else
			  myoutname=Ourusers("WS_Name")
			end if
	        response.write "<tr><td  class='face' onMouseDown=this.className='face-2' onMouseUp=this.className='face-1' onMouseOver=this.className='face-1' onMouseOut=this.className='face' style='CURSOR:hand;' onDblClick=""show('"&Ourusers("WS_Uid")&"');"" title=""双击给 ["&Outdepartment&" "&OutAppointment&" "&Ourusers("WS_Name")&"] 发短消息!!! &#10;注册时间:"&Ourusers("WS_addate")&"&#10;上次登录:"&Ourusers("WS_logindate")&"""><img src='../hximages/websms/userface.gif' align='absmiddle'> "&myoutname&"</td></tr>"
          Ourusers.movenext
          loop
          response.write "</table>"
        end if
		HX_RSClose(Ourusers)
   End Function
'返回
    Sub HX_Redirect(url)
	   if url<>"" then
	      response.redirect url
		  response.end
	   else
	      response.write "<script>history.go(-1);</script>"
		  response.end
	   end if	
	End Sub	
'向地址中加入 ? 或 & (无用)
	Public Function JoinChar(strUrl)
		if strUrl="" then JoinChar="":Exit Function
		if InStr(strUrl,"?")<len(strUrl) then 
			if InStr(strUrl,"?")>1 then
				if InStr(strUrl,"&")<len(strUrl) then 
					JoinChar=strUrl & "&"
				else
					JoinChar=strUrl
				end if
			else
				JoinChar=strUrl & "?"
			end if
		else
			JoinChar=strUrl
		end if
	End Function
' 判断是否安全字符串,在注册登录等特殊字段中使用
	Public Function IsSafeStr(str)
		Dim s_BadStr, n, i
		s_BadStr = "'   &<>?%,;:()`~!@#$^*{}[]|+-=" & Chr(34) & Chr(9) & Chr(32)
		n = Len(s_BadStr)
		IsSafeStr = True
		For i = 1 To n
			If Instr(str, Mid(s_BadStr, i, 1)) > 0 Then
				IsSafeStr = False
				Exit Function
			End If
		Next
	End Function
	'****************************************************************

'获取任何表任何字段信息函数
    Public Function HX_SetRSD(ColsStr,TaNameStr,OrderBystr)
	    If ColsStr="" then ColsStr="*"
         set HX_SetRSD=server.CreateObject("adodb.recordset")
		 'response.write "select "&ColsStr&" from "&TaNameStr&OrderBystr&"<br>"
		 'HX_SetRSD.open "select "&ColsStr&" from "&TaNameStr,conn,1,3
         HX_SetRSD.open "select "&ColsStr&" from "&TaNameStr&OrderBystr,conn,1,3			 	 
     End Function 
'写入任何表任何字段信息函数
	Public Sub InToColumn(TableName,ColumnName,ColumnValue)
		On Error Resume Next
		Execute("insert into ["&TableName&"] ("&ColumnName&") values ("&Replace(Replace(ColumnValue,"True","1"),"False","0")&")")
		If Err Then
			Response.Write "在数据库表"&TableName&"中添加记录失败!原因:<font color=red>" & Err.Description
			Err.Clear
			'Response.end
		End If
	End Sub
'显示从职位中显示部门
     Public Function HX_OutAppointment(Appointment)
	    If Appointment<>"" and Isnumeric(Appointment) Then
	    Set OutRs=WS_S.HX_SetRSD("WS_AppointmentName,WS_Did","HX_Appointment"," where WS_Aid="&Appointment)
		  If OutRs.recordcount>0 Then
		    Set Ders=WS_S.HX_SetRSD("WS_DepartmentName","HX_Department"," where WS_Did="&OutRs("WS_Did"))
			If Ders.recordcount>0 Then
			HX_OutAppointment=Ders(0)
			End If
			Call HX_RSClose(Ders)
		    HX_OutAppointment=HX_OutAppointment&OutRs(0)
		  Else
		    HX_OutAppointment="<font color=red>职位删除</font>"
		  End If
		Else
		  HX_OutAppointment="<font color=red>参数错误</font>"
		End If
		  Call HX_RSClose(OutRs)
	 End Function
'显示部门 
    Public Function HX_OutDepartment(Department)
	    If Department<>"" and Isnumeric(Department) Then
		    Set Ders=WS_S.HX_SetRSD("WS_DepartmentName","HX_Department"," where WS_Did="&Department)
			If Ders.recordcount>0 Then
			  HX_OutDepartment=Ders(0)
			End If
			Call HX_RSClose(Ders)
		end if	
	 End Function
'显示用户名、姓名、部门、职位	
	 Sub HX_OutUserInfo(Userid)
	   if Userid<>"" and isnumeric(Userid) then
	     OutUserName="":OutName="":OutPhone="":OutAddress="":OutAppointmentID="":OutdepartmentID=""
	     Set Outrs=WS_S.HX_SetRSD("*","HX_CompanyUser"," where WS_Uid="&Userid)
		 if Outrs.recordcount>0 then
		   OutUserName=Outrs("WS_UserName") '用户名
		   OutName=Outrs("WS_Name") '姓名
		   OutPhone=Outrs("WS_Phone")'电话号码
		   OutAddress=Outrs("WS_Address")'住址
		   OutAppointmentID=Outrs("WS_Appointment")'职位
		   OutdepartmentID=Outrs("WS_department")'部门
		   if OutAppointmentID>0 then
		     OutAppointment=conn.execute("select * from HX_Appointment where WS_Aid="&OutAppointmentID)("WS_AppointmentName")
		   end if
		   if OutdepartmentID>0 then
		     Outdepartment=conn.execute("select * from HX_Department where WS_Did="&OutdepartmentID)("WS_DepartmentName")
		   end if
		     Call HX_RSClose(OutRs)
		 end if
	   end if
	 End Sub
'显示客户
  Sub HX_OutCustonInfo(Cid)
    if WS_S.HX_IsNUM(Cid) then
     set crs=WS_S.HX_SetRSD(ColumnName,"HX_CustomInfo"," where WS_CIID="&Cid)
      if crs.recordcount>0 then
        response.write crs("WS_CustomInfoName")
	  else
	    response.write "不属于客户"	
      end if
	else
	  response.write "不属于客户"	 
	end if 
  End Sub
'显示供应商
  Sub HX_OutSaleShop(SSID)
    if WS_S.HX_IsNUM(SSID) then
     set crs=WS_S.HX_SetRSD(ColumnName,"HX_SaleShop"," where WS_SSID="&SSID)
      if crs.recordcount>0 then
        response.write crs("WS_SaleShopName")
	  else
	    response.write "内部产品"	
      end if
	else
	  response.write "内部产品"	 
	end if 
  End Sub
'显示产品名称
  Sub HX_OutProduct(PTID)
    if WS_S.HX_IsNUM(PTID) then
     set crs=WS_S.HX_SetRSD(ColumnName,"HX_Product"," where WS_PTID="&PTID)
      if crs.recordcount>0 then
        response.write crs("WS_ProductName")
	  else
	    response.write "产品空缺"	
      end if
	else
	  response.write "产品空缺"	 
	end if 
  End Sub
'显示日程类别
  Function OutSchEduleSort(SchEduleID)
    if WS_S.HX_IsNum(SchEduleID) then
      set OutRs=WS_S.HX_SetRSD(ColumnName,"HX_SchEduleSort"," where WS_SEID="&SchEduleID)
	  if OutRs.recordcount>0 then
	    OutSchEduleSort=OutRs("WS_SchEduleSortName")
	  end if
	  Call HX_RSClose(OutRs)
	end if
  End Function	 
	 
'写日志	
	Public Sub SaveAdminLog(WS_UserName,WS_Appointment,RequestStr)
		'On Error Resume Next
		Path_Info		= Request.ServerVariables("PATH_INFO")
		Tmpstr			= Split(Path_Info,"/")
		ScriptName		= Lcase(Tmpstr(UBound(Tmpstr)))
		Err=0
	    if RequestStr="" then
			RequestStr=Left(request.form,200)
			RequestStr=CheckStr(URLDecode(RequestStr))
			end if
			SQL="Insert Into HX_ManageLog (WS_UserName,WS_Appointment,WS_UserIP,WS_ScriptName,WS_LogContent,WS_LogTime) values ('"&WS_UserName&"',"&WS_Appointment&",'"&Request.ServerVariables("REMOTE_ADDR")&"','"&ScriptName&"','"&RequestStr&"','"&Now&"')"
			conn.Execute(SQL)
		If Err Then
			Response.Write "添加管理事件记录失败!原因:" & Err.Description
			Err.Clear
		End If
		HX_ClosDB()		
	End Sub
'关闭表对象	     
	 Public Function HX_RSClose(RecordSetStr)
	   if isobject(RecordSetStr) then
         RecordSetStr.Close:Set RecordSetStr = Nothing
	   end if
     End Function
	'Server.URLEncode解码函数
	Public Function URLDecode(enStr)
		dim deStr, c, i, v
		deStr=""
		for i=1 to len(enStr)
			c=Mid(enStr,i,1)
			if c="%" then
				v=eval("&h"+Mid(enStr,i+1,2))
				if v<128 then
					deStr=deStr&chr(v)
					i=i+2
				else
					if IsValidHex(mid(enstr,i,3)) then
						if IsValidHex(mid(enstr,i+3,3)) then

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -