<%
'商易仿淘宝4.0(多用户)
'ACCESS版演示网站：http://www.ftaobao.com(商易仿淘宝商城)
'SQL版演示网站：http://sql.ftaobao.com
'电话：0571-56907100
'QQ：1147100
%>
<%titlename="求购商品"%>
<body bgcolor="#ffffff" onload="setup()" onLoad="show(A61),show(A62)">
<!--#include file="top.asp"-->
<!--#include file="../include/ssdz.asp"-->
<html><head>
<meta http-equiv=Content-Type content='text/html; charset=gb2312'>
<link href="/include/css.css" rel="stylesheet" type="text/css">
<title><%=my_name%>-----会员中心</title></head>
<script language="javascript">
function check()
{
if(document.input.lbid.value=="0" ||document.input.catsonid.value=="")
{
alert("请选择子分类");
return false;
}
if(document.input.xlbid.value=="0")
{
alert("请选择分类");
return false;
}
if(document.input.jg1.value=="" || (!check_err(document.input.price.value)))
{
alert("求购价格不能为空，且不能包含非法字符");
return false;
document.input.jg1.focus();
}
if(document.input.js.value=="" || (!check_err(document.input.title.value)))
{
alert("求购信息不能为空，且不能包含非法字符");
return false;
}
if(document.input.num.value=="" || (!check_err(document.input.num.value)))
{
alert("求购数量不能为空，且不能包含非法字符");
return false;
document.input.num.focus();
}

}
function check_err(char) {
if (!(char.indexof ('script') == -1))

return false;
return true;
}
</script>
<%hy "login.asp"%>
<table width="762" border="0" align="center" cellpadding="2" cellspacing="0" style='BORDER-COLLAPSE: collapse;MARGIN: 3px'>
  <tr> 
    <td height="25" colspan="2">您的位置： <A href="../index.asp">首页</A> &gt;&gt; <a href="index.asp">会员中心</a>&nbsp;&gt;&gt; 求购商品</td>
  </tr>
  <tr> 
    <td width="180" valign="top">
<!--#include file="left.asp"-->
    </td>
<td width="582" height="280" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td><table border="0" align="left" cellpadding="0" cellspacing="0">
      <tr>
        <td width="1"><IMG SRC="../images/mytaobaobj1_3.gif" WIDTH=3 HEIGHT=25 ALT=""></td>
        <td width="120" align="center" background="../images/mytaobaobj1_4.gif"><font color="#FFFFFF" span class="C">求购商品</font></td>
        <td width="1"><IMG SRC="../images/mytaobaobj1_6.gif" WIDTH=7 HEIGHT=25 ALT=""></td>
      </tr>
    </table>
        <table border="0" align="left" cellpadding="0" cellspacing="0">
          <tr>
            <td width="1"><IMG SRC="../images/mytaobaobj1_8.gif" WIDTH=3 HEIGHT=25 ALT=""></td>
            <td width="120" align="center" background="../images/mytaobaobj1_9.gif"><font color="#FF0000"><span class="C"><a href="myqiugou.asp">我的求购</a></span></font></td>
            <td width="1"><IMG SRC="../images/mytaobaobj1_11.gif" WIDTH=7 HEIGHT=25 ALT=""></td>
          </tr>
        </table>
      </td>
  </tr>
</table>
  <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td height="4" bgcolor="1E88C1"></td>
    </tr>
  </table>
<%
Select case request("abc")
case "add_qiu"
'求购添加
lbid=shopnet("lbid")
xlbid=shopnet("xlbid")
if shopnet("slbid")="" then slbid=0 else slbid=shopnet("slbid")
mc=shopnet("mc")
js=left(shopnet("js"),3000)
jg1=shopnet("jg1")
dz=shopnet("dz")
dz1=shopnet("dz1")
dz2=shopnet("dz2")
num=shopnet("num")
if jg1<=0 then
Response.Write("<script>alert(""您的产品价格不能小于等于0！"");history.back();</script>")
Response.end
end if

