<!--#include file="../utf-8.asp" -->
<!--#include file="../js/Function.asp" -->
<!--#include file="../html/yidacms_htmlurl.asp" -->
<!--#include file="../js/admin_vipkp.asp" -->
<!--#include file="../CheckAdmin.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<META NAME="copyright" CONTENT="Copyright 2010-2012 - yidacms.com" />
<META NAME="Author" CONTENT="世纪伟成  yidacms.com" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../js/admin.css" rel="stylesheet" type="text/css">
<title>产品配置！</title>
	<script charset="utf-8" src="<%=webpath%>bianji/kindeditor.js"></script>
	<script charset="utf-8" src="<%=webpath%>bianji/lang/zh_CN.js"></script>
	<script charset="utf-8" src="<%=webpath%>bianji/plugins/code/prettify.js"></script>

	<script>
		KindEditor.ready(function(K) {
			var editor1 = K.create('textarea[name="content1"]', {

				uploadJson : '<%=webpath%>uploadclass/upfile_flash.asp',
				fileManagerJson : '<%=webpath%>uploadclass/file_manager_json.asp',
				allowFileManager : true,
				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						K('form[name=example]')[0].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();
						K('form[name=example]')[0].submit();
					});
				}
			});
			prettyPrint();
		});
	</script>
</head>
<body>
<%
'版权：世纪伟成(http://yidacms.com)
'本信息不会影响您网站的正常访问，无论免费用户或是收费用户请保留这里的信息.
'如果您删除了这里的版权信息,将追究法律责任.


	if request("t")="products" Then 

		yidacms_fenlei = request.form("shuaiweb_productsclass")
		yidacms_fenlei1 = split(yidacms_fenlei,"|")

		if len(trim(request.Form("shuaiweb_productsname")))<1 then
			response.write ("<script language=javascript>alert('产品名称必填且不能少于1个字符！');history.back(-1);</script>")
			response.end
		end if
	  
		if len(trim(request.Form("shuaiweb_productscontent")))<1 then
			response.write ("<script language=javascript> alert('产品内容简介不能为空,且不少于1个字符!');history.back(-1);</script>")
			response.end
		end if
	  
	dim rs,sql
	set rs=server.createobject("adodb.recordset")
	sql="select * from shuaiweb_products"
	rs.open sql,dbok,3,2
	rs.addnew 
		rs("shuaiweb_productsname")=trim(request.form("shuaiweb_productsname"))
		rs("shuaiweb_productsclass")=yidacms_fenlei1(0)
		rs("shuaiweb_productsclass2")=yidacms_fenlei1(1)
		rs("shuaiweb_productsno")=trim(request.form("shuaiweb_productsno"))
		rs("shuaiweb_productsmodel")=trim(request.form("shuaiweb_productsmodel"))
		rs("shuaiweb_productsbprice")=trim(request.form("shuaiweb_productsbprice"))
		rs("shuaiweb_productsprice")=trim(request.form("shuaiweb_productsprice"))
		rs("shuaiweb_productsLibrary")=trim(request.form("shuaiweb_productsLibrary"))
		rs("shuaiweb_productsunits")=trim(request.form("shuaiweb_productsunits"))
		rs("shuaiweb_productsco")=trim(request.form("shuaiweb_productsco"))
		rs("shuaiweb_productsstate")=trim(request.form("shuaiweb_productsstate1"))&trim(request.form("shuaiweb_productsstate2"))&_
					     trim(request.form("shuaiweb_productsstate3"))&trim(request.form("shuaiweb_productsstate4"))&_
					     trim(request.form("shuaiweb_productsstate5"))
		rs("shuaiweb_productsminpic")=trim(request.form("shuaiweb_productsminpic"))
		rs("shuaiweb_productsmaxpic")=trim(request.form("shuaiweb_productsmaxpic"))
		rs("shuaiweb_productscontent")=trim(request.form("shuaiweb_productscontent"))
		rs("wait_pryi")=trim(request.form("wait_pryi"))
		rs("shuaiweb_vippkeywords")=trim(request.form("shuaiweb_vippkeywords"))
		rs("shuaiweb_vippdescription")=trim(request.form("shuaiweb_vippdescription"))
		rs("yida_language")="ch"
		'
		rs("shuaiweb_userproducts")=trim(request.form("shuaiweb_userproducts"))
		rs("wait_prer")=trim(request.form("wait_prer"))
	rs.update
	rs.close
	set rs=nothing
	response.write "<script language=javascript> alert('成功添加！');location.replace('admin_productslist.asp');</script>"
	End If
