⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ly.asp

📁 一对一校友录多班级而且非常漂亮http://free.cnyys.com/my/yhe/DEFAULT.ASP
💻 ASP
📖 第 1 页 / 共 2 页
字号:
rs.open sql,conn,1,3

set rs=Server.CreateObject("Adodb.Recordset")
	sql="select * from user where username='"&use&"'"
rs.open sql,conn,1,3
		rs("lycount")=rs("lycount")-1
		rs("money")=rs("money")-2
	rs.update
	rs.close
	set rs=nothing
Response.Redirect "ly.asp"
end if
end sub

sub add
dim title,content,clas
content=request.form("content")
title=request.form("title")
clas=Session("clas")
if request.form("title")="" then
	Response.Write("请确认输入了留言主题")
	exit sub
end if
	if content="" then
		Response.Write("留言内容不能为空")
	exit sub
	end if
set rs=Server.CreateObject("Adodb.Recordset")
	rs.open "select * from ly where 1=2",conn,1,3
	rs.addnew()
		rs("class")=Session("clas")
		rs("title")=title
		rs("username")=Session("wzname")
		rs("content")=content
		rs("date")=now()
rs("ip")=Request.ServerVariables("REMOTE_ADDR")
	rs.update
	rs.close
set rs=nothing
set rs=Server.CreateObject("Adodb.Recordset")
	sql="select * from user where username='"&Session("wzname")&"'"
rs.open sql,conn,1,3
		rs("lycount")=rs("lycount")+1
		rs("money")=rs("money")+2
	rs.update
	rs.close
	set rs=nothing
response.redirect "ly.asp"
end sub

sub edit
Set rs = Server.CreateObject("ADODB.Recordset")
set rs=conn.execute ("select * from ly where id="&ad&" and username='"&session("wzname")&"'")
	set re=conn.execute ("select * from bj where adminname='"&Session("wzname")&"' and bjname='"&Session("clas")&"'")
	IF rs.eof and re.eof and Session("sitejob")<>3 then
	%>
                           你还没有这个权限呢!<br>
<a href='javascript:history.go(-1)'><font color="#FF0000">回去吧</font></a>
<%	
else
set rs=Server.CreateObject("Adodb.Recordset")
	sql="select * from ly where id="&ad&""
rs.open sql,conn,1,3
	%>
<table width="100%" border="1" cellpadding="1"  cellspacing="1" bordercolor="#EFD997">
                                <form name="form3" method="post" action="?type2=add2&ad=<%=rs("id")%>"><tr>
                                  <td width="26%"><B>留言主题</B></td>
                                  <td width="74%">
                                    <input name="title" type="text" id="title" value="<%=rs("title")%>" size="30" maxlength="17">
                                    <FONT color=red> *</FONT>不得超过15个汉字                                  </td>
                                </tr>
                                <tr>
                                  <td valign="top"><p><b>留言内容</b><br>
   现在的留言是不是简单多了?以后我们将走简约型的路子,不加那些无用的功能,将思索放在开发实用的部件上<br>
  <font color=brown><A href="javascript:checklength()">  </A></font>最大长度:<font color=brown>2KB<br>
                                        <A href="javascript:checklength()">[检测留言长度]</A> </font></p>
                                    </td>
                                  <td><textarea name="content" cols="50" rows="7" id="content"><%=rs("content")%></textarea>                                    </td>
                                </tr>
                                <tr>
                                  <td>时间:<%=now()%></td>
                                  <td>    
                                <%  If session("wzname")="" Then%>
<font color=red>只有登录才能留言!</font>
<%else%>
 <input type="submit" name="Submit2" value="提交"> 
                  <input type="reset" name="Submit3" value="重置">
<%End If%>
                                  </td>
                                </tr></form>
                              </table>
<%rs.close
	set rs=nothing
	end if
end sub

sub add2
dim title,content
content=request.form("content")
title=request.form("title")
set rs=Server.CreateObject("Adodb.Recordset")
	sql="select * from ly where id="&ad&""
rs.open sql,conn,1,3
		rs("title")=title
		rs("content")=content
	rs.update
	rs.close
	set rs=nothing
response.redirect "ly.asp"
end sub

