<!--#include file="head.asp"-->
<style>body{background-color: #fff;}</style>
<script type="text/javascript" src="/inc/qrcode.min.js"></script>
<%


rs.open "select * from ayquanju",conn,1,1
shangjiabao=rs("shangjiabao")
rs.close

act=SafeRequest("act")
id=SafeRequest("id")
	
	if act="pedit" then
	gname=trim(SafeRequestform("gname"))
	id=SafeRequestform("id")
	if gname="" then call PopErr("个性链接不能为空")
	if id="" then call PopErr("参数错误")
	
	if len(trim(gname))<5 or len(trim(gname))>15 then call PopErr("个性名称长度应大于4位小于15位")
	
	sql="select aygoodmd5,iszhuxiao from aygood where aygoodmd5='"&gname&"' and iszhuxiao=0"
	rs.open sql,conn,1,1
	if not(rs.bof and rs.eof) then
	call PopErr("该个性名称被占用，请重新选择")
	response.End()
	end if 
	rs.close
	
	sql="select * from aygood where aygoodid="&id&" and aygoodsuoyouid="&request.Cookies("aynameid")&"" 
	rs.open sql,conn,1,3
		if rs.bof and rs.eof then
		rs.close
		call PopErr("未找到参数")
    	else
		rs("aygoodmd5")=trim(gname)
		rs.update
		rs.close
		call logadd(request.Cookies("aynameid"),"商品设置个性链接成功"&id,0,0) 
		call PopErr2("设置成功","goodlink?id="&id&"")
		end if
	end if
	
	
	if act="gedit" then
	gname=trim(SafeRequestform("gname"))
	id=SafeRequestform("id")
	if gname="" then call PopErr("个性链接不能为空")
	if id="" then call PopErr("参数错误")
	
	if len(trim(gname))<5 or len(trim(gname))>15 then call PopErr("个性名称长度应大于4位小于15位")
	
	sql="select * from aygood where aygdlmd5url='"&gname&"' and iszhuxiao=0"
	rs.open sql,conn,1,1
	if not(rs.bof and rs.eof) then
	call PopErr("该个性名称被占用，请重新选择")
	response.End()
	end if 
	rs.close
	
	sql="select * from aygood where aygoodid="&id&" and aygoodsuoyouid="&request.Cookies("aynameid")&"" 
	rs.open sql,conn,1,3
		if rs.bof and rs.eof then
		rs.close
		call PopErr("未找到参数")
    	else
		rs("aygdlmd5url")=trim(gname)
		rs.update
		rs.close
		call logadd(request.Cookies("aynameid"),"商品设置独立个性链接成功"&id,0,0) 
		call PopErr2("设置成功","goodlink?id="&id&"")
		end if
	end if

%>


<script language="javascript">
  function CheckIfnum(String)
{
    var Letters = "1234567890";
     var i;
     var c;
     for( i = 0; i < String.length; i ++ )
     {
          c = String.charAt( i );
	  if (Letters.indexOf( c ) < 0)
	     return false;
     }
     return true;
}


function checkform1()
{ 

if(document.form1.gname.value=="")
{alert("请填写完整");return false}


if(CheckIfnum(document.form1.gname.value)==true){
alert("个性名字不可以全是数字");
return false;
}

} 

function checkform2()
{ 

if(document.form2.gname.value=="")
{alert("请填写完整");return false}


if(CheckIfnum(document.form2.gname.value)==true){
alert("个性名字不可以全是数字");
return false;
}

} 
 </script>
 

<main>
<div  class="container">
<div class="ui-lrctnei">
<%call userleft()%>
<div class="r"> 
<div class="ui-content">
                        
					
                            
<div class="neiye">

                   
                                                     
            <!-------------------------------------- 开始 -------------------------------------->
            <div class="neibiaoti"></div>
            <div class="neibiaoti2">商品链接</div>
                	<div class="gexian"></div>
                    <div class="neitablewu">
					<%if id="" then call PopErr("参数不完整")

					zdwapurl=wapurl
					
                    sql="select * from ayname where aynameid="&request.Cookies("aynameid")&"" 
                    rs.open sql,conn,1,1
					
						if cint(rs("shangjiabao"))<>2 then
							if cint(shangjiabao)=1 or cint(rs("shangjiabao"))=1 then
								if ccur(rs("ayisxiaojin"))<ccur(xiaobaojine) then
									call logadd(request.Cookies("aynameid"),"非平台VIP会员禁止上架销售",0,1)
									call PopErr2("2018-1-18日起为保障交易安全，非平台VIP会员，暂时不能上架销售","vip") 
									response.End
								end if
							end if
						end if
					
                    ayismd5=rs("ayismd5")
					
                    rs.close

					
                    sql="select * from aygood where aygoodid="&id&" and aygoodsuoyouid="&request.Cookies("aynameid")&"" 
                    rs.open sql,conn,1,1
                    if rs.bof and rs.eof then call PopErr("未找到数据")%>
    				<table>
           		  		<tr>
                            <td width="120">商品名称：</td>
                            <td><%=trim(rs("aygoodname"))%></td>
                        </tr>
                        <%
						web1=weburl
						zweburl=weburl
						%>
           		  		<tr>
                            <td width="110">普通链接：</td>
                            <td>
                            <form name="form1" method="post" action="?act=pedit"  onSubmit="return checkform1()">
                            <a style="color:#F60" href="<%=zweburl%><%=trim(rs("aygoodmd5"))%>.htm" target="_blank"><%=zweburl%><%=trim(rs("aygoodmd5"))%>.htm</a>
                            &nbsp;&nbsp;设置个性链接
                            &nbsp;<input name="gname" type="text" id="gname" size="15" class="reginputdd" maxlength="15" value="<%if not isnull(trim(rs("aygoodmd5"))) then response.Write trim(rs("aygoodmd5"))%>" />
                            <input name="id" type="hidden" value="<%=id%>" />
                            <input type="submit" name="button" id="button" value="  设置  " class="logindlregedit"/>
                      
                            </form>
                            </td>
                        </tr>
                        
           		  		<tr>
                            <td width="110">普通链接二维码：</td>
                            <td>
							<%if iswap="yes" then
							erweima=web1&trim(rs("aygoodmd5"))&".htm"
							%>
                            <div id="qrcode"></div>
                            <script type="text/javascript">var qrcode = new QRCode(document.getElementById("qrcode"), {width:160,height:160});qrcode.makeCode("<%=trim(ReplaceTrim(erweima))%>");</script>
                            将二维码截屏保存，可在微信中推广
                            <%else%>
                            [暂未开启]
                            <%end if%>
                            </td>
                        </tr>
                        
                        <tr><td width="110" height="10"></td><td></td></tr>
           		  		<tr style="background-color:#F7F7F7"><td width="110" height="10"></td><td></td></tr>
           		  		<tr><td width="110" height="10"></td><td></td></tr>
                        
           		  		<tr>
                            <td width="110">固定链接：</td>
                            <td>
                            <form name="form2" method="post" action="?act=gedit"  onSubmit="return checkform2()">
                            <a style="color:#F60" href="<%=zweburl%>buy/<%=trim(rs("aygdlmd5url"))%>.htm" target="_blank"><%=zweburl%>buy/<%=trim(rs("aygdlmd5url"))%>.htm</a>
                            &nbsp;&nbsp;设置个性链接
                            &nbsp; <input name="gname" type="text" id="gname" size="15" maxlength="15" class="reginputdd" value="<%if not isnull(trim(rs("aygdlmd5url"))) then response.Write trim(rs("aygdlmd5url"))%>" />
                            <input name="id" type="hidden" value="<%=id%>" />
                            <input type="submit" name="button" id="button" value="  设置  " class="logindlregedit"/>
                            </form>
                            </td>
                        </tr>
           		  		
           		  		
                        
           		  		<tr>
                            <td width="110">固定链接二维码：</td>
                            <td>
							<%if iswap="yes" then
							erweima=web1&"buy/"&trim(rs("aygdlmd5url"))&".htm"
							%>
                            <div id="qrcode2"></div>
							<script type="text/javascript">var qrcode2 = new QRCode(document.getElementById("qrcode2"), {width:160,height:160});qrcode2.makeCode("<%=trim(ReplaceTrim(erweima))%>");</script>
                            将二维码截屏保存，可在微信中推广
                            <%else%>
                            [暂未开启]
                            <%end if%>
                            </td>
                        </tr>
                        <!--
           		  		<tr>
                            <td width="110">嵌套代码：</td>
                            <td>
							&lt;iframe src=&quot;<%'=qiantao%>&quot; frameborder=&quot;0&quot; scrolling=&quot;yes&quot; width=&quot;980&quot; height=&quot;940&quot; &gt;&lt;/iframe&gt;  <br>
       						&lt;iframe src=&quot;<%'=gqiantao%>&quot; frameborder=&quot;0&quot; scrolling=&quot;yes&quot; width=&quot;980&quot; height=&quot;940&quot; &gt;&lt;/iframe&gt;
                            </td>
                        </tr>
                        -->
                    </table>
					</div>
            <!-------------------------------------- 结束 -------------------------------------->
            
            

            
            
            
            		<div class="gexian20"></div>
                    <div class="mzsmbox2">
                    商品普通链接：当买家打开时可以选择商品分类，也可以选择商品。<br>
                    商品固定链接：当买家打开时只固定显示该商品分类，只固定该商品。<br>
                    嵌套代码：当购买嵌套功能后，可以将嵌套代码放置自己的网页，提供买家进行购买支付。
                    </div>
       				<%rs.close%>
            
            
           

        <div class="clearfix"></div>



</div>








</div>
</div>
</div>
</div>
</main>


<footer>
<div class="container">
</div>
</footer>

</body>
</html>