<!--#include file="inc/conn.asp"-->
<!--#include file="usercookies.asp"-->
<!--#include file="inc/jle_sub.asp"-->
<!--#include file="inc/function.asp"-->
<%
'    @@@@@@ www.jl-e.com @@@@@@@@@@@@@@@@@
'   @                                        @
'  @                                          @
'  @      吉林信息网，服务百姓生活      @
'  @                                          @
'   @                                        @
'    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%>
 <html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=title%>-会员管理中心-修改信息</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script language= "JavaScript" src="inc/zoom.js"></script>
<script>
function loadThreadFollow(t_id,b_id){
	var targetImg =eval("document.all.followImg" + t_id);
	var targetDiv =eval("document.all.follow" + t_id);
	
	if ("object"==typeof(targetImg)){
		if (targetDiv.style.display!=''){
			targetDiv.style.display="";
			
		}else{
			targetDiv.style.display="none";
		}
	}
}
</script>

<SCRIPT language=javascript>
<!--
function CheckForm()
{
if(document.myform.class1.value=="")
	{
	    alert("请选择一级分类!");
        document.myform.class1.focus();
	    return false;
	}
if(document.myform.class2.value=="")
	{
	    alert("请选择二级分类!!");
        document.myform.class2.focus();
	    return false;
	}
if(document.myform.diqu.value=="选择地区")
	{
	    alert("请您选择地区！");
        document.myform.diqu.focus();
        return false;
	}

if(document.myform.leixing.value.length<1)
	{
	    alert("请选择信息类别!");
        document.myform.leixing.focus();
	    return false;
	}
if(document.myform.biaoti.value.length<3)
	{
	    alert("信息标题没有填写或内容太少!");
        document.myform.biaoti.focus();
        document.myform.biaoti.select();
	    return false;
	}
if(document.myform.memo.value.length>1500)
	{
	    alert("请把信息内容的字数控制在1500以内！");
        document.myform.memo.focus();
        document.myform.memo.select();
	    return false;
	}

if(document.myform.memo.value.length<3)
	{
	    alert("信息内容没有填写或内容太少!");
        document.myform.memo.focus();
        document.myform.memo.select();
	    return false;
	}
	
if (document.myform.name.value.length == 0) {
		alert("请您填写联系人姓名！");
		document.myform.name.focus();
		return false;
	}
	var str="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,./'[]{}`1234567890-=\~!@#$%^&*()_+|?><:";
	var errorChar
	errorChar = isCharsInBag(myform.name.value,str)
	if (errorChar != "" )
	{
		alert('联系人姓名必须是中文！');
		myform.name.focus();
		return false;
	} 
function isCharsInBag (s, bag)
{ 
var i,c;
for (i = 0; i < s.length; i++)
{ 
c = s.charAt(i);//字符串s中的字符
if (bag.indexOf(c) > -1) 
return c;
}
return "";
}

if(document.myform.name.value.length<2||document.myform.name.value.length>4)
	{
	    alert("联系人姓名不能少于2字多于4字！");
        document.myform.name.focus();
        document.myform.name.select();
	    return false;
	}
if(document.myform.dianhua.value.length<7)
	{
	    alert("请填写您的联系电话,不能小于七位！");
        document.myform.dianhua.focus();
        document.myform.dianhua.select();
	    return false;
	}
if(document.myform.days.value=="选择有效期")
	{
	    alert("请您选择有效期限！");
        document.myform.days.focus();
        return false;
	}

}
//-->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">      
<!-- Begin
maxLen = 1500;
function checkMaxInput(form) {
if (form.memo.value.length > maxLen)
form.remLen.value = 0;
else form.remLen.value = maxLen - form.memo.value.length;
}
//  End -->
</SCRIPT>
</head>
<body>
<div align="center">
<table width="600" cellspacing="0" cellpadding="0">
<tr>
<td height="2">
</td>
</tr>
</table>