sub cz
dim key,type3,clas,cur,rowcount,i
 clas=Session("clas")
type3=request("type3")
key=request("key")
set rs=Server.CreateObject("Adodb.Recordset")
sql="select user.*, ly.* from ly,user where ly."&type3&" like '%"&key&"%' and user.username=ly.username and class = '" &clas& "' order by date desc"
rs.open sql,conn,1,3
if rs.eof then
		%>
                             怎么一个也没有找到啊,真够纳闷的!<br>
<a href='javascript:history.go(-1)'><font color="#FF0000">回头重来</font></a>
				                <%else
cur=request.form("cur")
if cur="" then
cur=1
end if
rs.pagesize=10
rs.absolutepage=cint(cur)
rowcount=0%>
               <table width="100%"  cellspacing="0">
                            <tr> <form name="form1" method="post" action="?type2=cz">
                              <td> <span class="style2">我要留言</span>         留言搜索  条件:
                                <select name="type3" size="1">
                                  <option value="title" selected>标题</option>
                                  <option value="content">内容</option>
                                  <option value="username">作者</option>
                                </select>                                
                                 关键字:
                                    <input name="key" type="text" id="key"> 
                                    <input type="submit" name="Submit" value="查找">
                                  (支持模糊查询) </td> 
                            </form>
                            </tr>
               <%do while not rs.eof and rowcount<rs.pagesize%>
			   <tr>
                              <td>
<table width="100%" border="1" cellpadding="1"  cellspacing="1" bordercolor="#EFDA9A">
                                <tr>
                                  <td width="26%"><div align="center">姓名:<%=rs("name")%></div></td>
                                  <td width="74%">标题:<span class="style2"><%=rs("title")%></span>            短信 资料 邮件 <a href="http://search.tencent.com/cgi-bin/friend/user_show_info?ln=557563">QQ</a> 主页</td>
                                </tr>
                                <tr>
                                  <td><p><a href="../datum.asp?username=<%=rs("Username")%>" title="金钱:<%=rs("money")%>元 留言:<%=rs("lycount")%>条"><%=showuserpic(rs("userface"),rs("width"),rs("height"))%></a><br>
                                    <br>
                                    用户名:<%=rs("username")%><br>
                                          金钱:<%=rs("money")%>元<br>
										  留言:<%=rs("lycount")%>条<br>
                                          登录:<%=rs("userlogins")%>次</p>
                                    </td>
                                  <td valign="top">内容:<%=rs("content")%><BR>
                                    <br>
                                    <br>
                                    <br>
                                    <span class="style2">个人座右铭:<%=rs("usersign")%></span></td>
                                </tr>
                                <tr>
                                  <td><div align="center">发表:<%=rs("date")%></div></td>
                                  <td>IP:<%=rs("ip")%>                  <a href="?type2=edit&ad=<%=rs("id")%>">编辑</a>  <a href="?type2=del&ad=<%=rs("id")%>&use=<%=rs("username")%>" onClick="return confirm('真的要删除?')">删除</a></td>
                                </tr>
                              </table>
							  </td>
                            </tr>
<%rowcount=rowcount+1
				rs.movenext
      loop%>
                            <tr>
                              <td> <table width="100%"  border="0">
  <tr><form name="form2" method="post" action=""><TD align=left bgcolor="#FAF4E1"><span class="style2">共<%=rs.recordcount%>条  分<%=rs.pagecount%>页  每页10条   当前页次:<%=cur%>/<%=rs.pagecount%>                 
    转到: 
                      <select name="cur" size="1" onchange="javascript:submit()">
  <%for i = 1 to rs.pagecount%>              
    <option value="<%=i%>" <%if i=cint(cur) then%> selected <%end if%>>第<%=i%>页 </option>   
    <%next%>   
                      </select>
                      <%
  rs.close
	 set rs=nothing%>
</span></td>
  </form>
  </tr>
</table></td>
                            </tr></table>
							<%end if%>
<%end sub%>
                        </DIV></TR></TBODY>
                  </TABLE>
</TD></TR></TBODY></TABLE></TD></TR></TABLE></TD></TR></TBODY></TABLE>
<!--#include file="../bottom.asp"--></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -