www.gusucode.com > 云枫工作室企业网站源代码第五版 1.0 > docc/admin/cpbigstyle.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <!--#include file="conn.asp"--> <!--#include file="check.asp"--> <!--#include file="include.asp"--> <% Dim MM_TableName '表名 Dim MM_DatabaseStr '数据库各项 Dim MM_FormStr '表单各项 Dim MM_SqlKey '条件数据库项 Dim MM_SqlValue '条件值 Dim MM_SqlQuery '最终执行语句 Dim MM_ReturnPath '执行成功后返回的路径 Dim MM_FileName '自身文件名 MM_TableName = "cpbigstyle" MM_SqlKey = "sqlindex" MM_SqlValue = Request.Form("MM_recordId") MM_ReturnPath = GetReturnPath() MM_FileName = GetFileName() Dim MM_AddDataPage '添加数据的页面 Dim MM_ModDataPage '添加数据的页面 Dim MM_FindSql '查询执行语句 Dim MM_Count '一页最大显示条数 Dim MM_re_count '记录总个数 Dim MM_re_number1 '记录开始号 Dim MM_re_number2 '记录结束号 Dim MM_NowPage '当前页码 Dim MM_NowPagePath '当前页面路径 MM_NowPagePath = CStr(Request.ServerVariables("SCRIPT_NAME")) MM_NowPage = Request.QueryString("page") MM_AddDataPage = "cpbigstyleadd.asp" MM_ModDataPage = "cpbigstylemod.asp" MM_FindSql = "select * from " & MM_TableName & " order by sqlnumber" MM_Count = 15 '-----------------------------------以上为设置信息------------------------------------------- set re = conn.Execute(MM_FindSql) MM_re_count = re.RecordCount If (MM_re_count = -1) Then MM_re_count=0 While (Not re.EOF) MM_re_count = MM_re_count + 1 re.MoveNext Wend if MM_re_count > 0 then re.MoveFirst end if end if if MM_NowPage = "" then MM_NowPage = 1 end if Temp = MM_re_Count/MM_count MaxPage = Cint(Temp) if Temp > MaxPage then MaxPage = MaxPage + 1 end if '以下是删除记录的代码 if (Request.Form("MM_delete") <> "") and (Request.QueryString("style") = "") then Dim MM_Delete_Sql MM_Delete_Sql = "delete from " & MM_TableName & " where sqlindex=" & Request.Form("MM_recordId") conn.Execute(MM_Delete_Sql) Response.Redirect(MM_ReturnPath) end if %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>产品类别系统系统</title> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body topmargin="0" bgcolor="#799AE1"> <table width="100%" height="100%" border="0" align="center" cellspacing="0"> <tr height="60" valign="bottom" bgcolor="#668ED4"> <td height="63" align="center" valign="middle" bgcolor="#668ED4" class="unnamed1"><img src="images/toplogo.gif" width="500" height="60"></td> </tr> <tr bgcolor="#9ebef5"> <td height="300" valign="top" bgcolor="#668ED4" class="unnamed1"> <table width="100%" border="0"> <tr> <td width="100%"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="91%" height="23" valign="bottom" background="images/menu_bk.gif"><font color="#FFFFFF">共有<%=MM_re_count%>条记录,现在显示的是第<%=((MM_NowPage*MM_Count)-MM_Count+1)%>条至第 <% if (((MM_NowPage*MM_Count))) <= MM_re_count then response.write(MM_NowPage*MM_Count) else response.write((MM_Count-((MM_NowPage*MM_Count)-MM_re_count)) + ((MM_NowPage*MM_Count)-MM_Count)) end if %> 条!</font></td> <td width="9%" valign="bottom" background="images/menu_bk.gif"><a href="<%=MM_AddDataPage%>"><font size="2" color="#FFFFFF"><b>添加大类</b></font></a></td> </tr> </table> <table width="100%" height="100%" align="center" cellpadding="1" cellspacing="1" bordercolor="#ADADC9" bgcolor="#666699"> <tr bgcolor="#799AE1"> <td width="50"> <div align="center"><font color="#FFFFFF">排序/ID</font></div></td> <td> <div align="center"><font color="#FFFFFF"><span class="style4">大类名称</span></font></div></td> <td width="133"> <div align="center"><font color="#FFFFFF">日期</font></div></td> <td width="118"> <div align="center"><font color="#FFFFFF"><span class="style4">操作</span></font></div></td> </tr> <% dim TheIndex TheIndex = 0 While (NOT re.EOF) TheIndex = TheIndex + 1 if (TheIndex > (MM_NowPage*MM_Count)-MM_Count) and (TheIndex <= (MM_NowPage*MM_Count)) then %> <tr bgcolor="#DFEFFF"> <td width="50"> <div align="center"><%=(re.Fields.Item("sqlnumber").Value)%>/<%=(re.Fields.Item("sqlindex").Value)%></div></td> <td width="328"><a href="cpsmallstyle.asp?style=<%=re.Fields.item("sqlindex")%>"><%=re.Fields.item("sqlstyle")%></a></td> <td width="133"> <div align="center"><%=(re.Fields.Item("sqldate").Value)%></div></td> <form ACTION="<%=MM_ReturnPath%>" METHOD="POST" name="form1"> <td width="118"><input type="button" name="Submit2" value="修 改" onClick="vbscript:window.location.href='<%=MM_ModDataPage%>?id=<%=re.Fields.item("sqlindex")%>'"> <input type="submit" name="Submit3" value="删 除" onClick="javascript:if(!confirm('如果还存在该类别的产品,建议不要删除该类!确定删除吗?')) return false; "> <input type="hidden" name="MM_delete" value="form1"> <input type="hidden" name="MM_recordId" value="<%= re.Fields.Item("sqlindex").Value %>"> </td> </form> </tr> <% end if re.MoveNext() Wend %> </table></td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><div align="center"> <% response.write("<a href=" & NowPagePath & "?page=1><</a> ") if (MM_NowPage-5) < 1 then ThePage = 1 else ThePage = MM_NowPage-5 end if for i=ThePage to (MM_NowPage-1) response.write("<a href=" & MM_NowPagePath & "?page=" & i & ">" & i & "</a> ") next response.write(MM_NowPage & " ") if (MM_NowPage+5) > MaxPage then ThePage = MaxPage else ThePage = MM_NowPage+5 end if for i=(MM_NowPage+1) to ThePage response.write("<a href=" & MM_NowPagePath & "?page=" & i & ">" & i & "</a> ") next response.write("<a href=" & MM_NowPagePath & "?page=" & MaxPage & ">></a>") %> </div></td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <div align="left">注意:请认真操作,删除后不可恢复!请点击大类名称,对子小类进行管理。</div></td> </tr> </table></td> </tr> </table> </body> </html> <% re.Close() Set re = Nothing %>