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

📄 roleqx.jsp

📁 学生信息管理系统主要包括学生学籍管理
💻 JSP
字号:
<%@ page contentType="text/html; charset=GB2312"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>学生管理系统</title>
		<link rel="stylesheet" type="text/css" media="all" href="./../../css/Style1.css"  />
		<script type="text/javascript" language="javascript">
var identity;
function updateqxlist(){
  var jsbh=document.getElementById("js").value;
  xmlhttp=getxmlhttp();
  if(xmlhttp){
    var i = Math.floor(Math.random()*1000); 
    xmlhttp.open("get","/xsglxt/updateqxlist?jsbh="+jsbh+"&mathss="+i,false);
    xmlhttp.onreadystatechange=fillqxlist;
    xmlhttp.send(null);
  }
}
function getxmlhttp(){
  if(window.XMLHttpRequest){
    xmlhttp=new XMLHttpRequest();
  }else if(typeof ActiveXObject != "undefined"){
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
  return xmlhttp;
}
function fillqxlist(){
  if (xmlhttp.readyState==4) {
   // var str="";
    var response = xmlhttp.responseText;
   // var response = xmlhttp.responseXML.documentElement;
    //alert(xmlhttp.responseText);
    var qxdiv=document.getElementById("qxdiv");
    //alert(response);
   // var rows=response.getElementsByTagName("option");
  //  str += "<table style='font-size:12px' width='100%'>";
  //  for(i=0;i<rows.length;i++){
  //    var text=rows[i].childNodes[0].firstChild.nodeValue;
  //    var value=rows[i].childNodes[1].firstChild.nodeValue;
  //    var qx=rows[i].childNodes[2].firstChild.nodeValue;
  //    if(i%5==0){
  //      str+="<tr>";
  //    }
   //   if (qx == '1'){
   //     str += "<td><input type='checkbox' value="+value+" name=qx checked='checked' >"+text+"</td>";
  //    }else{
  //      str += "<td><input type='checkbox' value="+value+" name=qx >"+text+"</td>";
  //    }
 //     if(i%5==4){
  //      str+="</tr>";
  //    }
 //   }
  //  str += "</tr></table>";
   // qxdiv.innerHTML=str;
    qxdiv.innerHTML= response;
    qxdiv.style.display="";
  }
}
function modify(){
  var jsbh=document.getElementById("js").value;
  var qx=document.modifyform.qx;
    var i = Math.floor(Math.random()*1000); 
  var url="/xsglxt/updateroleqx?jsbh="+jsbh+"&iii="+i;
  xmlhttp=getxmlhttp();
  for(i=0;i<qx.length;i++){
    if(qx[i].checked==true){
      url+="&roles=";
      url+=qx[i].value;
    }
  }
  if(xmlhttp){
    xmlhttp.open("get",url,false);
    xmlhttp.onreadystatechange=info;
    xmlhttp.send(null);
  }
  window.location.href='/xsglxt/roleqx';
}
function cancel(){
  document.getElementById("addrolediv").style.display="none";
}
function info(){
if (xmlhttp.readyState==4) {
    var response = xmlhttp.responseText;
    window.alert(response);
  }
}
function add(){
  var mc=document.adddiv.addmc.value;
  var qxs=document.adddiv.addqx;
  var ms=document.adddiv.addms.value;
  if(mc == "" && ms ==""){
    alert("请输入完整信息");
    return false;
  }
    var i = Math.floor(Math.random()*1000); 
  var url="/xsglxt/addroleqx?mc="+mc+"&ms="+ms+"&ddd="+i;
  for(i=0;i<qxs.length;i++){
    if(qxs[i].checked==true){
      url+="&qxs=";
      url+=qxs[i].value;
    }
  }
  if(xmlhttp){
    xmlhttp.open("get",url,false);
    xmlhttp.onreadystatechange=info;
    xmlhttp.send(null);
  }
  window.location.href='/xsglxt/roleqx';
}
function showadd(){
  document.getElementById("addrolediv").style.display="";
}
function showmodify(){
  document.getElementById("modifyrolediv").style.display="";
}
function remove(){
  var bh=document.getElementById("js").value;
    var i = Math.floor(Math.random()*1000); 
  var url="/xsglxt/delrole?bh="+bh+"&asdf="+i;
  if(xmlhttp){
    identity=new Date();
    xmlhttp.open("get",url,false);
    xmlhttp.onreadystatechange=info;
    xmlhttp.send(null);
  }
  window.location.href='/xsglxt/roleqx';
}
function showmodify(){
  document.getElementById("modifydiv").style.display="";
}
</script>
	</head>
	<body id="mainFrame" onload="updateqxlist()">
	   <div class="part">
		<form action="" name="modifyform">
		  <div class="part1">
            <div class="parttop">
                <div class="parttop-L1">
                    角色管理
                </div>
                <div class="parttop-R">
                    <div class="parttop-select">
                        角色名称:
						<select id="js" onchange="updateqxlist()">
						    <option value="-1" selected >请选择</option>
							<c:forEach items="${roles}" var="row">
								<option  value='<c:out value="${row.id}"/>'>
									<c:out value="${row.name}" />
								</option>
							</c:forEach>
						</select>
                    </div>
                    <div class="parttop-list"> 
                    <a href="#" onClick="showadd()">添加角色</a>
                    </div>
                    <div class="parttop-list">
                     <a href="#" onClick="showmodify()">修改角色</a>                    
                    </div>
                    <div class="parttop-list">
                     <a href="#" onClick="remove()">删除角色</a>
                    </div>
                </div>
            </div>
        </div>
        <div id="modifydiv" style="display:none">
        <div class="part2">
            <div class="parttop">
                <div class="parttop-L2">
                    拥有权限
                </div>
                <div class="parttop-R">
                </div>
            </div>
            <div class="partbody">
            <table style="font-size: 12px" border=0 width="100%">    
                	<tr class="tr1">
					    <td>
					        <div id="qxdiv" style="display:none">
					        </div>
						</td>
					</tr>
            
            </table>
            </div>
             <div class="partfoot">
                <div class="partfoot-list">
                    <span>  <a href="#" onClick="modify()"> 修 改</a> </span>
                </div>
                <div class="partfoot-list">
                    <span><a href="#" onclick="javascript:modifydiv.style.display='none'" > 取 消</a></span>
                </div>
            </div>
        </div>
        </div>
      </form>
      <form action="" name="adddiv" style="font-size:12px">
		<div id="addrolediv" style="display:none">
		   <div class="part3">
            <div class="parttop3">
                <div class="parttop-L3">
                    添加角色
                </div>
                <div class="parttop-R">
                    <table class="app">
                            <tr class="topbody">
                                <td>
                                    角色名称
                                    <input name="addmc">
                                    角色描述
                                    <input name="addms">
                                </td>
                            </tr>
                            <tr class="topbody">
                                <td>
                                </td>
                            </tr>
                    </table>
                </div>
            </div>
            <div class="partbody">
            <table style="font-size: 12px" width="100%">    
            	<c:forEach items="${qxs}" var="row" varStatus="statu">
					<c:if test="${statu.index mod 4 ==0}">
						<tr>
					</c:if>
						<td>
						<input type="checkbox" value='<c:out value="${row.id}"/>'name="addqx" />
						<c:out value="${row.name}" />
						</td>
						<!--  <c:if test="${statu.index mod 5 ==4}"></tr> </c:if> -->
				</c:forEach>
            
            </table>
            </div>
     </div>
        <div class="partfoot">
            <div class="partfoot-list">
             <a href="#" onClick="add()">添 加</a>
                
            </div>
            <div class="partfoot-list">
             <a href="#" onClick="cancel()">取 消</a>        
            </div>
       </div>          
	</div>
   </form>
</div>	
</body>
</html>

⌨️ 快捷键说明

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