<!-- #include file="conn.asp" -->
<!-- #include file="include.asp" -->
<%
Dim rst
			set rst=server.createobject("adodb.recordset")
		    sqlt="select * from type order by xu"
			rst.open sqlt,conn,1,1

Dim rsts

			set rsts=server.createobject("adodb.recordset")
		    sqlts="select * from type_son order by xu"
			rsts.open sqlts,conn,1,1

Dim rsb
			set rsb=server.createobject("adodb.recordset")
		    sqlb="select * from brand order by xu"
			rsb.open sqlb,conn,1,1
Dim rsp
			set rsp=server.createobject("adodb.recordset")
		    sqlp="select * from products inner join brand on products.brand_id=brand.brand_id ORDER BY idate desc"
			rsp.open sqlp,conn,1,1			
%>
<html>
<head>
<title>增加报价--PCBaoJia.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<%
dim mm_jsmenu
dim i 
i = -1
mm_jsmenu = "<script language="&chr(34)&"javascript"&chr(34)&">"&chr(13)
mm_jsmenu = mm_jsmenu&"<!--"&chr(13)
mm_jsmenu = mm_jsmenu&"var subcat = new Array();"&chr(13)
do while not rsts.eof
i = i + 1
mm_jsmenu = mm_jsmenu&"subcat["&i&"] = new Array('"&(rsts.Fields.Item("type_id").Value)&"','"&(rsts.Fields.Item("type_son_name").Value)&"','"&(rsts.Fields.Item("type_son_id").Value)&"')"&chr(13)
rsts.movenext
loop
mm_jsmenu = mm_jsmenu&chr(13)&"function changeselect1(locationid)"&chr(13)
mm_jsmenu = mm_jsmenu&"{"&chr(13)
mm_jsmenu = mm_jsmenu&"document.add_offer.new_type_son_id.length = 0; "&chr(13)
mm_jsmenu = mm_jsmenu&"document.add_offer.new_type_son_id.options[0] = new Option('请选择','');"&chr(13) 
mm_jsmenu = mm_jsmenu&"for (i=0; i<subcat.length; i++) "&chr(13)
mm_jsmenu = mm_jsmenu&"{"&chr(13)
mm_jsmenu = mm_jsmenu&"if (subcat[i][0] == locationid) "&chr(13)
mm_jsmenu = mm_jsmenu&"{document.add_offer.new_type_son_id.options[document.add_offer.new_type_son_id.length] = new Option(subcat[i][1], subcat[i][2]);} "&chr(13) 
mm_jsmenu = mm_jsmenu&"}"&chr(13)
mm_jsmenu = mm_jsmenu&"document.add_offer.new_type_son_id.disabled = 0; "&chr(13)
mm_jsmenu = mm_jsmenu&"add_offer.new_type_son_id.focus(); "&chr(13)
mm_jsmenu = mm_jsmenu&"}"&chr(13)
response.Write mm_jsmenu

dim mm_jsmenu2
dim j 
j = -1
mm_jsmenu2 = mm_jsmenu2&"var subbrand = new Array();"&chr(13)
do while not rsb.eof
j = j + 1
mm_jsmenu2 = mm_jsmenu2&"subbrand["&j&"] = new Array('"&(rsb.Fields.Item("type_son_id").Value)&"','"&(rsb.Fields.Item("brand_name").Value)&"','"&(rsb.Fields.Item("brand_id").Value)&"')"&chr(13)
rsb.movenext
loop
mm_jsmenu2 = mm_jsmenu2&chr(13)&"function changeselect2(locationid)"&chr(13)
mm_jsmenu2 = mm_jsmenu2&"{"&chr(13)
mm_jsmenu2 = mm_jsmenu2&"document.add_offer.new_brand_id.length = 0; "&chr(13)
mm_jsmenu2 = mm_jsmenu2&"document.add_offer.new_brand_id.options[0] = new Option('请选择类型','');"&chr(13) 
mm_jsmenu2 = mm_jsmenu2&"for (j=0; j<subbrand.length; j++) "&chr(13)
mm_jsmenu2 = mm_jsmenu2&"{"&chr(13)
mm_jsmenu2 = mm_jsmenu2&"if (subbrand[j][0] == locationid) "&chr(13)
mm_jsmenu2 = mm_jsmenu2&"{document.add_offer.new_brand_id.options[document.add_offer.new_brand_id.length] = new Option(subbrand[j][1], subbrand[j][2]);} "&chr(13) 
mm_jsmenu2 = mm_jsmenu2&"}"&chr(13)
mm_jsmenu2 = mm_jsmenu2&"document.add_offer.new_brand_id.disabled = 0; "&chr(13)
mm_jsmenu2 = mm_jsmenu2&"add_offer.new_brand_id.focus(); "&chr(13)
mm_jsmenu2 = mm_jsmenu2&"}"&chr(13)
response.Write mm_jsmenu2