<table width="600" bgcolor="#FFFFFF" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="100%" class="td" cellspacing="0">
<tr>
<td class="tdt4" width="822" height="25">
<p align="center">修改信息</b>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top">
<%
username=request.cookies("jle")("username")
function fsow(filename)
set mfo=Server.CreateObject("Scripting.FileSystemObject")
set rtf=mfo.OpenTextFile(server.mappath(filename),1)
body=rtf.readall
fsow=body
end function

if request("jle") = "edit" then

biaoti=HtmlEncode(request.form("biaoti"))
class1=Strint(request.form("class1"))
class2=Strint(request.form("class2"))
diqu=HtmlEncode(request.form("diqu"))
leixing=HtmlEncode(request.form("leixing"))
memo=HtmlEncodes(request.form("memo"))
'memo=replace(replace(memo1,chr(13),"<br>"),"   ","&nbsp;")
'memo=replace(replace(memo1,"   ", "&nbsp;"),"<br>",vbCr)
tupian=HtmlEncode(request.form("tupian"))
name=HtmlEncode(request.form("name"))
dianhua=HtmlEncode(request.form("dianhua"))
email=HtmlEncode(request.form("email"))
qq=HtmlEncode(request.form("qq"))
dizhi=HtmlEncode(request.form("dizhi"))
sdays=request.form("days")
tuijian=request.form("tui")

'fbsj=date()
fbsj=now()

if username<>"" then
set rs=server.createobject("adodb.recordset")
if request("comper")="com" then
sql = "select * from [jle_shop] where username='"&username&"'"
else
sql = "select * from [user] where username='"&username&"'"
end if
rs.open sql,conn,1,3
rs("jf")=rs("jf")+3
if request("hb")>=1 and rs("hb")>=1 then
rs("hb")=rs("hb")-int(request("hb"))
end if

rs.update
rs.close
set rs=nothing
end if

set rs=Server.createObject("adodb.recordset")
strsql="select * from jle_info where id="&request("id")
rs.open strsql,conn,3,3
rs("biaoti")=biaoti
rs("class1")=class1
rs("class2")=class2
rs("diqu")=diqu
rs("leixing")=leixing
rs("memo")=memo
rs("fbsj")=fbsj
'rs("xurl")=filename2
rs("tupian")=tupian
rs("name")=name
rs("dianhua")=dianhua
rs("email")=email
rs("qq")=qq
rs("dizhi")=dizhi
rs("tuijian")=tuijian
a=request.form("hb")
rs("a")=a
rs("dqsj")= dateadd("d", sdays, now)
rs.update
rs.close

set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from jle_info where id="&request("id")
rs.open sql,conn,1,1
ip=rs("ip")
'okfile=fsow("categories_mb.html")
'dim ax
'ax=left(rs("xurl"),1)
'file1=server.mappath( "/"&ax&"" )
'XFile2 = rs("xurl")
'XFile=replace(XFile2,""&ax&"/","")
'file2=file1&"\"&XFile

'dim dtime,filename1
'dtime=now()
'filename1=year(now)&month(now)&day(now)&""&id&".html"
'filename2="categories/"&filename1
'file1=server.mappath( "/categories" )
'file2=file1&"\"&filename1
'okfile=fsow("categories_mb.html")
'Conn.Execute("Update jle_info Set xurl='"&filename2&"' where id="&id&"")

okfile=fsow("inc/categories_mb.html")
dim NewsFile
if right(rs("xurl"),4)="html" then
ax=left(rs("xurl"),10)
file1=server.mappath("/"&ax&"")
NewsFile2 = rs("xurl")
NewsFile=replace(NewsFile2,""&ax&"/","")
else
file1=server.mappath("/categories")
'NewsFile=month(now)&day(now)&hour(now)&minute(now)&second(now)&""&rs("id")&".html"
'NewsFile = rs("id")&".html"
NewsFile = year(now)&month(now)&day(now)&""&rs("id")&".html"
'NewsFile = "jlecms"&""&rs("id")&".html"
NewsFile2="categories/"&NewsFile
end if

