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

📄 admin.js

📁 java + sqlserver2000编写的一个网上购书系统,实现了一些基本的功能,但对于初学者来说这个系统已经足以起到帮助作用
💻 JS
字号:
function validate(){//正则表达式
   var flag=false;	
   if(document.form1.AdminName.value==""){
		  alert("请输入用户帐号!!!");
		  document.AdminName.focus();

          }else if(document.form1.AdminPas.value==""){
		alert("请输入密码!!!");				  					document.AdminPas.focus();
	}else if(document.form1.AuthCode.value==""){
		alert("请输入验证码!!!");				  					document.AuthCode.focus();
	}
	else{
		flag=true;
	}

  return flag;
}
function exitlogin(){
	var a=confirm("你确定要退出系统吗?");
	if(a==true)
	{
	parent.window.location.href="exit.jsp";
	}
}
function sendwaydel(obj){
	var a=confirm("你确实要删除该送货方式吗?");
	if(a==true)
	{
	window.location.href="sendway_del.jsp?ID="+obj;
	}
}
function upsend(id){
	var a=confirm("你确实要修改该送货方式吗?");
	  if(a==true)
	  {
	  window.location.href="upsendway.jsp?ID="+id ;
	  }
}

function paydel(id){
	var a=confirm("你确实要删除该支付方式吗?");
	if(a==true)
	{
	window.location.href="payway_del.jsp?ID="+id;
	}}
function payup(id){
	var a=confirm("你确实要修改该支付方式吗?");
	if(a==true)
	window.location.href="uppayway.jsp?ID="+id;}

function uplist(id)
	{
		var a=confirm("你确实要修改该订单吗?");
		if(a==true)
		window.location.href="uplist.jsp?ID="+id;
	}
function listdel(id)
	{
		var a=confirm("你确定要删除该订单吗?");
		if(a==true)
		window.location.href="dellist.jsp?ID="+id;
	}
function listprint(id)
	{

		var a=confirm("你确实要打印该订单吗?");
		if(a==true)
		window.open("printlist.jsp?ID="+id);
	}
function addsendway(){
	if(document.addsw.s_way.value=="" || document.addsw.s_mon1.value=="" || document.addsw.s_wei.value=="" || document.addsw.s_mon2.value=="" || document.addsw.s_intro.value=="")
	{alert("请输入完整的信息!");
	return false;
	}
}

