一个经过完善设计的经典网上购物系统

源代码在线查看: editnews.asp

软件大小: 1846 K
上传用户: philipsx
关键词: 网上购物
下载地址: 免注册下载 普通下载 VIP

相关代码

				
								response.Write "alert('网络超时或您还没有登陆!');window.location.href='login.asp';"
				response.End
				else
				if session("flag")>1 then
				response.Write "您没有此项目管理权限!"
				response.End
				end if
				end if
				 if request.QueryString("action")="del" then
				conn.execute "delete from shop_news where newsid in ("&request("selectdel")&")"
				response.Redirect "editnews.asp"
				end if %>
				Untitled Document
				
				
				
				
				
				
				 
				
				                              								Const MaxPerPage=20 
				   				dim totalPut   
				   				dim CurrentPage
				   				dim TotalPages
				   				dim j
				   				dim sql
				    				if Not isempty(request("page")) then
				      				currentPage=Cint(request("page"))
				   				else
				      				currentPage=1
				   				end if 
						 set rs=server.createobject("adodb.recordset")
					rs.open "select newsid,newsname,addname,adddate from shop_news order by adddate desc",conn,1,1
						  
								if err.number0 then
								response.write "数据库中无数据"
								end if
								
				  				if rs.eof And rs.bof then
				       				Response.Write " 您还没有添加新闻!"
				   				else
					  				totalPut=rs.recordcount
				
				      				if currentpage				          				currentpage=1
				      				end if
				
				      				if (currentpage-1)*MaxPerPage>totalput then
					   					if (totalPut mod MaxPerPage)=0 then
					     					currentpage= totalPut \ MaxPerPage
					   					else
					      					currentpage= totalPut \ MaxPerPage + 1
					   					end if
				      				end if
				
				       				if currentPage=1 then
				            			showContent
				            			showpage totalput,MaxPerPage,"editnews.asp"
				       				else
				          				if (currentPage-1)*MaxPerPage				            				rs.move  (currentPage-1)*MaxPerPage
				            				dim bookmark
				            				bookmark=rs.bookmark
				            				showContent
				             				showpage totalput,MaxPerPage,"editnews.asp"
				        				else
					        				currentPage=1
				           					showContent
				           					showpage totalput,MaxPerPage,"editnews.asp"
					      				end if
					   				end if
				   				   				end if
				
				   				sub showContent
				       			dim i
					   			i=0
				
							%>
				                            
				                                
												 
				         						首页新闻管理
				        						
				                                 
				                                新闻主题
				                                发布人
				                                发布时间
				                                选 择
				                                  
				                                  
				                                   
				                                    
				                                    
				                                    
				                                    
													
				                                    
				                                  
				                                  							if i>=MaxPerPage then Exit Do
							rs.movenext
						  loop
						  rs.close
						  set rs=nothing%>
				                                   
				                                     
													
													全选
													
				                                    
				                                  
				                                
				                              
				                              								End Sub   
				  
								Function showpage(totalnumber,maxperpage,filename)  
				  				Dim n
				  				
								If totalnumber Mod maxperpage=0 Then  
									n= totalnumber \ maxperpage  
								Else
									n= totalnumber \ maxperpage+1  
								End If
								
								Response.Write ""  
								Response.Write " "  
								If CurrentPage									Response.Write "首页 上一页 "  
								Else  
									Response.Write "首页 "  
									Response.Write "上一页 "  
								End If
								
								If n-currentpage									Response.Write "下一页 尾页"  
								Else  
									Response.Write ""  
									Response.Write "下一页 尾页"  
								End If  
									Response.Write " 页次:"&CurrentPage&"/"&n&"页 "  
									Response.Write " 共有"&totalnumber&"条新闻 " 
									Response.Write "转到:"  
									Response.Write " "  
								End Function  
							%>
				
				
				
				 
				
				
				
				function mm()
				{
				   var a = document.getElementsByTagName("input");
				   if(a[0].checked==true){
				   for (var i=0; i				      if (a[i].type == "checkbox") a[i].checked = false;
				   }
				   else
				   {
				   for (var i=0; i				      if (a[i].type == "checkbox") a[i].checked = true;
				   }
				}
							

相关资源