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

📄 main.asp

📁 OFFICE办公自动化
💻 ASP
📖 第 1 页 / 共 2 页
字号:
        </tr>
       <%end if%>
        <tr>
          <td align=right width="129"><b>生日</b> </td>
          <td colspan="2">
          	<input TYPE="TEXT" SIZE="12" MAXLENGTH="12" NAME="birthday" value="<%if strBirthday<>"1900-01-01" then response.write strBirthday%>" class="input" readonly> <a href=# title="选择日期" onClick="fPopUpDlg('../js/calendar.htm', document.Rightfrm.birthday, 'winpop', 234, 261);return false"><img src="../images/datetime.gif" border=0></a>
          </td>
        </tr>
        <tr>
          <td VALIGN="TOP"  align=right width="129"><b>E-mail</b> </td>
          <td colspan="2">
            <input   TYPE="TEXT" SIZE="30" MAXLENGTH="30" NAME="Email" value="<%=strEmail%>" class="input">
          </td>
        </tr>
        <tr>
          <td VALIGN="TOP"  align=right width="129"><b>公司电话(O)</b> </td>
          <td colspan="2">
            <input   TYPE="TEXT" SIZE="30" MAXLENGTH="40" NAME="OfficeTel" value="<%=strOfficeTel%>" class="input">
          </td>
        </tr>
        <tr>
          <td VALIGN="TOP" ALIGN="right" width="129"><b>家庭电话(H)</b> </td>
          <td colspan="2">
            <input   TYPE="TEXT" SIZE="30" MAXLENGTH="40" NAME="HomeTel" value="<%=strHomeTel%>" class="input">
          </td>
        </tr>
        <tr>
          <td VALIGN="TOP" ALIGN="right" width="129"><b>传真</b> </td>
          <td colspan="2">
            <input   TYPE="TEXT" SIZE="30" MAXLENGTH="40" NAME="Fax" value="<%=strFax%>" class="input">
          </td>
        </tr>
        <tr>
          <td VALIGN="TOP" ALIGN="right" width="129"><b>小灵通</b> </td>
          <td colspan="2">
            <input   TYPE="TEXT" SIZE="30" MAXLENGTH="40" NAME="Pager" value="<%=strPager%>" class="input">
          </td>
        </tr>
        <tr>
          <td VALIGN="TOP" ALIGN="right" width="129"><b>手机</b> </td>
          <td colspan="2">
            <input   TYPE="TEXT" SIZE="30" MAXLENGTH="40" NAME="Mobiletel" value="<%=strMobiletel%>" class="input">
          </td>
        </tr>
        <tr>
          <td VALIGN="TOP" ALIGN="right" width="129"><b>邮政编码</b> </td>
          <td colspan=2>
            <input   TYPE="TEXT" SIZE="30" MAXLENGTH="40" NAME="Postcode" value="<%=strPostCode%>" class="input">
          </td>
        </tr>
        <tr>
          <td VALIGN="TOP" ALIGN="right" width="129"><b>详细地址</b> </td>
          <td colspan=2>
            <input   TYPE="TEXT" SIZE="30" MAXLENGTH="40" NAME="Address" value="<%=strAddress%>" class="input">
          </td>
        </tr>
        <tr>
          <td VALIGN="TOP" ALIGN="right" width="129"><b>简历</b> </td>
          <td VALIGN="TOP" ALIGN="LEFT" colspan=2>
            <textarea COLS="35" ROWS="5" NAME="SelfBody" WRAP="PHYSICAL" class="textarea"><%=strSelfbody%>
	</textarea>
          </td>
        </tr>
        <tr>
          <td valign=top align=right width="129"><b>其他</b> </td>
          <td colspan=2>
            <textarea COLS="35" ROWS="5" NAME="Info" class="textarea"><%=strInfo%>
	</textarea>
          </td>
        </tr>
        <tr>
          <td ALIGN="center" colspan=3>
            <%if ID<>"0" then%>
              <input type="submit" class="button0" value="修改信息" name="cmdUpdate" onClick="return CheckData();" onmouseout=className="button0" onmouseover=className="button1">
            <%else%>
              <input type="submit" class="button0" value="添加用户" name="cmdAdd" onClick="return CheckData();" onmouseout=className="button0" onmouseover=className="button1">
            <%end if%>
          </td>
        </tr>
      </table>
      <% end if %>
     </td>
   </tr>
 </table>
