YNICTE/BO/Views/cm/cmreginning.cshtml

529 lines
30 KiB
Plaintext
Raw Normal View History

2020-10-12 14:39:23 +09:00
@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="active"><a href="#" data-toggle="tab">회차설정</a></li>
@*20220725 강좌인경우 교육일정 보이도록 처리
@if (Model.CM.ismaster == 0 && Model.CM.cshape == 2)*@
@if (Model.CM.ismaster == 0)
2020-10-22 10:12:30 +09:00
{
<li class=""><a href="#" onclick="gotab(2);" data-toggle="tab">교육일정</a></li>
}
@if (!ViewBag.IsSubAdmin96)
{
<li class=""><a href="#" onclick="gotab(3);" data-toggle="tab">평가설정</a></li>
2025-12-26 23:11:05 +09:00
<li class=""><a href="#" onclick="gotab(5);" data-toggle="tab">시험설정</a></li>
<li class=""><a href="#" onclick="gotab(4);" data-toggle="tab">메뉴설정</a></li>
}
2020-10-12 14:39:23 +09:00
</ul>
</div>
<form id="mform1" method="post" class="form-horizontal">
<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">
@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 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">
<input type="file" name="uploadfile" id="uploadfile" />
<br />
<a href="~/Content/file/cminnings.xlsx" class="btn btn-info">양식다운로드</a>
<a href="#" class="btn btn-primary" onclick="regbatch()">일괄등록</a>
<br />
@Html.Partial("./Partial/Radio", null, new ViewDataDictionary() { { "valuetext", "1:순차학습(이전회차를 반드시 학습완료해야 다음회차 학습가능);0:임의학습" }, { "checked", Model.CM.isseq }, { "name", "CM.isseq" } })
<a href="#" class="btn btn-primary" onclick="saveseq();">설정저장</a>
</div>
</div>
</div>
</section>
<div class="tar buttonbox"><a href="#" onclick="reg(0,@Model.CM.cshape);" class="btn btn-s-xs btn-info">등록</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="excel1">
<table class="table table-striped b-t b-light">
<thead>
<tr>
<th width="80">회차</th>
<th>학습방식</th>
<th>강의주제</th>
<th>강사</th>
<th>최근수정일</th>
</tr>
</thead>
<tbody class="data" id="tbody1">
@foreach (var item in Model.CMInnings)
{
<tr>
<td>@item.iseq @(item.istaste == 1 ? "(S)" : "")</td>
<td>@item.isonlinename</td>
2020-10-26 10:26:54 +09:00
<td class="link"><a href="#" onclick="reg(@item.cmino,@item.cshape,@item.isonline)">@item.ititle</a></td>
2020-10-12 14:39:23 +09:00
<td>@item.username</td>
<td>@item.udtymd</td>
</tr>
}
</tbody>
</table>
</div>
</section>
</form>
<form id="dform" method="post" action="/cm/@Model.listviewname">
@Html.Partial("./Partial/DForm", Model, new ViewDataDictionary { { "preform", 1 } })
</form>
<div id="thisbox" class="findbox draggable regbox" style="width: 800px; z-index: 1041; top: 60px; overflow: auto;">
2020-11-12 10:04:27 +09:00
<h4><i class="fa fa-bars"></i> <span id="pcap">회차등록수정</span><a href="#" class="btn btn-default btn-xs f-r closethisbox" onclick="changeRadio();">닫기</a></h4>
2020-10-12 14:39:23 +09:00
<table class="regtable">
<colgroup><col style="width:150px;" /><col /></colgroup>
<tr>
<th>학습방식</th>
2020-11-12 10:04:27 +09:00
<td>
@if (Model.CM.cshape == 0)
{
<input type="radio" name="isonline" id="rdoOnline" value="1" checked><label for="rdoOnline">온라인</label>
2021-03-30 10:10:24 +09:00
<input type="radio" name="isonline" id="rdoOffline" value="0" disabled><label for="rdoOffline">교육장</label>
2020-11-12 10:04:27 +09:00
}
@if (Model.CM.cshape == 1)
{
<input type="radio" name="isonline" id="rdoOnline" value="1" disabled><label for="rdoOnline">온라인</label>
2021-03-30 10:10:24 +09:00
<input type="radio" name="isonline" id="rdoOffline" value="0" checked><label for="rdoOffline">교육장</label>
2020-11-12 10:04:27 +09:00
}
@if (Model.CM.cshape == 2)
{
<input type="radio" name="isonline" id="rdoOnline" value="1" checked><label for="rdoOnline">온라인</label>
2021-03-30 10:10:24 +09:00
<input type="radio" name="isonline" id="rdoOffline" value="0" disabled><label for="rdoOffline">교육장</label>
2020-11-12 10:04:27 +09:00
}
@*@Html.Partial("./Partial/Radio", null, new ViewDataDictionary() { { "valuetext", "1:온라인;0:오프라인" }, { "checked", 1 }, { "name", "isonline" } })*@
</td>
2020-10-12 14:39:23 +09:00
</tr>
<tr>
<th class="req">강의주제</th>
<td>@Html.TextBox("ititle", "", new { @class = "form-control", @style = "", @maxlength = "100" })</td>
</tr>
2020-10-26 10:26:54 +09:00
<tr class="troffline" id="scdLocation">
2020-10-12 14:39:23 +09:00
<th class="req">강의장소</th>
<td>@Html.TextBox("icontent", "", new { @class = "form-control", @style = "", @maxlength = "250" })</td>
</tr>
2020-10-26 10:26:54 +09:00
<tr class="troffline" id="scdTime">
2020-10-12 14:39:23 +09:00
<th class="req">학습시점/시간</th>
<td>
@Html.Partial("./Partial/Date", (DateTime?)null, new ViewDataDictionary { { "name", "idate" } })
@Html.Partial("./Partial/Select", "", new ViewDataDictionary { { "special", "fromto" }, { "name", "iday" }, { "start", 1 }, { "end", 31 }, { "textadd", "일차" }, { "df", ":-일차" }, { "class", "disp-init" }, { "style", "width: 100px;" } })
&nbsp;&nbsp;
@Html.Partial("./Partial/Select", "", new ViewDataDictionary { { "special", "fromto" }, { "name", "isth" }, { "start", 0 }, { "end", 23 }, { "textadd", "시" }, { "df", ":-시" }, { "class", "disp-init" }, { "style", "width: 80px;" } })
@Html.Partial("./Partial/Select", "", new ViewDataDictionary { { "special", "fromto" }, { "name", "istm" }, { "start", 0 }, { "end", 59 }, { "textadd", "분" }, { "df", ":-분" }, { "class", "disp-init" }, { "style", "width: 80px;" } })
~
@Html.Partial("./Partial/Select", "", new ViewDataDictionary { { "special", "fromto" }, { "name", "ieth" }, { "start", 0 }, { "end", 23 }, { "textadd", "시" }, { "df", ":-시" }, { "class", "disp-init" }, { "style", "width: 80px;" } })
@Html.Partial("./Partial/Select", "", new ViewDataDictionary { { "special", "fromto" }, { "name", "ietm" }, { "start", 0 }, { "end", 59 }, { "textadd", "분" }, { "df", ":-분" }, { "class", "disp-init" }, { "style", "width: 80px;" } })
</td>
</tr>
<tr class="troffline">
<th>교안</th>
<td>
<input type="hidden" name="fgnotf" id="fgnotf" />
<input type="file" name="filetf" id="filetf" />
<div id="files"></div>
</td>
</tr>
<tr class="tronline">
<th class="req">콘텐츠</th>
<td class="selectgroupulbox">
<a href="#" class="btn btn-info btn-find btn-xs data-find data-find-float" onclick="findcontentshow()"><i class="fa fa-search"></i></a>
<ul class="selectgroupul" id="contentdatabox">
@*<li class="no@ctno" data-no="@ctno"><label>@ctname</label><a href="#" class="adel" onclick="ullidel(this)">X</a></li>*@
</ul>
&nbsp;<a href="#" class="btn btn-info btn-xxs withhidedelitem" style="margin-top: -20px; display: none;" id="btnpreview" onclick="viewcontent(0)">[미리보기]</a>
</td>
</tr>
2020-12-21 14:18:36 +09:00
<tr style="display:none;">
2020-10-12 14:39:23 +09:00
<th>맛보기</th>
<td>@Html.Partial("./Partial/Radio", null, new ViewDataDictionary() { { "valuetext", "1:예;0:아니오" }, { "checked", 0 }, { "name", "istaste" } })</td>
</tr>
<tr class="tronline">
<th class="req">학습시간</th>
<td>@Html.TextBox("sttime", 0, new { @class = "form-control disp-init int nocomma text-center", @style = "width: 80px;", @maxlength = "3" })분</td>
</tr>
<tr class="tronline">
<th class="req">출석인정시간</th>
<td>@Html.TextBox("atime", 0, new { @class = "form-control disp-init int nocomma text-center", @style = "width: 80px;", @maxlength = "3" })분</td>
</tr>
<tr class="tronline">
<th>중간출석팝업</th>
<td>
@Html.TextBox("mstime", 0, new { @class = "form-control disp-init int nocomma text-center", @style = "width: 80px;", @maxlength = "3" })분
~
@Html.TextBox("metime", 0, new { @class = "form-control disp-init int nocomma text-center", @style = "width: 80px;", @maxlength = "3" })분
</td>
</tr>
<tr>
<th class="req">강사</th>
<td>@Html.Partial("./Partial/Select", Model.CMPRs, new ViewDataDictionary { { "special", "reg" }, { "name", "userno" }, { "selected", "" }, { "df", ":-강사선택" }, { "class", "disp-init" } })</td>
</tr>
<tr>
<th class="req">회차(순서)</th>
<td>@Html.TextBox("iseq", "", new { @class = "form-control disp-init int nocomma text-center", @style = "width: 80px;", @maxlength = "3" })</td>
</tr>
</table>
2020-10-26 10:26:54 +09:00
<div class="findboxbtnbox" id="scdSave">
2020-10-12 14:39:23 +09:00
<a href="#" class="btn btn-primary" onclick="save();">저장</a>
<a href="#" class="btn btn-danger" id="btndel" onclick="del();">삭제</a>
</div>
<br /><br />
</div>
2020-10-23 17:42:52 +09:00
2020-10-12 14:39:23 +09:00
@Html.Partial("./Partial/ContentBox", "bindContent;콘텐츠 선택;1;" + (Model.CM.pcmno ?? Model.CM.cmno) + ";thisbox", new ViewDataDictionary { { "cms", Model.CMs } })
@section styles{
}
@section scriptsHeader{
@Html.Partial("./Partial/ScriptDate")
}
@section scripts{
2020-10-23 17:42:52 +09:00
<script>
2020-10-12 14:39:23 +09:00
$(document).ready(function () {
2020-10-23 17:42:52 +09:00
2020-10-12 14:39:23 +09:00
$("input[name='isonline']").on("change", function () {
2020-10-23 17:42:52 +09:00
2020-10-12 14:39:23 +09:00
$(".troffline,.tronline").hide();
if ($(this).val() == "1") {
$(".tronline").show();
2020-10-26 10:26:54 +09:00
$("#scdSave").show();
}
else
{
2020-10-12 14:39:23 +09:00
$(".troffline").show();
if ($("#files").html() == "") {
$("#filetf").show();
}
$("#idate,#iday").hide();
$("#idate").next("i").hide();
if (@Model.CM.ismaster == 1) {
$("#iday").show();
} else {
$("#idate").show();
$("#idate").next("i").show();
}
2020-10-26 10:26:54 +09:00
if (@Model.CM.ismaster == 0 && @Model.CM.cshape == 2) {
$("#scdLocation").hide();
$("#scdTime").hide();
$("#scdSave").hide();
}
else {
$("#scdLocation").show();
$("#scdTime").show();
$("#scdSave").show();
}
2020-10-12 14:39:23 +09:00
}
});
});
function bindContent(ui) {
var split1 = ""; var split2 = ""; var split3 = ""; var split4 = ""; var split5 = "";
$("#contentdatabox li").remove();
$.each($(ui.split(';')), function (i, d) {
if ($("#contentdatabox li.no" + d.split(':')[0]).length < 1) {
if (!isnulloremt(d.split(':')[4])) { split1 = "[" + d.split(':')[4] + "]"; } if (!isnulloremt(d.split(':')[5])) { split2 = "[" + d.split(':')[5] + "]"; } if (!isnulloremt(d.split(':')[6])) { split3 = "[" + d.split(':')[6] + "]"; } if (!isnulloremt(d.split(':')[7])) { split4 = "[" + d.split(':')[7] + "]"; } if (!isnulloremt(d.split(':')[8])) { split5 = "[" + d.split(':')[8] + "]"; }
$("#contentdatabox").append("<li style=\"margin-left:0px;\" class=\"no" + d.split(':')[0] + "\" text-left data-no=\"" + d.split(':')[0] + "\">" + "[" + d.split(':')[1] + "]" + "[" + d.split(':')[2] + "]" + split1 + split2 + split3 + split4 + split5 + d.split(':')[3] + "&nbsp;<a href=\"#\"class=\"adel\" onclick=\"ullidel(this)\">x</a></li>")
$("#btnpreview").show();
}
});
}
function save() {
if (check("ititle", null, "강의주제를 입력해주세요.", true)) { }
else if (getrv("isonline") == "1" && $("#contentdatabox li").length < 1) { msg2("콘텐츠를 등록해주세요."); }
else if (getrv("isonline") == "1" && getint(val("sttime")) < 1) { focus("sttime"); msg2("학습시간을 입력해주세요."); }
else if (getrv("isonline") == "1" && getint(val("atime")) < 1) { focus("atime"); msg2("출석인정시간을 입력해주세요."); }
//else if (getrv("isonline") == "1" && getint(val("mstime")) < 1) { focus("mstime"); msg2("중간출석팝업시간을 입력해주세요."); }
//else if (getrv("isonline") == "1" && getint(val("metime")) < 1) { focus("metime"); msg2("중간출석팝업시간을 입력해주세요."); }
//else if (getrv("isonline") == "1" && getint(val("metime")) >= getint(val("atime"))) { focus("metime"); msg2("중간출석팝업시간을 확인해주세요(출석인정시간보다 빠르게)."); }
//else if (getrv("isonline") == "1" && getint(val("metime")) < getint(val("mstime"))) { focus("metime"); msg2("중간출석팝업시간을 확인해주세요."); }
else if (getrv("isonline") == "0" && check("icontent", null, "강의장소를 입력해주세요.", true)) { }
else if (getrv("isonline") == "0" && @Model.CM.ismaster == 1 && check("iday", null, "학습시점일자를 입력해주세요.", true)) { }
else if (getrv("isonline") == "0" && @Model.CM.ismaster == 0 && check("idate", null, "학습시점일자를 입력해주세요.", true)) { }
else if (getrv("isonline") == "0" && val("isth") == "") { focus("isth"); msg2("학습시간을 확인해주세요."); }
else if (getrv("isonline") == "0" && val("istm") == "") { focus("istm"); msg2("학습시간을 확인해주세요."); }
else if (getrv("isonline") == "0" && val("ieth") == "") { focus("ieth"); msg2("학습시간을 확인해주세요."); }
else if (getrv("isonline") == "0" && val("ietm") == "") { focus("ietm"); msg2("학습시간을 확인해주세요."); }
else if (getrv("isonline") == "0" && getint(val("isth")) > getint(val("ieth"))) { focus("ieth"); msg2("학습시간을 확인해주세요(종료시간이 더 빠름)"); }
else if (getrv("isonline") == "0" && getint(val("isth")) == getint(val("ieth")) && getint(val("istm")) > getint(val("ietm"))) { focus("ieth"); msg2("학습시간을 확인해주세요(종료시간이 더 빠름)"); }
else if (check("userno", null, "강사를 선택해주세요.", true)) { }
else if (getint(val("iseq")) < 1) { focus("iseq"); msg2("회차를 입력해주세요."); }
else if (confirm("저장하시겠습니까?")) {
if (getrv("isonline") == "1") {
2021-11-03 15:19:08 +09:00
capp("/acommon/cminningsave", { cmino: _cmino, cmno: @Model.CM.cmno, isonline: getrv("isonline"), ititle: getv("ititle"), ctno: $("#contentdatabox li").attr("data-no"), istaste: getrv("istaste"), sttime: getint(val("sttime")), atime: getint(val("atime")), mstime: getint(val("mstime")), metime: getint(val("metime")), userno: val("userno"), iseq: val("iseq"), isscd:0 }, "cbcminningsave", null, null,null,true);
2020-10-12 14:39:23 +09:00
} else {
2020-10-20 15:42:40 +09:00
if (@Model.CM.cshape == 2) {
2021-06-03 10:43:16 +09:00
msg2("온라인 교육시 교육장 회차는 등록 할 수 없습니다.");
2020-10-20 15:42:40 +09:00
return;
}
2020-10-12 14:39:23 +09:00
var data = new FormData();
2021-11-03 15:19:08 +09:00
data.append("isscd", 0);
2020-10-12 14:39:23 +09:00
data.append("cmino", _cmino);
data.append("cmno", @Model.CM.cmno);
data.append("isonline", getrv("isonline"));
data.append("ititle", getv("ititle"));
data.append("icontent", val("icontent"));
data.append("idate", val("idate"));
data.append("iday", getint(val("iday")));
data.append("ist", fillzero(val("isth"), true, 2) + fillzero(val("istm"), true, 2));
data.append("iet", fillzero(val("ieth"), true, 2) + fillzero(val("ietm"), true, 2));
data.append("fgnotf", val("fgnotf"));
if ($("#filetf")[0].files.length > 0) {
data.append("filetf", $("#filetf")[0].files[0]);
}
data.append("userno", val("userno"));
data.append("iseq", val("iseq"));
capfile("/acommon/cminningsave", data, "cbcminningsave", null, null, true);
}
}
}
2020-10-23 17:42:52 +09:00
2020-10-12 14:39:23 +09:00
function cbcminningsave() {
if (capResult.code == 1000 && capResult.obj > 0) {
msg2("저장되었습니다.", 0, null, "gotab(1);");
} else {
msg2("이미 등록된 회차입니다. 다른 회차를 입력해주세요.");
}
}
2020-10-26 10:26:54 +09:00
function reg(no, cshape, isonline) {
if (@Model.CM.ismaster == 0 && @Model.CM.cshape == 2 && isonline == 0) {
setTimeout(function () {
2020-11-12 10:04:27 +09:00
$("#rdoOnline").prop("disabled", true);
$("#rdoOffline").prop("disabled", false);
2020-10-26 10:26:54 +09:00
$("#scdLocation").hide();
$("#scdTime").hide();
2020-11-12 15:00:39 +09:00
$("#scdSave").hide(); }, 300);
2020-11-12 10:04:27 +09:00
}
else if (@Model.CM.ismaster == 0 && @Model.CM.cshape == 2 && isonline == 1)
{
$("#rdoOffline").prop("disabled", true);
$("#rdoOnline").prop("disabled", false);
$("#scdLocation").show();
$("#scdTime").show();
$("#scdSave").show();
2020-10-26 10:26:54 +09:00
}
else {
$("#scdLocation").show();
$("#scdTime").show();
$("#scdSave").show();
}
2020-11-12 10:04:27 +09:00
if (isonline == 0) {
setTimeout(function () {
$("#rdoOffline").prop("checked", true).trigger("change");
2020-11-12 15:00:39 +09:00
}, 300);
2020-11-12 10:04:27 +09:00
}
else if (isonline == 1){
setTimeout(function () {
$("#rdoOnline").prop("checked", true).trigger("change");
2020-11-12 15:00:39 +09:00
}, 300);
2020-11-12 10:04:27 +09:00
}
if (@Model.CM.cshape == 0 && isonline == undefined) {
setTimeout(function () {
$("#rdoOnline").prop("checked", true).trigger("change");
2020-11-12 15:00:39 +09:00
}, 300);
2020-11-12 10:04:27 +09:00
}
if (@Model.CM.cshape == 1 && isonline == undefined) {
setTimeout(function () {
$("#rdoOffline").prop("checked", true).trigger("change");
2020-11-12 15:00:39 +09:00
}, 300);
2020-11-12 10:04:27 +09:00
}
if (@Model.CM.cshape == 2 && isonline == undefined) {
setTimeout(function () {
$("#rdoOnline").prop("checked", true).trigger("change");
2020-11-12 15:00:39 +09:00
}, 300);
2020-11-12 10:04:27 +09:00
}
2020-10-12 14:39:23 +09:00
_cmino = no;
$("#btndel,#btnpreview").hide();
$(".troffline,.tronline").hide();
$("#idate,#iday").hide();
$("#idate").next("i").hide();
if (cshape == 0) {
setrv("isonline", 1);
$(".tronline").show();
} else {
setrv("isonline", 0);
$(".troffline").show();
if ($("#files").html() == "") {
2020-10-26 10:26:54 +09:00
$("#filetf").show();
}
2020-10-12 14:39:23 +09:00
if (@Model.CM.ismaster == 1) {
2020-10-26 10:26:54 +09:00
$("#iday").show();
} else {
$("#idate").show();
$("#idate").next("i").show();
}
2020-10-12 14:39:23 +09:00
}
setrv("istaste", 0);
$("#ititle,#icontent,#idate,#iday,#isth,#istm,#ieth,#ietm,#userno,#iseq,#fgnotf,#filetf").val("");
$("#files").html("");
$("#sttime,#atime,#mstime,#metime").val("");
$("#contentdatabox").html("");
$("#pcap").text("회차등록");
if (no < 1) {
bglayer(); $("#thisbox").slideDown("fast", function () { $("#thisbox").scrollTop(0); });
} else {
$("#pcap").text("회차수정");
capp("/acommon/cminningget", { cmino: no }, "cbcminningget", null, null, null, true);
}
}
var _cmino = 0;
function cbcminningget() {
if (capResult.code == 1000) {
var d = capResult.obj;
$("#btndel").show();
setrv("isonline", d.isonline);
setv("ititle", d.ititle);
setv("userno", d.userno);
setv("iseq", d.iseq);
if (d.isonline == 1) {
$("#contentdatabox").append("<li class=\"no" + d.ctno + "\" data-no=\"" + d.ctno + "\"><label>" + d.ctname + "</label><a href=\"#\" class=\"adel\" onclick=\"ullidel(this)\">X</a></li>");
$("#btnpreview").show();
setrv("istaste", d.istaste);
setv("sttime", d.sttime);
setv("atime", d.atime);
setv("mstime", d.mstime);
setv("metime", d.metime);
} else {
$(".troffline").show();
$(".tronline").hide();
setv("icontent", d.icontent);
setv("idate", d.idateymd);
setv("iday", d.iday);
setv("isth", getint(d.ist.substr(0, 2)));
setv("istm", getint(d.ist.substr(2, 2)));
setv("ieth", getint(d.iet.substr(0, 2)));
setv("ietm", getint(d.iet.substr(2, 2)));
setv("fgnotf", getdb(d.fgnotf));
$("#filetf").show();
if (getdb(d.orgname2) != "") {
$("#filetf").hide();
$("#files").append("<a href=\"/aCommon/DownFile?fno=" + d.fileno2 + "\" title=\"다운로드\"><i class=\"fa fa-paperclip\"></i> <span class=\"fileitem\">" + d.orgname2 + "</span></a>" +
"&nbsp;&nbsp;<a href=\"#\" class=\"btn_txt btn btn-xxs btn-danger\" onclick=\"javascript:delfiletf("+d.fileno2+", this, '"+d.cmino+"|9', true, 'cbfgnotfdel()');\" title=\"삭제\">삭제</a>");
}
$("#idate,#iday").hide();
$("#idate").next("i").hide();
if (@Model.CM.ismaster == 1) {
$("#iday").show();
} else {
$("#idate").show();
$("#idate").next("i").show();
}
}
bglayer(); $("#thisbox").slideDown("fast", function () { $("#thisbox").scrollTop(0); });
}
}
function delfiletf(id, a, log, isjs2, cb) {
log = log || "";
if (confirm('삭제 하시겠습니까?')) {
capp('/aCommon/DeleteFile', { key: id, log: log }, cb || "cbdelfilenew", null, null, null, isjs2);
}
}
function cbfgnotfdel() {
if (capResult.code == 1000) {
$("#files").html("");
$("#filetf").show();
}
}
function saveseq() { if (confirm("학습방식을 저장하시겠습니까?")) { capp("/acommon/cmseqsave", { cmno: @Model.CM.cmno, isseq: getrv("CM.isseq") }, "cbsaveseq"); } }
function cbsaveseq() { if (capResult.code == 1000) { msg("학습방식을 변경했습니다.") } else { msgadmin() } }
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(); }
2020-10-22 10:12:30 +09:00
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(); }
2025-12-26 23:11:05 +09:00
else if (idx == 5) { $("#dform").attr("action", "/cm/@(Model.viewname)exset").submit(); }
2020-10-12 14:39:23 +09:00
}, t);
}
function regbatch() {
if ($("#uploadfile").val() == "") { msg("파일을 선택해주세요."); }
else {
var thumbext = $("#uploadfile").val();
thumbext = thumbext.slice(thumbext.indexOf(".") + 1).toLowerCase();
if ("xlsx".indexOf(thumbext) < 0) {
msg("xlsx 확장자만 가능합니다.");
}
else if (confirm("일괄등록하시겠습니까?")) {
var formData = new FormData();
formData.append("uploadfile", $("#uploadfile")[0].files[0]);
formData.append("intval", @Model.CM.cmno);
formData.append("intval2", @Model.CM.ismaster);
formData.append("uploadjob", "cminningbatch");
capfile("/acommon/uploadexcel", formData, "cbregbatch", null, true, false, true);
}
}
}
function cbregbatch() {
//$('#thisbox').slideUp('fast'); $('#bglayer').hide();
//$("#uploadfile").val("");
if (capResult.code == 1000) {
msg("일괄등록을 완료했습니다.", null, true, null, true);
gotab(1, 500);
}
else {
console.log(capResult.msg);
msg("업로드가 실패했습니다.<br /><br />" + capResult.msg);
}
}
function del() {
if (confirm("삭제하시겠습니까?")) {
capp("/acommon/cminningdel", { im: @(Model.CM.ismaster), cmino: _cmino}, "cbdel");
}
}
function cbdel() {
if (capResult.code == 1000) {
msg("삭제했습니다.", null, true, null, true);
gotab(1, 500);
} else {
msg("수강신청정보가 있습니다. 삭제할 수 없습니다.");
}
}
var _ctno;
var _dtype = 1;
function viewcontent(ctno) {
_ctno = ctno < 1 ? $("#contentdatabox li").attr("data-no") : ctno;
capp("/acommon/setauthkey", { dtype: _dtype, intval: _ctno }, "cbauth", null, null, null, true);
}
function cbauth() {
if (capResult.code == 1000) {
var nWidth = "1080";
var nHeight = screen.availHeight;
var popOption = "";
popOption += "width=" + nWidth + "px,";
popOption += "height=" + nHeight + "px,";
popOption += "toolbar=no,menubar=no,location=yes,";
popOption += "resizable=yes,status=yes,scrollbars=yes";
var pop = window.open("@ViewBag.fronturl.Replace("https://", "http://")/CDMS/PlayTaste?authtype=" + _dtype +"&authkey=" + capResult.obj + "&ctno=" + _ctno + "&ismobile=0", 'contentsview', popOption);
if (pop == null) {
msg("팝업이 차단되어 있습니다. 차단을 해제해 주세요.");
}
}
2020-11-12 10:04:27 +09:00
}
function changeRadio() {
if (@Model.CM.ismaster == 0 && @Model.CM.cshape == 2) {
$("#rdoOnline").prop("checked", true);
$("#rdoOnline").prop("disabled", false);
$("#rdoOffline").prop("disabled", true);
2020-10-12 14:39:23 +09:00
}
2020-11-12 10:04:27 +09:00
}
2020-10-23 17:42:52 +09:00
</script>
2020-10-12 14:39:23 +09:00
}