<!--#include file="inc/conn.asp"-->
<!--#include file="inc/jle_sub.asp"-->
<!--#include file="inc/function.asp"-->
<!--#include file="inc/sip.asp"-->
<%
if session("jleinfomation")<>"" then
if DateDiff("s",session("jleinfomation"),Now())<30 then
Response.Write "<script language='javascript'>alert('对不起！你发信息太快了，请等待30秒钟后再发！');history.back();</script>" 
response.end
end if
end if
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") = "add" then
biaoti=HtmlEncode(request.form("biaoti"))
delpass=HtmlEncode(request.form("delpass"))
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;")
tupian=HtmlEncode(request.form("tupian"))
if right(tupian,4)=".gif" or right(tupian,4)=".bmp" or right(tupian,4)=".jpg" or right(tupian,5)=".jpeg" or tupian="" then
else
Response.Write "<script language='javascript'>alert('请正确填写图片地址！');history.back();</script>" 
response.end
end if
if memo="" then
response.write"<script language=JavaScript>" & chr(13) & "alert('内容不能为空！');" & "history.back()" & "</script>"
response.end
end if

'jle_checkcode=CStr(session("GetCode"))
'session("GetCode")=""
'if jle_checkcode<>CStr(request("jle_checkcode"))  then
'Response.write"<script>alert(""验证码不正确，请刷新后重写！  "");history.back();</script>"
'Response.end
'end if

Dim jle_checkcode,GetCode
	jle_checkcode=Strint(Request("jle_checkcode"))
	GetCode=Strint(Session("GetCode"))
	Session("GetCode")=""
	If jle_checkcode<>GetCode Or GetCode=0 Then
		Response.Write"<script>alert('验证码错误，请刷新后重填！');history.go(-1)</script>"
		Response.End()
	End If

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

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"))
'fbsj=date()
fbsj=now()
sdays=request.form("days")

set rs=Server.createObject("adodb.recordset")
strsql="select * from jle_info"
rs.open strsql,conn,3,3
rs.addnew
rs("biaoti")=biaoti
rs("delpass")=delpass
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
if username<>"" then
rs("username")=username
tuijian=request.form("tui")
sj=request.form("sj")
a=request.form("hb")
rs("tuijian")=tuijian
rs("sj")=sj
rs("a")=a
'if request.cookies("jle")("com")<>"" then
'Conn.Execute("Update com Set hb="&rs("hb")&"-a where username='"&username&"'")
'else
'Conn.Execute("Update user Set hb="&rs("hb")&"-a where username="&username&"")
'end if
end if
rs("yz")=guan
rs("dqsj")= dateadd("d", sdays, now)
userip=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If userip="" Then 
userip=Request.ServerVariables("REMOTE_ADDR")
end if
rs("ip")=userip
rs.update
'id=rs("id")
'rs.update
session("jleinfomation")=now()
rs.close
set rs=nothing
set rs=Server.createObject("adodb.recordset")
strsql="select top 1 id from jle_info order by id desc"
rs.open strsql,conn,1,1
id=rs("id")
rs.close
set rs=nothing
dim dtime,filename1
dtime=now()
'filename1=month(now)&day(now)&hour(now)&minute(now)&second(now)& ".html"
'filename1=id&".html"
filename1=year(now)&month(now)&day(now)&""&id&".html"
'filename1="jlecms"&""&id&".html"
filename2="categories/"&filename1
file1=server.mappath( "/categories" )
file2=file1&"\"&filename1
okfile=fsow("inc/categories_mb.html")
Conn.Execute("Update jle_info Set xurl='"&filename2&"' where id="&id&"")

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 = rc("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,"Diqu",diqu)
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",userip)
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
response.write "<meta http-equiv=refresh content=""1;URL=postok.html"">"
end if%>