file2=file1&"\"&NewsFile


set rc=Server.createObject("adodb.recordset")
sql="select * from class1 where id ="&class1&""
rc.open sql,conn,1,1
dim cla1
cla1=rc("class1")
rc.close
set rc=Server.createObject("adodb.recordset")
sql="select * from class2 where id ="&class2&" "
rc.open sql,conn,1,1
dim cla2
cla2=rc("class2")
rc.close

'set rc=Server.createObject("adodb.recordset")
'sql="select * from jle_info where xurl = '"&filename2&"'"
'rc.open sql,conn,3,3
x_id = rs("id")

okfile = replace(okfile,"X_ID",x_id)
okfile = replace(okfile,"City",city)
okfile = replace(okfile,"Class1",cla1)
okfile = replace(okfile,"C1url",class1)
okfile = replace(okfile,"Class2",cla2)
okfile = replace(okfile,"C2url",class2)
okfile = replace(okfile,"Diqu",diqu)
okfile = replace(okfile,"Leixing",leixing)
okfile = replace(okfile,"Biaoti",biaoti)
okfile = replace(okfile,"Memo",memo)
okfile = replace(okfile,"Adclass1",adclass1)
if tupian<>"" and tupian<>"0" then
if left(tupian,4)="http" then
okfile = replace(okfile,"Tupian",""&tupian&"")
okfile = replace(okfile,"TUurl",""&tupian&"")
else
okfile = replace(okfile,"Tupian","/"&tupian&"")
okfile = replace(okfile,"TUurl","/"&tupian&"")
end if
else
okfile = replace(okfile,"Tupian",ad11(0))
okfile = replace(okfile,"TUurl",ad11(1))
end if
okfile = replace(okfile,"Fbsj",fbsj)
okfile = replace(okfile,"Name",name)
okfile = replace(okfile,"Dianhua",dianhua)
if qq<>"" then
okfile = replace(okfile,"Qq",qq)
else 
okfile  =  replace(okfile,"Qq","这家伙很懒，没留下QQ。")
end if
if dizhi<>"" then
okfile = replace(okfile,"Dizhi",dizhi)
else 
okfile = replace(okfile,"Dizhi","这家伙很懒，没留下联系地址。")
end if
if email<>"" then
okfile = replace(okfile,"Email",email)
else 
okfile  =  replace(okfile,"Email","这家伙很懒，没留下邮箱。")
end if
okfile = replace(okfile,"Userip",ip)
okfile = replace(okfile,"Title",title)
okfile = replace(okfile,"Web",web)
okfile = replace(okfile,"Coryright",coryright)

Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fout = fso.Createtextfile(file2,true)
fout.writeline okfile
fout.close
sql="update jle_info set xurl = '"&NewsFile2&"', fbsj = '"&fbsj&"' where ID = "&rs("ID")
conn.execute(sql)


Response.Write "<script language='javascript'>alert('更新成功！');" & "history.back()" & "</script>" 
else %> <form action="?jle=edit" name="myform" method="POST"><table width="100%" border="0" cellspacing="0" class="td" cellpadding="0"><tr><td height="26" align="right" width="20%">信息版块：</td><td height="25"><%
id=trim(request("id"))
username=request.cookies("jle")("username")
set rs=server.createobject("adodb.recordset")
sql = "select * from jle_info where username='"&username&"' and id="&cstr(id)
rs.open sql,conn,1,1
if rs.eof then
errjle(0)
response.end
end if
class1=rs("class1")
class2=rs("class2")
biaoti=rs("biaoti")
leixing=rs("leixing")
diqu=rs("diqu")
memo=HTMLEncodex(rs("memo"))
tupian=rs("tupian")
name=rs("name")
email=rs("email")
dianhua=rs("dianhua")
qq=rs("qq")
tuijian=rs("tuijian")
rs.close
sql = "select * from class2 order by paixu desc"
rs.open sql,conn,1,1
%><SCRIPT language = "JavaScript">
var onecountf;
onecountf=0;
subcatf = new Array();
        <%
        count = 0
        do while not rs.eof 
        %>
        subcatf[<%=count%>] = new Array("<%= trim(rs("class2"))%>","<%= trim(rs("class1"))%>","<%= trim(rs("id"))%>");
        <%
        count = count + 1
        rs.movenext
        loop
        rs.close
        %>
