<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<% data_path="../" 'ACC连接数据库路径，对SQL无效 %>
<!--#include file="../conn/conn.asp"-->
<!--#include file="../inc/safe.asp"-->
<!--#include file="../inc/head.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 http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<style type="text/css">
<!--
/*图片*/
#gpic{width:200px; height:150px; float:left; margin:0 0 15px 10px;}
#gpic ul{list-style:none; width:125px; height:140px;}
#gpic ul li{border:1px dashed #336699; margin:15px; padding:1px; width:125px; height:140px;}

/*基本信息*/
#gnote{width:400px; height:150px; float:left; margin:10px 0px 15px 10px;}
#gnote ul{list-style:none; height:140px; width:auto;}
#gnote ul li{padding:1px; margin:1px; height:25px;}

/*详细信息*/
#mall{width:600px; height:auto; margin:10px 0px 5px 15px; padding:5px;}
#mall ul{list-style:none;}


body,td,th {
	font-size: 9pt;
}
-->
</style>
<script language="javascript">
<!--
function postchk()
{

 if(document.postorder.ordernum.value == "") {
		    alert("请输入订购数量");
			document.postorder.ordernum.focus();
		    return false;
	}
	
var ynnum=isNaN(document.postorder.ordernum.value)
if(ynnum)
{
alert("订购数量必须为数字");
return false;
}

if(document.postorder.tel.value == "") {
		alert("请输入联系电话");
		document.postorder.tel.focus();
		return false;
}
if(document.postorder.getadd.value == "") {
		alert("请输入收货地址");
		document.postorder.getadd.focus();
		return false;
}
if(document.postorder.chkcom1.value == document.postorder.chkcom2.value) {
		alert("买卖双方不能同为一人");
		document.postorder.ordernum.focus();
		return false;
}
	 
	document.postorder.submit();
}
-->
</script>
</head>
<%
if issession=0 then
if request.Cookies("Yxmemberid")="" then
response.write "<script language='javascript'>"
response.write"parent.location.href='../login/login1.asp';</SCRIPT>"
response.end
end if
username=Replace_Text(request.Cookies("Yxmember"))
gsid=Replace_Text(request.Cookies("Yxmemberid"))
gradeid=Replace_Text(request.Cookies("gradeid"))
else
if session("id")="" then
response.write "<script language='javascript'>"
response.write"parent.location.href='../login/login1.asp';</SCRIPT>"
response.end
end if
username=session("user")
gsid=session("id")
gradeid=session("gradeid")
end if 
	
	
gtype=request("gtype")
gid=request("gid")
comid=request("comid")
set rs=server.CreateObject("adodb.recordset")
sql=""
if gtype=1 then
 	sql=sql&"select * from yixiang_info where info_id="&gid
else
	sql=sql&"select * from yixiang_productshow where id="&gid
end if
rs.open sql,conn,1,1

'查询公司
set rscom=server.CreateObject("adodb.recordset")
sqlcom="select * from yixiang_corporation where id="&comid
rscom.open sqlcom,conn,1,1


'获取图片   PTpic=HOPE_InstallDir&"UploadFile/nopicture.gif"
if gtype=1 then
   if trim(rs("draw"))&"ok"="ok" and trim(rs("draw1"))&"ok"="ok" and rs(("draw2"))&"ok"="ok" then
   		PTpic=HOPE_InstallDir&"UploadFile/nopicture.gif"
   elseif trim(rs("draw"))&"ok"="ok" and  trim(rs("draw1"))&"ok"<>"ok" and trim(rs("draw2"))&"ok"="ok" then
   		PTpic=HOPE_InstallDir&"Vipcom/"&rscom("User")&"/"&rs("draw1")
   elseif trim(rs("draw"))&"ok"<>"ok" and  trim(rs("draw1"))&"ok"="ok" and trim(rs("draw2"))&"ok"="ok" then
   		PTpic=HOPE_InstallDir&"Vipcom/"&rscom("User")&"/"&rs("draw")
   elseif trim(rs("draw"))&"ok"="ok" and  trim(rs("draw1"))&"ok"="ok" and trim(rs("draw2"))&"ok"<>"ok" then
   		PTpic=HOPE_InstallDir&"Vipcom/"&rscom("User")&"/"&rs("draw2")
   else
   		PTpic=HOPE_InstallDir&"Vipcom/"&rscom("User")&"/"&rs("draw")
   end if
else
   if trim(rs("picture_summ"))&"ok"="ok" and trim(rs("picture"))&"ok"="ok"  then
  		PTpic=HOPE_InstallDir&"UploadFile/nopicture.gif"
   elseif trim(rs("picture_summ"))&"ok"<>"ok" and trim(rs("picture"))&"ok"="ok" then
   		PTpic=HOPE_InstallDir&"Vipcom/"&rscom("User")&"/"&rs("picture_summ")
   elseif trim(rs("picture_summ"))&"ok"="ok" and trim(rs("picture"))&"ok"<>"ok" then
   		PTpic=HOPE_InstallDir&"Vipcom/"&rscom("User")&"/"&rs("picture")
   else
   		PTpic=HOPE_InstallDir&"Vipcom/"&rscom("User")&"/"&rs("picture_summ")
   end if
end if

if gtype=1 then
	cpmc=trim(rs("showname"))
else
	cpmc=trim(rs("cpmc"))
end if

if gtype=1 then
	cpid=trim(rs("info_id"))
else
	cpid=trim(rs("id"))
