YNICTE/BO/Views/user/LeaveHistory.cshtml

191 lines
8.2 KiB
Plaintext
Raw Normal View History

2025-07-23 13:21:57 +09:00
@model NP.Model.VMUsersLeave
<form id="mform" method="post">
<section class="panel panel-default clearfix devsearch" data-cleartbody="tbody1">
@Html.Partial("./Partial/SearchCaption")
<div class="step-content">
<div class="step-pane active form-inline">
<div class="form-group">
@Html.Partial("./Partial/Select", null, new ViewDataDictionary { { "name", "LeaveStatus" }, { "selected", Model.LeaveStatus }, { "valuetext", ":-선택;0:신청;1:완료;2:취소" } })
@Html.Partial("./Partial/Select", null, new ViewDataDictionary { { "name", "searchtype" }, { "selected", Model.searchtype }, { "valuetext", "username:이름;userid:ID" } })
@Html.Partial("./Partial/Text", Model.stringval5, Helpers.DicText(new NP.Model.TextDic() { Name = "searchtext", Value = Model.searchtext, PH = "검색어를 입력하세요.", CssClass = "esitem" }))
<div class="form-group input-group-btn">
<button class="btn btn-default btn-s-xs" type="button" onclick="javascript:userleaveSearch();"><i class="fa fa-search"></i></button>
</div>
</div>
</div>
</div>
</section>
<div class="tar buttonbox m-b-sm">
@Html.Partial("./Partial/pagerow", new ViewDataDictionary { { "tbodyid", "tbody1" }, { "searchmethod", "submit()" }, { "pagesize", Model.pagerowcount } })
<a href="javascript:;" onclick="userLeaves(1);" class="btn btn-s-xs btn-danger"><i class="fa fa-ban"></i> 완료처리</a>
<a href="javascript:;" onclick="userLeaves(2);" class="btn btn-s-xs btn-primary"><i class="fa fa-reply-all"></i> 취소처리</a>
</div>
<br/>
<section class="panel panel-default">
<div class="table-responsive" id="excel1">
<table class="table table-striped b-t b-light">
<colgroup>
<col style="width:10%" />
<col />
<col />
<col />
</colgroup>
<thead>
<tr>
<th>선택</th>
<th>아이디</th>
<th>요청일</th>
<th>처리상태</th>
</tr>
</thead>
<tbody class="data" id="tbody1">
@if (Model.UserLeaves.Any())
{
foreach (var item in Model.UserLeaves)
{
<tr>
<td>
@if (item.status == 0 && item.userstatus == 98)
{ // 탈퇴신청이면서 회원상태는 탈퇴신청일때만 체크박스
<input type="checkbox" id="chk_@item.levno" value="@item.userno" />
}
else if (item.status == 0 && item.userstatus != 98)
{ // 위 if절이 명확하지 않으면 readonly 처리 (조작된 데이터로 예상)
<input type="checkbox" id="chk_@item.levno" value="@item.userno" readonly="readonly" />
}
<input type="hidden" id="hdn_UserStatus" value="@item.userstatus" />
</td>
<td>
@if (item.status != 1 && item.userstatus != 99)
{
<a href="javascript:;" onclick="reg(@item.userno);" style="text-decoration: underline; color: blue;">
@item.userid @string.Format("({0})", item.username)
</a>
}
else
{
<span>@item.userid</span>
}
</td>
<td>@item.levdate.ToString("yy-MM-dd HH:mm")</td>
<td>
@if (item.status != 1 && item.userstatus == 99)
{
<span>@this.LeaveStatusToText(item.status)</span> <span>(관리자탈퇴)</span>
}
else
{
<span>@this.LeaveStatusToText(item.status)</span>
}
</td>
</tr>
}
}
</tbody>
</table>
<div id="pagerArea">
@Html.Pager((int)Model.pagenum, 10, Model.pagerowcount, Model.pagetotalcount)
</div>
</div>
</section>
</form>
<form id="dform" method="post" action="/user/userreg">
@Html.Partial("./Partial/dform", Model, new ViewDataDictionary { { "preform", 1 } })
</form>
@section scripts{
<script type="text/javascript">
$(function () {
});
@*/** 검색 */*@
function userleaveSearch() {
var p = {};
p.searchtype = $('#searchtype').val();
p.searchtext = $.trim($('#searchtext').val());
p.LeaveStatus = $.trim($('#LeaveStatus').val());
postSubmit('/user/LeaveHistory', p);
}
@*/** 탈퇴완료 처리 클릭 */ *@
function userLeaves(status) {
var _usernos = $('input[type="checkbox"]:checked')
.map(function () { return this.value; })
.get()
.join(',');
var statusNumber = parseInt(status);
if (isNaN(statusNumber)) {
msg('오류가 발생했습니댜.');
return;
}
if (![1, 2].includes(statusNumber)) {
msg('오류가 발생했습니다.');
return;
}
var confirmMessage = statusNumber == 1 ?
"선택한 수강생을 탈퇴 완료처리 하시겠습니까?" : "선택한 수강생에 대해 취소처리 하시겠습니까?";
if (_usernos != undefined && _usernos != null && _usernos != '') {
// 영남에 confirmmsg가 없다
if (confirm(confirmMessage)) {
capp(
'/acommon/UserLeaves',
{
usernos: _usernos,
leaveStatus: statusNumber
},
'cbUserLeave'
);
}
}
else {
msg('수강생을 선택해주세요.');
}
}
@*/** 탈퇴완료 처리 콜백 */*@
function cbUserLeave() {
msg('선택한 수강생을 탈퇴완료처리 했습니다.');
submit(null, 300);
}
@*/** 회원정보 상세보기 페이지 이동 */*@
function reg(no) {
setv("dform_intval", no);
setv("dform_viewname", "leavehistory");
$("#dform").attr("action", "/user/userreg").submit();
}
</script>
}
@functions{
/// <summary>
/// 탈퇴 신청 히스토리의 상태코드 값을 텍스트로 반환
/// </summary>
/// <param name="status"></param>
/// <returns></returns>
public string LeaveStatusToText(byte status)
{
string result = string.Empty;
switch (status)
{
case 0: result = "신청"; break;
case 1: result = "완료"; break;
case 2: result = "취소"; break;
default: break;
}
return result;
}
}