<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 (Getconfig("SK_Product")="0" AND (Session("Manager")="1" OR (JudgePopedomTF(Session("UserName"),"SK800000000") AND JudgePopedomTF(Session("UserName"),"SK800000100")))) then Call ReturnError()%>
<%
'AddNew
if RQ("Action")="Add" and F("S_ProName")<>"" and F("S_ProNo")<>"" and F("S_ProTypeID")<>"" then
Call ChkIsOuter()
set rs=server.createobject("adodb.recordset")
sql="select * from SK_Product"
rs.open sql,conn,1,3
rs.AddNew
rs("SK_Di")=NoCSSHackInput(F("S_Di"))
rs("SK_ProType")=NoCSSHackInput(F("S_ProTypeID"))
rs("SK_ProName")=NoCSSHackInput(F("S_ProName"))
rs("SK_ProNo")=NoCSSHackInput(F("S_ProNo"))
rs("SK_ProNum")=NoCSSHackInput(F("S_ProNum"))
rs("SK_ProTm")=NoCSSHackInput(F("S_ProTm"))
rs("SK_Price1")=NoCSSHackInput(F("S_Price1"))
rs("SK_Price2")=NoCSSHackInput(F("S_Price2"))
rs("SK_Unit")=NoCSSHackInput(F("S_Unit"))
rs("SK_Early")=NoCSSHackInput(F("S_Early"))
rs("SK_Content")=NoCSSHackContent(F("S_Content"))
rs("SK_Parame")=NoCSSHackContent(F("S_Parame"))
rs("SK_Remarks")=NoCSSHackContent(F("S_Remarks"))
rs("SK_SalesID")=Session("UID")
rs("SK_Addor")=Session("Oname")
rs("SK_ATime")=Now()
rs("SK_Del")="0"
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_ProName"))&""
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>
<style type="text/css">
<!--
body {
margin: 5px 0px 5px 0px;
overflow-x: hidden;
}
-->
</style>
<SCRIPT language=JavaScript>
function Form1_Validator(theForm)
{

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

if(form1.S_ProNo.value ==""){
alert("对不起,产品编号不能为空!");
form1.S_ProNo.focus();
return false;
}

if(form1.S_ProTypeName.value ==""){
alert("对不起,请选择不能为空!");
form1.S_ProTypeName.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="12%" class="SK_Text2">产品名称</td>
  <td class="SK_Text1"><input name="S_ProName" type="text" size="40"> <font color=red>*</font></td>
  <td width="13%" colspan="-1" class="SK_Text2">产品编码</td>
  <td width="41%" class="SK_Text1"><input name="S_ProNo" type="text" size="20"> <font color=red>*</font></td>
</tr>
<tr>
  <td class="SK_Text2">产品分类</td>
  <td class="SK_Text1"><input name="S_ProTypeName" type="text" size="20" readonly>
  <input name="S_ProTypeID" type="hidden"> <a onClick="JavaScript:window.open('SK.SProClass.asp?form=form1&field=S_ProTypeName&S_ProTypeID','','directorys=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=820,height=400,top=176,left=161');" style="cursor:hand"><img src="../images/SK_tb.gif" /></a>  </td>
  <td colspan="-1" class="SK_Text2">产品规格</td>
  <td class="SK_Text1"><input name="S_ProNum" type="text" size="20"></td>
</tr>
<tr>
  <td class="SK_Text2">销售价格</td>
  <td class="SK_Text1"><input name="S_Price1" type="text" size="20" onKeyPress="if(!this.value.match(/^[\+\-]?\d*?\.?\d*?$/))this.value=this.t_value;else this.t_value=this.value;if(this.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?)?$/))this.o_value=this.value;if((event.keyCode<48 || event.keyCode>57) && event.keyCode!=46 || /\.\d\d$/.test(value))event.returnValue=false" onKeyUp="if(!this.value.match(/^[\+\-]?\d*?\.?\d*?$/))this.value=this.t_value;else this.t_value=this.value;if(this.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?)?$/))this.o_value=this.value" onBlur="if(!this.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?|\.\d*?)?$/))this.value=this.o_value;else{if(this.value.match(/^\.\d+$/))this.value=0+this.value;if(this.value.match(/^\.$/))this.value=0;this.o_value=this.value}"></td>
  <td colspan="-1" class="SK_Text2">采购价格</td>
  <td class="SK_Text1"><input name="S_Price2" type="text" size="20" onKeyPress="if(!this.value.match(/^[\+\-]?\d*?\.?\d*?$/))this.value=this.t_value;else this.t_value=this.value;if(this.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?)?$/))this.o_value=this.value;if((event.keyCode<48 || event.keyCode>57) && event.keyCode!=46 || /\.\d\d$/.test(value))event.returnValue=false" onKeyUp="if(!this.value.match(/^[\+\-]?\d*?\.?\d*?$/))this.value=this.t_value;else this.t_value=this.value;if(this.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?)?$/))this.o_value=this.value" onBlur="if(!this.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?|\.\d*?)?$/))this.value=this.o_value;else{if(this.value.match(/^\.\d+$/))this.value=0+this.value;if(this.value.match(/^\.$/))this.value=0;this.o_value=this.value}" ></td>
</tr>
<tr>
  <td class="SK_Text2">产品单位</td>
  <td class="SK_Text1"><select name="S_Unit">
<option value="" selected>请选择</option>
<%
Set rs1=Server.CreateObject("ADODB.RecordSet") 
sql1="SELECT * from SK_SystemCategory where SK_Di=161 order by CategoryID asc" 
rs1.Open sql1,conn,1,1
do while not rs1.eof
%><option value="<%=rs1("CategoryID")%>"><%=rs1("SK_Name")%></option>
<%
rs1.movenext
loop
rs1.close
set rs1=Nothing
%></select></td>
  <td colspan="-1" class="SK_Text2">预警数量</td>
  <td class="SK_Text1"><input name="S_Early" type="text" onKeyUp="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" size="20" /></td>
</tr>
<tr>
  <td class="SK_Text2">产品性质</td>
  <td class="SK_Text1"><select name="S_Di">
    <option value="0">出售产品</option>
    <option value="1">内部使用</option>
  </select>  </td>
  <td class="SK_Text2">条形码</td>
  <td class="SK_Text1"><input name="S_ProTm" type="text" size="20"></td>
</tr>

<tr>
  <td valign="top" class="SK_Text2">产品说明</td>
  <td colspan="3" class="SK_Text1"><IFRAME ID="eWebEditor1" SRC="<%=getconfig("SK_EditorPath")%>/ewebeditor.htm?id=S_Content&style=mini" FRAMEBORDER="0" SCROLLING="no" WIDTH="600" HEIGHT="200"></IFRAME>
<input type="hidden" name="S_Content"></td>
</tr>

<tr>
  <td valign="top" class="SK_Text2">产品参数</td>
  <td colspan="3" class="SK_Text1"><IFRAME ID="eWebEditor1" SRC="<%=getconfig("SK_EditorPath")%>/ewebeditor.htm?id=S_Parame&style=mini" FRAMEBORDER="0" SCROLLING="no" WIDTH="600" HEIGHT="200"></IFRAME>
<input type="hidden" name="S_Parame"></td>
</tr>

<tr>
  <td valign="top" class="SK_Text2">产品备注</td>
  <td colspan="3" class="SK_Text1"><IFRAME ID="eWebEditor1" SRC="<%=getconfig("SK_EditorPath")%>/ewebeditor.htm?id=S_Remarks&style=mini" FRAMEBORDER="0" SCROLLING="no" WIDTH="600" HEIGHT="200"></IFRAME>
<input type="hidden" name="S_Remarks"></td>
</tr>

<tr>
<td 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>