<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>添加团购</title>
<link href="../skins/css/main.css" rel="stylesheet" type="text/css">
</head>
<!--#include file="../../Conn2.asp" -->
<SCRIPT LANGUAGE="JavaScript">
<!--
function checkkk()
{
     if(checkspace(document.pic.proname.value)) {
	document.pic.proname.focus();
    alert("请输入名称！");
	return false;
  }
  
  
  
 if (document.pic.pingpai.value=="")
	{
	  alert("请选择品牌！")
	  document.pic.pingpai.focus()
	  return false
	 }
  
  
  
   if (document.pic.cpfl.value=="")
	{
	  alert("请选择产品分类！")
	  document.pic.cpfl.focus()
	  return false
	 }
  
   
 if (document.pic.nianfen.value=="")
	{
	  alert("请选择上市年份！")
	  document.pic.nianfen.focus()
	  return false
	 }


 if (document.pic.yanse.value=="")
	{
	  alert("请输入颜色！")
	  document.pic.yanse.focus()
	  return false
	 }



 if (document.pic.gmjl.value=="")
	{
	  alert("请输入购买记录！")
	  document.pic.gmjl.focus()
	  return false
	 }

 if (document.pic.gmjl.value=="")
	{
	  alert("请输入购买记录！")
	  document.pic.gmjl.focus()
	  return false
	 }

if (document.pic.ytgsl.value=="")
	{
	  alert("请输入已团购数量！")
	  document.pic.ytgsl.focus()
	  return false
	 }


if (document.pic.a5.value=="")
	{
	  alert("请上传团购缩微图！")
	  //document.pic.ytgsl.focus()
	  return false
	 }
	 


if (document.pic.a.value=="")
	{
	  alert("第一张必须上传！")
	  //document.pic.ytgsl.focus()
	  return false
	 }



if (document.pic.tuanjia.value=="")
	{
	  alert("请输入团购价格！")
	  document.pic.tuanjia.focus()
	  return false
	 }


if (document.pic.wxts.value=="")
	{
	  alert("请输入温馨提示！")
	  document.pic.wxts.focus()
	  return false
	 }


 
     
 
}
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}
//-->
</script>

<%username=now()
username=replace(trim(username),"-","")
username=replace(username,":","")
username=replace(username," ","")
username=replace(username,"上午","")
username=replace(username,"下午","")
%>
<%set rstt=server.CreateObject("adodb.recordset")
rstt.Open "select * from bianhaoyf",conn,1,3
rstt.addnew

rstt("bianhaoyf")=username '编号

rstt.Update
rstt.Close
set rstt=nothing%>
<body>
<%set rssx1=server.CreateObject("adodb.recordset")


rssx1.Open "select top 1 * from bianhaoyf order by id desc",conn,1,3%>
<%if request("action")="save" then  
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from tuangou",conn,1,3
rs.AddNew

rs("proname")=trim(request("proname")) '商品名称
rs("bianhao")=rssx1("bianhaoyf") '
rs("pingpai")=trim(request("pingpai"))
rs("cpfl")= trim(request("cpfl"))
rs("nianfen")=trim(request("nianfen"))
rs("cpbh")=trim(request("cpbh"))
rs("yanse")=trim(request("yanse"))
rs("gmjl")=trim(request("gmjl"))
rs("ytgsl")=trim(request("ytgsl"))
rs("zssl")=trim(request("zssl"))
rs("a5")=trim(request("a5"))

rs("scjia")=trim(request("scjia"))
rs("tuanjia")=trim(request("tuanjia"))
rs("wxts")=trim(request("wxts"))
rs("fenlei")=trim(request("fenlei"))
rs("jieshao")=trim(request("body"))

'rs("bookmulu")=htmlencode2(trim(request("bookmulu")))  '目录
rs.Update
rs.Close
set rs=nothing
response.write "<script language=javascript>alert('添加成功！');window.location.href='Adminproduct.asp';</script>"
response.End
 


end if%>
<form id="pic" name="pic" method="post" action="addproduct.asp?action=save" OnSubmit="return checkkk()" >

	<table width="100%" border="0" cellspacing="1" cellpadding="5">
		<tr>
			<td height="25" colspan="2" class="td_title">添加团购&nbsp;&nbsp;<%set rssx2=server.CreateObject("adodb.recordset")