function chalist(){
	if(document.solistform.riqi1.value=="" || document.solistform.riqi2.value==""){
		alert("请选择日期!");
		return false;}
}
function addpayway(){
	if(document.addpw.p_way.value=="" || document.addpw.p_intro.value=="")
	{alert("请输入完整的信息!");
		return false;
		}
}
function admindele(){
  	 var check=0;
  	 var count=0;
  	  for(var i=0;i<checkform.length;i++){  	
		 if(document.checkform[i].checked==1){
		  		 check=1;
		  		 count++;
  	  		}
  	 	}
  	 if(count>=1)
		  var a=confirm("你确定要删除该管理员吗?");
		  if(a==true)
		  	   {
		  		document.checkform.action="admin_del.jsp";
		  		document.checkform.submit();
		  		 }		 
      if(check==0) 
           {
             alert("你没有选中有效的行!");   
             
           } 
  }
  function sous(){
	if((document.sobook.book.value=="请输入关键字" && document.sobook.soulei.value=="") || 	(document.sobook.book.value=="" && document.sobook.soulei.value==""))
	{ alert("请输入搜索关键字!");
	  return false;}
}
function souren(){
	if(document.selForm.select.value=="")
	{ alert("请在下拉列表中选择你要搜索的管理员!");
	  return false;}
}
  function suser(){
	if((document.userform.key.value=="请输入关键字" && document.userform.souser.value=="") || 		(document.userform.key.value=="" && document.userform.souser.value==""))
	{
	alert("请输入搜索关键字!");
	return false;}
}

  function bookdele(){
  	 var check=0;
  	 var count=0;
  	  for(var i=0;i<checkform.length;i++){  	
		 if(document.checkform[i].checked==1){
		  		 check=1;
		  		 count++;
  	  		}
  	 	}
  	 if(count>=1)
		  var a=confirm("你确定要删除该书吗?");
		  if(a==true)
		  	   {
		  		document.checkform.action="book_del.jsp";
		  		document.checkform.submit();
		  		 }		 
      if(check==0) 
           {
             alert("你没有选中有效的行!");   
             
           } 
  }
  
  function messdele(){
  	 var check=0;
  	 var count=0;
  	  for(var i=0;i<checkform.length;i++){  	
		 if(document.checkform[i].checked==1){
		  		 check=1;
		  		 count++;
  	  		}
  	 	}
  	 if(count>=1)
		  var a=confirm("你确定要删除该新闻吗?");
		  if(a==true)
		  	   {
		  		document.checkform.action="mess_del.jsp";
		  		document.checkform.submit();
		  		 }		 
      if(check==0) 
           {
             alert("你没有选中有效的行!");   
             
           } 
  }
  function leavedele(){
  	 var check=0;
  	 var count=0;
  	  for(var i=0;i<checkform.length;i++){  	
		 if(document.checkform[i].checked==1){
		  		 check=1;
		  		 count++;
  	  		}
  	 	}
  	 if(count>=1)
		  var a=confirm("你确定要删除该留言吗?");
		  if(a==true)
		  	   {
		  		document.checkform.action="leaveword_del.jsp";
		  		document.checkform.submit();
		  		 }		 
      if(check==0) 
           {
             alert("你没有选中有效的行!");    
           } 
  }
  function bookupp(){
   	var check2=0;
	var count=0;
  	  for(var i=0;i<checkform.length;i++){  	
		 if(document.checkform[i].checked==1)
		 {	
		    check2=1;
		    count++;
		  }
		}	
	   if(count==1)
		{var a=confirm("你确定要修改该书的信息吗?");
			  if(a==true)
			  {	
			  document.checkform.action="upbook.jsp";
			  document.checkform.submit(); 
	  	  	  }}
	    else if(count>1)
			{alert("请注意,你一次只能修改一本书的信息!");}
    if(check2==0) 
           {
             alert("你没有选中有效的行!");   
             return false;
           } 
  }

  function updata1()
 {
  	  var check2=0;
	  var count=0;
  	  for(var i=0;i<checkform.length;i++){  	
		 if(document.checkform[i].checked==1)
		 {	
		    check2=1;
		    count++;
		  }}	
  	   if(count==1){
		var a=confirm("你确定要修改该管理员的信息吗?");
	   	if(a==true)
		 {	
		  document.checkform.action="upadmin.jsp";
		  document.checkform.submit(); 		
  		 }}
	  else if(count>1)
			{alert("请注意,你一次只能修改一个管理员的信息!");}
       
	 if(check2==0) 
           {
             alert("你没有选中有效的行!");   
             return false;
           } 
 }
  function check()
  {  for(var i=0;i<checkform.length;i++)
    {
	  document.checkform[i].checked=1;	
	 }
  }
  function check2()
  {  for(var i=0;i<checkform.length;i++)
    	{
		  if(document.checkform[i].checked==1)
		    {document.checkform[i].checked=0;}	
		  else
		      {document.checkform[i].checked=1; }}
  }
  function checkfan()
  {  for(var i=0;i<checkform.length;i++)
    	{
		  if(document.checkform[i].checked==1)
		    {document.checkform[i].checked=0;}	
		  else
		      {document.checkform[i].checked=1; }}
  }
  function gotoPage(topage){
  		location.href="user.jsp?page="+topage;
  }
  function gotoPagenext(topage){
		location.href="admin.jsp?page="+topage;
  }
  function gotoPagebook(topage){
		location.href="bookinfo.jsp?page="+topage;
  }
  function gotoPagemess(topage){
		location.href="message.jsp?page="+topage;
  }
   function gotoPageleave(topage){
		location.href="leaveword.jsp?page="+topage;
  }
  function gotoPagerep(topage){
		location.href="repeatonly.jsp?page="+topage;
  }
  function gotoPagenorep(topage){
		location.href="unrepeat.jsp?page="+topage;
  }
  function gotoPageorder(topage){
		location.href="orderlist.jsp?page="+topage;
  }
  function gotoPagelogin(topage){
		location.href="come.jsp?page="+topage;
  }
  function gotoPagesoulogin(topage){
		location.href="login_so.jsp?page="+topage;
  }
  function admintian()
  {
  	if(document.addform.text1.value==""){
			alert("请输入管理员帐号!!!");
			return false;
			 document.addform.text1.focus();
    }else if(document.addform.password2.value==""){
			alert("请输入密码!!!");
			return false;
			document.addform.password2.focus();}
	else{
		return true;
		//document.addform.submit();
}
  }

 function bsdel(){
  	 var check=0;
  	 var count=0;
  	  for(var i=0;i<bsform.length;i++){  	
		 if(document.bsform[i].checked==1){
		  		 check=1;
		  		 count++;
  	  		}}
  	  	 if(count>=1)
		  	var a=confirm("你确定要删除该图书类吗?");
		  	   if(a==true)
		  	   {
		  	        document.bsform.action="booksort_del.jsp";
		  		document.bsform.submit();
		  		 }	 
      if(check==0) 
           {
             alert("你没有选中有效的行!");       
           } 
  }
  function bsup()
 {
  	var check2=0;
	var count=0;
  	  for(var i=0;i<bsform.length;i++){  	
		 if(document.bsform[i].checked==1)
		 {	
		    check2=1;
		    count++;
	         }}
	if(count==1){
	var a=confirm("你确定要修改该图书类的信息吗?");
		if(a==true)
		 {	
		  document.bsform.action="upbooksort.jsp";
		  document.bsform.submit(); 	
  	  	}}
	else if(count>1)
			{alert("请注意,你一次只能修改一种图书分类的信息!");}
        if(check2==0) 
           {
             alert("你没有选中有效的行!");   
             return false;
           } 
 }
  function bstian()
  {
  	if(document.bsform.text1.value==""){
			alert("请输入图书ID!!!");
			return false;
			 document.bsform.text1.focus();
    }else if(document.bsform.text2.value==""){
			alert("请输入图书类别名!!!");
			return false;
			document.bsform.text2.focus();}
	else{
		document.bsform.action="booksort_add.jsp";
		document.bsform.submit();}
  }
function dele()
   {
  	 var check=0;
  	 var count=0;
  	  for(var i=0;i<checkform.length;i++){  	
		 if(document.checkform[i].checked==1){
		  		 check=1;
		  		 count++;} }
  	  	if(count>=1)
		  	var a=confirm("你确定要删除该用户吗?");
      			if(a==true)
		  	   {
		  	    document.checkform.action="user_del.jsp";
		  	    document.checkform.submit();}	
      	if(check==0) 
           {
             alert("你没有选中有效的行!");         
           } }
  function check()
  {  for(var i=0;i<checkform.length;i++)
    {
	  document.checkform[i].checked=1;	
	 }
  }
  function check2()
  {  for(var i=0;i<checkform.length;i++)
    	{
		  	if(document.checkform[i].checked==1)
		  	  {document.checkform[i].checked=0;}	
		    else
		      {document.checkform[i].checked=1;  }
		}
  }
  
  function tianjia()
  {
  	if(document.addform.text1.value==""){
			alert("请输入用户名!!!");
			return false;
			 document.addform.text1.focus();
    }else if(document.addform.password2.value==""){
			alert("请输入密码!!!");
			return false;
			document.addform.password2.focus();}
	else{
		return true;
}
  }

⌨️ 快捷键说明

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