dim mm_jsmenu3
dim p 
p = -1
mm_jsmenu3 = mm_jsmenu3&"var subpro = new Array();"&chr(13)
do while not rsp.eof
p = p + 1
mm_jsmenu3 = mm_jsmenu3&"subpro["&p&"] = new Array('"&(rsp.Fields.Item("brand_id").Value)&"','"&(rsp.Fields.Item("pro_name").Value)&"','"&(rsp.Fields.Item("pro_id").Value)&"')"&chr(13)
rsp.movenext
loop
mm_jsmenu3 = mm_jsmenu3&chr(13)&"function changeselect3(locationid)"&chr(13)
mm_jsmenu3 = mm_jsmenu3&"{"&chr(13)
mm_jsmenu3 = mm_jsmenu3&"document.add_offer.new_pro_id_1.length = 0; "&chr(13)
mm_jsmenu3 = mm_jsmenu3&"document.add_offer.new_pro_id_1.options[0] = new Option('请选择产品','');"&chr(13) 
mm_jsmenu3 = mm_jsmenu3&"for (p=0; p<subpro.length; p++) "&chr(13)
mm_jsmenu3 = mm_jsmenu3&"{"&chr(13)
mm_jsmenu3 = mm_jsmenu3&"if (subpro[p][0] == locationid) "&chr(13)
mm_jsmenu3 = mm_jsmenu3&"{document.add_offer.new_pro_id_1.options[document.add_offer.new_pro_id_1.length] = new Option(subpro[p][1], subpro[p][2]);} "&chr(13) 
mm_jsmenu3 = mm_jsmenu3&"}"&chr(13)
mm_jsmenu3 = mm_jsmenu3&"document.add_offer.new_pro_id_1.disabled = 0; "&chr(13)
mm_jsmenu3 = mm_jsmenu3&"document.add_offer.new_pro_radio_1.disabled = 0; "&chr(13)
mm_jsmenu3 = mm_jsmenu3&"document.add_offer.new_pro_radio_2.disabled = 0; "&chr(13)
mm_jsmenu3 = mm_jsmenu3&"add_offer.new_pro_id_1.focus(); "&chr(13)
mm_jsmenu3 = mm_jsmenu3&"}"&chr(13)
response.Write mm_jsmenu3

dim mm_jsmenu4
mm_jsmenu4 = mm_jsmenu4&chr(13)&"function changeselect4()"&chr(13)
mm_jsmenu4 = mm_jsmenu4&"{"&chr(13)
mm_jsmenu4 = mm_jsmenu4&"document.add_offer.new_pro_radio_1.disabled = 0; "&chr(13)
mm_jsmenu4 = mm_jsmenu4&"document.add_offer.new_pro_radio_2.disabled = 0; "&chr(13)
mm_jsmenu4 = mm_jsmenu4&"}"&chr(13)
response.Write mm_jsmenu4

dim mm_jsmenu5
mm_jsmenu5 = mm_jsmenu5&chr(13)&"function changeselect5()"&chr(13)
mm_jsmenu5 = mm_jsmenu5&"{"&chr(13)
mm_jsmenu5 = mm_jsmenu5&"document.add_offer.new_pro_id_1.disabled = 0; "&chr(13)
mm_jsmenu5 = mm_jsmenu5&"document.add_offer.new_pro_id_2.disabled = 1; "&chr(13)
mm_jsmenu5 = mm_jsmenu5&"add_offer.new_pro_id_1.focus(); "&chr(13)
mm_jsmenu5 = mm_jsmenu5&"}"&chr(13)
response.Write mm_jsmenu5