rssx2.Open "select top 1 * from bianhaoyf order by id desc",conn,1,3%>


<%=rssx2("bianhaoyf")%>&nbsp;&nbsp;&nbsp;

<%set rssx3=server.CreateObject("adodb.recordset")


rssx3.Open "select top 1 * from bianhaoyf where id<"&rssx2("id")&" order by id desc",conn,1,3%>
<%=rssx3("bianhaoyf")%></td>
		</tr>
		<tr>
			<td width="18%" height="23" class="td_content">产品名称：</td>
			<td width="82%" height="23" class="td_content"><input name="proname" type="text" id="proname" size="70" /></td>
		</tr>
		<tr>
			<td height="23" class="td_content">产品品牌：</td>
			<td height="23" class="td_content"><select name="pingpai" id="pingpai" class="keyPropClass">
    <option class="J_empty" value="" selected>请选择品牌</option>
    												
			
	<option  value="苹果" >苹果</option>
	<option  value="LV" >LV</option>    												
    <option value="其他" class="J_other" >其他</option>
																							    								</select></td>
		</tr>
		
				<tr>
			<td height="23" class="td_content">所属分类：</td>
			<td height="23" class="td_content"><select name="fenlei" id="fenlei" class="keyPropClass">
    <option class="J_empty" value="" selected>请选择</option>
    												
			
	<option  value="热卖推荐" >热卖推荐</option>
	<option  value="特价促销" >特价促销</option>    												
    <option value="限时抢购" class="J_other" >限时抢购</option>
																							    								</select></td>
		</tr>
		
				<tr>
			<td height="23" class="td_content">产品分类：</td>
			<td height="23" class="td_content"><select name="cpfl" id="cpfl" class="keyPropClass">
    <option class="J_empty" value="" selected>请选择</option>
    												
			
	<option  value="手机" >手机</option>
	<option  value="电脑" >电脑</option>    												
    <option value="包包" class="J_other" >包包</option>
																							    								</select></td>
		</tr>
		
		
		
				<tr>
			<td height="23" class="td_content">产品编号：</td>
			<td height="23" class="td_content"><label>
			  <input name="cpbh" type="text" id="cpbh" value="">
			</label></td>
		</tr>
				<tr>
			<td height="23" class="td_content">上市年份：</td>
			<td height="23" class="td_content"><select name="nianfen" id="nianfen">
 <option  value="" selected>请选择上市年份</option>
<option   value="2011年" >2011年</option>
<option  value="2010年" >2010年</option>
<option  value="2009年" >2009年</option>

