WEB关于用户状态

WEB关于用户状态

jsp页面

<script type="text/javascript">
    function lock(id,isLock){
    var mag="";
     if(isLock==true){
     mag="确定要锁定嘛?";
     }else{
      mag="确定要解锁嘛?";
     }
     //1等于锁定  2等于解锁
     var lockflag="";
     if(isLock){
     lockflag="2";//如果传过来的是true 就把 2 给后台     
     }else{
     lockflag="1";
     }
     if(confirm(mag)){
     window.location.href="${pageContext.request.contextPath}/AdminList?flag=lock&id="+id+"&isLock="+lockflag;
     }
    }

    </script>

<table id="table1">
  <tr><th>ID</th><th>账号</th><th>密码</th><th>状态</th><th>时间</th><th colspan="3">操作</th></tr>
  <c:forEach var="list" items="${json}">
  <tr><td>${list.id}</td>
  <td>${list.userName}</td>
  <td>${list.password}</td>
  <td><c:choose>
  <c:when test="${list.pageIndex==1}">正常</c:when>
  <c:when test="${list.pageIndex==2}">已锁定</c:when>
  </c:choose>
  </td>
  <td>${list.time}</td>
  <td><c:if test="${list.pageIndex=='1'}"><a href="">修改</a></td></c:if>
  <td><a href=“”>删除</a></td>
  <td><c:if test="${list.pageIndex=='1'}"><a href="javascript:lock(${list.id},true)">锁定</a></c:if>
      <c:if test="${list.pageIndex=='2'}"><a href="javascript:lock(${list.id},false)">解锁</a></c:if>
      </td>
  </tr>
    </c:forEach>
  </table>