dim mm_jsmenu6
mm_jsmenu6 = mm_jsmenu6&chr(13)&"function changeselect6()"&chr(13)
mm_jsmenu6 = mm_jsmenu6&"{"&chr(13)
mm_jsmenu6 = mm_jsmenu6&"document.add_offer.new_pro_id_1.disabled = 1; "&chr(13)
mm_jsmenu6 = mm_jsmenu6&"document.add_offer.new_pro_id_2.disabled = 0; "&chr(13)
mm_jsmenu6 = mm_jsmenu6&"add_offer.new_pro_id_2.focus(); "&chr(13)
mm_jsmenu6 = mm_jsmenu6&"}"&chr(13)
mm_jsmenu6 = mm_jsmenu6&"//-->"&chr(13)&"</script>"&chr(13)
response.Write mm_jsmenu6
%>
<script language="JavaScript">
<!--
function  check_add_offer() {
  if (add_offer.new_type_id.value=="") {
		alert("请选择类别！");
		add_offer.new_type_id.focus();		
		    return (false);
  }
  if (add_offer.new_type_son_id.value=="") {
		alert("请选择二级分类！");
		add_offer.new_type_son_id.focus();		
		    return (false);
  }
  if (add_offer.new_brand_id.value=="") {
		alert("请选择二级类型！");
		add_offer.new_brand_id.focus();		
		    return (false);
  }
  if(document.add_offer.new_pro_radio[0].checked==false)
		{
	    if (add_offer.new_pro_id_2.value=="") {
		alert("请填写新的商品名称！");
		add_offer.new_pro_id_2.focus();		
		    return (false);
			}
		}
  if(document.add_offer.new_pro_radio[1].checked==false)
		{
	    if (add_offer.new_pro_id_1.value=="") {
		alert("请选择报价商品！");
		add_offer.new_pro_id_1.focus();		
		    return (false);
			}
		}
  if (add_offer.price.value=="") {
		alert("请填写商品价格！");
		add_offer.price.focus();		
		    return (false);
  }
  if (add_offer.price.value=="") {
		alert("请填写商品价格！");
		add_offer.price.focus();		
		    return (false);
  }
  if (add_offer.price.value=="") {
		alert("请填写商品价格！");
		add_offer.price.focus();		
		    return (false);
  }
  if (add_offer.price_in.value=="") {
		alert("请填写经销商价格！");
		add_offer.price_in.focus();		
		    return (false);
  }
 else
	document.add_offer.submit();
}// -->
</script>
<body>
<%call head(0)%>
<table width="764" border="0" cellpadding="0" cellspacing="0" background="images/bg_body.gif" align="center">
  <tr>
    <td align="center"><table width="760" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="159" align="center" valign="top" bgcolor="3E93C9"><TABLE WIDTH=157 BORDER=0 CELLPADDING=0 CELLSPACING=0>
              <TR>
                <TD COLSPAN=3> <IMG SRC="images/login_t.gif" WIDTH=157 HEIGHT=38 ALT=""></TD>
              </TR>
              <TR>
                <TD> <IMG SRC="images/login_l.gif" WIDTH=9 HEIGHT=112 ALT=""></TD>
                <TD width="139" align="center" bgcolor="#FFFFFF"><%call login%></TD>
                <TD> <IMG SRC="images/login_r.gif" WIDTH=9 HEIGHT=112 ALT=""></TD>
              </TR>
              <TR>
                <TD COLSPAN=3> <IMG SRC="images/login_b.gif" WIDTH=157 HEIGHT=8 ALT=""></TD>
              </TR>
            </TABLE>
              <br>
              <table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#2F75A6" bgcolor="2F75A6">
                <tr>
                  <td height="3" bgcolor="#3399CC"></td>
                </tr>
                <tr>
                  <td align="center" class="white_b_14">最新加盟经销商</td>
                </tr>
            </table></td>
          <td align="center" valign="top"><TABLE WIDTH=600 BORDER=0 CELLPADDING=0 CELLSPACING=0>
              <TR>
                <TD> <IMG SRC="images/body_l.gif" WIDTH=5 HEIGHT=10 ALT=""></TD>
                <TD></TD>
                <TD align="right"> <IMG SRC="images/body_r.gif" WIDTH=5 HEIGHT=10 ALT=""></TD>
              </TR>
            </TABLE>
              <table width="578"  border="0" cellpadding="0" cellspacing="1" bgcolor="2F75A6">
                <tr>
                  <td bgcolor="FFFFFF"><table width="100%" height="235"  border="0" cellpadding="10" cellspacing="0">
                      <tr>
                        <td height="4" bgcolor="ADECF9"></td>
                      </tr>
                      <tr>
                        <td height="408" align="center" valign="top">
                          <form name="add_offer" method="post" action="com_add_baojia_save.asp">
                              <TABLE width="100%" border=1 align=center cellPadding=5 cellSpacing=5 borderColorLight=#cccccc borderColorDark=white bgcolor="#EFFCFE">
                                <tr align="center" bgcolor="C7F3FF">
                                  <td colspan="2" class="title">增加报价</td>
                            </tr>
                                <tr bgcolor="#FFFFFF">
                                  <td width="28%" align="right">商品类型：</td>
                                  <td width="72%">
                                    <select name="new_type_id" style="font-family: 宋体; font-size: 9pt" onChange="changeselect1(this.value)">
                                      <option value="" selected >请选择</option>
                                      <%