</select></td>
		</tr>
		
		
				<tr>
			<td height="23" class="td_content">颜&nbsp;&nbsp;&nbsp;&nbsp;色：</td>
			<td height="23" class="td_content"><label>
			  <input name="yanse" type="text" id="yanse" size="50">
			</label></td>
		</tr>
		
				<tr>
			<td height="23" class="td_content">购买记录：</td>
			<td height="23" class="td_content"><label>
			  <textarea name="gmjl" cols="80" rows="10" id="gmjl"></textarea>
			</label></td>
		</tr>
		
			<tr>
			<td height="23" class="td_content">团购时间：</td>
			<td height="23" class="td_content">从&nbsp;
			  <label>
			  <input type="text" name="textfield">
			  </label>
			  到
			  <label>
			  <input type="text" name="textfield2">
			  </label></td>
		</tr>
		
			<tr>
			<td width="18%" height="23" class="td_content">已团购数量：</td>
			<td width="82%" height="23" class="td_content"><input name="ytgsl" type="text" id="ytgsl" size="20" />
			&nbsp;真实数量：<input name="zssl" type="text" id="zssl" size="20" /></td>
		</tr>
		
		
				<tr>
			<td width="18%" height="23" class="td_content">团购图片：</td>
			<td width="82%" height="23" class="td_content" align="left"   valign="middle"><IFRAME name=ad src="/4upsc4.htm" frameBorder=0 width="100%" scrolling=no height=30></IFRAME><INPUT type="hidden" id="a5" title=可直接输入网上图片的地址，或由上传程序自动产生图片地址 style="WIDTH: 200px" value="" name="a5"  size="20">
      <INPUT id="f5" type="hidden" title=可直接输入网上图片的地址，或由上传程序自动产生图片地址 style="WIDTH: 200px" value="" name="f5" size="20"></td>
		</tr>
		
					<tr>
			<td width="18%" height="23" class="td_content">团购相册：</td>
			<td width="82%" height="23" class="td_content"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="left"  valign="middle"><IFRAME name=ad src="/1up2.htm" frameBorder=0 width="100%" scrolling=no height=30></IFRAME><INPUT type="hidden" id=a title=可直接输入网上图片的地址，或由上传程序自动产生图片地址 style="WIDTH: 200px" value="" name=a  size="20">
      <INPUT id=f type="hidden" title=可直接输入网上图片的地址，或由上传程序自动产生图片地址 style="WIDTH: 200px" value="" name=f size="20"></td>
      </tr>
      <tr>
        <td align="left" valign="middle"><IFRAME name=ad src="/1upsc.htm" frameBorder=0 width="100%" scrolling=no height=30></IFRAME><INPUT type="hidden" id="a1" title=可直接输入网上图片的地址，或由上传程序自动产生图片地址 style="WIDTH: 200px" value="" name="a1"  size="20">
      <INPUT id="f1" type="hidden" title=可直接输入网上图片的地址，或由上传程序自动产生图片地址 style="WIDTH: 200px" value="" name="f1" size="20"></td>
      </tr>
      <tr>
        <td align="left" valign="middle"><IFRAME name=ad src="/1upsc1.htm" frameBorder=0 width="100%" scrolling=no height=30></IFRAME><INPUT type="hidden" id="a2" title=可直接输入网上图片的地址，或由上传程序自动产生图片地址 style="WIDTH: 200px" value="" name="a2"  size="20">
      <INPUT id="f2" type="hidden" title=可直接输入网上图片的地址，或由上传程序自动产生图片地址 style="WIDTH: 200px" value="" name="f2" size="20"></td>
      </tr>
         <tr>
        <td align="left" valign="middle"><IFRAME name=ad src="/2upsc2.htm" frameBorder=0 width="100%" scrolling=no height=30></IFRAME><INPUT type="hidden" id="a3" title=可直接输入网上图片的地址，或由上传程序自动产生图片地址 style="WIDTH: 200px" value="" name="a3"  size="20">
      <INPUT id="f3" type="hidden" title=可直接输入网上图片的地址，或由上传程序自动产生图片地址 style="WIDTH: 200px" value="" name="f3" size="20"></td>
      </tr>
             <tr>
        <td align="left" valign="middle"><IFRAME name=ad src="/3upsc3.htm" frameBorder=0 width="100%" scrolling=no height=30></IFRAME><INPUT type="hidden" id="a4" title=可直接输入网上图片的地址，或由上传程序自动产生图片地址 style="WIDTH: 200px" value="" name="a4"  size="20">
      <INPUT id="f4" type="hidden" title=可直接输入网上图片的地址，或由上传程序自动产生图片地址 style="WIDTH: 200px" value="" name="f4" size="20"></td>
      </tr>

    </table></td>
		</tr>
		
				<tr>
			<td width="18%" height="23" class="td_content">团购价格：</td>
			<td width="82%" height="23" class="td_content">&nbsp;市场价：<input name="scjia" type="text" id="scjia" size="20" />
			&nbsp;团购价：<input name="tuanjia" type="text" id="tuanjia" size="20" /></td>
		</tr>
		
					<tr>
			<td width="18%" height="23" class="td_content">温馨提示：</td>
			<td width="82%" height="23" class="td_content"><label>
			  <textarea name="wxts" cols="50" rows="6" id="wxts"></textarea>
			</label></td>
		</tr>
		
		
					<tr>
			<td width="18%" height="23" class="td_content">本团详情：</td>
			<td width="82%" height="23" class="td_content"><INPUT type="hidden" name="body" value=""><IFRAME ID="eWebEditor1" SRC="../hyeWebEditor/ewebeditor.htm?id=body&style=popup" FRAMEBORDER="0" SCROLLING="no" WIDTH="650" HEIGHT="450"></IFRAME></td>
		</tr>
		
		<tr><td colspan="2" height="45"   bgcolor="#E1F5FD" align="center" ><input type="submit" name="Submit" value="发布团购"   style="font-size:14px; font-weight:bold; width:120px; height:50px;"/></td></tr>
		</table>
		
</form>
		
</body>
</html>
