166 lines
5.4 KiB
Plaintext
166 lines
5.4 KiB
Plaintext
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
|
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
|
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
|
|
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
|
|
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
|
|
|
|
<!DOCTYPE html>
|
|
<html lang="ko">
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>모바일센터 관리시스템</title>
|
|
<script src="<c:out value="/js/jquery-3.5.1.min.js" />"></script>
|
|
<script src="<c:out value="/js/bootstrap.min.js" />"></script>
|
|
<link href="<c:out value="/css/normalize.css" />" rel="stylesheet">
|
|
<link href="<c:out value="/css/bootstrap.min.css" />" rel="stylesheet">
|
|
<link href="<c:out value="/css/style.css" />" rel="stylesheet">
|
|
</head>
|
|
<body>
|
|
<%@ include file="../include/header.jsp"%>
|
|
<section class="section">
|
|
<div class="section_content">
|
|
<form:form commandName="userVO" name="updateForm" id="updateForm" action="/admin/userUpdate" method="post">
|
|
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" />
|
|
<input type="hidden" name="userid" value="${userVO.userid}" />
|
|
<div class="join_top">
|
|
<h2><span class="glyphicon glyphicon-edit"></span> 회원 정보 수정</h2>
|
|
</div>
|
|
<table class="join_table">
|
|
<tbody>
|
|
<tr>
|
|
<th>아이디</th>
|
|
<td>${userVO.userid}</td>
|
|
</tr>
|
|
<tr>
|
|
<th>비밀번호</th>
|
|
<td>
|
|
<p><label><input type="checkbox" id="changePw" /> 비밀번호 변경</<label></p>
|
|
<input type="password" class="form-control" id="password" name="password" value="" disabled="true" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>비밀번호 확인</th>
|
|
<td><input type="password" class="form-control" id="passwordCheck" name="passwordCheck" value="" disabled="true" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>이름</th>
|
|
<td><input type="text" class="form-control" name="name" id="name" value="${userVO.name}" /></td>
|
|
</tr>
|
|
<tr>
|
|
<th>소속기관</th>
|
|
<td><input type="text" class="form-control" name="company" id="company" value="${userVO.company}" /></td>
|
|
</tr>
|
|
<tr>
|
|
<th>연락처</th>
|
|
<td><input type="text" class="form-control" name="phonenum" id="phonenum" value="${userVO.phonenum}"/></td>
|
|
</tr>
|
|
<tr>
|
|
<th>이메일</th>
|
|
<td>
|
|
<div>
|
|
<input type="text" class="form-control" name="email" id="email" value="${userVO.email}" />
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<c:if test="${userVO.auth ne '99'}">
|
|
<tr>
|
|
<th>권한</th>
|
|
<td>
|
|
<label class="auth-label">
|
|
<input type="radio" name="auth" value="2"
|
|
<c:if test="${userVO.auth eq '2'}">checked</c:if>
|
|
/> 사용자
|
|
</label>
|
|
<label class="auth-label">
|
|
<input type="radio" name="auth" value="1"
|
|
<c:if test="${userVO.auth eq '1'}">checked</c:if>
|
|
/> 관리자
|
|
</label>
|
|
</td>
|
|
</tr>
|
|
</c:if>
|
|
</tbody>
|
|
</table>
|
|
<div class="join_top" style="margin-top:20px;">
|
|
<p class="search_p1">
|
|
<input class="btn btn-primary" type="button" value="목록" onclick="history.go(-1)" />
|
|
</p>
|
|
<p class="search_p2">
|
|
<c:choose>
|
|
<c:when test="${userVO.auth eq '99'}">
|
|
<input type="button" class="btn btn-primary" value="승인" onclick="confirmBtn('${item.userid}','2'); return false;" />
|
|
<input type="button" class="btn btn-primary" value="삭제" onclick="confirmBtn('${item.userid}','-1'); return false;" />
|
|
</c:when>
|
|
<c:otherwise>
|
|
<input class="btn btn-primary" type="button" value="수정" onclick="update();" />
|
|
</c:otherwise>
|
|
</c:choose>
|
|
</p>
|
|
</div>
|
|
</form:form>
|
|
</div>
|
|
</section>
|
|
|
|
<script type="text/javascript">
|
|
$(function(){
|
|
$("#changePw").click(function(){
|
|
if($(this).is(":checked")){
|
|
$("#password").attr("disabled", false);
|
|
$("#passwordCheck").attr("disabled", false);
|
|
}else{
|
|
$("#password").attr("disabled", true);
|
|
$("#passwordCheck").attr("disabled", true);
|
|
}
|
|
});
|
|
});
|
|
|
|
function update() {
|
|
var changePw = $("#changePw").is(":checked");
|
|
var pw1 = $('#password').val();
|
|
var pw2 = $('#passwordCheck').val();
|
|
var name = $('#name').val();
|
|
var company = $('#company').val();
|
|
var tell = $('#phonenum').val();
|
|
var email_1 = $('#email').val();
|
|
|
|
if (changePw && pw1 == "") {
|
|
alert('비밀번호를 입력해주세요');
|
|
$('#password').focus();
|
|
return;
|
|
} else if (changePw && pw2 == "") {
|
|
alert('비밀번호를 입력해주세요');
|
|
$('#passwordCheck').focus();
|
|
return;
|
|
} else if (changePw && (pw1 != pw2)) {
|
|
alert('비밀번호가 일치하지 않습니다.');
|
|
$('#pass').focus();
|
|
return;
|
|
} else if (name == "") {
|
|
alert('이름을 입력해주세요');
|
|
$('#name').focus();
|
|
return;
|
|
} else if (company == "") {
|
|
alert('소속기관을 입력해주세요');
|
|
$('#company').focus();
|
|
return;
|
|
} else if (tell == "") {
|
|
alert('연락처를 입력해주세요');
|
|
$('#phone_num').focus();
|
|
return;
|
|
} else if (email_1 == "") {
|
|
alert('이메일을 입력해주세요');
|
|
$('#email').focus();
|
|
return;
|
|
} else {
|
|
$("#updateForm").submit();
|
|
}
|
|
}
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|