While (NOT rst.EOF)
%>
                                      <option value="<%=(rst.Fields.Item("type_id").Value)%>"><%=(rst.Fields.Item("type_name").Value)%></option>
                                      <%
  rst.MoveNext()
Wend
If (rst.CursorType > 0) Then
  rst.MoveFirst
Else
  rst.Requery
End If
%>
                                    </select>
                                    <select name="new_type_son_id" class="px12" id="new_type_son_id" onChange="changeselect2(this.value)" disabled>
                                      <option selected>请选择</option>
                                    </select>
                                    <select name="new_brand_id" class="px12" id="new_brand_id" onChange="changeselect3(this.value)" disabled>
                                      <option selected>请选择</option>
                                  </select>                                  </td>
                                </tr>
                                <tr bgcolor="#FFFFFF">
                                  <td align="right">商品名称：</td>
                                  <td bgcolor="#FFFFFF">
								  <input name="new_pro_radio" id="new_pro_radio_1" type="radio" value="1" checked onChange="changeselect5()" disabled>
                                    <select name="new_pro_id_1" class="px12" id="new_pro_id_1" disabled>
                                      <option selected>请选择</option>
                                    </select>
                                    <br>
                                  <input type="radio" name="new_pro_radio" id="new_pro_radio_2" value="2" onChange="changeselect6()" disabled>
								  <input name="new_pro_id_2" type="text" id="new_pro_id_2"  size="18" disabled>
                                  <span class="red_12px">（如果选项中没有，请手动添加）</span></td>
                                </tr><tr bgcolor="#FFFFFF">
                                  <td align="right">外部公开价格：</td>
                                  <td>
                                  <input name="price" type="text" size="15">
                                  <b>元</b><span class="red_12px">（价格必须为数字，可以为小数）</span> </td>
                                </tr>
                                <tr bgcolor="#FFFFFF">
                                  <td align="right">经销商内部调货价格：</td>
                                  <td bgcolor="#FFFFFF">
                                    <input name="price_in" type="text" size="15">
                                    <b>元</b><span class="red_12px">（此价格只有本站认证经销商才能查看）</span> </td>
                                </tr>
                                <tr align="center" bgcolor="C7F3FF">
                                  <td colspan="2"><input type="button" onClick="check_add_offer()" name="yes" value="&nbsp;确定&nbsp;">&nbsp;&nbsp;&nbsp;
                                  <input type="reset" name="no" value="重写"></td>
                                </tr>
                            </table>
                        </form></td>
                      </tr>
                      <tr>
                        <td height="2" bgcolor="ADECF9"></td>
                      </tr>
                  </table></td>
                </tr>
            </table>
              <table width="96%" height="5"  border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td></td>
                </tr>
              </table></td>
        </tr>
    </table></td>
  </tr>
</table>
<TABLE WIDTH=764 BORDER=0 CELLPADDING=0 CELLSPACING=0 align="center">
  <TR>
    <TD> <IMG SRC="images/foot_1.gif" WIDTH=4 HEIGHT=8 ALT=""></TD>
    <TD> <IMG SRC="images/foot_2.gif" WIDTH=153 HEIGHT=8 ALT=""></TD>
    <TD> <IMG SRC="images/foot_3.gif" WIDTH=3 HEIGHT=8 ALT=""></TD>
    <TD> <IMG SRC="images/foot_4.gif" WIDTH=600 HEIGHT=8 ALT=""></TD>
    <TD> <IMG SRC="images/foot_5.gif" WIDTH=4 HEIGHT=8 ALT=""></TD>
  </TR>
</TABLE>
<!--#include file="foot.asp"-->
</body>
</html>
<%
rst.Close()
Set rst = Nothing
rsts.Close()
Set rsts = Nothing
rsb.Close()
Set rsb = Nothing
rsp.Close()
Set rsp = Nothing
%>