PublicSupplyEdit.asp
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:17k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../../FS_Inc/Const.asp" -->
  3. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  4. <!--#include file="../../FS_Inc/Function.asp" -->
  5. <!--#include file="../lib/strlib.asp" -->
  6. <!--#include file="../lib/UserCheck.asp" -->
  7. <%
  8. Dim str_CurrPath,rs
  9. str_CurrPath = Replace("/"&G_VIRTUAL_ROOT_DIR &"/"&G_USERFILES_DIR&"/"&Session("FS_UserNumber"),"//","/")
  10. if trim(NoSqlHack(Request.QueryString("id")))="" then
  11. strShowErr = "<li>错误的参数</li>"
  12. Response.Redirect(""& s_savepath &"/lib/error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  13. Response.end
  14. end if
  15. set rs = Server.CreateObject(G_FS_RS)
  16. rs.open "select * From FS_SD_News where UserNumber='"& Fs_User.UserNumber &"' and Id="&NoSqlHack(Request.QueryString("id")),conn,1,3
  17. if rs.eof then
  18. strShowErr = "<li>找不到记录</li>"
  19. Response.Redirect(""& s_savepath &"/lib/error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  20. Response.end
  21. end if
  22. '获得留言
  23. dim book_rs,new_count
  24. set book_rs= Server.CreateObject(G_FS_RS)
  25. book_rs.open "Select count(BookID) From FS_ME_Book where M_ReadUserNumber='"&Fs_User.UserNumber&"' and M_ReadTF=0 and M_Type=2",User_Conn,1,3
  26.  if book_rs(0)>0 then
  27.  new_count = "<span class=""tx""><b>您有留言"& book_rs(0) &"</b></span>"
  28.  else
  29.  new_count =  book_rs(0)
  30.  end if
  31. book_rs.close:set book_rs = nothing
  32. %>
  33. <html xmlns="http://www.w3.org/1999/xhtml">
  34. <title>User Manage Center-网站内容管理系统</title>
  35. <meta name="keywords" content="风讯cms,cms,FoosunCMS,FoosunOA,FoosunVif,vif,风讯网站内容管理系统">
  36. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  37. <meta content="MSHTML 6.00.3790.2491" name="GENERATOR" />
  38. <link href="../images/skin/Css_<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>/<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  39. <head></head>
  40. <body>
  41. <table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  42.   <tr>
  43.     <td>
  44.       <!--#include file="../top.asp" -->
  45.     </td>
  46.   </tr>
  47. </table>
  48. <table width="98%" height="135" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  49.     <tr class="back"> 
  50.       <td   colspan="2" class="xingmu" height="26"> <!--#include file="../Top_navi.asp" -->
  51.     </td>
  52.     </tr>
  53.     <tr class="back"> 
  54.       <td width="18%" valign="top" class="hback"> <div align="left"> 
  55.           <!--#include file="../menu.asp" -->
  56.         </div></td>
  57.       <td width="82%" valign="top" class="hback">
  58.   <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  59.         <tr class="hback"> 
  60.           <td  valign="top">你的位置:<a href="../../">网站首页</a> &gt;&gt; <a href="../main.asp">会员首页</a> 
  61.             &gt;&gt; <a href="PublicManage.asp">供求系统</a> &gt;&gt;发布供求</td>
  62.         </tr>
  63.         <tr class="hback"> 
  64.           <td  valign="top"><a href="PublicSupply.asp">发布信息</a>┆<a href="PublicManage.asp">管理信息</a>┆<a href="PublicManage.asp#top10">你的信息浏览排行(TOP10)</a>┆<a href="PublicManage.asp#new">最新供求信息</a>┆<a href="PublicManage.asp#rec">供求推荐</a>┆<a href="../Book.asp?M_type=2">我的新留言(<%=new_count%>)</a></td> 
  65.         </tr>
  66.       </table>
  67.       <table width="98%"  border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  68.         <form action="PubLic_Save.asp" method="post" name="s_form"  onSubmit="return checkinput();">
  69.           <tr class="hback"> 
  70.             <td width="100"> <div align="right"> 
  71.                 <input name="id" type="hidden" id="id" value="<%=rs("id")%>">
  72.                 *信息标题</div></td>
  73.             <td > <input name="PubTitle" type="text" id="title2"  value="<%=rs("PubTitle")%>" size="40" maxlength="50">
  74.               *类型 
  75.               <select name="PubType" id="PubType">
  76.                 <option value="0" <%if rs("PubType")=0 then response.Write "selected"%>>供应</option>
  77.                 <option value="1" <%if rs("PubType")=1 then response.Write "selected"%>>求购</option>
  78.                 <option value="2" <%if rs("PubType")=2 then response.Write "selected"%>>合作</option>
  79.                 <option value="3" <%if rs("PubType")=3 then response.Write "selected"%>>代理</option>
  80.                 <option value="4" <%if rs("PubType")=4 then response.Write "selected"%>>其他</option>
  81.               </select>
  82.                *所在地区 
  83.               <select name="AreaID" id="AreaID">
  84.                 <%
  85.   dim obj_zl_rs
  86.   set obj_zl_rs= Server.CreateObject(G_FS_RS)
  87.   obj_zl_rs.open "select ID,PID,ClassName From FS_SD_Address  where PID=0  order by ClassLevel desc,id asc",Conn,1,3
  88.   do while not obj_zl_rs.eof 
  89.    if rs("AreaID")=obj_zl_rs("id") then
  90. Response.Write"<option value="""& obj_zl_rs("ID")&""" selected>├"& obj_zl_rs("ClassName")&"</option>"
  91. else
  92. Response.Write"<option value="""& obj_zl_rs("ID")&""">├"& obj_zl_rs("ClassName")&"</option>"
  93. end if
  94.   Response.Write childAreaclassList(obj_zl_rs("ID")," ")
  95.   obj_zl_rs.movenext
  96.   Loop
  97.   obj_zl_rs.close:set obj_zl_rs =nothing
  98.   %>
  99.               </select></td>
  100.           </tr>
  101.           <tr class="hback"> 
  102.             <td width="100"> <div align="right">*分类</div></td>
  103.             <td > <select name="ClassID" id="ClassID">
  104.                 <%
  105.   set obj_zl_rs= Server.CreateObject(G_FS_RS)
  106.   obj_zl_rs.open "select ID,PID,GQ_ClassName,PID,classorder From FS_SD_Class  where PID=0  order by classorder desc,id desc",Conn,1,3
  107.   do while not obj_zl_rs.eof 
  108.   if rs("ClassID")=obj_zl_rs("id") then
  109. Response.Write"<option value="""& obj_zl_rs("ID")&""" selected>├"& obj_zl_rs("GQ_ClassName")&"</option>"
  110.   else
  111. Response.Write"<option value="""& obj_zl_rs("ID")&""">├"& obj_zl_rs("GQ_ClassName")&"</option>"
  112. end if
  113.    Response.Write childclassList(obj_zl_rs("ID")," ")
  114.   obj_zl_rs.movenext
  115.   Loop
  116.   obj_zl_rs.close:set obj_zl_rs =nothing
  117.   %>
  118.               </select>
  119.                 我的专栏 
  120.               <select name="MyClassID" id="MyClassID">
  121.                 <option value="">选择您的归类</option>
  122.                 <%
  123.   set obj_zl_rs= Server.CreateObject(G_FS_RS)
  124.   obj_zl_rs.open "select ClassID,ClassCName,ClassEName,ParentID,UserNumber,ClassTypes From FS_ME_InfoClass  where ParentID=0 and ClassTypes=4 and UserNumber='"& Fs_User.UserNumber&"' order by ClassID desc",User_Conn,1,3
  125.   do while not obj_zl_rs.eof 
  126.    if rs("MyClassID")=obj_zl_rs("Classid") then
  127. Response.Write"<option value="""& obj_zl_rs("ClassID")&""" selected>"& obj_zl_rs("ClassCName")&"</option>"
  128. else
  129. Response.Write"<option value="""& obj_zl_rs("ClassID")&""">"& obj_zl_rs("ClassCName")&"</option>"
  130. end if
  131.   obj_zl_rs.movenext
  132.   Loop
  133.   obj_zl_rs.close:set obj_zl_rs =nothing
  134.   %>
  135.               </select></td>
  136.           </tr>
  137.           <tr class="hback"> 
  138.             <td><div align="right">关键字</div></td>
  139.             <td ><input name="keyword1" type="text" id="keyword1"  value="<%=split(rs("Keyword"),",")(0)%>" size="15" maxlength="15">
  140.               , 
  141.               <input name="keyword2" type="text" id="keyword2"  value="<%=split(rs("Keyword"),",")(1)%>" size="15" maxlength="15">
  142.               , 
  143.               <input name="keyword3" type="text" id="keyword3"  value="<%=split(rs("Keyword"),",")(2)%>" size="15" maxlength="15"></td>
  144.           </tr>
  145.           <tr class="hback"> 
  146.             <td width="100"> <div align="right">经营方式</div></td>
  147.             <td > <input name="CompType" type="radio" value="0" <%if rs("CompType")=0 then response.Write("checked")%>>
  148.               批发 
  149.               <input name="CompType" type="radio" value="1" <%if rs("CompType")=1 then response.Write("checked")%>>
  150.               零售 
  151.               <input type="radio" name="CompType" value="2" <%if rs("CompType")=2 then response.Write("checked")%>>
  152.               批零兼营</td>
  153.           </tr>
  154.           <tr class="hback"> 
  155.             <td width="100"> <div align="right">数量</div></td>
  156.             <td ><input name="PubNumber" type="text" id="PubNumber" value="<%=rs("PubNumber")%>">
  157.                有效期限 
  158.               <input name="ValidTime" type="text" id="ValidTime" size="20"  value="<%=rs("ValidTime")%>">
  159.               天。有效值为1~360</td>
  160.           </tr>
  161.           <tr class="hback"> 
  162.             <td rowspan="2" align="center"><div align="right">产品参数</div></td>
  163.             <td  align="center"><div align="left">包装说明 
  164.                 <input name="PubPack" type="text" id="PubPack" maxlength="100" value="<%=rs("PubPack")%>">
  165.                 产品价格 
  166.                 <input name="PubPrice" type="text" id="PubPrice"  maxlength="10" value="<%=rs("PubPrice")%>">
  167.                 ,0表示面议</div></td>
  168.           </tr>
  169.           <tr class="hback"> 
  170.             <td  align="center"><div align="left">产品规格 
  171.                 <input name="Pubgui" type="text" id="title3"  value="<%=rs("Pubgui")%>" size="40" maxlength="50">
  172.               </div></td>
  173.           </tr>
  174.           <tr class="hback">
  175.             <td align="center"><div align="right">产地</div></td>
  176.             <td  align="center"><div align="left">
  177.                 <input name="PubAddress2" type="text" id="PubAddress2" size="20"  value="<%=rs("PubAddress")%>">
  178.               </div></td>
  179.           </tr>
  180.           <tr class="hback"> 
  181.             <td width="100" align="center"> <div align="right">*描述</div></td>
  182.             <td  align="center"> <div align="left"> 
  183.                 <textarea name="PubContent" rows="6" id="PubContent" style="width:100%"><%=rs("PubContent")%></textarea>
  184.               </div></td>
  185.           </tr>
  186.           <tr class="hback"> 
  187.             <td align="center"><div align="right">图片</div></td>
  188.             <td align="center"><table width="100%" border="0" cellspacing="1" cellpadding="5">
  189.                 <tr> 
  190.                   <td width="29%"> <div align="center"> 
  191.                       <table width="1" border="0" cellspacing="2" cellpadding="1" class="table">
  192.                         <tr> 
  193.                           <td class="hback"><img src="<%if trim(rs("PubPic_1"))="" or isnull(trim(rs("PubPic_1"))) then: response.Write"../Images/nopic_supply.gif":else:Response.Write rs("PubPic_1"):end if%>" width="90" height="90" id="pic_p_1"></td>
  194.                         </tr>
  195.                       </table>
  196.                       <input name="pic_1" type="hidden" id="pic_1" size="40" value="<%=rs("PubPic_1")%>">
  197.                     </div></td>
  198.                   <td width="36%"> <div align="center"> 
  199.                       <table width="1" height="96" border="0" cellpadding="1" cellspacing="2" class="table">
  200.                         <tr> 
  201.                           <td height="92" class="hback"><img src="<%if trim(rs("PubPic_2"))="" or isnull(trim(rs("PubPic_2")))then: response.Write"../Images/nopic_supply.gif":else:Response.Write rs("PubPic_2"):end if%>" width="90" height="90" id="pic_p_2"></td>
  202.                         </tr>
  203.                       </table>
  204.                       <input name="pic_2" type="hidden" id="pic_2" size="40" value="<%=rs("PubPic_2")%>">
  205.                     </div></div>
  206.                   </td>
  207.                   <td width="35%"> <div align="center"> 
  208.                       <table width="1" border="0" cellspacing="2" cellpadding="1" class="table">
  209.                         <tr> 
  210.                           <td height="92" class="hback"><img src="<%if trim(rs("PubPic_3"))="" or isnull(trim(rs("PubPic_3"))) then: response.Write"../Images/nopic_supply.gif":else:Response.Write rs("PubPic_3"):end if%>" width="90" height="90" id="pic_p_3"></td>
  211.                         </tr>
  212.                       </table>
  213.                       <input name="pic_3" type="hidden" id="pic_3" size="40" value="<%=rs("PubPic_3")%>">
  214.                     </div></div>
  215.                   </td>
  216.                 </tr>
  217.                 <tr> 
  218.                   <td><div align="center"><img  src="../Images/upfile.gif" width="44" height="22" onClick="OpenWindowAndSetValue('../CommPages/SelectPic.asp?CurrPath=<% = str_CurrPath %>&f_UserNumber=<% = session("FS_UserNumber")%>',500,320,window,document.s_form.pic_1);" style="cursor:hand;"> 
  219.                        <img src="../Images/del_supply.gif" width="44" height="22" onClick="dels_1();" style="cursor:hand;"> 
  220.                     </div></td>
  221.                   <td><div align="center"><img  src="../Images/upfile.gif" width="44" height="22" onClick="OpenWindowAndSetValue('../CommPages/SelectPic.asp?CurrPath=<% = str_CurrPath %>&f_UserNumber=<% = session("FS_UserNumber")%>',500,320,window,document.s_form.pic_2);" style="cursor:hand;"> 
  222.                        <img src="../Images/del_supply.gif" width="44" height="22" onClick="dels_2();" style="cursor:hand;"> 
  223.                     </div></td>
  224.                   <td><div align="center"><img  src="../Images/upfile.gif" width="44" height="22" onClick="OpenWindowAndSetValue('../CommPages/SelectPic.asp?CurrPath=<% = str_CurrPath %>&f_UserNumber=<% = session("FS_UserNumber")%>',500,320,window,document.s_form.pic_3);" style="cursor:hand;"> 
  225.                        <img src="../Images/del_supply.gif" width="44" height="22" onClick="dels_3();" style="cursor:hand;"> 
  226.                     </div></td>
  227.                 </tr>
  228.               </table></td>
  229.           </tr>
  230.           <tr class="hback"> 
  231.             <td align="center">&nbsp;</td>
  232.             <td align="center"> <div align="left"> 
  233.                 <input type="submit" name="Submit" value="保存信息">
  234.                 <input type="reset" name="Submit" value="重置">
  235.                 <input name="Action" type="hidden" id="Action" value="<%=Request.QueryString("Action")%>">
  236.               </div></td>
  237.           </tr>
  238.         </form>
  239.       </table>
  240.       </td>
  241.     </tr>
  242.     <tr class="back"> 
  243.       <td height="20"  colspan="2" class="xingmu"> <div align="left"> 
  244.           <!--#include file="../Copyright.asp" -->
  245.         </div></td>
  246.     </tr>
  247. </table>
  248. </body>
  249. </html>
  250. <%
  251. Function childclassList(f_classid,f_tmp)
  252. Dim f_Child_c_Rs,ChildTypeListStr,f_TempStr,f_isUrlStr,lng_GetCount,tmp_sed
  253. Set f_Child_c_Rs = Conn.Execute("Select ID,PID,GQ_ClassName,classorder From FS_SD_Class  where PID=" & f_classid & "  order by classorder desc,id desc" )
  254. f_TempStr =f_tmp & "┄"
  255. do while Not f_Child_c_Rs.Eof
  256. if rs("ClassID")=f_Child_c_Rs("id") then
  257. tmp_sed="selected"
  258. else
  259. tmp_sed=""
  260. end if
  261. childclassList = childclassList & "<option value="""& f_Child_c_Rs("ID") &""" "&tmp_sed&">"
  262. childclassList = childclassList & "├" & f_TempStr &  f_Child_c_Rs("GQ_ClassName") 
  263. childclassList = childclassList & "</option>" & Chr(13) & Chr(10)
  264. childclassList = childclassList &childclassList(f_Child_c_Rs("ID"),f_TempStr)
  265. f_Child_c_Rs.MoveNext
  266. loop
  267. f_Child_c_Rs.Close
  268. Set f_Child_c_Rs = Nothing
  269. end function
  270. Function childAreaclassList(f_classid,f_tmp)
  271. dim rs_1,f_TempStr
  272. Set rs_1 = Conn.Execute("Select ID,PID,ClassName From FS_SD_Address  where PID=" & f_classid & "  order by ClassLevel desc,id asc" )
  273. f_TempStr =f_tmp & "┄"
  274. do while Not rs_1.Eof
  275. if Rs("AreaId")=rs_1("ID") then
  276. childAreaclassList = childAreaclassList & "<option value="""& rs_1("ID") &""" selected>"
  277. else
  278. childAreaclassList = childAreaclassList & "<option value="""& rs_1("ID") &""">"
  279. end if
  280. childAreaclassList = childAreaclassList & "├" & f_TempStr &  rs_1("ClassName") 
  281. childAreaclassList = childAreaclassList & "</option>" & Chr(13) & Chr(10)
  282. childAreaclassList = childAreaclassList &childAreaclassList(rs_1("ID"),f_TempStr)
  283. rs_1.MoveNext
  284. loop
  285. rs_1.Close
  286. Set rs_1 = Nothing
  287. end function
  288. Set Fs_User = Nothing
  289. rs.close:set rs = nothing
  290. %>
  291. <script language="JavaScript" type="text/JavaScript">
  292. new Form.Element.Observer($('pic_1'),1,pics_1);
  293. function pics_1()
  294. {
  295. if ($('pic_1').value=='')
  296. {
  297. $('pic_p_1').src='../Images/nopic_supply.gif'
  298. }
  299. else
  300. {
  301. $('pic_p_1').src=$('pic_1').value
  302. }
  303. new Form.Element.Observer($('pic_2'),1,pics_2);
  304. function pics_2()
  305. {
  306. if($('pic_2').value=='')
  307. {
  308. $('pic_p_2').src='../Images/nopic_supply.gif'
  309. }
  310. else
  311. {
  312. $('pic_p_2').src=$('pic_2').value
  313. }
  314. new Form.Element.Observer($('pic_3'),1,pics_3);
  315. function pics_3()
  316. {
  317. if($('pic_3').value=='')
  318. {
  319. $('pic_p_3').src='../Images/nopic_supply.gif'
  320. }
  321. else
  322. {
  323. $('pic_p_3').src=$('pic_3').value
  324. }
  325. }
  326. function dels_1()
  327. {
  328. document.s_form.pic_1.value=''
  329. }
  330. function dels_2()
  331. {
  332. document.s_form.pic_2.value=''
  333. }
  334. function dels_3()
  335. {
  336. document.s_form.pic_3.value=''
  337. }
  338. function checkinput()
  339. {
  340. if(document.s_form.PubTitle.value=='') {
  341. alert("请填写信息标题")
  342. s_form.PubTitle.focus();
  343. return false;
  344. }
  345. if(document.s_form.PubAddress.value=='') {
  346. alert("填写所在地区")
  347. s_form.PubAddress.focus();
  348. return false;
  349. }
  350. if(document.s_form.ClassID.value=='') {
  351. alert("请填写分类")
  352. s_form.ClassID.focus();
  353. return false;
  354. }
  355. if(document.s_form.PubContent.value=='') {
  356. alert("填写信息描述")
  357. s_form.PubContent.focus();
  358. return false;
  359. }
  360. }
  361. </script>
  362. <!--Powsered by Foosun Inc.,Product:FoosunCMS V4.0系列-->