set rs=server.createobject("adodb.recordset")
sql="select * from qiugou" 
rs.open sql,conn,1,3
rs.addnew
rs("lbid")=lbid
rs("xlbid")=xlbid
rs("slbid")=slbid
rs("mc")=mc
rs("num")=num

rs("dz")=dz&dz1&dz2
rs("jg1")=jg1
rs("date")=sqlnow
rs("js")=js
rs("huiyuan")=Request.Cookies(Rikee)("huiyuan")
rs.update
rs.close
set rs=nothing
'conn.execute("Update lb set qgnum=0 where lbid is not null")
'conn.execute("Update xlb set qgnum=0 where  xlbid is not null")
'conn.execute("Update slb set qgnum=0 where  slbid is not null")

conn.execute("Update lb set qgnum=qgnum+1 where lbid="&lbid&"")
conn.execute("Update xlb set qgnum=qgnum+1 where lbid="&lbid&" and xlbid="&xlbid&"")
conn.execute("Update slb set qgnum=qgnum+1 where lbid="&lbid&" and xlbid="&xlbid&" and slbid="&slbid&"")
Response.Write "<script>alert(""求购商品添加成功"");location.href=""index.asp"";</script>"
case else
ranNum=int(900*rnd)+100 
mybh="ISBN-"&trim(year(date()))&right("0"&trim(month(date)),2)&right("0"&trim(day(date)),2)&right("0"&trim(hour(time())),2)&right("0"&trim(minute(time())),2)&ranNum%>
<%set rs = conn.execute("select * from xlb order by xlbid")%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%count = 0
do while not rs.eof
Response.Write "subcat["&count&"] = new Array('"&rs("xlbname")&"','"&rs("lbid")&"','"&rs("xlbid")&"');"&chr(10)&""
count = count + 1
rs.movenext
loop
rs.close
set rs=nothing%>
onecount=<%=count%>;  
<%set rs = conn.execute("select * from slb order by slbid")%>
var onecount2;
onecount2=0;
subcat2 = new Array();
<%count2 = 0
do while not rs.eof
Response.Write "subcat2["&count2&"] = new Array('"&rs("slbname")&"','"&rs("xlbid")&"','"&rs("slbid")&"');"&chr(10)&""
count2 = count2 + 1
rs.movenext
loop
rs.close
set rs=nothing%>
onecount2=<%=count2%>;
function changelocation(locationid){
document.myform.xlbid.length = 0; 
document.myform.slbid.length = 0; 
var locationid=locationid;
var i;
for (i=0;i < onecount; i++){
if (subcat[i][1] == locationid){ 
document.myform.xlbid.options[document.myform.xlbid.length] = new Option(subcat[i][0], subcat[i][2]);
}}} ; 
function changelocation2(villageid){
document.myform.slbid.length = 0; 
var villageid=villageid;
var j;
for (j=0;j < onecount2; j++){
if (subcat2[j][1] == villageid){ 
document.myform.slbid.options[document.myform.slbid.length] = new Option(subcat2[j][0], subcat2[j][2]);}}} 
function changeInfo() {
if (document.getElementById('catInfo')) {
var rootCat = document.forms['myform'].elements['lbid'];
var subCat = document.forms['myform'].elements['xlbid'];
var subCat3 = document.forms['myform'].elements['slbid'];
var str = '';
var rootCatName = '';
var subCatName = '';
var subCatName3 = '';
if (rootCat && rootCat.selectedIndex>=0) {
rootCatName = rootCat.options[rootCat.selectedIndex].innerHTML;
str = rootCatName;
if (subCat && subCat.selectedIndex>=0) {
subCatName = subCat.options[subCat.selectedIndex].innerHTML;
if (subCatName.length > 0) {
str += ' &gt;&gt; ' + subCatName;}
if (subCat3 && subCat3.selectedIndex >= 0) {
subCatName3 = subCat3.options[subCat3.selectedIndex].innerHTML;
if (subCatName3.length > 0) {
str += ' &gt;&gt; ' + subCatName3;}}}}
document.getElementById('catInfo').innerHTML = str;
window.setTimeout('changeInfo()', 500);}} 
function ModifyWriteFrom() {
document.myform.bh.value="";}
function ModifyWriteFrom1(){
document.myform.bh.value="<%=mybh%>";}
function changSelect_radio(info){  
pm.style.display='none'; 
cp01.style.display='none';
cp02.style.display='none';
if(info=='一口价'){
cp01.style.display='';
cp02.style.display='';}
if(info=='拍卖'){
pm.style.display=''; }}
function checksignup() {
if ( document.myform.lbid.value == '' ) {
window.alert('请正确选择产品一级归类，这将有助您的产品销售!!');
return false;}
if ( document.myform.xlbid.value == '' ) {
window.alert('请正确选择产品二级归类，这将有助您的产品销售!!');
return false;}
if ( document.myform.mc.value == '' ) {
window.alert('请输入产品名称!!');
document.myform.mc.focus();
return false;}
if ( document.myform.mc.value.length>30 ) {
window.alert('产品名称请控制在30个字符（15个汉字）以内!!');
document.myform.mc.focus();
return false;}
if ( document.myform.jg1.value == '' ) {
window.alert('请输入销售价格!!');
document.myform.jg1.focus();
return false;}
if (isNaN( document.myform.jg1.value )) {
window.alert('请用数字填写格!!');
document.myform.jg1.focus();
return false;}
if ( document.myform.num.value == '' ) {
window.alert('请输入数量!!');
document.myform.num.focus();
return false;}
if (isNaN( document.myform.num.value )) {
window.alert('请用数字填数量!!');
document.myform.num.focus();
return false;}
if ( document.myform.js.value == '' ) {
window.alert('请输入商品要求!!');
document.myform.js.focus();
return false;}
if ( document.myform.js.value.length>3000 ) {
window.alert('产品名称请控制在3000个字符（1500个汉字）以内!!');
document.myform.js.focus();
return false;}
if (( document.myform.fs.item(0).checked)){if(( document.myform.jg2.value == '' )||( document.myform.jg2.value<=0)||( document.myform.jg3.value == '' )||( document.myform.jg3.value<=0 )||(isNaN( document.myform.jg1.value))||(isNaN( document.myform.jg2.value))||(isNaN( document.myform.jg3.value))){
window.alert('请输入正确的销售价格，只能为大于等于0的数值!');
return false;}}
if (( document.myform.fs.item(1).checked)){if(( document.myform.p_jg1.value == '' )||( document.myform.p_jg1.value<=0)||( document.myform.p_jg2.value == '' )||( document.myform.p_jg2.value<=0 )||(isNaN( document.myform.p_jg1.value))||(isNaN( document.myform.p_jg1.value)))  {
window.alert('请输入正确的拍卖价格，只能为大于等于0的数值!');
return false;}}
if (( document.myform.sj.value == '' )||( document.myform.sj.value<=0 )||(isNaN( document.myform.sj.value))){
window.alert('请输入正确的销售结束时间，只能为大于等于0的数值!');
return false;}
if ( document.myform.jp.value == '' ) {
window.alert('请输入产品简评!!');
document.myform.jp.focus();
return false;}
if (document.myform.jp.value.length>300){
window.alert("产品简评不能超过300字！");
document.myform.jp.focus();
return false;}
if (document.myform.js.value.length>3000){
window.alert("产品介绍不能超过3000字！");
document.myform.js.focus();
return false;}
return true;}
</script>
<br><table width="570" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#efefef">
        <form action=?abc=add_qiu method="post" name="myform" id="myform">
          <tr valign="middle" bgcolor="#f1f1f1"> 
      <td height="21" colspan="2" background="../image/bk.gif" bgcolor="#FFCC00">&nbsp;</td>
    </tr>
    <tr valign="middle"> 
            <td width="89" height="25" align="center" bgcolor="#FFFFFF">产品归类</td>
      <td height="25" bgcolor="#FFFFFF"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
        <tr>
                  <td height="22" valign="middle" nowrap>
