<추가사항>

1. 개인정보수정 팝업 (p7)

 - 개인정보 수정 팝업 및 저장

 - 메뉴 등록 및 권한 추가 /user/editinfo


# 커밋 파일
BO\Views\user\editinfo.cshtml

# 테스트 결과
- 이상없음

# 특이사항 및 이슈사항
- 이상없음
This commit is contained in:
swpark 2021-12-08 08:32:02 +00:00
parent 449a5802dd
commit adef8bfd29
1 changed files with 211 additions and 0 deletions

View File

@ -0,0 +1,211 @@
@model NP.Model.VMUser
@{
Layout = "~/Views/Shared/_PopupLayout.cshtml";
}
<div class="row" id="regbox">
<form id="mform" method="post" enctype="multipart/form-data" class="form-horizontal">
<section class="panel panel-default">
<div class="panel-body">
@Html.HiddenFor(m => m.User.usertype)
<div class="line line-dashed line-lg pull-in"></div><div class="form-group">
<label class="col-sm-4 col-md-2 control-label req">권한선택</label>
<div class="col-sm-8 col-md-10">@Html.TextBoxFor(m => m.User.usertypename, new { @class = "form-control disp-init ff", @style = "width: 300px;", @maxlength = "50" })</div>
</div>
<div class="line line-dashed line-lg pull-in"></div><div class="form-group">
<label class="col-sm-4 col-md-2 control-label req">ID</label>
<div class="col-sm-8 col-md-10">@Html.TextBoxFor(m => m.User.userid, new { @class = "form-control disp-init ff", @style = "width: 300px;", @maxlength = "50" })</div>
</div>
<div class="line line-dashed line-lg pull-in"></div><div class="form-group">
<label class="col-sm-4 col-md-2 control-label">비밀번호</label>
<div class="col-sm-8 col-md-10">@Html.PasswordFor(m => m.User.userpass, new { @class = "form-control disp-init", @style = "width: 300px;", @maxlength = "20" })</div>
</div>
<div class="line line-dashed line-lg pull-in"></div><div class="form-group">
<label class="col-sm-4 col-md-2 control-label req">이름</label>
<div class="col-sm-8 col-md-10">@Html.TextBoxFor(m => m.User.username, new { @class = "form-control disp-init", @style = "width: 300px;", @maxlength = "50" })</div>
</div>
<div class="line line-dashed line-lg pull-in"></div><div class="form-group">
<label class="col-sm-4 col-md-2 control-label">이메일</label>
<div class="col-sm-8 col-md-10">
@Html.TextBoxFor(m => m.User.email, new { @class = "form-control disp-init", @style = "width: 300px;", @maxlength = "50" })
</div>
</div>
<div class="line line-dashed line-lg pull-in req"></div><div class="form-group">
<label class="col-sm-4 col-md-2 control-label">핸드폰</label>
<div class="col-sm-8 col-md-10">
@Html.TextBoxFor(m => m.User.mobile, new { @class = "form-control disp-init mobilefmt nocomma", @data_zero = "1", @style = "width: 300px;", @maxlength = "13" })
</div>
</div>
<div class="line line-dashed line-lg pull-in req"></div><div class="form-group">
<label class="col-sm-4 col-md-2 control-label">소속</label>
<div class="col-sm-8 col-md-10">
<span id="asdiv">@(Model.User.asname)</span>
@Html.HiddenFor(m => m.User.asno)
</div>
</div>
<div class="line line-dashed line-lg pull-in"></div><div class="form-group">
<label class="col-sm-4 col-md-2 control-label">부서</label>
<div class="col-sm-8 col-md-10">@Html.TextBoxFor(m => m.User.depart, new { @class = "form-control disp-init", @style = "width: 300px;", @maxlength = "50" })</div>
</div>
@*@if (Model.IsOutsider != 1)
{*@
<div class="line line-dashed line-lg pull-in"></div><div class="form-group">
<label class="col-sm-4 col-md-2 control-label">직급</label>
<div class="col-sm-8 col-md-10">
@Html.Partial("./Partial/Select", Model.ComCodes.Where(w => w.cgroup == "jobposition"), new ViewDataDictionary { { "special", "reg" }, { "name", "User.ccposition" }, { "selected", Model.User.ccposition }, { "df", ":-직급선택" }, { "class", "disp-init" } })
@Html.TextBoxFor(m => m.User.ccpositionetc, new { @class = "form-control disp-init", @style = "width: 100px;" + (Model.User.ccposition == null || (Model.ComCodes.Where(w => w.ccode == Model.User.ccposition).FirstOrDefault() ?? new NP.Model.ComCode()).refcode != "9" ? "display:none;" : ""), @maxlength = "40" })
</div>
</div>
@*}*@
@if (ViewBag.isprofessor)
{
<div class="line line-dashed line-lg pull-in"></div><div class="form-group">
<label class="col-sm-4 col-md-2 control-label">사진</label>
<div class="col-sm-8 col-md-10">
@Html.Partial("./Partial/File", Model.FileList, new ViewDataDictionary {
{ "name", "User.fgnoprofile" },{"value", Model.User.fgnoprofile },{ "fname", "file"},
{"width", null },{"table", "users" },{ "column", "fgnoprofile"},{"filecount", 1 },
{"readmode", 0 },{"hidemode", 0 },
{ "isimage", 1 },{ "imageid", "imgprofile" },{ "dftsrc", "/img/common/profile_sample.jpg" },
{ "fileext", "" }, { "loginfo",Model.User.userno+"|9"}
})
<br />
<img id="imgprofile" src="@(Model.FileList.Count() > 0 && !string.IsNullOrEmpty(Model.FileList.First().fileurl) ? string.Format("{0}{1}", Model.Files, Model.FileList.First().fileurl) : "/img/common/profile_sample.jpg")" style="max-width: 135px; max-height: 135px; border-radius: 5px;" />
</div>
</div>
<div class="line line-dashed line-lg pull-in"></div><div class="form-group">
<label class="col-sm-4 col-md-2 control-label">주소</label>
<div class="col-sm-8 col-md-10 postbox" style="line-height: 35px;">
@Html.TextBoxFor(m => m.User.post, new { @readonly = "readonly", @style = "width: 70px; background-color: #ddd;", @class = "postno form-control disp-init" }) <a href="#" onclick="javascript: getpost2(this);" title="주소찾기"><i class="fa fa-map-marker" style="font-size: 13px;"></i> 주소찾기(클릭 후 상단검색)</a>
<br />@Html.TextBoxFor(m => m.User.address1, new { @readonly = "readonly", @style = "background-color: #ddd; width: 300px;", @class = "postadr form-control disp-init", @placeholder = "주소" })
@Html.TextBoxFor(m => m.User.address2, new { @class = "postadrsub form-control disp-init", @placeholder = "상세주소", @style = "width: 400px;" })
</div>
</div>
<div class="line line-dashed line-lg pull-in"></div><div class="form-group">
<label class="col-sm-4 col-md-2 control-label">주민번호</label>
<div class="col-sm-8 col-md-10">
@Html.HiddenFor(m => m.User.userpno)
@Html.TextBox("userpno1", (Model.User.userpno ?? "").Length > 5 ? Model.User.userpno.Substring(0, 6) : Model.User.userpno, new { @class = "form-control disp-init int nocomma text-center", @data_zero = "1", @style = "width: 120px;", @maxlength = "6" })
-
@Html.TextBox("userpno2", (Model.User.userpno ?? "").Length > 6 ? Model.User.userpno.Substring(6) : "", new { @class = "form-control disp-init int nocomma text-center", @data_zero = "1", @style = "width: 120px;", @maxlength = "7" })
</div>
</div>
<div class="line line-dashed line-lg pull-in"></div><div class="form-group">
<label class="col-sm-4 col-md-2 control-label">계좌정보</label>
<div class="col-sm-8 col-md-10">
@Html.TextBoxFor(m => m.User.bankname, new { @class = "form-control disp-init", @style = "width: 200px;", @maxlength = "50", @placeholder = "은행입력" })
@Html.TextBoxFor(m => m.User.bankno, new { @class = "form-control disp-init", @style = "width: 400px;", @maxlength = "30", @placeholder = "계좌번호입력" })
</div>
</div>
<div class="line line-dashed line-lg pull-in"></div><div class="form-group">
<label class="col-sm-4 col-md-2 control-label">강사소개</label>
<div class="col-sm-8 col-md-10">@Html.TextAreaFor(m => m.User.introhtml, new { @class = "form-control", @style = "resize: none; width: 90%; height: 80px; padding: 3px 5px;" })</div>
</div>
}
</div>
</section>
<div class="botfixempty">&nbsp;</div>
<div class="form-group botfix">
<a href="#" class="btn btn-primary" onclick="save();">저장</a>
<a href="#" class="btn btn-default" onclick="goparent();">닫기</a>
</div>
@Html.HiddenFor(m => m.User.userno)
</form>
</div>
<form id="dform" method="post" action="/user/editinfo">
@Html.Partial("./Partial/DForm", Model, new ViewDataDictionary { { "preform", 1 } })
</form>
<div id="postlayer" class="daumpost">
<a href="#" class="btn btn-xxs btn-select closedaumpost" onclick="closeDaumPostcode();">close</a>
</div>
@section styles{
@Html.Partial("./Partial/Summernotestyle")
}
@section scriptsHeader{
@Html.Partial("./Partial/ScriptPost")
@Html.Partial("./Partial/FileScript")
@Html.Partial("./Partial/Summernote")
}
@section scripts{
<script>
$(document).ready(function () {
if ('@(Model.User.userno)' != '0') {
$("#User_usertypename").attr("readonly", "readonly");
$("#User_userid").attr("readonly", "readonly");
}
if ('@(ViewBag.isprofessor)' == 'True') {
$('#User_introhtml').summernote({
height: 100,
tabsize: 2,
callbacks: {
onImageUpload: function (files, editor, welEditable) {
var fdata = new FormData();
fdata.append('img', files[0]);
fdata.append('fd', "Editor");
uploadeditorimage(files, this, fdata, "cbeditorupload()");
}
}
});
}
$("#User_ccposition").on("change", function () {
$("#User_ccpositionetc").hide();
if ($(this).find("option:selected").attr("data-refcode") == "9") {
$("#User_ccpositionetc").show().focus();
}
});
});
function save() {
setv("User_userpno", val("userpno1") + val("userpno2"));
setv("User_mobile", formatmobile(val("User_mobile")));
setv("User_telno", formatphone(val("User_telno")));
if (check("User_userid", null, "ID를 입력해주세요.")) { }
//else if (val("User_userid").length < 6) {focus("User_userid"); msg("ID를 6글자 이상으로 입력해주세요.");}
else if (val("User_userpass") != "" && !ispass(val("User_userpass"))) { focus("User_userpass"); msg("비밀번호는 영문, 숫자, 특수문자를 조합하여 8자리 이상으로 사용해야 합니다."); }
else if (check("User_username", null, "이름을 입력해주세요.")) { }
//else if (check("User_mobile", null, "핸드폰 번호를 입력해주세요")) { }
else if (!isnulloremt(val("User_email")) && !isemail(val("User_email"))) { focus("User_email"); msg("이메일주소를 올바르게 입력해주세요."); }
else if (!isnulloremt(val("User_mobile")) && !ismobile(val("User_mobile"))) { focus("User_mobile"); msg("핸드폰번호를 올바르게 입력해주세요."); }
else if (confirm("저장하시겠습니까?")) {
if (val("User_usertype") >= 92) {
setv("User_asno", "");
}
if ('@(ViewBag.isprofessor)' == 'True') {
var cdata = $('#User_introhtml').summernote('code');
cdata = cdata == "<p><br></p>" ? "" : cdata;
setv("User_introhtml", cdata);
}
capfileform("/acommon/useredit", "mform", "cbsave");
}
}
function cbsave() {
if (capResult.code == 1000) {
msgok(1, "", true);
golist(200, true);
// 팝업 닫기
goparent();
} else if (capResult.obj == -1) {
focus("User_userid");
msg("이미 사용중인 아이디입니다.");
} else if (capResult.obj == -2) {
focus("User_email");
msg("이미 사용중인 이메일주소입니다.");
} else if (capResult.obj == -3) {
msg("이미 사용중인 핸드폰번호입니다.");
}
else { msgdev(); }
}
function del() {
if (confirm(('@Model.viewname' == "user"?"탈퇴":"삭제")+"처리하시겠습니까?")) {
capp("/acommon/userexitjoin", { userno: @Model.User.userno}, "cbdel");
}
}
function cbdel() {
if (capResult.code == 1000) {
msg("처리되었습니다.", 0, null, null, true);
golist(500, true);
}
}
</script>
}