2020-10-12 14:39:23 +09:00
|
|
|
@model NP.Model.VMUser
|
|
|
|
|
<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">
|
|
|
|
|
@if (ViewBag.isadmin)
|
|
|
|
|
{
|
|
|
|
|
@Html.Partial("./Partial/Text", Model.stringval, Helpers.DicText(new NP.Model.TextDic() { Name = "stringval", Value = Model.stringval, PH = "소속사", Style="width: 205px;",CssClass = "esitem" }))
|
|
|
|
|
@Html.Partial("./Partial/Text", Model.stringval2, Helpers.DicText(new NP.Model.TextDic() { Name = "stringval2", Value = Model.stringval2, PH = "사업자등록번호", Style = "width: 300px;", CssClass = "esitem"}))
|
|
|
|
|
<br />
|
|
|
|
|
}
|
|
|
|
|
@Html.Partial("./Partial/Select", null, new ViewDataDictionary { { "name", "stringval3" }, { "selected", Model.stringval3 }, { "valuetext", "1:활성;8:휴면;9:비활성" }, { "df", ":-상태" } })
|
2021-08-23 15:10:15 +09:00
|
|
|
@Html.Partial("./Partial/Select", null, new ViewDataDictionary { { "name", "stringval4" }, { "selected", Model.stringval4 }, { "valuetext", "username:이름;userid:ID;email:이메일;mobile:휴대폰;userpno:주민등록번호" } })
|
2020-10-12 14:39:23 +09:00
|
|
|
@Html.Partial("./Partial/Text", Model.stringval5, Helpers.DicText(new NP.Model.TextDic() { Name = "stringval5", Value = Model.stringval5, PH = "검색어를 입력하세요.", CssClass = "esitem" }))
|
|
|
|
|
@Html.Partial("./Partial/Button", new NP.Model.Button() { Special = "search" })
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
<div class="tar buttonbox">
|
|
|
|
|
@Html.Partial("./Partial/pagerow", new ViewDataDictionary { { "tbodyid", "tbody1" }, { "searchmethod", "submit()" }, { "pagesize", Model.pagerowcount } })
|
|
|
|
|
<a href="#" onclick="javascript:reg(0);" class="btn btn-s-xs btn-info">@(Model.viewname == "user"?"개별":"")등록</a>
|
|
|
|
|
@if (Model.viewname == "user")
|
|
|
|
|
{
|
|
|
|
|
<a href="#" onclick="javascript:reg(-1);" class="btn btn-s-xs btn-info">일괄등록</a>
|
|
|
|
|
<a href="#" onclick="javascript:del(0);" class="btn btn-s-xs btn-primary">일괄휴면</a>
|
|
|
|
|
if (!ViewBag.IsSiteAdmin)
|
|
|
|
|
{
|
|
|
|
|
<a href="#" onclick="javascript:del(-1);" class="btn btn-s-xs btn-danger">일괄탈퇴</a>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
<section class="panel panel-default">
|
|
|
|
|
<div class="table-responsive" id="excel1">
|
|
|
|
|
<table class="table table-striped b-t b-light">
|
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
@if (Model.viewname == "user")
|
|
|
|
|
{
|
|
|
|
|
<th width="20"><input type="checkbox" onclick="javascript: checkall('excel1', this);" /></th>
|
|
|
|
|
<th width="20">No</th>
|
|
|
|
|
<th>소속</th>
|
|
|
|
|
<th>이름(ID)</th>
|
|
|
|
|
<th>핸드폰</th>
|
2021-08-23 15:10:15 +09:00
|
|
|
<th>생년월일</th>
|
2020-10-12 14:39:23 +09:00
|
|
|
<th style="width:60px;">상태</th>
|
|
|
|
|
<th>최근로그인</th>
|
2021-01-06 13:01:08 +09:00
|
|
|
<th>상담하기</th>
|
2020-10-12 14:39:23 +09:00
|
|
|
<th>입장</th>
|
|
|
|
|
}
|
|
|
|
|
else if (Model.viewname == "professor")
|
|
|
|
|
{
|
|
|
|
|
<th width="20">No</th>
|
|
|
|
|
<th>소속</th>
|
|
|
|
|
<th>이름(ID)</th>
|
|
|
|
|
<th>핸드폰</th>
|
|
|
|
|
<th style="width:60px;">상태</th>
|
|
|
|
|
<th>최근로그인</th>
|
|
|
|
|
<th>입장</th>
|
|
|
|
|
}
|
|
|
|
|
else if (Model.viewname == "admin")
|
|
|
|
|
{
|
|
|
|
|
<th width="20">No</th>
|
|
|
|
|
<th>소속</th>
|
|
|
|
|
<th>권한</th>
|
|
|
|
|
<th>이름(ID)</th>
|
|
|
|
|
<th>핸드폰</th>
|
|
|
|
|
<th style="width:60px;">상태</th>
|
|
|
|
|
<th>최근로그인</th>
|
|
|
|
|
}
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody class="data" id="tbody1">
|
|
|
|
|
@if (Model.viewname == "user")
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in Model.Users)
|
|
|
|
|
{
|
|
|
|
|
<tr>
|
|
|
|
|
<td><input type="checkbox" class="autocheck" value="@item.userno" data-userno="@item.userno" /></td>
|
|
|
|
|
<td>@item.rnorvt</td>
|
|
|
|
|
<td>@item.asname</td>
|
|
|
|
|
<td class="link"><a href="#" onclick="reg(@item.userno)">@string.Format("{0}({1})", item.username, item.userid)</a></td>
|
|
|
|
|
<td>@item.mobile</td>
|
2021-08-23 15:10:15 +09:00
|
|
|
@if((item.userpno ?? "").Length > 6)
|
|
|
|
|
{
|
|
|
|
|
<td>@(item.userpno.Substring(0,6))</td>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
<td></td>
|
|
|
|
|
}
|
2020-10-12 14:39:23 +09:00
|
|
|
<td>@item.statusname</td>
|
|
|
|
|
<td>@item.logintime.ToString("yy-MM-dd HH:mm")</td>
|
2021-01-06 13:01:08 +09:00
|
|
|
<td><a href="#" onclick="gocouncel(@item.userno)">[상담하기]</a></td>
|
2020-10-12 14:39:23 +09:00
|
|
|
<td><a href="#" onclick="ee(@item.userno)">[입장]</a></td>
|
|
|
|
|
</tr>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (Model.viewname == "professor")
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in Model.Users)
|
|
|
|
|
{
|
|
|
|
|
<tr>
|
|
|
|
|
<td>@item.rnorvt</td>
|
|
|
|
|
<td>@item.pasname</td>
|
|
|
|
|
<td class="link"><a href="#" onclick="reg(@item.userno)">@string.Format("{0}({1})", item.username, item.userid)</a></td>
|
|
|
|
|
<td>@item.mobile</td>
|
|
|
|
|
<td>@item.statusname</td>
|
|
|
|
|
<td>@item.logintime.ToString("yy-MM-dd HH:mm")</td>
|
|
|
|
|
<td><a href="#" onclick="ee(@item.userno)">[입장]</a></td>
|
|
|
|
|
</tr>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (Model.viewname == "admin")
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in Model.Users)
|
|
|
|
|
{
|
|
|
|
|
<tr>
|
|
|
|
|
<td>@item.rnorvt</td>
|
|
|
|
|
<td>@item.asname</td>
|
|
|
|
|
<td>@item.usertypestr</td>
|
|
|
|
|
<td class="link"><a href="#" onclick="reg(@item.userno)">@string.Format("{0}({1})", item.username, item.userid)</a></td>
|
|
|
|
|
<td>@item.mobile</td>
|
|
|
|
|
<td>@item.statusname</td>
|
|
|
|
|
<td>@item.logintime.ToString("yy-MM-dd HH:mm")</td>
|
|
|
|
|
</tr>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
@Html.Pager((int)Model.pagenum, 10, Model.pagerowcount, Model.pagetotalcount)
|
|
|
|
|
</section>
|
|
|
|
|
</form>
|
|
|
|
|
<form id="dform" method="post" action="/user/userreg">
|
|
|
|
|
@Html.Partial("./Partial/dform", Model, new ViewDataDictionary { { "preform", 1 } })
|
|
|
|
|
</form>
|
|
|
|
|
<div id="thisbox" class="findbox draggable regbox summernoteparentfixedbox" style="width: 500px; z-index: 1041; left: 50%; margin-left: -250px; top: 60px; bottom: 30px; overflow: auto;">
|
|
|
|
|
<h4><a href="#" class="btn btn-default btn-xs f-r closethisbox" style="margin-right:5px; margin-top:5px;">닫기</a></h4>
|
|
|
|
|
<section class="panel panel-default" style="border-top: 1px solid #ddd; margin-top: 5px;">
|
|
|
|
|
<header class="panel-heading"><strong><i class="fa fa-bars"></i> 일괄등록<span class=""></span></strong></header>
|
|
|
|
|
<div class="panel-body">
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-sm-5 col-md-3 control-label">일괄등록</label>
|
|
|
|
|
<div class="col-sm-7 col-md-9">
|
|
|
|
|
<input id="uploadfile" type="file" /><br />
|
|
|
|
|
<p style="color:red">※ 비밀번호는 핸드폰번호로 초기값이 등록됩니다.</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="findboxbtnbox">
|
|
|
|
|
<a href="~/Content/file/users.xlsx" class="btn btn-info">양식다운로드</a>
|
|
|
|
|
<a href="#" class="btn btn-primary" onclick="save();">일괄등록</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
</div>
|
|
|
|
|
@section scripts{
|
|
|
|
|
<script>
|
|
|
|
|
$(document).ready(function () {
|
2021-11-29 15:11:55 +09:00
|
|
|
if ('@(ViewBag.issiteadmin)' == 'True' && '@(Model.viewname)' == 'user' && '@(ViewBag.SSPWC)' == 'True') {
|
|
|
|
|
showramemainlayer('/user/pwchange');
|
|
|
|
|
$("#mainlayerframe").css("width", "520px");
|
|
|
|
|
$("#mainlayerframe").css("height", "520px");
|
|
|
|
|
}
|
2020-10-12 14:39:23 +09:00
|
|
|
});
|
|
|
|
|
function reg(no) {
|
|
|
|
|
if (no < 0) {
|
|
|
|
|
bglayer(); $("#thisbox").slideDown("fast", function () { $("#thisbox").scrollTop(0); });
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
setv("dform_intval", no);
|
|
|
|
|
$("#dform").attr("action", "/user/@(Model.viewname)reg").submit();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
var str = "";
|
|
|
|
|
function del(no) {
|
|
|
|
|
var unos = "";
|
|
|
|
|
if (no == 0) { str = "휴면"; } else { str = "삭제"; }
|
|
|
|
|
$.each($("#tbody1 tr td input.autocheck:checked"), function () {
|
|
|
|
|
unos += "," + $(this).val();
|
|
|
|
|
});
|
|
|
|
|
if (unos == "") {
|
|
|
|
|
msg(str+"할 수강생을 선택해주세요");
|
|
|
|
|
}
|
|
|
|
|
else if (confirm("선택한 수강생을 " + str + "하시겠습니까?")) {
|
|
|
|
|
if (no == 0) {
|
|
|
|
|
capp("/acommon/usersdormant", { usernos: unos.substr(1) }, "cbusersdormant");
|
|
|
|
|
} else {
|
|
|
|
|
capp("/acommon/usersdel", { usernos: unos.substr(1) }, "cbusersdel");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function cbusersdormant() {
|
|
|
|
|
if (capResult.code == 1000) {
|
|
|
|
|
msg("선택한 수강생을 일괄휴면처리 했습니다.");
|
|
|
|
|
submit(null, 300);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function cbusersdel() {
|
|
|
|
|
if (capResult.code == 1000) {
|
|
|
|
|
msg("선택한 수강생을 일괄탈퇴처리 했습니다.");
|
|
|
|
|
submit(null, 300);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function ee(no) {
|
|
|
|
|
capp("/acommon/useree", { userno: no }, "cbee");
|
|
|
|
|
}
|
|
|
|
|
function cbee() {
|
|
|
|
|
if (capResult.code == 1000) {
|
|
|
|
|
if ('@Model.viewname' == 'user') {
|
|
|
|
|
var w = window.open(capResult.obj, "usersite");
|
|
|
|
|
if (w != null) {
|
|
|
|
|
w.focus();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
msg("팝업차단을 해제해주세요.");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
location.href = capResult.obj;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function save() {
|
|
|
|
|
if ($("#uploadfile").val() == "") {
|
|
|
|
|
msg2("파일을 선택해주세요.");
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
var thumbext = $("#uploadfile").val();
|
|
|
|
|
thumbext = thumbext.slice(thumbext.indexOf(".") + 1).toLowerCase();
|
|
|
|
|
//if ("xls,xlsx".indexOf(thumbext) < 0) {
|
|
|
|
|
// msg("xls,xlsx 확장자만 가능합니다.", 0, true);
|
|
|
|
|
//}
|
|
|
|
|
if (thumbext.indexOf("xlsx")<0) {
|
|
|
|
|
msg("xlsx 확장자만 가능합니다.", 0, true);
|
|
|
|
|
}
|
|
|
|
|
else if (confirm("일괄등록하시겠습니까?")){
|
|
|
|
|
var formData = new FormData();
|
|
|
|
|
formData.append("uploadfile", $("#uploadfile")[0].files[0]);
|
|
|
|
|
formData.append("uploadjob", "userbatch");
|
|
|
|
|
capfile("/acommon/uploadexcel", formData, "cbsave", true, false, true, true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function cbsave() {
|
|
|
|
|
//$('#thisbox').slideUp('fast'); $('#bglayer').hide();
|
|
|
|
|
$("#uploadfile").val("");
|
|
|
|
|
if (capResult.code == 1000) {
|
|
|
|
|
msg("일괄등록을 완료했습니다.", null, true, null, true);
|
|
|
|
|
submit(null, 300);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
console.log(capResult.msg);
|
|
|
|
|
if (capResult.code==1 && capResult.msg.indexOf("uiusersuserid") != -1) {
|
|
|
|
|
capResult.msg = "동일한 사용자는 등록할 수 없습니다.";
|
|
|
|
|
}
|
|
|
|
|
msg("업로드가 실패했습니다.<br /><br /><br />" + capResult.msg, null, true);
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-01-06 13:01:08 +09:00
|
|
|
|
|
|
|
|
function gocouncel(no) {
|
|
|
|
|
setv("dform_intval", no);
|
|
|
|
|
$("#dform_tabidx").val(3);
|
|
|
|
|
$("#dform").attr("action","/user/@(Model.viewname)reg").submit();
|
|
|
|
|
}
|
2020-10-12 14:39:23 +09:00
|
|
|
</script>
|
|
|
|
|
}
|