onecountf=<%=count%>;

function changelocationf(locationidf)
    {
    document.myform.class2.length = 0; 

    var locationidf=locationidf;
    var i;
    for (i=0;i < onecountf; i++)
        {
            if (subcatf[i][1] == locationidf)
            { 
                document.myform.class2.options[document.myform.class2.length] = new Option(subcatf[i][0], subcatf[i][2]);
            }        
        }
        
    }    
</SCRIPT>
 <%
sql = "select * from class1 order by paixu desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "请先添加分类。"
response.end
else
%> <SELECT name="class1" onChange="changelocationf(document.myform.class1.options[document.myform.class1.selectedIndex].value)" size="1"><OPTION value="0">==分类==</OPTION><%do while not rs.eof%><OPTION  <%if trim(class1)=cstr(rs("id")) then%>selected<%end if%>  value="<%=trim(rs("id"))%>"><%=trim(rs("class1"))%></OPTION><%
        rs.movenext
        loop
	    end if
        rs.close
        %></SELECT> <SELECT name="class2"><%
sql = "select id,class2 from class2 where id="&cstr(class2)
rs.open sql,conn,1,1
%><OPTION  <%if trim(class2)=cstr(rs("id")) then%>selected<%end if%>  value="<%=trim(rs("id"))%>"><%=trim(rs("class2"))%></OPTION><%rs.close%></SELECT><input type="hidden" name="id" size="7" maxlength="6" value="<%=id%>"> </td></tr><tr><%
if request.cookies("jle")("com")="" then
sql = "select * from [user] where username='"&username&"'"
else
sql = "select * from [jle_shop] where username='"&username&"'"
end if
rs.open sql,conn,1,1
if rs.eof then
response.write "没有找到该用户"
response.end
end if
%> 
<td height="26" align="right" width="20%">信息标题：</td>
<td height="25"><input type="text" maxlength="4" name="leixing" size="8" value="<%=leixing%>">
<input type="text" maxlength="80" name="biaoti" size="42" value="<%=biaoti%>"> <font color="#FF0000">*</font></td>
</tr>
<tr>
<td height="26" align="right" width="20%">信息地区：</td>
<td height="25"><!--%if diqu1="1" then call dix() else call dix1()end if%--><!---区域start-->
<script language="JavaScript">
var onecount;
onecount=0;
subcat = new Array();
        
		<%
		i=0
		set rs2=server.createobject("ADODB.Recordset")
            sql2="select shi_id,shi_name,sheng_id from sc_shi"
            rs2.open sql2,conn,1,3
            If Not rs2.Eof Then 
            do while not rs2.eof
			
            %>
			subcat[<%=i%>] = new Array("<%=rs2("shi_name")%>","<%=rs2("sheng_id")%>","<%=rs2("shi_id")%>");
            <%
			i=i+1
              rs2.movenext
              loop
              end if
              rs2.close
              set rs2=nothing
            %>

onecount=<%=i%>;

var onecount4;
onecount4=0;
subcat4 = new Array();
     
