<html xmlns="http://www.w3.org/1999/xhtml">
<!--#include file="../Inc/Conn.asp" -->
<!--#include file="../Inc/SK.Funtion.asp" -->
<!--#include file="../Inc/SK.Md5.asp"-->
<%
if Getconfig("SK_Regedit")=1 then 
Response.Write("<script LANGUAGE='javascript'>alert('对不起,系统不允许注册！');window.close();</script>")
Response.End
end if

'AddNew
if RQ("Action")="Add" and F("S_Name")<>"" and F("S_Pass")<>"" and F("S_Oname")<>"" then
Call ChkIsOuter()
set rs=server.createobject("adodb.recordset")
sql="select * from SK_SystemUsers where SK_Name='"&F("S_Name")&"'"
rs.open sql,conn,1,3
if not rs.eof or not rs.bof then
Response.Write("<script LANGUAGE='javascript'>alert('对不起,用户名已经存在，请重新填写用户名！');history.go(-1);</script>")
Response.End
end if
rs.AddNew
rs("SK_Manager")="6"
rs("SK_Dept1")="0"
rs("SK_Dept2")="0"
rs("SK_Dept3")="0"
rs("SK_Name")=NoCSSHackInput(F("S_Name"))
rs("SK_Pass")=md5(NoCSSHackInput(F("S_Pass")),16)
rs("SK_Locked")="1"
rs("SK_Incum")="0"
rs("SK_NumID")=NoCSSHackInput(F("S_NumID"))
rs("SK_Oname")=NoCSSHackInput(F("S_Oname"))
rs("Sex")=NoCSSHackInput(F("S_Sex"))
rs("SK_Job")=NoCSSHackInput(F("S_Job"))
rs("SK_CID")=NoCSSHackInput(F("S_CID"))
rs("SK_Birth")=NoCSSHackInput(F("S_Birth"))
rs("SK_Native")=NoCSSHackInput(F("S_Native"))
rs("SK_Nation")=NoCSSHackInput(F("S_Nation"))
rs("SK_Above")=NoCSSHackInput(F("S_Above"))
rs("SK_School")=NoCSSHackInput(F("S_School"))
rs("SK_Major")=NoCSSHackInput(F("S_Major"))
rs("SK_Gradu")=NoCSSHackInput(F("S_Gradu"))
rs("SK_Tel")=NoCSSHackInput(F("S_Tel"))
rs("SK_Fax")=NoCSSHackInput(F("S_Fax"))
rs("SK_Email")=NoCSSHackInput(F("S_Email"))
rs("SK_Phone")=NoCSSHackInput(F("S_Phone"))
rs("SK_Mobile")=NoCSSHackInput(F("S_Mobile"))
rs("SK_Skill")=NoCSSHackInput(F("S_Skill"))
rs("SK_Bplace")=NoCSSHackInput(F("S_Bplace"))
rs("SK_Address")=NoCSSHackInput(F("S_Address"))
rs("SK_Hobby")=NoCSSHackInput(F("S_Hobby"))
rs("SK_Intime")=NoCSSHackInput(F("S_Intime"))
rs("SK_Time")=Now()
rs.Update
rs.Close 
set rs=Nothing
'Event Begin
if getconfig("SK_Event")=0 then
set rsEvent=server.createobject("adodb.recordset")
sqlEvent="select * from SK_SystemEvent"
rsEvent.open sqlEvent,conn,1,3
rsEvent.AddNew
rsEvent("SK_Title")="注册用户："&NoCSSHackInput(F("S_Name"))&" 的信息"
rsEvent("SK_User")=Session("UserName")
rsEvent("SK_Time")=Now()
rsEvent("SK_IP")=request.ServerVariables("Remote_Addr")
rsEvent.Update
rsEvent.Close 
set rsEvent=Nothing
end if
'Event End
Response.Write"<script>alert('恭喜你,注册成功,您的用户名是:"&F("S_Name")&",立即登录！');this.location.href='Login.asp';</SCRIPT>"
Response.End
end if
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312" />
<title>内部员工注册</title>
<META http-equiv=Page-Enter content=SKCRM>
<META http-equiv=Page-Exit content=SKCRM>
<META content="MSHTML 6.00.3790.2858" name=GENERATOR>
<LINK href="../images/style.css" type=text/css rel=stylesheet>
<script language="javascript" src="../Inc/Check.js"></script>
<script language="javascript" src="../Inc/Calendar.js"></script>
<SCRIPT language=javascript src="../inc/Openwin.js"></SCRIPT>
<script>
window.onbeforeunload = function()
{
if (document.body.offsetWidth-50 < event.clientX && event.clientY<0)
{
return "是否关闭当前窗口？关闭本窗口将放弃注册！";
}
}
</script>
<style type="text/css">
<!--
body {
margin: 5px 0px 5px 0px;
overflow-x: hidden;
}
-->
</style>
<SCRIPT language=JavaScript>
function Form1_Validator(theForm)
{

if(form1.S_Name.value ==""){
alert("对不起,用户名不能为空!");
form1.S_Name.focus();
return false;
}

if(form1.S_Pass.value ==""){
alert("对不起,密码不能为空!");
form1.S_Pass.focus();
return false;
}

if(form1.S_Oname.value ==""){
alert("对不起,姓名不能为空!");
form1.S_Oname.focus();
return false;
}

return true;
}
</SCRIPT>
</head>
<body>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
<TBODY>
<tr>
<td class="SK_Td_Top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="12" height="25"><img src="../images/tab_03.gif" width="12" height="25" /></td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="46%" valign="middle">员工注册</td>
<td width="54%"></td>
</tr>
</table></td>
<td width="16"><img src="../images/tab_07.gif" width="16" height="25" /></td>
</tr>
</table></td>
</tr>
<tr>
<td>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="8" background="../images/tab_12.gif"></td>
<td>