</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/conn_close.asp"-->
<%
Sub GetSelectUserData(ID)  '查询数据
	set strRstmp=Server.createobject("ADODB.RecordSet")
	sql="select * from tbioaUser where id=" & ID
	strRstmp.open sql,oConn
	if strRstmp.eof then
		ID=""
	else
		strLoginName=trim(strRstmp("LoginName"))
		strPwd=trim(strRstmp("Pwd"))
		strName=trim(strRstmp("Name"))
		strInfo=trim(strRstmp("Info"))
		Sex=trim(strRstmp("sex"))
		Department=trim(strRstmp("Department"))
		if Department="" then Department=0
		strOfficeTel=trim(strRstmp("Officetel"))
		strHomeTel=trim(strRstmp("HomeTel"))
		strPager=trim(strRstmp("Pager"))
		strMobiletel=trim(strRstmp("Mobiletel"))
		strPostCode=trim(strRstmp("PostCode"))
		strEmail=trim(strRstmp("Email"))
		strBirthday=trim(strRstmp("Birthday"))
		strAddress=trim(strRstmp("Address"))
		strFax=trim(strRstmp("Fax"))
		strSelfBody=trim(strRstmp("Selfbody"))
		sPhoto=trim(strRstmp("Photo"))

	end if
	strRstmp.close
	set strRstmp = Nothing
End Sub

Sub AddUser	 '添加用户
     sql="INSERT INTO tbioaUser (Department,Roleid,Sex,LoginName,Pwd,Name,Info,OfficeTel,HomeTel,Pager,MobileTel,Postcode,Email,Birthday,Address,Fax,SelfBody) VALUES(" & Department & _
     		"," & StrRoleid & _
		"," & Sex & _
		",'" & strLoginName & _
		"','" & md5(strPwd) & _
		"','" & strName & _
		"','" & strInfo & _
		"','" & strOfficeTel & _
		"','" & strHomeTel & _
		"','" & strPager & _
		"','" & strMobileTel & _
		"','" & strPostcode & _
		"','" & strEmail & _
		"','" & strBirthday & _
		"','" & strAddress & _
		"','" & strFax & _
		"','" & strSelfBody & _
		"')"
		oConn.execute (sql)
	    ID = ""

End Sub

Sub DeleteUser(ID)  '删除用户
  sql="delete tbioaUser where id=" & ID
  oConn.execute(sql)
  ID=""

End Sub

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

Function CheckUser(strName)  '查找是否有重名用户
	set strRstmp=Server.createobject("ADODB.RecordSet")
	sql="select id from tbioaUser where LoginName='" & trim(strName) & "'"
	strRstmp.open sql,oConn
	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 tbioaUser where ID<>"& ID &" and LoginName='" & trim(strName) & "'"
	strRstmp.open sql,oConn
	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(document.Rightfrm.LoginName.value=="")	{
		alert("请输入登录用户名。")
		document.Rightfrm.LoginName.focus();
		return false;
	}
	if(document.Rightfrm.LoginName.value.length>50)
	{
		alert("登录用户名不能超过50个字。")
		document.Reportform.LoginName.focus();
		return false;
	}
	if(document.Rightfrm.Name.value=="")
	{
		alert("请输入用户姓名。")
		document.Rightfrm.Name.focus();
		return false;
	}
	if(document.Rightfrm.departmentkl.value=="")
	{
		alert("请选择部门。")
		document.Rightfrm.departmentkl.focus();
		return false;
	}
	return true;
}
</script>
 

⌨️ 快捷键说明

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