<%
		i=0
		set rs3=server.createobject("ADODB.Recordset")
            sql3="select a.qu_id,a.qu_name,a.shi_id,b.shi_name,b.sheng_id from sc_qu a inner join sc_shi b on a.shi_id=b.shi_id"
            rs3.open sql3,conn,1,3
            If Not rs3.Eof Then 
            do while not rs3.eof
			
            %>
			subcat4[<%=i%>] = new Array("<%=rs3("qu_name")%>","<%=rs3("sheng_id")%>","<%=rs3("shi_id")%>","<%=rs3("qu_id")%>");
            <%
			i=i+1
              rs3.movenext
              loop
              end if
              rs3.close
              set rs3=nothing
            %>

onecount4=<%=i%>;

	 

 
 
 
function changelocation_shi(locationid)
    {
    document.myform.city_two.length = 0; 
	document.myform.city_two.options[0] = new Option('选择城市','');
	document.myform.city_three.length = 0; 
	document.myform.city_three.options[0] = new Option('选择城市','');
    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.myform.city_two.options[document.myform.city_two.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    
	
	function changelocation4(locationid,locationid1)
    {
    document.myform.city_three.length = 0; 
    document.myform.city_three.options[0] = new Option('选择城市','');
    var locationid=locationid;
	 var locationid1=locationid1;
    var i;
    for (i=0;i < onecount4; i++)
        {
            if (subcat4[i][2] == locationid)
            { 
			if (subcat4[i][1] == locationid1)
			{
                document.myform.city_three.options[document.myform.city_three.length] = new Option(subcat4[i][0], subcat4[i][3]);
            }        
        }
       } 
    }            
</script>
<select onChange="changelocation_shi(document.myform.city_one.options[document.myform.city_one.selectedIndex].value)" id="select" size="1" name="city_one">
            <option selected="" value="">选择城市</option>
 <%set rs1=server.createobject("ADODB.Recordset")
            sql1="select sheng_id,sheng_name from sc_sheng"
            rs1.open sql1,conn,1,3
            If Not rs1.Eof Then 
            do while not rs1.eof
            %>
			<option value='<%=rs1("sheng_id")%>'><%=rs1("sheng_name")%></option>
            <%
              rs1.movenext
              loop
              end if
              rs1.close
              set rs1=nothing
            %>
          </select>
		  <select onChange="changelocation4(document.myform.city_two.options[document.myform.city_two.selectedIndex].value,document.myform.city_one.options[document.myform.city_one.selectedIndex].value)" id="select6" name="city_two">

		  </select>
		  <select id="select7" name="city_three">
          
         
		
		  </select>


</td></tr><tr><td height="26" align="right" width="20%">信息内容：</td>
<td height="25"><textarea rows="9" name="memo" cols="44" onKeyDown="checkMaxInput(this.form)" onKeyUp="checkMaxInput(this.form)"><%=memo%></textarea>
<BR>
*&nbsp;1500字以内&nbsp;目前还可以写
<INPUT readonly type=text name=remLen size=4 maxlength=2 value="1500" style="border: 1 solid #888888">
个字
<font color="#FF0000">*</font>
<img border="0" src="image/plus.gif" width="20" height="20" onMouseOver="this.style.cursor='hand'" onClick="sizeContent(5,'memo')" alt="增大输入框">
<img border="0" src="image/minus.gif" width="20" height="20" onMouseOver="this.style.cursor='hand'" onClick="sizeContent(-5,'memo')" alt="缩小输入框">
</td>
</tr>
<tr>
<td height="26" align="right" width="20%">相关图片：</td>
<td height="25"><input type="text" name="tupian" size="32" id="tupian" maxlength="200" value="<%=tupian%>"> 
<% if  tupian ="" then
response.write "暂无相关图片"
end if
%>
<span id="followImg1" style="CURSOR: hand" title="选中上传图片" onClick="loadThreadFollow(1,5)">无现成图片,</span>
<span id="followImg1" style="CURSOR: hand" onClick="loadThreadFollow(1,5)"><input type="checkbox" name="C3" value="ON"></span>
<span id="followImg1" style="CURSOR: hand" title="选中上传图片" onClick="loadThreadFollow(1,5)"><font color="#FF0000">上传图片</font></span>

</td>
</tr>
<tr style="display:none" id="follow1">
<td height="26" align="right" width="20%"></td>
<td height="26">
<iframe name="I1" frameborder="0" width="400" height="30" scrolling="no" src="uploadinfo.asp"></iframe>
</td>
</tr>
<tr>
<td height="26" align="right" width="20%">联系人：</td><td height="25"><input type="text" name="name" size="13" maxlength="20" value="<%=rs("name")%>"> 
<%if request.cookies("jle")("com")<>"" then%>－<input type="hidden" name="comper" value="com">
<input type="text" name="com" size="25" maxlength="20" value="<%=rs("com")%>">
<%else%>
<%end if%>
<font color="#FF0000">*</font>
</td>
</tr>
<tr>
<td height="26" align="right" width="20%">联系电话：</td>
<td height="25"><input type="text" name="dianhua" size="23" maxlength="40" value="<%=rs("dianhua")%>">&nbsp; <font color="#FF0000">*</font></td>
</tr>
<tr>
<td height="26" align="right" width="20%">Email：</td>
<td height="25"><input type="text" name="email" size="23" maxlength="40" value="<%=rs("email")%>">&nbsp; <font color="#FF0000">*&nbsp; </font>QQ：<input type="text" name="qq" size="17" maxlength="11" value="<%=rs("qq")%>"></td>
</tr>
<tr>
<td height="26" align="right" width="20%">联系地址：</td>
<td height="25"><input type="text" name="dizhi" size="51" maxlength="20" value="<%=rs("dizhi")%>"></td>
</tr>
<tr>
<td height="26" align="right" width="20%"><font face="宋体" size="2">置顶排行：</td>
<td height="25"><font face="宋体" size="2">
<%hb=rs("hb")%>
<%if hb>0 then%>
<select name="hb"><option value="0">不使用</option><%for i=1 to hb%><option value="<%=i%>"><%=i%></option><%next%></select>个 <img border="0" src="image/jsq.gif" title="使您的信息排在最前，数字越大越靠前,使用需要花对应个货币" width="15" height="15"> <%else%> <font color="#999999">没有货币,请[联系本站购买货币]吧</font> 
<%end if%>
</td>
</tr>
<tr>
<td height="26" align="right" width="20%">信息有效期：</td>

<td height="26" width="73%">
<select name="days" size="1">
<OPTION value="选择有效期" selected>选择有效期</OPTION>
          <OPTION value="7">一星期</OPTION>
          <OPTION value="15">半个月</OPTION>
          <OPTION value="31">一个月</OPTION>
          <OPTION value="61">两个月</OPTION>
          <OPTION value="92">三个月</OPTION>
          <OPTION value="183">半年</OPTION>
          <OPTION value="365">一年</OPTION>
</select>
</td>
</tr>

<tr>
<td height="26" align="right" width="20%">是否推荐：</td>
<td height="25"><%if request.cookies("jle")("vip")=1 then%><input type="radio" value="1" name="tui" title="选中推荐您的信息">推荐 <input type="radio" name="tui" value="0" checked>不推荐<font color="#C0C0C0"><%else%></font><input type="radio" name="tui" value="0" checked>
<font color="#ACACAC"><img border="0" src="image/jian.gif" width="15" height="15"></font><font color="#FF0000">您不是VIP会员，不能使用推荐，请联系本站</font><%end if%></td>
</tr>
<tr>
<td height="44" colspan="2" width="531"><p align="center"><input type="submit" onClick="javascript:return CheckForm();" value="提交修改，刷新信息" name="xiu">　<input type="reset" value="重写" name="B2"></td></tr></table></form><%end if%> </td>
</tr>
</table>
</div>
 </body>
 </html>