<select name="lbid" size="8" class="wenbenkuang" style="width:170px" onChange="javascript:changelocation(document.myform.lbid.options[document.myform.lbid.selectedIndex].value);changeInfo();"><%set rs = conn.Execute ("select lbid,lbname from lb order by lbid" ) 
do while not rs.eof
Response.Write"<option value="&rs(0)&">"&rs(1)&"</option>" 
rs.movenext 
loop 
rs.close 
set rs = nothing%>
</select>
<select name="xlbid" size="8" class="wenbenkuang" style="width:120px" onChange="javascript:changelocation2(document.myform.xlbid.options[document.myform.xlbid.selectedIndex].value);changeInfo();">
</select>
<select name="slbid" size="8" class="wenbenkuang" style="width:120px" onChange="javascript:changeInfo();">
</select>
<font color="#FF3333">*</font></td>
        </tr>
        <tr>
          <td height="22" valign="middle"><font color="#999999">您目前选择的归类：</font>
              <label id="catInfo"></label></td>
        </tr>
        <tr>
          <td height="22" valign="middle"><font color="#999999">请正确选择产品的归类。</font></td>
        </tr>
      </table></td>
    </tr>
    <tr valign="middle"> 
            <td width="89" height="25" align="center" bgcolor="#FFFFFF">求购商品名称</td>
      <td height="25" bgcolor="#FFFFFF"> <input name="mc" type="text" class="wenbenkuang" id="mc" size="40" maxlength="50"> 
        <font color="#FF3333">*</font> <br />
        <span class="line1">标题请限定在15个汉字内（30个字符）。如：求购佳能a70数码相机；求购纯白t恤衬衫。请写清楚您要求购的商品名称，卖家才能更容易看到您的求购信息。</span></td>
    </tr>

    
    <tr valign="middle" id=cp01 style="DISPLAY:"> 
            <td width="89" height="25" align="center" bgcolor="#FFFFFF">价格</td>
      <td height="25" bgcolor="#FFFFFF"> <input name="jg1" type="text" class="wenbenkuang" id="jg1" size="10" maxlength="20">
        设置一个价格<font color="#FF3333">*</font></td>
      </tr>
    <tr valign="middle">
      <td height="25" align="center" bgcolor="#FFFFFF">求购数量</td>
      <td height="25" bgcolor="#FFFFFF"><span class="line1">
        <input name="num" type="text" id="num" maxlength="6" />
