wy_trip_fun.inc
上传用户:hnxqingdao
上传日期:2013-05-22
资源大小:1283k
文件大小:3k
源码类别:

其他行业

开发平台:

ASP/ASPX

  1. <!--#include file="../wy_trip_inc/wy_trip_cnn.inc"-->
  2. <%
  3.     '处理登录字符
  4.     function wylog(infor)
  5.           infor=trim(infor)
  6.           infor=replace(infor,"'","''")
  7.     end function
  8.     '获得指定图片的名称
  9.     function pictitle(tablename)
  10.          set rst=server.createobject("adodb.recordset")
  11.          sqlstr="select * from "&tablename
  12.          
  13.          rst.open sqlstr,conn,1,1
  14.          if not (rst.eof or rst.bof) then
  15.               pname=rst("picpath")
  16.          end if
  17.          rst.close
  18.          set rst=nothing
  19.          
  20.          pictitle="../wy_trip_images/"&pname     
  21.     end function
  22.     
  23.   
  24.   
  25.     '提取数据库中指定表,指定字段 信息
  26.     function sqlshow(sqlstr,strname)
  27.         
  28.         revalue=""
  29.         set rst=server.CreateObject("adodb.recordset")
  30.        rst.open sqlstr,conn,1,1
  31.       
  32.        if not(rst.eof or rst.bof) then
  33.           revalue=rst(strname).value
  34.        end if
  35.        rst.close
  36.        set rst=nothing
  37.       
  38.        sqlshow=revalue
  39.     end function
  40.   
  41.    '更新数据库中指定表,指定字段 信息
  42.    function sqlupdata(sqlstr,strname,updatainfor)
  43.         
  44.         updatainfor=replace(updatainfor,chr(13),"<br>")
  45.         i=0
  46.         set rst=server.CreateObject("adodb.recordset")
  47. rst.open sqlstr,conn,1,3
  48. if not(rst.eof or rst.bof) then
  49.       rst(strname)=updatainfor
  50.       rst.update
  51.       i=1
  52.   end if
  53.   
  54.   rst.close
  55.   set rst=nothing
  56.   
  57.   sqlupdata=i
  58.    end function
  59.   
  60.   
  61.   '删除说明信息及图片数据表,指定记录
  62.   'return 1 complete ; 0 fair
  63.    function deleteitem(solname,tablename)
  64.           i=0
  65.       set rst=server.createobject("adodb.recordset")
  66.       sqlstr="select * from "&tablename&" where  solname='"&solname&"'"
  67.       rst.open sqlstr,conn,1,3
  68.       if not (rst.eof or rst.bof) then
  69.             rst.delete
  70.             i=1
  71.       end if
  72.       
  73.       deletesta=i
  74.    end function
  75.        
  76.    
  77.    sub systemerror(infor)
  78.          %>
  79.            <html>
  80. <head>
  81. <title>PTrip Server 2005 For 数据库课程设计
  82. </title>
  83. <META http-equiv=Content-Type content="text/html; charset=gb2312">
  84. <link rel="stylesheet" type="text/css" href="../wy_trip.css">
  85. </head>
  86.          
  87.             <body leftmargin="0" topmargin="0"  bottommargin="0" rightmargin="0" link="#3357B3" vlink="#3357B3" alink="#3357B3" bgcolor="#e8eefc">
  88.             <table width="750" height="700" cellpadding="0" cellspacing="0">
  89. <tr>
  90.    <td valign="top" class="Main">
  91. <p class="NoBreakBeforeAfter"><img src="../wy_trip_images/TopCol3.gif" WIDTH="247" HEIGHT="23"></p>
  92. <p class="NoBreakBeforeAfter"><img src="../wy_trip_images/HeaderOtherDestination.gif" width="229" height="28"></p>
  93. <p class="Indented1" align="center"><font size="6"><b><%=infor%></b></font></p>
  94. </tr>
  95.             </body>
  96.             </html>
  97.          <%
  98.    end sub
  99.       
  100.    
  101.    'get now time
  102.    function wytime()
  103.         wyyear=year(now)
  104.         wyday=day(now)
  105.         wymonth=month(now)
  106.         
  107.         wytime=wyyear&"-"&wymonth&"-"&wyday
  108.    end function
  109.    
  110.    
  111.    
  112.    
  113.    'return the strlen1/3
  114.    function wystrlenonethird(infor)
  115.            allstrlen=len(infor)
  116.            onepart=allstrlen / 3
  117.            onepart=int(onepart)
  118.            
  119.            wystrlenonethird=onepart
  120.    end function
  121.   
  122.   
  123.    'format note
  124.    function wynote(infor)
  125.             wynote=replace(trim(infor),chr(13),"<br>")
  126.    end function
  127.   
  128.   
  129. %>