end if
%>
<body>
<table width="850" border="0" cellpadding="0" cellspacing="0" align="center">
  <tr>
    <td style="padding:0 0 10px 0;">
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td style="border-bottom:1px solid #3366CC;">
		   <div id="gpic">
		     <ul>
			   <li><%if gtype=1 then%><img src="<%=PTpic%>" width="123" height="138" /><%else%><img src="<%=PTpic%>" width="123" height="138" /><%end if%></li>
			 </ul>
		   </div>
		   <div id="gnote">
		      <ul>
			    <li>产品名称：<%=cpmc%></li>
				<li>产品规格：<%if gtype=1 then%><%=trim(rs("Specifications"))%><%else%><%=trim(rs("cpgg"))%><%end if%></li>
				<li>价格说明：<%if gtype=1 then%><%=trim(left(rs("priceterms"),15))%><%else%><%=trim(rs("cpjg"))%><%end if%></li>
				<li>公司名称：<%=trim(rscom("qymc"))%></li>
				
				
	 <%
	 
	 iscan=0
	 iscomc=0
 	 if issee=0 then
	   set rsamp=server.CreateObject("adodb.recordset")
	   sqlamp="select * from yixiang_vipgrade where roleid="&gradeid
	   rsamp.open sqlamp,conn,1,1
	   if not rsamp.eof  then 	 
 	   if gtype=1 then
 	   if rs("type")="买"  then
	     if instr(rsamp("rolelist"),"msgq")>0 then
		 iscan=1
		 end if
 		 else
       	  if instr(rsamp("rolelist"),"msgg")>0 then
		 iscan=1
		 end if
 		 end if
 	   else
	     if instr(rsamp("rolelist"),"msgp")>0 then
		 iscan=1
		 end if  
  	   end if
	    if instr(rsamp("rolelist"),"msgc")>0 then
		iscomc=1  
		end if
 	   rsamp.close
	   end if
	   else
	   iscan=1
	   end if
	  
  	   if iscomc=1 then
	    %>
	   	<li>所在地区：<%if gtype=1 then%><%=trim(rscom("address"))%><%else%><%=trim(rs("cpcd"))%><%end if%></li>
 	   <%
	   end if
 	'在线联系
	if iscan=1 then
 
'response.Write"<li>联系卖家：<a href='tencent://message/?uin="&rscom("qq")&"&Site=发送信息&Menu=yes'><img border='0' src='http://wpa.qq.com/pa?p=1:"&rscom("qq")&":7' alt='点击这里即时聊天' /></a>"	

 end if
 %>
 
 
 </li>
			  </ul>
		   </div>
		  </td>
        </tr>
        <tr>
          <td style="border-bottom:1px solid #3366CC;">
		    <div id="mall">
			   <h5><span>产品详细信息</span></h5>
			   <ul>
			      <li>
				  <%if gtype=1 then%><%=trim(left(rs("content"),500))%><br /><font color="#660000">【此处仅显示500字，更多信息请查看产品信息】</font><%else%><%=trim(left(rs("xxsm"),500))%><br /><font color="#660000">【此处仅显示500字，更多信息请查看产品信息】</font><%end if%>
				  </li>
			   </ul>
			</div>
          </td>
        </tr>
        <tr>
          <td height="13">
		    <div id="mall">
			   <h5><span>确认购买</span></h5>
			   <ul>
			      <li>
				  <form name="postorder" method="post" action="ordersave.asp?sid=<%=comid%>&cpname=<%=cpmc%>&gtype=<%=gtype%>&cpid=<%=cpid%>">
				    <table width="100%" border="0" cellpadding="0" cellspacing="0">
                      <tr>
                        <td width="26%" height="30" align="center">购买数量：</td>
                        <td width="74%" height="30"><label>
                          <input name="ordernum" type="text" id="ordernum" />
                        </label></td>
                      </tr>
                      <tr>
                        <td height="30" align="center">付款方式：</td>
                        <td height="30"><label>
                        <select name="paytype" id="paytype">
                          <option value="网银支付">网银支付</option>
                          <option value="支付宝支付">支付宝支付</option>
                          <option value="现金支付">现金支付</option>
                          <option value="邮局汇款">邮局汇款</option>
                          <option value="其他方式">其他方式</option>
                        </select>
                        </label></td>
                      </tr>
                      <tr>
                        <td height="30" align="center">联系电话：</td>
                        <td height="30"><label>
                          <input name="tel" type="text" id="tel" />
                        </label></td>
                      </tr>
					  <tr>
                        <td height="30" align="center">收货地址：</td>
                        <td height="30"><label>
                          <input name="getadd" type="text" id="getadd" />
                        </label></td>
                      </tr>
                      <tr>
                        <td height="30" align="center" valign="top" style="border-bottom:1px solid #CCCCCC;">买家留言：</td>
                        <td height="30" style="border-bottom:1px solid #CCCCCC;"><label>
                          <textarea name="lmsg" cols="45" rows="6" id="lmsg"></textarea>
                        </label></td>
                      </tr>
                      <tr>
                        <td height="30" colspan="2" align="center"><br /><br />
                          <label>
                          <input type="button" name="Submit" value="确认提交" onclick=javascript:postchk() />
						  <input type="hidden" name="chkcom1" value=<%=gsid%> />
						  <input type="hidden" name="chkcom2" value=<%=comid%> />
                        </label></td>
                      </tr>
                    </table>
				  </form>
				  </li>
			   </ul>
			</div>
		  </td>
        </tr>
      </table>       
    </td>
  </tr>
</table>
 <!--#include file="../inc/end.asp"-->
<%
rscom.close
rs.close
%>
</body>
</html>