件 </span><font color="#FF3333">*</font></td>
    </tr>
    <tr valign="middle"> 
            <td width="89" height="25" align="center" bgcolor="#FFFFFF"><span class="line1"><font color="#FF0000">*</font>商品要求： </span></td>
      <td height="25" bgcolor="#FFFFFF"> <textarea name="js" cols="65" rows="6" class="wenbenkuang" id="js"></textarea><font color="#FF3333">*</font>      </td>
    </tr>
    <tr valign="middle">
      <td height="25" align="center" bgcolor="#FFFFFF">您的所在地:</td>
      <td height="25" bgcolor="#FFFFFF"><table width="100%" align="center">
        <tr>
          <td>
<style>
body,select
{
 font-size:9pt;
 font-family:Verdana;
}
a
{
 color:red;
 text-decoration:none;
}
a:hover{
 text-decoration:underline;
}
</style>

</head>


<select name="dz" id="s1">
  <option>省份</option></select>
<select name="dz1" id="s2">
  <option>地级市</option></select>
<select name="dz2" id="s3">
  <option>市、县级市、县</option></select></td>
        </tr>
      </table></td>
    </tr>
    <tr valign="middle"> 
            <td height="25" colspan="2" align="center" bgcolor="#FFFFFF"> 
                <input name="Submit" type="submit" class="go-wenbenkuang" value="OK,提交" ONCLICK="javascript:return checksignup()">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                 <input name="Submit2" type="reset" class="go-wenbenkuang" value="NO，重置">
            </td>
      </tr>
    <tr valign="middle">
      <td height="21" colspan="2" align="center" background="../image/bk1.gif" bgcolor="#FFFFFF">&nbsp;</td>
      </tr>
        </form>
  </table>  
<%End Select%></td>
  </tr>
</table>

<!--#include file="../bottom.asp"-->
