YNICTE/BO/Views/cm/cmregest.cshtml

253 lines
16 KiB
Plaintext

@model NP.Model.VMCM
<div style="@(Model.CM.cmno < 1 ? "display: none;":"")">
<ul class="pagination pagination-md" style="margin: 0;">
<li class=""><a href="#" onclick="gotab(0);" data-toggle="tab">기본정보</a></li>
<li class=""><a href="#" onclick="gotab(1);" data-toggle="tab">회차설정</a></li>
@*20220725 강좌인경우 교육일정 보이도록 처리
@if(Model.CM.ismaster == 0 && Model.CM.cshape == 2) *@
@if (Model.CM.ismaster == 0)
{
<li class=""><a href="#" onclick="gotab(2);" data-toggle="tab">교육일정</a></li>
}
<li class="active"><a href="#" data-toggle="tab">평가설정</a></li>
<li class=""><a href="#" onclick="gotab(4);" data-toggle="tab">메뉴설정</a></li>
</ul>
</div>
<form id="mform" method="post" class="form-horizontal">
<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" 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>
<table class="regtable" id="esttable">
<colgroup><col style="width: 80px;display:none;" /><col style="width: 100px;" /><col /><col /><col /><col /><col /><col /><col style="display:none;" /></colgroup>
<tr><th style="display:none;">기준</th><th>평가항목</th><th>진도율</th>@*<th>진행평가(%)</th>*@<th>최종평가(%)</th><th>과제(%)</th><th style="display:none;">토론(%)</th><th style="display:none;">기타(%)</th><th>합계(총점)</th></tr>
<tr class="auto" id="trest">
<th rowspan="2" style="display:none;">비환급</th>
<th>비율(점수)</th>
<td><input type="text" class="form-control int nocomma" maxlength="100" name="attend" id="attend" value="@Model.CMEV.attend" /></td>
<td style="display:none;"><input type="text" class="form-control int nocomma" maxlength="100" name="mid" id="mid" value="@Model.CMEV.mid" /></td>
<td><input type="text" class="form-control int nocomma" maxlength="100" name="final" id="final" value="@Model.CMEV.final" /></td>
<td><input type="text" class="form-control int nocomma" maxlength="100" name="subject" id="subject" value="@Model.CMEV.subject" /></td>
<td style="display:none;"><input type="text" class="form-control int nocomma" maxlength="100" name="discuss" id="discuss" value="@Model.CMEV.discuss" /></td>
<td style="display:none;"><input type="text" class="form-control int nocomma" maxlength="100" name="etc" id="etc" value="@Model.CMEV.etc" /></td>
<td><input type="text" class="form-control int nocomma tot" maxlength="100" name="tot" id="tot" value="@(Model.CMEV.attend+Model.CMEV.mid+Model.CMEV.final+Model.CMEV.subject+Model.CMEV.discuss+Model.CMEV.etc)" readonly="readonly" /></td>
</tr>
<tr id="trestcut">
<th>수료기준</th>
<td><input type="text" class="form-control int nocomma" maxlength="100" name="attendcut" id="attendcut" value="@Model.CMEV.attendcut" /></td>
<td style="display:none;"><input type="text" class="form-control int nocomma" maxlength="100" name="midcut" id="midcut" value="@Model.CMEV.midcut" /></td>
<td><input type="text" class="form-control int nocomma" maxlength="100" name="finalcut" id="finalcut" value="@Model.CMEV.finalcut" /></td>
<td><input type="text" class="form-control int nocomma" maxlength="100" name="subjectcut" id="subjectcut" value="@Model.CMEV.subjectcut" /></td>
<td style="display:none;"><input type="text" class="form-control int nocomma" maxlength="100" name="discusscut" id="discusscut" value="@Model.CMEV.discusscut" /></td>
<td style="display:none;"><input type="text" class="form-control int nocomma" maxlength="100" name="etccut" id="etccut" value="@Model.CMEV.etccut" /></td>
<td><input type="text" class="form-control int nocomma" maxlength="100" name="cut" id="cut" value="@Model.CMEV.cut" /></td>
</tr>
@* <tr class="auto" id="trestrfd" style="@(Model.CM.isrefund == 1?"":"display:none;")">
<th rowspan="2" style="display:none;">환급</th>
<th>비율(점수)</th>
<td><input type="text" class="form-control int nocomma" maxlength="100" name="attendrfd" id="attendrfd" value="@Model.CMEV.attendrfd" /></td>
<td><input type="text" class="form-control int nocomma" maxlength="100" name="midrfd" id="midrfd" value="@Model.CMEV.midrfd" /></td>
<td><input type="text" class="form-control int nocomma" maxlength="100" name="finalrfd" id="finalrfd" value="@Model.CMEV.finalrfd" /></td>
<td><input type="text" class="form-control int nocomma" maxlength="100" name="subjectrfd" id="subjectrfd" value="@Model.CMEV.subjectrfd" /></td>
<td style="display:none;"><input type="text" class="form-control int nocomma" maxlength="100" name="discussrfd" id="discussrfd" value="@Model.CMEV.discussrfd" /></td>
<td style="display:none;"><input type="text" class="form-control int nocomma" maxlength="100" name="etcrfd" id="etcrfd" value="@Model.CMEV.etcrfd" /></td>
<td><input type="text" class="form-control int nocomma tot" maxlength="100" name="totrfd" id="totrfd" value="@(Model.CMEV.attendrfd+Model.CMEV.midrfd+Model.CMEV.finalrfd+Model.CMEV.subjectrfd+Model.CMEV.discussrfd+Model.CMEV.etcrfd)" readonly="readonly" /></td>
</tr>
<tr id="trestcutrfd" style="@(Model.CM.isrefund == 1?"":"display:none;")">
<th>수료기준</th>
<td><input type="text" class="form-control int nocomma" maxlength="100" name="attendcutrfd" id="attendcutrfd" value="@Model.CMEV.attendcutrfd" /></td>
<td><input type="text" class="form-control int nocomma" maxlength="100" name="midcutrfd" id="midcutrfd" value="@Model.CMEV.midcutrfd" /></td>
<td><input type="text" class="form-control int nocomma" maxlength="100" name="finalcutrfd" id="finalcutrfd" value="@Model.CMEV.finalcutrfd" /></td>
<td><input type="text" class="form-control int nocomma" maxlength="100" name="subjectcutrfd" id="subjectcutrfd" value="@Model.CMEV.subjectcutrfd" /></td>
<td style="display:none;"><input type="text" class="form-control int nocomma" maxlength="100" name="discusscutrfd" id="discusscutrfd" value="@Model.CMEV.discusscutrfd" /></td>
<td style="display:none;"><input type="text" class="form-control int nocomma" maxlength="100" name="etccutrfd" id="etccutrfd" value="@Model.CMEV.etccutrfd" /></td>
<td><input type="text" class="form-control int nocomma" maxlength="100" name="cutrfd" id="cutrfd" value="@Model.CMEV.cutrfd" /></td>
</tr>*@
</table>
</section>
@if (Model.CM.cshape == 2)//혼합유형
{
<div id="divoffabs" style="@(Model.CMEV.scdtype == 1 ? "display:none;" : "")">
<label><input type="checkbox" @(Model.CMEV.scdtype == 1 ? "disabled" : "") name="isoffabs" id="isoffabs" @(Model.CMEV.isoffabs != 0 ? "checked" : "") /> 집합교육 출석 필수</label>
</div>
}
<div style="padding-left: 0px; font-weight: bold;">
※ 비율의 합은 100%가 되어야 하며, 합계(총점) 수료기준은 반드시 입력하셔야 합니다.<br />
※ 수료기준은 각 평가기준별 받아야하는 최소 점수를 의미합니다.<br /><br />
</div>
<div class="buttonbox text-center"><a href="#" onclick="save();" class="btn btn-s-xs btn-info">평가기준 및 비율 저장</a></div>
<br />
<div class="tar buttonbox">
<a href="#" onclick="add(0, 0);" class="btn btn-s-xs btn-primary">최종평가추가</a>
<a href="#" onclick="add(1, 0);" class="btn btn-s-xs btn-primary">과제추가</a>
<a href="#" onclick="add(2, 0);" class="btn btn-s-xs btn-primary">설문추가</a>
</div>
<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="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>
</tr>
</thead>
<tbody class="data" id="tbody1">
@foreach (var item in Model.ESTs)
{
<tr>
<td>@item.estkindname</td>
<td>@item.rno</td>
<td class="link"><a href="#" onclick="add(@item.gubun, @item.exno)">@item.exname</a></td>
<td>출석 @item.econdition 이상</td>
<td>@(item.estkind < 30 ? (item.tpoint.ToString() + "점") : "-")</td>
<td><a href="#" style="color: red;" onclick="del(@(item.estkind), @item.exno)">[삭제]</a></td>
</tr>
}
</tbody>
</table>
</div>
</section>
<input type="hidden" name="cmno" value="@Model.CM.cmno" />
</form>
<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;}
</style>
}
@section scriptsHeader{
}
@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 () {
if (idx == 0) { $("#dform").attr("action", "/cm/@Model.viewname").submit(); }
else if (idx == 1) { $("#dform").attr("action", "/cm/@(Model.viewname)inning").submit(); }
else if (idx == 2) { $("#dform").attr("action", "/cm/@(Model.viewname)eduschedule").submit(); }
else if (idx == 3) { $("#dform").attr("action", "/cm/@(Model.viewname)est").submit(); }
else if (idx == 4) { $("#dform").attr("action", "/cm/@(Model.viewname)menu").submit(); }
}, 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 == true ? 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(3, 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("수강데이터가 생성되어 삭제할 수 없습니다.");
}
}
</script>
}