<html xmlns="http://www.w3.org/1999/xhtml">
<!--#include file="../Inc/Conn.asp" -->
<!--#include file="../Inc/SK.Session.asp" -->
<!--#include file="../Inc/SK.Funtion.asp" -->
<!--#include file="../Inc/SK.Md5.asp"-->
<%if Not (Session("Manager")="1" OR (JudgePopedomTF(Session("UserName"),"SK900000000") AND JudgePopedomTF(Session("UserName"),"SK910000007"))) then Call ReturnError1()%>
<%
'AddNew
if RQ("Action")="Add" and F("Dept1")>"0" and F("Dept2")>"0" and F("Dept3")>"0" and F("S_Name")<>"" 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
Call ReturnError11()
end if
rs.AddNew
rs("SK_Manager")=NoCSSHackInput(F("S_Manager"))
rs("SK_Dept1")=NoCSSHackInput(F("Dept1"))
rs("SK_Dept2")=NoCSSHackInput(F("Dept2"))
rs("SK_Dept3")=NoCSSHackInput(F("Dept3"))
rs("SK_Name")=NoCSSHackInput(F("S_Name"))
rs("SK_Pass")=md5(NoCSSHackInput(F("S_Pass")),16)
rs("SK_Locked")=NoCSSHackInput(F("S_Locked"))
rs("SK_Incum")=NoCSSHackInput(F("S_Incum"))
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_Atime")=NoCSSHackInput(F("S_Atime"))
rs("SK_Btime")=NoCSSHackInput(F("S_Btime"))
rs("SK_Remind")=NoCSSHackInput(F("S_Remind"))
rs("SK_Intime")=NoCSSHackInput(F("S_Intime"))
rs("SK_Outtime")=NoCSSHackInput(F("S_Outtime"))
rs("SK_UsersContent")=F("S_Content")
rs("SK_Property")=F("S_Property")
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 LANGUAGE='javascript'>alert('恭喜你,新建用户成功！');window.close();window.opener.location.reload();</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_Manager.value ==""){
alert("对不起,请选择用户级别!");
form1.S_Manager.focus();
return false;
}

if(form1.Dept1.value <="0"){
alert("对不起,请选择分区!");
form1.Dept1.focus();
return false;
}

if(form1.Dept2.value <="0"){
alert("对不起,请选择部门1!");
form1.Dept2.focus();
return false;
}

if(form1.Dept3.value <="0"){
alert("对不起,请选择分组!");
form1.Dept3.focus();
return false;
}

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 colspan="6" class="SK_Title1">用户信息</td>
</tr>

<tr>
  <td class="SK_Text2">用户级别</td>
  <td width="21%" class="SK_Text1">
<select name="S_Manager">
<option value="" selected>---请选择---</option>
<%
Set rs1=Server.CreateObject("ADODB.RecordSet") 
sql1="SELECT * from SK_SystemUsersGroup order by UsersGroupID asc" 
rs1.Open sql1,conn,1,1
do while not rs1.eof
%><option value="<%=rs1("UsersGroupID")%>"><%=rs1("SK_GroupName")%></option>
<%
rs1.movenext
loop
rs1.close
set rs1=Nothing
%></select>
<font color=red>*</font></td>
  <td width="10%" class="SK_Text2">部门分组</td>
  <td colspan="3" class="SK_Text1"><!-- #include file="../Inc/SK.Dept.asp" --> <font color=red>*</font></td>
</tr>
<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 class="SK_Text2">是否锁定</td>
  <td colspan="5" class="SK_Text1"><select name="S_Locked">
    <option value="1">是</option>
    <option value="0" selected>否</option>
  </select>  <font color="#FF0000">为了系统的安全和防止错误的操作,系统只需设置1名系统管理员即可,反之造成的损失自行承担. </font></td>
  </tr>
<tr>
  <td class="SK_Text2">用户性质</td>
  <td colspan="5" class="SK_Text1"><select name="S_Property">
    <option value="1">销售</option>
    <option value="2">财务</option>
    <option value="3">采购</option>
    <option value="4">仓管</option>
    <option value="5">客服</option>
    <option value="6">人事</option>
	<option value="10">领导</option>
  </select> 
  </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_Atime" type="text" size="20" onClick="new Calendar().show(this);" readOnly /></td>
  <td class="SK_Text2">合同截止</td>
  <td class="SK_Text1"><input name="S_Btime" type="text" size="20" onClick="new Calendar().show(this);" readOnly /></td>
  <td class="SK_Text2">合同提醒</td>
  <td class="SK_Text1"><select name="S_Remind">
    <option value="0" selected>不提醒</option>
	<option value="1">提前1天提醒</option>
	<option value="2">提前2天提醒</option>
	<option value="3">提前3天提醒</option>
	<option value="5">提前5天提醒</option>
  </select></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">是否在职</td>
  <td class="SK_Text1"><select name="S_Incum">
    <option value="1">离职</option>
    <option value="0" selected>在职</option>
  </select></td>
  <td class="SK_Text2">离职日期</td>
  <td class="SK_Text1"><input name="S_Outtime" type="text" size="20" onClick="new Calendar().show(this);" readOnly /></td>
</tr>

<tr>
  <td valign="top" class="SK_Text2">备　　注</td>
  <td colspan="5" valign="top" class="SK_Text1"><IFRAME ID="eWebEditor1" SRC="<%=getconfig("SK_EditorPath")%>/ewebeditor.htm?id=S_Content&style=standard650" FRAMEBORDER="0" SCROLLING="no" WIDTH="650" HEIGHT="300"></IFRAME>
<input type="hidden" name="S_Content"></td>
  </tr>

<tr>
  <td colspan="6" class="SK_Text"><INPUT class="button1" type="submit" value=" 保存 "> <input type="button" value=" 关闭 " onClick="window.opener.location.reload();window.close();" 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>