www.gusucode.com > 维六酷博客管理系统 1.1源码程序 > master/myinfoProperty.asp
<!--#include file="check.asp"--> <!-- #include file="../inc/conn.asp" --> <!-- #include file="../inc/function.asp" --> <!--#include file="../inc/asppage.asp"--> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>myinfoproperty</title> <link href="css.css" rel="stylesheet" type="text/css"> <script type="text/javascript"> function del(id) { var ok; ok=confirm("删除后不可恢复!您确定要删除此属性吗?"); if (ok==true) { window.location="myinfoproperty.asp?action=del&id="+id; } else {} } </script> </head> <body topmargin="10" background="images/bg1024.gif"> <% Sub Head() Response.Write "<table cellpadding=""5"" cellspacing=""1"" border=""0"" width=""98%"" class=""tableBorder"" align=center><tr><th height=25>属性</th></tr><tr class=""tdbg"">"&_ "<td width=""66%""><a href=""favorite.asp"">收藏夹首页</a> <a href=""myinfoproperty.asp"">属性管理</a> | <a href=""myinfoproperty.asp?action=add"">添加属性</a> </td></tr></table><br>" End Sub Call Head() action=Request("action") Select Case action Case "add" Call add() Case "save" Call save() Case "edit" Call edit() Case "editsave" Call editSave() Case "del" Call del() Case else Call show() End Select %> <% Sub save() proterty=RequestFormStr("proterty") cindex=RequestFormNum("cindex") If proterty="" Then Call MessageBox("请输入属性名称!","") Response.End End If set rs=Server.CreateObject("ADODB.Recordset") sql="select * from myinfoproperty" rs.open sql,conn,1,3 rs.addnew rs("proterty")=proterty rs("cindex")=cindex rs.update rs.close Call MessageBox("添加属性成功!","myinfoproperty.asp") End Sub Sub editSave() id=RequestFormNum("id") If id<>0 then proterty=RequestFormStr("proterty") cindex=RequestFormNum("cindex") set rs=Server.CreateObject("ADODB.Recordset") sql="select * from myinfoproperty Where id="& id &"" rs.open sql,conn,2,3 If Not rs.eof then rs("proterty")=proterty rs("cindex")=cindex rs.update End If rs.close Call MessageBox("修改属性成功!","myinfoproperty.asp") End If End Sub 'del Sub del() id=RequestQueryNum("id") If id<>0 Then 'conn.Execute("delete From myinfoproperty Where id="& id &"") Call MessageBox("删除成功!","myinfoproperty.asp") End If End Sub Sub show() sql="Select * From myinfoproperty Order by id desc" Set mypage=new xdownpage '创建对象 mypage.getconn=conn '得到数据库连接 mypage.getsql=sql mypage.pagesize=20 '设置每一页的记录条数据为5条 set rs=mypage.getrs() '返回Recordset 'Set rs=conn.Execute("Select * From myinfoproperty Order by id desc") %> <table width="98%" border="0" class="tableBorder" align=center cellpadding="2" cellspacing="1" bgcolor="#FFFFFF"> <tr> <th height="25" colspan="5">属性</th> </tr> <tr> <td class=Forumrow width="100">编号</td> <td class=Forumrow>类名</td> <td class=Forumrow width="50">排序</td> <td class=Forumrow align="center" width="200">操作</td> </tr> <% for i=1 to mypage.pagesize If rs.eof Then Exit for End If %> <tr> <td class=Forumrow><%=rs("id")%></td> <td class=Forumrow><a href="favorite.asp?cprotertyid=<%=rs("id")%>"><%=rs("proterty")%></a></td> <td class=Forumrow><%=rs("cindex")%></td> <td class=Forumrow align="center"> <a href="?action=edit&id=<%=rs("id")%>">改名</a> <a href="javascript:del(<%=rs("id")%>)">删除</a></td> </tr> <% rs.MoveNext Next %> <tr align="center"><td colspan="4"td><%mypage.showpage() %></td></tr> </table> <% End Sub Sub add() %> <table width="98%" border="0" class="tableBorder" align=center cellpadding="2" cellspacing="1" bgcolor="#FFFFFF"> <form name="add" method="post" action="?action=save"> <tr> <th height="25" colspan="3">添加属性</th> </tr> <tr> <td width="35%" height="25" align="right" class=Forumrow>属性名称:</td> <td width="180" align="left" class=Forumrow> <input name="proterty" type="text" value="" size=20 style="width:150"></td> <td height="30" class=Forumrow> <input type="submit" name="Submit" value="提 交" class="input1"></td> </tr> </form> </table> <% End Sub Sub edit() id=RequestQueryNum("id") Set rs=conn.Execute("Select * From myinfoproperty Where id="& id &"") If Not rs.eof Then %> <table width="98%" border="0" class="tableBorder" align=center cellpadding="2" cellspacing="1" bgcolor="#FFFFFF"> <form name="add" method="post" action="?action=editsave"> <input type="hidden" name="id" value="<%=id%>"> <tr> <th height="25" colspan=2>修改属性</th> </tr> <tr> <td width="35%" height="25" align="right" class=Forumrow>所属属性</td> <td width="65%" align="left" class=Forumrow> <input name="proterty" type="text" value="<%=rs("proterty")%>" size=20 style="width:150"></td> </tr> <tr> <td width="35%" height="25" align="right" class=Forumrow>排序</td> <td width="65%" align="left" class=Forumrow> <input name="cindex" type="text" size=20 value="<%=rs("cindex")%>" style="width:150">(0表示系统默认排序)</td> </tr> <tr align="center"> <td height="30" colspan=2 class=Forumrow><input type="submit" name="Submit" value="提 交" class="input1"></td> </tr> </form> </table> <% End If End Sub %> </body> </html>