<form name="thisForm" id="form1" method="post" action="?Action=Add" onSubmit="return Form1_Validator(this)"> 
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="b5d6e6">
<tr>
<td width="11%" class="SK_Text2">用户名</td>
<td class="SK_Text1"><input name="S_Name" type="text" size="20" /> <font color=red>*</font>
<td class="SK_Text2">密码</td>
<td colspan="3" class="SK_Text1"><input name="S_Pass" type="password" size="20" /> <font color=red>*</font></td>
</tr>

<tr>
  <td colspan="6" class="SK_Title1">员工资料</td>
</tr>

<tr>
<td width="11%" class="SK_Text2">员工编号</td>
<td class="SK_Text1"><input name="S_NumID" type="text" size="20" /></td>
<td class="SK_Text2">姓　　名</td>
<td width="22%" class="SK_Text1"><input name="S_Oname" type="text" size="20" /> <font color=red>*</font></td>
<td width="9%" class="SK_Text2">性　　别</td>
<td width="27%" class="SK_Text1"><select name="S_Sex">
    <option value="1">男</option>
    <option value="0" selected>女</option>
  </select></td>
</tr>
<tr>
  <td class="SK_Text2">职位名称</td>
  <td class="SK_Text1"><input name="S_Job" type="text" size="20" /></td>
  <td class="SK_Text2">身份证号</td>
  <td class="SK_Text1"><input name="S_CID" type="text" size="20" /></td>
  <td class="SK_Text2">生　　日</td>
  <td class="SK_Text1"><input name="S_Birth" type="text" size="20" onClick="new Calendar().show(this);" readOnly /></td>
</tr>

<tr>
  <td class="SK_Text2">籍　　贯</td>
  <td class="SK_Text1"><input name="S_Native" type="text" size="20" /></td>
  <td class="SK_Text2">民　　族</td>
  <td class="SK_Text1"><input name="S_Nation" type="text" size="20" /></td>
  <td class="SK_Text2">学　　历</td>
  <td class="SK_Text1"><input name="S_Above" type="text" size="20" /></td>
</tr>

<tr>
  <td class="SK_Text2">毕业院校</td>
  <td class="SK_Text1"><input name="S_School" type="text" size="20" /></td>
  <td class="SK_Text2">专　　业</td>
  <td class="SK_Text1"><input name="S_Major" type="text" size="20" /></td>
  <td class="SK_Text2">毕业时间</td>
  <td class="SK_Text1"><input name="S_Gradu" type="text" size="20" onClick="new Calendar().show(this);" readOnly /></td>
</tr>

<tr>
  <td class="SK_Text2">办公电话</td>
  <td class="SK_Text1"><input name="S_Tel" type="text" size="20" /></td>
  <td class="SK_Text2">传　　真</td>
  <td class="SK_Text1"><input name="S_Fax" type="text" size="20" /></td>
  <td class="SK_Text2">电子邮件</td>
  <td class="SK_Text1"><input name="S_Email" type="text" size="20" /></td>
</tr>
<tr>
  <td class="SK_Text2">家庭电话</td>
  <td class="SK_Text1"><input name="S_Phone" type="text" size="20" /></td>
  <td class="SK_Text2">手　　机</td>
  <td class="SK_Text1"><input name="S_Mobile" type="text" size="20" /></td>
  <td class="SK_Text2">特长技能</td>
  <td class="SK_Text1"><input name="S_Skill" type="text" size="20" /></td>
</tr>
<tr>
  <td class="SK_Text2">出生地址</td>
  <td class="SK_Text1"><input name="S_Bplace" type="text" size="20" /></td>
  <td class="SK_Text2">现居地址</td>
  <td class="SK_Text1"><input name="S_Address" type="text" size="20" /></td>
  <td class="SK_Text2">个人爱好</td>
  <td class="SK_Text1"><input name="S_Hobby" type="text" size="20" /></td>
</tr>

<tr>
  <td class="SK_Text2">入职日期</td>
  <td class="SK_Text1"><input name="S_Intime" type="text" size="20" onClick="new Calendar().show(this);" readOnly /></td>
  <td class="SK_Text2">&nbsp;</td>
  <td class="SK_Text1">&nbsp;</td>
  <td class="SK_Text2">&nbsp;</td>
  <td class="SK_Text1">&nbsp;</td>
</tr>

<tr>
  <td colspan="6" class="SK_Text"><INPUT class="button1" type="submit" value=" 注册 "> <input type="button" value=" 返回 " onClick="javascript:history.back(-1);" class="button1" /></td>
  </tr>
</table>
</form>

</td>
<td width="8" background="../images/tab_15.gif"></td>
</tr>
</table></td>
</tr>
<tr>
<td class="SK_Td_Foot">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%" height="20"><img src="../images/tab_18.gif" width="12" height="20" /></td>
<td width="98%" class="SK_Td_Page"></td>
<td width="1%"><img src="../images/tab_20.gif" width="16" height="20" /></td>
</tr>
</table>

</td>
</tr>
</TBODY>
</table>
</body>
<%
Call CloseDB()
%>
</html>