회원 정보 수정 페이지 모달로 변경.
parent
24b2c41b10
commit
5a5777a164
|
|
@ -323,7 +323,7 @@ public class AdminController {
|
|||
UserVO userVO = userService.selectUserInfo(userid);
|
||||
model.addAttribute("userVO", userVO);
|
||||
|
||||
return "admin/userInfoView";
|
||||
return "admin/html/userInfoView";
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
e.printStackTrace();
|
||||
|
|
|
|||
|
|
@ -5,14 +5,7 @@
|
|||
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
|
||||
|
||||
<script src="../../../js/admin/userinfo.js"></script>
|
||||
|
||||
|
||||
<style>
|
||||
.searchList > li{
|
||||
display: inline;
|
||||
}
|
||||
</style>
|
||||
<script src="/js/admin/userinfo.js"></script>
|
||||
|
||||
<div class="section_title">
|
||||
<!-- <p>현장 지원 시스템</p> -->
|
||||
|
|
@ -21,7 +14,7 @@
|
|||
<h1 class="h4 m-3">회원관리</h1>
|
||||
<form:form commandName="userSearchVO" name="searchForm" action="/admin/userInfo" method="get">
|
||||
|
||||
<div class="row justify-content-between bg-white mx-3 py-2"">
|
||||
<div class="row justify-content-between bg-white mx-3 py-2">
|
||||
<div class="col-auto">
|
||||
<ul class="nav nav-pills" role="tablist" style="margin-left: 16px">
|
||||
<li role="presentation" class="nav-item"><a class="nav-link ${userSearchVO.auth eq '99'?'active':''}" href="/admin/userInfo?auth=99">승인대기<span class="badge"><c:out value='${standByCount}' /></span></a></li>
|
||||
|
|
@ -61,33 +54,27 @@
|
|||
<th>전화번호</th>
|
||||
<th>이메일</th>
|
||||
<th>가입일</th>
|
||||
<c:choose>
|
||||
<c:when test="${userSearchVO.auth eq '99'}">
|
||||
<th>상태</th>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<th>권한</th>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<th>${userSearchVO.auth eq '99'?'상태':'권한'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:if test="${count >= 1}">
|
||||
<c:forEach var="item" items="${userList}" varStatus="idx">
|
||||
<c:forEach var="user" items="${userList}" varStatus="idx">
|
||||
<tr>
|
||||
<td><a href="/admin/userInfo/<c:out value='${item.userid}' />"><c:out value='${item.userid}' /></a></td>
|
||||
<td><a href="/admin/userInfo/<c:out value='${item.userid}' />"><c:out value='${item.name}' /></a></td>
|
||||
<td><a href="/admin/userInfo/<c:out value='${item.userid}' />"><c:out value='${item.company}' /></a></td>
|
||||
<td><a href="/admin/userInfo/<c:out value='${item.userid}' />"><c:out value='${item.phonenum}' /></a></td>
|
||||
<td><a href="/admin/userInfo/<c:out value='${item.userid}' />"><c:out value='${item.email}' /></a></td>
|
||||
<td class="td_date"><c:out value='${item.regdate}' /></a></td>
|
||||
<%--<a href="/admin/userInfo/<c:out value='${item.userid}' />"></a>--%>
|
||||
<td class="clickAbleObj userInfoModalBtn useridTd"><c:out value='${user.userid}' /></td>
|
||||
<td class="clickAbleObj userInfoModalBtn"><c:out value='${user.name}' /></td>
|
||||
<td class="clickAbleObj userInfoModalBtn"><c:out value='${user.company}' /></td>
|
||||
<td class="clickAbleObj userInfoModalBtn"><c:out value='${user.phonenum}' /></td>
|
||||
<td class="clickAbleObj userInfoModalBtn"><c:out value='${user.email}' /></td>
|
||||
<td class="clickAbleObj userInfoModalBtn td_date"><c:out value='${user.regdate}' /></td>
|
||||
<td>
|
||||
<c:choose>
|
||||
<c:when test="${item.auth eq '1'}">관리자</c:when>
|
||||
<c:when test="${item.auth eq '2'}">사용자</c:when>
|
||||
<c:when test="${item.auth eq '99'}">
|
||||
<input type="button" class="btn btn-outline-success" value="승인" onclick="confirmBtn('${item.userid}','2'); return false;" />
|
||||
<input type="button" class="btn btn-outline-danger" value="삭제" onclick="confirmBtn('${item.userid}','-1'); return false;" />
|
||||
<c:when test="${user.auth eq '1'}">관리자</c:when>
|
||||
<c:when test="${user.auth eq '2'}">사용자</c:when>
|
||||
<c:when test="${user.auth eq '99'}">
|
||||
<input type="button" class="btn btn-outline-success" value="승인" onclick="confirmBtn('${user.userid}','2'); return false;" />
|
||||
<input type="button" class="btn btn-outline-danger" value="삭제" onclick="confirmBtn('${user.userid}','-1'); return false;" />
|
||||
</c:when>
|
||||
</c:choose>
|
||||
</td>
|
||||
|
|
@ -115,3 +102,17 @@
|
|||
<input type="hidden" id="auth" name="auth" />
|
||||
</form:form>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="userInfoModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="userInfoModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="userInfoModalLabel">회원 정보 수정</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body" id="userInfoModalBody">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -4,17 +4,12 @@
|
|||
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
|
||||
|
||||
<script src="../../../js/admin/userinfoView.js"></script>
|
||||
<div class="row justify-content-between bg-white mx-3 py-2">
|
||||
|
||||
<form:form commandName="userVO" name="updateForm" id="updateForm" action="/admin/userUpdate" method="post">
|
||||
<div class="section_content">
|
||||
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" />
|
||||
<input type="hidden" name="userid" value="${userVO.userid}" />
|
||||
|
||||
<div class="join_top">
|
||||
<h2> <i class="bi bi-person-circle"></i> 회원 정보 수정</h2>
|
||||
</div>
|
||||
<table class="join_table">
|
||||
<tbody>
|
||||
<tr>
|
||||
|
|
@ -22,31 +17,31 @@
|
|||
<td>${userVO.userid}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>비밀번호</th>
|
||||
<th><label for="password">비밀번호</label></th>
|
||||
<td>
|
||||
<p><label><input type="checkbox" id="changePw" /> 비밀번호 변경</<label></p>
|
||||
<p><label for="changePw"><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>
|
||||
<th><label for="passwordCheck">비밀번호 확인</label></th>
|
||||
<td><input type="password" class="form-control" id="passwordCheck" name="passwordCheck" value="" disabled="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>이름</th>
|
||||
<th><label for="name">이름</label></th>
|
||||
<td><input type="text" class="form-control" name="name" id="name" value="${userVO.name}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>소속기관</th>
|
||||
<th><label for="company">소속기관</label></th>
|
||||
<td><input type="text" class="form-control" name="company" id="company" value="${userVO.company}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>연락처</th>
|
||||
<th><label for="phonenum">연락처</label></th>
|
||||
<td><input type="text" class="form-control" name="phonenum" id="phonenum" value="${userVO.phonenum}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>이메일</th>
|
||||
<th><label for="email">이메일</label></th>
|
||||
<td>
|
||||
<div>
|
||||
<input type="text" class="form-control" name="email" id="email" value="${userVO.email}" />
|
||||
|
|
@ -58,30 +53,21 @@
|
|||
<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>
|
||||
<input type="radio" name="auth" id="auth2" value="2" <c:if test="${userVO.auth eq '2'}">checked</c:if>/>
|
||||
<label for="auth2" class="auth-label">사용자</label>
|
||||
<input type="radio" name="auth" id="auth1" value="1" <c:if test="${userVO.auth eq '1'}">checked</c:if>/>
|
||||
<label for="auth1" class="auth-label">관리자</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>
|
||||
<div class="join_top mt-3">
|
||||
<p class="search_p2">
|
||||
<c:choose>
|
||||
<c:when test="${userVO.auth eq '99'}">
|
||||
<input type="button" class="btn btn-success" value="승인" onclick="confirmBtn('${item.userid}','2'); return false;" />
|
||||
<input type="button" class="btn btn-danger" value="삭제" onclick="confirmBtn('${item.userid}','-1'); return false;" />
|
||||
<input type="button" class="btn btn-success" value="승인" onclick="confirmBtn('${userVO.userid}','2'); return false;" />
|
||||
<input type="button" class="btn btn-danger" value="삭제" onclick="confirmBtn('${userVO.userid}','-1'); return false;" />
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<input class="btn btn-success" type="button" value="수정" onclick="update();" />
|
||||
|
|
@ -91,4 +77,4 @@
|
|||
</div>
|
||||
</div>
|
||||
</form:form>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -719,3 +719,7 @@ a {
|
|||
color:#fff;
|
||||
|
||||
}
|
||||
|
||||
.clickAbleObj:hover{
|
||||
cursor:pointer;
|
||||
}
|
||||
|
|
@ -1,3 +1,23 @@
|
|||
let userInfoModal;
|
||||
$(function(){
|
||||
userInfoModal = new bootstrap.Modal(document.getElementById('userInfoModal'));
|
||||
})
|
||||
|
||||
$(document).on('click', '.userInfoModalBtn', function (){
|
||||
const userid = $(this.parentNode).find(".useridTd")[0].innerText;
|
||||
$.ajax({
|
||||
url: '/admin/userInfo/'+userid,
|
||||
type: 'GET',
|
||||
dataType:"html",
|
||||
success: function(html){
|
||||
$("#userInfoModalBody").append(html);
|
||||
userInfoModal.show();
|
||||
},
|
||||
error:function(){
|
||||
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
function fn_link_page(pageNo) {
|
||||
document.searchForm.pageIndex.value = pageNo;
|
||||
|
|
@ -5,13 +25,12 @@
|
|||
document.searchForm.submit();
|
||||
}
|
||||
|
||||
|
||||
function confirmBtn(userid, auth){
|
||||
$("#userid").val(userid);
|
||||
$("#auth").val(auth);
|
||||
|
||||
var msg;
|
||||
if(auth == 2){
|
||||
if(auth === "2"){
|
||||
msg = "승인";
|
||||
}else{
|
||||
msg = "삭제";
|
||||
|
|
@ -24,3 +43,50 @@
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
$(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() {
|
||||
const changePw = $("#changePw").is(":checked");
|
||||
const pw1 = $('#password');
|
||||
const pw2 = $('#passwordCheck');
|
||||
const name = $('#name');
|
||||
const company = $('#company');
|
||||
const tell = $('#phonenum');
|
||||
const email_1 = $('#email');
|
||||
|
||||
if (changePw && pw1.val() === "") {
|
||||
alert('비밀번호를 입력해주세요');
|
||||
pw1.focus();
|
||||
} else if (changePw && pw2.val() === "") {
|
||||
alert('비밀번호를 입력해주세요');
|
||||
pw2.focus();
|
||||
} else if (changePw && (pw1.val() !== pw2.val())) {
|
||||
alert('비밀번호가 일치하지 않습니다.');
|
||||
pw1.focus();
|
||||
} else if (name.val() === "") {
|
||||
alert('이름을 입력해주세요');
|
||||
name.focus();
|
||||
} else if (company.val() === "") {
|
||||
alert('소속기관을 입력해주세요');
|
||||
company.focus();
|
||||
} else if (tell.val() === "") {
|
||||
alert('연락처를 입력해주세요');
|
||||
tell.focus();
|
||||
} else if (email_1.val() === "") {
|
||||
alert('이메일을 입력해주세요');
|
||||
email_1.focus();
|
||||
} else {
|
||||
$("#updateForm").submit();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,54 +0,0 @@
|
|||
|
||||
$(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();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue