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

📄 main.asp

📁 办公自动化系统 适用于办公室的各种几本功能的操作 功能比较简单
💻 ASP
📖 第 1 页 / 共 2 页
字号:
	<textarea COLS="35" ROWS="5" NAME="SelfBody" WRAP="PHYSICAL"><%=strSelfbody%>
	</textarea>
	</td>
	</tr>

	<tr bgcolor=#ffffff>
	<td valign=top align=right><b>其他</b>	</td>
	<td colspan=2>
	<textarea COLS="35" ROWS="5" NAME="Info"><%=strInfo%>
	</textarea>
	</td>
	</tr>
	
	
	<tr bgcolor=#ffffff>
		<td colspan=3>维护权限</td>
	</tr>
	<%set oRsRight=server.createobject("ADODB.RecordSet")
	sql="select Title,Rkey from tblRights where rkey In ("& strSelfRight & ")"
	oRsRight.open sql,Conn,1,1
	while not oRsRight.eof
	%>
    <tr bgcolor=#ffffff>
		<td height="30" width="146" valign="middle">
			<%if not oRsRight.eof then%>
				<INPUT TYPE="checkbox" NAME="Rights" value="<%=trim(oRsRight("Rkey"))%>" <%if instr(strRights,trim(oRsRight("Rkey")))>0 then response.write " checked"%> >	
				<font color="#FF0080">&nbsp;<%=trim(oRsRight("Title"))%></font>
				<%oRsRight.movenext
			end if%>
		</td>
		<td height="30" width="146" valign="middle">
			<%if not oRsRight.eof then%>
				<INPUT TYPE="checkbox" NAME="Rights" value="<%=trim(oRsRight("Rkey"))%>" <%if instr(strRights,trim(oRsRight("Rkey")))>0 then response.write " checked"%> >	
				<font color="#FF0080">&nbsp;<%=trim(oRsRight("Title"))%></font>
				<%oRsRight.movenext
			end if%>
		</td>
		<td height="30" width="146" valign="middle">
			<%if not oRsRight.eof then%>
				<INPUT TYPE="checkbox" NAME="Rights" value="<%=trim(oRsRight("Rkey"))%>" <%if instr(strRights,trim(oRsRight("Rkey")))>0 then response.write " checked"%> >	
				<font color="#FF0080">&nbsp;<%=trim(oRsRight("Title"))%></font>
				<%oRsRight.movenext
			end if%>
		</td>
    </tr>
    <%wend
	oRsRight.close
	set oRsRight = nothing%>

    <tr bgcolor=#ffffff>
	
	  <%if ID<>"0" then%>
		  <td></td>
		  <td height="40" valign="middle" align="center">
		  <input type="Submit" value="修改信息" name="cmdUpdate" onclick="return CheckData();">
		  </td>
		  <td height="40" valign="middle" align="center">
		  <input type="Submit" value="删除用户" name="cmdDelete" onclick="return CheckDelete();">
		  </td>
	 <%else%>
		  <td></td><td></td>
		  <td height="40" valign="middle" align="center">
		  <input type="Submit" value="添加用户" name="cmdAdd" onclick="return CheckData();"></td>
	  <%end if%>


    </tr>
	<%if ID<>"0" and ID<>"" then%>
	<tr bgcolor=#FFFFFF>
		<td VALIGN="TOP" ALIGN="LEFT"><b>照片</b>
		</td>
		<td VALIGN="TOP" ALIGN="LEFT" colspan=2>
		<%if sPhoto<>"" then%>
		<img src="../File_up/Photo/<%=ID%>/<%=sPhoto%>" border=0>
		<%end if%>
		<!--input type="file" name="Photo" size=20 class="input"-->
		<input type="button" value="更改照片" onclick="OpenWindow('PhotoUpfrm.asp?ID=<%=ID%>','PhotoWindow')">

		</td>
		</tr>
		<tr bgcolor=#FFFFFF>
		<td VALIGN="TOP" ALIGN="LEFT"><b>签名</b>
		</td>
		<td VALIGN="TOP" ALIGN="LEFT" colspan=2>
		<%if sPhoto<>"" then%>
		<img src="../File_up/Photo/<%=ID%>/<%=sSignature%>" border=0>
		<%end if%>
		<!--input type="file" name="Signature" size=20 class="input"-->
		<input type="button" value="更改签名" onclick="OpenWindow('SignatureUpfrm.asp?ID=<%=ID%>','PhotoWindow')">
		</td>
		</tr>
	<%end if%>
  </table>
  </center></div>
</form>
</body>
</html>
<script language="JavaScript">
function OpenWindow(url,windowname)
{
window.open(url,windowname,'left=100,top=50,height=100,width=350,toolbar=no,menubar=no,scrollbars=yes')
}
</script>
<!--#include file="../inc/connclose.asp"-->

<%
Function SelfRights(ID)
	set Rstmp=server.createobject("adodb.recordset")
	Rstmp.open "Select Rights from tblUser where id="& ID, Conn, 1, 1
	if not Rstmp.eof then
		str = trim(Rstmp("Rights"))
	else
		str = ""
	end if
	Rstmp.close
	set Rstmp=nothing
	dim strtemp
	arrStr=split(str,",")
	strtemp="'xxxxx'"
	for I=0 to ubound(arrStr)
		strtemp=strtemp &",'"& trim(arrStr(I)) &"'"
	next
	SelfRights = strtemp
End Function