%>
		<table width="98%" height="205" border="0" cellpadding="10" cellspacing="0" bordercolor="#666666" style="border-collapse:collapse" align="center">
		 <form id="form1" name="form1" method="post" action="admin_products.asp?t=products">
                  <tr>
		<td onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">产品栏目:<br />
<%
		set rs = server.createobject("adodb.recordset")
		sql="select * from shuaiweb_productsclass where wait_pcyi = '0' ORDER BY shuaiweb_classsort ASC"
		rs.open sql,dbok,1,1
%>	  
			<select name="shuaiweb_productsclass" id="shuaiweb_productsclass" class="fenleiliebiao">
<%
		if rs.bof and rs.eof then
			response.write "暂无记录!"
				Else
		do while not rs.eof
%>
		<optgroup label="<%=rs("shuaiweb_classname")%>">
<%
		set rss = server.createobject("adodb.recordset")
		sql="select * from shuaiweb_productsclass where wait_pcyi = '"&rs("id")&"' ORDER BY shuaiweb_classsort ASC"
		rss.open sql,dbok,1,1
		do while not rss.eof
%>
				<option value="<%=rss("id")%>|<%=rs("id")%>"> ┝ <%=rss("shuaiweb_classname")%></option>
<%
                rss.movenext
                Loop
				rss.close
				set rss = nothing

		rs.MoveNext 
		loop   
		rs.close
		End If 
		%>
			  </select>
		 </td>
                  </tr>
		  <tr>
			<td onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc"><div class="uppic">产品名称<br /><input name="shuaiweb_productsname" type="text" id="shuaiweb_productsname" class="win"/></div><div class="uppic2">
                <select name="wait_prer" style=" width:80px; height:33px;">
                <option value="">无颜色</option>
                <option value="#000000" style="background:#000000"></option>
                <option value="#FF0000" style="background:#FF0000"></option>
                <option value="#009900" style="background:#009900"></option>
                <option value="#0066FF" style="background:#0066FF"></option>
                <option value="#00CCFF" style="background:#00CCFF"></option>
                <option value="#FF6600" style="background:#FF6600"></option>
                <option value="#FF0066" style="background:#FF0066"></option>
                <option value="#FF3399" style="background:#FF3399"></option>
                <option value="#FFFF00" style="background:#FFFF00"></option>
                <option value="#FF00FF" style="background:#FF00FF"></option>
                <option value="#FF9933" style="background:#FF9933"></option>
                <option value="#FF99FF" style="background:#FF99FF"></option>
                <option value="#CCCC66" style="background:#CCCC66"></option>
                <option value="#0000FF" style="background:#0000FF"></option>
                </select><font color=red>(必填)</font></div></td>
		  </tr>
		  <tr>
			<td onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">产品编号<br /><input name="shuaiweb_productsno" type="text" id="shuaiweb_productsno" class="win"/></td>
		  </tr>
		  <tr>
			<td onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">产品型号<br /><input name="shuaiweb_productsmodel" type="text" id="shuaiweb_productsmodel" class="win"/></td>
		  </tr>
		  <tr>
			<td onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">产品材质<br /><input name="wait_pryi" type="text" id="wait_pryi" class="win"/></td>
		  </tr>
		  <tr>
			<td onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">标准价格<br /><input name="shuaiweb_productsbprice" type="text" id="shuaiweb_productsbprice" class="win"/>  <a href="#" onClick="window.open('../js/admin_calculator.asp','go','scrollbars=no,resizable=no,width=250,height=300,left=300,top=300,screenX=50,screenY=50')">计算器</a></td>
		  </tr>
		  <tr>
			<td onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">优惠价格<br /><input name="shuaiweb_productsprice" type="text" id="shuaiweb_productsprice" class="win"/></td>
		  </tr>
		  <tr>
			<td onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">库存数量<br /><input name="shuaiweb_productsLibrary" type="text" id="shuaiweb_productsLibrary" class="win"/></td>
		  </tr>
		  <tr>
			<td colspan="2" onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">计价单位<br />
			<%
			set rs = server.createobject("adodb.recordset")
			sql="select * from shuaiweb_currency ORDER BY shuaiweb_moneysort ASC"
			rs.open sql,dbok,1,1
			%>	  
			  <select name="shuaiweb_productsunits" id="shuaiweb_productsunits" class="winla">
			<%
			if rs.bof and rs.eof then
				response.write "暂无记录!"
					Else
			do while not rs.eof
			%>	  
					 <option value="<%=rs("shuaiweb_money")%>"><%=rs("shuaiweb_money")%></option>
			<%
			rs.MoveNext 
			loop   
			rs.close
			End If 
			%>
				   </select>
            <a href="../admin_Money.asp">编 辑</a>
		 </td>
		  </tr>
		  <tr>
			<td colspan="2" onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">出品公司<br /><input name="shuaiweb_productsco" type="text" id="shuaiweb_productsco" class="win"/></td>
		  </tr>
		  <tr>
			<td colspan="2" onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">属性<br />
				  <input type="checkbox" name="shuaiweb_productsstate1" value="01," />
				热销
				  <input type="checkbox" name="shuaiweb_productsstate2" value="02," />
			  推荐  <input type="checkbox" name="shuaiweb_productsstate3" value="03," /> 滚动 <input type="checkbox" name="shuaiweb_productsstate4" value="04," /> 特价 <input name="shuaiweb_productsstate5" type="checkbox" value="05," /> 推荐给会员 </td>
		  </tr>
		  <tr>
			<td colspan="2" onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc"><div class="uppic">缩略图<br /><input name="shuaiweb_productsminpic" type="text" id="shuaiweb_productsminpic" class="win"/></div><div class="uppic2"><iframe width="305" height="34" marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no src="../../uploadclass/min/upfile.htm" allowtransparency="true" ></iframe></div>
