<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" -->
<%if Not (Session("Manager")="1" OR JudgePopedomTF(Session("UserName"),"SK900000001")) then Call ReturnError1()%>
<%
'AddNew
if RQ("Action")="Add" and F("S_OptionsID")<>"" and F("S_OName")<>"" then
Call ChkIsOuter()

Dim i
S_Name=split(F("S_OName"),"|")
for i=0 to ubound(S_Name)

set rs=server.createobject("adodb.recordset")
sql="select * from SK_OfficeOptionsDetail where SK_OptionsID="&F("S_OptionsID")&" and SK_OName='"&S_Name(i)&"'"
rs.open sql,conn,1,3
if not rs.eof or not rs.bof then
else
rs.AddNew
rs("SK_OptionsID")=NoCSSHackInput(F("S_OptionsID"))
rs("SK_OName")=S_Name(i)
rs.Update
end if
next
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")="新建Office选项参数："&F("S_OName")&""
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/jquery.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>
<SCRIPT language=JavaScript>
function Form1_Validator(theForm)
{
if(form1.S_OptionsID.value ==""){
alert("对不起,请选择所属选项!");
form1.S_OptionsID.focus();
return false;
}

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

return true;
}
</SCRIPT>
<style type="text/css">
<!--
body {
margin: 5px 0px 5px 0px;
overflow-x: hidden;
}
-->
</style>
</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 class="SK_Text2">所属选项</td>
  <td colspan="3" class="SK_Text1"><select name="S_OptionsID">
<option value="" selected>---请选择---</option>
<%
Set rs1=Server.CreateObject("ADODB.RecordSet") 
sql1="SELECT * from SK_OfficeOptions where SK_ShowOnForm=0 order by FieldID asc" 
rs1.Open sql1,conn,1,1
do while not rs1.eof
if Rs1("SK_Di")=0 then
DiName="(工作日志)"
elseif Rs1("SK_Di")=1 then
DiName="(报销列表)"
elseif Rs1("SK_Di")=2 then
DiName="(借款列表)"
end if
%>
<option value="<%=rs1("FieldID")%>"><%=rs1("SK_Title")%> -- <%=DiName%></option>
<%
rs1.movenext
loop
rs1.close
set rs1=Nothing
%></select> <font color=red>*</font></td>
</tr>
<tr>
  <td width="17%" valign="top" class="SK_Text2">参数名称</td>
  <td width="83%" colspan="3" class="SK_Text1"><textarea name="S_OName" cols="30" rows="5"></textarea> 
  <font color=red>* 多个参数中间以"|"隔开</font></td>
</tr>

<tr>
<td height="22" colspan="4" 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>