YNICTE/BO/Views/cm/cmregexset.cshtml

344 lines
13 KiB
Plaintext
Raw Normal View History

2025-12-26 23:11:05 +09:00
@model NP.Model.VMCM
<!-- div[id=container] -->
<div style="@(Model.CM.cmno < 1 ? "display: none;" : "")">
<ul class="pagination pagination-md" style="margin: 0;">
<li><a href="javascript:;" onclick="gotab(0);" data-toggle="tab">기본정보</a></li>
<li><a href="javascript:;" onclick="gotab(1);" data-toggle="tab">회차설정</a></li>
@if (Model.CM.ismaster == 0) {
<li><a href="javascript:;" onclick="gotab(2);" data-toggle="tab">교육일정</a></li>
}
<li><a href="javascript:;" data-toggle="tab" onclick="gotab(3);">평가설정</a></li>
<li class="active"><a href="javascript:;" onclick="gotab(5);" data-toggle="tab">시험설정</a></li>
<li><a href="javascript:;" onclick="gotab(4);" data-toggle="tab">메뉴설정</a></li>
</ul>
</div>
<!-- // div[id=container] -->
<!-- form[id=mform] -->
<form id="mform" method="post" class="form-horizontal">
<!-- section[class=panel panel-default] -->
<section class="panel panel-default" style="border-top: 1px solid #ddd; margin-top: 5px;">
<div class="panel-body">
@if (Model.CM.ismaster == 1) {
<div class="form-group">
<label class="col-sm-4 col-md-2 control-label">과정분류 | 과정명</label>
<div class="col-sm-8 col-md-10">
<input type="text" class="form-control" disabled value="[ @(Model.CM.pcgname) | @(Model.CM.cgname) ] @(Model.CM.cname)" />
</div>
</div>
} else {
<div class="form-group">
<label class="col-sm-4 col-md-2 control-label">기수 | 강좌명 | 분반</label>
<div class="col-sm-8 col-md-10">
<input type="text" class="form-control" disabled value="@(Model.CM.tmname) | @(Model.CM.cname) | @(Model.CM.classno)반" />
</div>
</div>
}
</div>
</section>
<!-- // section[class=panel panel-default] -->
<!-- section[class=panel panel-default] -->
<!-- // section[class=panel panel-default] -->
<br />
<!-- section[class=panel panel-default] -->
<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></span></strong>
</header>
<div style="padding: 5px 20px; background-color: #fff;">
교육종료일
@Html.Partial("./Partial/Date", string.IsNullOrEmpty(Model.stringval5) ? (DateTime?)null : Convert.ToDateTime(Model.stringval5), new ViewDataDictionary { { "name", "vm.CM.estart" } }) ~
@Html.Partial("./Partial/Date", string.IsNullOrEmpty(Model.stringval6) ? (DateTime?)null : Convert.ToDateTime(Model.stringval6), new ViewDataDictionary { { "name", "vm.CM.eend" } })
@Html.Partial("./Partial/Text", Model.addstringval5, Helpers.DicText(new NP.Model.TextDic() { Name = "vm.CM.instructors", Value = Model.addstringval5, PH = "교강사 이름을 입력하세요.", CssClass = "", Style = "width:250px; display:inline-block;" }))
<a href="#" class="btn btn-default" onclick="submit()" id="btnsearchtext">검색</a>
&nbsp;&nbsp;
<a href="javascript:;" onclick="add(0, 0);" class="btn btn-s-xs btn-primary">최종평가추가</a>
</div>
<div class="table-responsive" id="excel2">
<table class="table table-striped b-t b-light">
<thead>
<tr>
@*<th>평가구분</th>*@
<th>평가명</th>
<th>집체교육일</th>
<th>참여일시</th>
<th>참여조건</th>
<th>총점</th>
<th>삭제</th>
</tr>
</thead>
<tbody class="data" id="tbody1">
@{
var estList = Model.ESTs.ToList();
foreach (var item in estList) {
<tr>
<!--<td>@item.estkindname</td>-->
<td class="link"><a href="javascript:;" onclick="add(@item.gubun, @item.exno)">@item.exname</a></td>
<td>
@if(item.cshape == 1) { //오프라인
@(item.estart + "~" + item.eend)
} else { //온라인
@(item.estart)
}
</td>
<td>
@if (item.testsdate != null && item.testedate != null) {
@(Html.Raw(item.testsdate + " ~ <br/>" + item.testedate))
}
</td>
<td>
@if (item.rstype == 1) {
@(item.iseq + "회차" + " (" + item.teachername + ")")
} else {
@:출석 @(item.econdition) 이상
}
</td>
<td>@(item.estkind < 30 ? item.tpoint.ToString() + "점" : "-")</td>
<td><a href="javascript:;" class="delete-link" onclick="del(@item.estkind, @item.exno)">[삭제]</a></td>
</tr>
}
}
</tbody>
</table>
</div>
</section>
<!-- // section[class=panel panel-default] -->
<input type="hidden" id="cmno" name="cmno" value="@Model.CM.cmno" />
<input type="hidden" id="vm.CM.cmno" name="vm.CM.cmno" value="@Model.CM.cmno" />
</form>
<!-- // form[id=mform] -->
<form id="dform" method="post" action="/cm/@Model.listviewname">
@Html.Partial("./Partial/DForm", Model, new ViewDataDictionary { { "preform", 1 } })
</form>
@section styles {
<style type="text/css">
input.int {
text-align: right;
}
.delete-link {
color: red;
}
</style>
}
@section scriptsHeader {
@Html.Partial("./Partial/ScriptDate")
}
@section scripts {
<script>
@*/* 문서 로드 시 초기화 */*@
$(document).ready(function () {
$("#esttable tr td input.int").on("keyup", function (e) {
if ($(this).closest("tr").hasClass("auto")) {
var tot = 0;
$.each($(this).closest("tr").find("td input.int"), function (i, c) {
if (!$(c).hasClass("tot")) {
tot += getint($(c).val());
}
});
$(this).closest("tr").find("td input.int.tot").val(tot);
}
});
});
@*/* 탭 이동 함수 */*@
function gotab(idx, t) {
bglayer();
t = t || 0;
setTimeout(function () {
switch (idx) {
case 0:
$("#dform").attr("action", "/cm/@Model.viewname").submit();
break;
case 1:
$("#dform").attr("action", "/cm/@(Model.viewname)inning").submit();
break;
case 2:
$("#dform").attr("action", "/cm/@(Model.viewname)eduschedule").submit();
break;
case 3:
$("#dform").attr("action", "/cm/@(Model.viewname)est").submit();
break;
case 4:
$("#dform").attr("action", "/cm/@(Model.viewname)menu").submit();
break;
case 5:
$("#dform").attr("action", "/cm/@(Model.viewname)exset").submit();
break;
}
}, t);
}
// 온라인 여부 변수
var _isonline = @(Model.CMEV.scdtype == 1 ? "true" : "false");
@*/* 평가기준 저장 함수 */*@
function save() {
var isok = true;
$("#isoffabs").attr("disabled", false);
// 총점 검증
$.each($("tr td input.tot"), function (i, c) {
if (getint($(c).val()) != 100) {
isok = false;
$(c).focus();
msg("평가항목의 " + ($(c).hasClass("tot") ? "합이" : "기준이") + " [100]이 되도록 입력해주세요.");
return false;
}
});
// 수료기준 검증
if (isok) {
$.each($("tr#trestcut td input.tot"), function (i, c) {
if (getint($(c).val()) != 100) {
isok = false;
$(c).focus();
msg("평가항목의 기준이 [100]이 되도록 입력해주세요.");
return false;
}
});
}
// 비환급 점수 검증
if (isok) {
$.each($("tr#trestrfd td input.int"), function (i, c) {
if (getint($(c).val()) > 100) {
isok = false;
$(c).focus();
msg("평가항목의 " + ($(c).hasClass("tot") ? "합이" : "기준이") + " 100 이하가 되도록 입력해주세요.");
return false;
}
});
}
// 비환급 수료기준 검증
if (isok) {
$.each($("tr#trestcutrfd td input.int"), function (i, c) {
if (getint($(c).val()) > 100) {
isok = false;
$(c).focus();
msg("평가항목의 기준이 100 이하가 되도록 입력해주세요.");
return false;
}
});
}
// 체크박스 값 설정
var chked = $("#isoffabs").is(':checked');
setv("isoffabs", chked ? 1 : 0);
// 비환급 값을 환급에 적용
$.each($("#trest input"), function () {
$("#trestrfd input[name='" + this.name + "rfd']").val(this.value);
});
$.each($("#trestcut input"), function () {
$("#trestcutrfd input[name='" + this.name + "rfd']").val(this.value);
});
if (isok && confirm("평가기준/비율을 저장하시겠습니까?")) {
cap("/acommon/cmevsave", "mform", "cbsave");
}
}
@*/* 저장 콜백 함수 */*@
function cbsave() {
$("#isoffabs").attr("disabled", _isonline);
if (capResult.code == 1000) {
msg("평가기준/비율을 저장했습니다.", null, true, null, true);
gotab(3, 500);
} else {
msgadmin();
}
}
@*/* 페이지 새로고침 함수 */*@
function pagerefresh() {
gotab(5, 500);
}
@*/* 평가 추가 함수 */*@
function add(idx, no) {
if (idx == 0) {
showramemainlayer("/cm/cmregex?cmno=@(Model.CM.cmno)&intval=" + no);
} else if (idx == 1) {
showramemainlayer("/cm/cmregsd?cmno=@(Model.CM.cmno)&intval=" + no);
} else if (idx == 2) {
showramemainlayer("/cm/cmregrs?cmno=@(Model.CM.cmno)&intval=" + no);
}
}
@*/* 평가 삭제 함수 */*@
function del(extype, no) {
if (confirm("삭제하시겠습니까?")) {
capp("/acommon/estdel", { extype: extype, no: no }, "cbdel");
}
}
@*/* 삭제 콜백 함수 */*@
function cbdel() {
if (capResult.code == 1000) {
msg("삭제했습니다.", null, true, null, true);
gotab(3, 500);
} else {
msg("수강데이터가 생성되어 삭제할 수 없습니다.");
}
}
function submit() {
$("#cmno").val("vm.CM.");
capp("/acommon/ExamList", $("#mform").serialize(), "examList");
}
function examList() {
if (capResult.code == 1000) {
let html = "";
$.each($(capResult.obj), function (i, item) {
let cShape = "", rsType = "", testDate = "", estKind = "";
if (item.cshape == 1) { //오프라인
cShape = item.estart + "~" + item.eend;
} else { //온라인
cShape = item.estart;
}
if (item.rstype == 1) {
rsType = item.iseq + " 회차 (" + item.teachername + ")";
} else {
rsType = " 출석 " + item.econdition + " 이상";
}
if (item.testsdate != null && item.testedate != null) {
testDate = item.testsdate + " ~<br />" + item.testedate;
}
if (item.estkind < 30) {
estKind = item.tpoint + "점";
} else {
estKind = "-";
}
html += "<tr>";
html += " <td class=\"link\"><a href=\"javascript:;\" onclick=\"add(" + item.gubun + ", " + item.exno + ")\">" + item.exname + "</a></td>";
html += " <td>" + cShape + "</td>";
html += " <td>" + testDate + "</td>";
html += " <td>" + rsType + "</td>";
html += " <td>" + estKind +"</td>"
html += " <td><a href=\"javascript:;\" class=\"delete-link\" onclick=\"del(" + item.estkind + ", " + item.exno + ")\">[삭제]</a></td>";
html += "</tr>";
});
$("#tbody1").html(html);
}
}
</script>
}