</td>
		  </tr>
		  <tr>
			<td colspan="2" onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc"><div class="uppic">大图<br /><input name="shuaiweb_productsmaxpic" type="text" id="shuaiweb_pic" class="win"/></div><div class="uppic2"><iframe width="305" height="34" marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no src="../../uploadclass/upfile.htm" allowtransparency="true" ></iframe></div></td>
		  </tr>
		  <tr>
			<td colspan="2" width="90%" onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">内容<br /><textarea id="content1" name="shuaiweb_productscontent" style="width:100%;height:300px;"></textarea><font color=red>(必填)</font>
		</td>
		  </tr>
		  <tr>
			<td colspan="2"><input type="submit" name="Submit" value="添 加" class="inanniu"/>
			  <input type="reset" name="Submit2" value="重 置" class="inanniu"/</td>
		  </tr>
			<tr>
				<td>
<script>
 function showText(){
  if(document.getElementById("q").value==2){
   document.getElementById("text").innerHTML="<div style='padding:5px 5px 5px 5px; font-size:12px;'><input type='button' value='隐藏' onclick='hiddenText();' /><br /><br />网站标题 {sys:title} | 网站地址 {sys:weburl} | 公司标题 {sys:gongsibiaoti} | 公司地址 {sys:gongsidizhi}<br />联系电话 {sys:dianhua} | 移动电话 {sys:yidongdianhua} | 传真 {sys:chuanzhen} | QQ {sys:qq} | 联系人 {sys:lianxiren}<br />备案号 {sys:beian} | 邮箱 {sys:youxiang} | 邮编 {sys:youbian} </div>";
  } 
 }
 function hiddenText(){
  document.getElementById("text").innerHTML="";
 }
</script>
<select name="q" id="q" onchange="showText();">
 <option value="1">===查看可用标签===</option>
    <option value="2">基本标签</option>
</select>
<span id="text"></span>
				</td>
			</tr>
			</form>
		</table>
</body>
</html>