Sub GetSelectUserData(ID)  '查询数据
	set strRstmp=Server.createobject("ADODB.RecordSet")
	sql="select * from tblUser where id=" & ID
	strRstmp.open sql,Conn
	if strRstmp.eof then 
		ID=""
	else
		strLoginName=trim(strRstmp("LoginName"))
		strPwd=trim(strRstmp("Pwd"))
		strName=trim(strRstmp("Name"))
		strInfo=trim(strRstmp("Info"))
		strRights=trim(strRstmp("Rights"))
		Sex=trim(strRstmp("sex"))
		PreviousID=trim(strRstmp("PreviousID"))
		Department=trim(strRstmp("Department"))
		if Department="" then Department=0
		strPosition=trim(strRstmp("Position"))
		strOfficeTel=trim(strRstmp("Officetel"))
		strHomeTel=trim(strRstmp("HomeTel"))
		strPager=trim(strRstmp("Pager"))
		strMobiletel=trim(strRstmp("Mobiletel"))
		strPostCode=trim(strRstmp("PostCode"))
		strEmail=trim(strRstmp("Email"))
		strAddress=trim(strRstmp("Address"))
		strFax=trim(strRstmp("Fax"))
		strSelfBody=trim(strRstmp("Selfbody"))
		sPhoto=trim(strRstmp("Photo"))
		sSignature=trim(strRstmp("Signature"))

	end if
	strRstmp.close
	set strRstmp = Nothing
End Sub

Sub AddUser	 '添加用户
     sql="INSERT INTO tblUser (PreviousID,Department,Sex,LoginName,Pwd,Name,Info,Rights,Position,OfficeTel,HomeTel,Pager,MobileTel,Postcode,Email,Address,Fax,SelfBody) VALUES(" & PreviousID & _
		"," & Department & _
		"," & Sex & _
		",'" & strLoginName & _
		"','"& strPwd & _
		"','" & strName & _
		"','" & strInfo & _
		"','" & strRights & _
		"','" & strPosition & _
		"','" & strOfficeTel & _
		"','" & strHomeTel & _
		"','" & strPager & _
		"','" & strMobileTel & _
		"','" & strPostcode & _
		"','" & strEmail & _
		"','" & strAddress & _
		"','" & strFax & _
		"','" & strSelfBody & _
		"')"
		Conn.execute (sql)
	    ID = ""
		
End Sub

Sub DeleteUser(ID)  '删除用户
  sql="delete tblUser where id=" & ID
  Conn.execute(sql)
  ID=""
  
End Sub

Sub UpdateUser(ID)  '修改信息
	sql="update tblUser set LoginName='"& strLoginName &"',Pwd='"& strPwd &"',Name='"& strName &"',Info='"& strInfo &"',Rights='"& strRights &"',PreviousID="&PreviousID&",Sex="&Sex&",Department="&Department&",Position='"&strPosition&"',OfficeTel='"&strOfficeTel&"',HomeTel='"&strHomeTel&"',Pager='"&strPager&"',Mobiletel='"&strMobiletel&"',PostCode='"&strPostCode&"',Email='"&strEmail&"',Address='"&strAddress&"',Fax='"&strFax&"',SelfBody='"&strSelfBody&"' where id=" & ID
	Conn.execute(sql)	
End Sub
Sub UpdateUser2(ID)  '修改信息
	sql="update tblUser set LoginName='"& strLoginName &"',Name='"& strName &"',Info='"& strInfo &"',Rights='"& strRights &"',PreviousID="&PreviousID&",Sex="&Sex&",Department="&Department&",Position='"&strPosition&"',OfficeTel='"&strOfficeTel&"',HomeTel='"&strHomeTel&"',Pager='"&strPager&"',Mobiletel='"&strMobiletel&"',PostCode='"&strPostCode&"',Email='"&strEmail&"',Address='"&strAddress&"',Fax='"&strFax&"',SelfBody='"&strSelfBody&"' where id=" & ID
	Conn.execute(sql)	
End Sub

Function CheckUser(strName)  '查找是否有重名用户
	set strRstmp=Server.createobject("ADODB.RecordSet")
	sql="select id from tblUser where LoginName='" & trim(strName) & "'"
	strRstmp.open sql,Conn
	if not strRstmp.eof then
		bFindUser=true  '错误,有相同的用户名
	else
		bFindUser=false
	end if
	strRstmp.close
	set strRstmp = Nothing
	CheckUser=bFindUser
End Function

Function CheckUpdateUser(ID,strName)  '查找修改时是否有重名用户
	set strRstmp=Server.createobject("ADODB.RecordSet")
	sql="select id from tblUser where ID<>"& ID &" and LoginName='" & trim(strName) & "'"
	strRstmp.open sql,Conn
	if not strRstmp.eof then
		bFindUser=true  '错误,有相同的用户名
	else
		bFindUser=false
	end if
	strRstmp.close
	set strRstmp = Nothing
	CheckUpdateUser=bFindUser
End Function
%>
<script language=javascript>
function CheckData()
{
	if(jtrim(document.Rightfrm.LoginName.value)=="")
	{
		alert("请输入登录用户名。")
		document.Rightfrm.LoginName.focus();
		return false;
	}
	if(jtrim(document.Rightfrm.LoginName.value).length>50)
	{
		alert("登录用户名不能超过50个字。")
		document.Reportform.LoginName.focus();
		return false;
	}
	if(jtrim(document.Rightfrm.Name.value)=="")
	{
		alert("请输入用户姓名。")
		document.Rightfrm.Name.focus();
		return false;
	}
	
	return true;
}
</script>
<script language=javascript src="../inc/jtrim.js"></script>
<script language=javascript>
function CheckDelete()
{
	document.Rightfrm.cmdDelete.value !=""
	return confirm("确实删除吗?");
}
</script>

⌨️ 快捷键说明

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