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

📄 main.asp

📁 OFFICE办公自动化
💻 ASP
字号:
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/const.asp"-->
<!--#include file="inc/md5.asp"-->
<!-- #include file="inc/pubfun_a.inc" -->
<%
If Session("LoginOk")<>true or Session("LoginID")="" then
	dim LoginName, Pwd

	LoginName = crequest("LoginName")
	Pwd = crequest("Pwd")

	if LoginName="" and Pwd="" then
		'session name
		LoginName = session("LoginName")
		Pwd = session("pwd")
	end if

	dim Success
	Success = false
	dim Rs
	Set Rs= server.createobject ("adodb.recordset")
	Rs.open "select * from tbioaUser where LoginName='"& LoginName &"'", oConn, 1, 3
	if not Rs.eof then
		if Rs("department") = 0 then
			ErrorMessage = "该用户帐号为分配部门!(请与部门负责人联系)"
			Success = false
		elseif Rs("roleid") = "" then
			ErrorMessage = "该人已离职!(请与人事部门联系)"
			Success = false
		elseif md5(Pwd) <> Rs("pwd") then
			ErrorMessage="用户名或密码错误,请重新输入。"
			Success = false
		else
			Session("LoginName") = LoginName
			Session("pwd") = md5(Pwd)
			Session("LoginID") = trim(Rs("ID"))
			Session("RealName") = trim(Rs("Name"))
			if GetTableValue("tbioaDepartment","pmod","id",Rs("Department")) then
				Session("DepID") = 1
			else
				Session("DepID") = trim(Rs("Department"))
			end if
			Session("LoginOK")=true
			Rs("OnlineMod")=1
			Rs.Update()
			Success = true '登陆成功
		end if
	else
		ErrorMessage = "没有该用户!"
	end if

	Rs.close
	set Rs=nothing
%>
<%
	if not Success then
		if ErrorMessage="" then ErrorMessage="用户名或密码错误,请重新输入。"
		response.redirect("Default.asp?errormessage="& Server.URLencode(ErrorMessage))
		response.end
		oConn.close
	else
		Response.Redirect("main.asp")
	end if
end if
%>
<html>

<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<link rel="stylesheet" href="css/index.css" type=text/css>
<title><%=Corp%></title>
<script language="JavaScript">
<!--
 <%
 '--------------------------------------------取离线设置记录
 set rs=Server.CreateObject("ADODB.RecordSet")
 sql="select * from tbioaOutline where UserID="&Session("LoginID")
 rs.open sql,oConn,3,2
 if rs.EOF then
 	rs.AddNew
 	rs("UserID")=Session("LoginID")
 	rs.Update
 	rs.close
 	rs.open sql,oConn,1,1
 end if
 '------------------------------------------------
 if rs("alertmod")="1" then
 %>alertmod=1;<%
 else
 %>alertmod=0;<%
 end if
 rs.close
 set rs=nothing
 %>
 function beforeunload() {
	if (alertmod==1){
		showModalDialog("OutLine/OutLine_Alert.html", "", "dialogWidth:26.4em; dialogHeight:255px; center: Yes; scroll:No; resizable: No; status: No; help: No;");
	}
	return "离开页面后,您将退出OA系统。"
 }
 function unload(){
	window.open('Unload.asp?userid=<%=Session("LoginID")%>','','top=1000,width=0,height=0');
 }
-->
</script>
<%
	'---------------------
	'增加签到数据
	dim rskq,srq,rsxxr,xxdate
	set rskq=server.CreateObject("adodb.recordset")
	set rsxxr=server.CreateObject("adodb.recordset")
	xxdate=year(now())&"-"&month(now())&"-"&day(now())
	set rsxxr=oConn.execute("select * from kq_xxrb where xxr='" & xxdate &"'")
	if rsxxr.EOF then
		srq=formatdatetime_activenew(now,"yyyy-mm-dd")
		rskq.Open "Select * from kq_kqb where kqrq='" & srq & "' and YGBH=" & Session("LoginID"),oConn,3,2
		if rskq.EOF then
			if Instr(Request.ServerVariables("REMOTE_ADDR"),"172.27.229")>0 or Instr(Request.ServerVariables("REMOTE_ADDR"),"127.0.0.1")>0 then
				if timevalue(time) > timevalue(timevalue("6:00")) then
					rskq.AddNew
					rskq("ygbh")=Session("LoginID")
					rskq("kqrq")=srq
					rskq("qdsj")=formatdatetime_activenew(now,"hh:nn:ss")
					rskq("qtsj")=""
					rskq.Update
				else
					response.write "<script language=""vbscript"">msgbox ""『各位职工』请注意:"" & vbcrlf & vbcrlf & "" ★ 只有在6:00以后才能【签到】 !"" & vbcrlf  & vbcrlf & "" ★ 本次签到无效!!!""</script>"
				end if
			else
			response.write "<script language=""vbscript"">msgbox ""『您好』:"" & vbcrlf & vbcrlf & "" ★ 欢迎使用卓耀网络办公系统 !!!""</script>"
			end if
		end if
		rskq.close
	end if
	rsxxr.Close
	set rsxxr=nothing
	set rskq = nothing
	'---------------------
%>
</head>
</head>

<frameset rows="123,0,*,20" framespacing="0" frameborder="no" bordercolor="#E4E4E4" onbeforeunload="javascript:return beforeunload()" onunload="javascript:unload()">
  <frame name="Top" scrolling="no" framespacing="0" frameBorder=no noresize src="html/top.asp" target="Main">
  <frame name="hidframe" src="UntitledFrame-1" name="left" noresize>
  <frame name="Main" noresize framespacing="0" frameBorder="no" src="office/OfficeMain.asp">
  <frame name="bottom" scrolling="no" frameBorder=no noresize src="html/bottom.asp" target="_self">
  <noframes>
  <body>
  <p>此网页使用了框架,但您的浏览器不支持框架。</p>
  </body>
  </noframes>
</frameset>
</html>
<!-- #include file="inc/conn_close.asp" --> <font face="宋体" size=2>

⌨️ 快捷键说明

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