YNICTE/BO/Views/croom/grade1.cshtml

264 lines
12 KiB
Plaintext

@model NP.Model.VMLect
<form id="mform" method="post">
<section class="panel panel-default">
<div style="padding: 5px 10px; text-align: right;">
@Html.Partial("./Partial/Select", null, new ViewDataDictionary { { "valuetext", ":전체;1:환급;0:비관급" }, { "name", "addstringval" }, { "selected", Model.addstringval }, { "style", "position: absolute; left: 0; margin-left: 50px;" + (Model.CM.isrefund == 1 ? "" : "display:none;") }, { "onchange", "findme()" } })
@Html.Partial("./Partial/sembtns", "#tbody1;" + (Model.IsAdmin ? "1;1" : "0;0") + ";1;1;0;평가안내")
&nbsp;&nbsp;&nbsp;
@if (!ViewBag.IsSubAdmin96)
{
if (Model.IsAdmin)
{
<a href="#" class="btn btn-primary" onclick="save();">출석완료처리</a>
}
<a href="#" class="btn btn-danger" onclick="save2();">OFF출결관리</a>
@Html.Raw("&nbsp;&nbsp;&nbsp");
}
<a href="#" class="btn btn-default" onclick="golist();">목록</a>
</div>
<div class="table-responsive" id="excel1">
<table class="table table-striped b-t b-light">
<thead>
<tr>
<th><input type="checkbox" onclick="javascript: checkall('excel1', this);" /></th>
<th width="20">No</th>
<th>구분</th>
<th>고객사</th>
<th>교육생(ID)</th>
<th>진도율</th>
<th>최초학습</th>
<th>최근학습</th>
<th>상세이력</th>
</tr>
</thead>
<tbody class="data" id="tbody1">
@foreach (var d in Model.Lects)
{
<tr>
<td><input type="checkbox" class="autocheck" value="@d.lectno" data-userno="@d.userno" /></td>
<td>@d.rnorvt</td>
<td>@d.isrebatename</td>
<td>@d.asname</td>
<td>@d.usernameid</td>
<td>@string.Format("{0}%({1}/{2})", d.attrate, d.countattok, d.countinning)</td>
<td>@Html.Raw(d.stime == null ? "" : string.Format("{0}<br />{1}", d.stime.Value.ToString("yyyy-MM-dd HH:mm:ss"), d.sip))</td>
<td>@Html.Raw(d.etime == null ? "" : string.Format("{0}<br />{1}", d.etime.Value.ToString("yyyy-MM-dd HH:mm:ss"), d.eip))</td>
<td class="link text-center"><a onclick="viewatt(@d.lectno)" href="#">조회</a></td>
</tr>
}
</tbody>
</table>
</div>
</section>
@Html.Partial("./Partial/dform", Model)
</form>
<div id="thisbox" class="findbox draggable regbox" style="width: 800px; z-index: 1041; top: 60px; bottom: 30px; overflow: auto;">
<h4><i class="fa fa-bars"></i> <span id="pcap">OFF출결관리</span><a href="#" class="btn btn-default btn-xs f-r closethisbox">닫기</a></h4>
<br />
<table class="regtable">
<colgroup><col width="100" /><col /></colgroup>
<tr>
<th>회차선택</th>
<td>
<select id="cmino" class="form-control" onchange="getoff()">
<option value="">-회차선택</option>
@foreach (var d in Model.CMInnings)
{
if (Model.CM.cshape == 2)
{
<option value="@d.cmino">@string.Format("{0}.{1}", d.iseq, d.ititle)</option>
}
else
{
<option value="@d.cmino">@string.Format("{0}.{1}({2} {3}:{4}~{5}:{6})", d.iseq, d.ititle, d.idate.ToString("yy-MM-dd"), d.ist.Substring(0, 2), d.ist.Substring(2, 2), d.iet.Substring(0, 2), d.iet.Substring(2, 2))</option>
}
}
</select>
</td>
</tr>
<tr>
<th>근거자료</th>
<td id="tdfile"></td>
</tr>
</table>
<br />
<section class="panel panel-default">
<div class="table-responsive">
<table class="table table-striped b-t b-light">
<colgroup><col width="50" /><col /><col /><col /><col /><col /><col /><col /></colgroup>
<thead>
<tr>
<th>No</th>
<th>고객사</th>
<th>교육생(ID)</th>
<th>입실</th>
<th>퇴실</th>
<th>미입력&nbsp;&nbsp;<input type="radio" name="attradio" onchange="changeatt('-1')" /></th>
<th>출석&nbsp;&nbsp;<input type="radio" name="attradio" onchange="changeatt('2')" /></th>
<th>결석&nbsp;&nbsp;<input type="radio" name="attradio" onchange="changeatt('0')" /></th>
</tr>
</thead>
<tbody id="tbodyoff"></tbody>
</table>
</div>
</section>
<div class="findboxbtnbox">
<a href="#" class="btn btn-primary" onclick="saveatt();">저장</a>
</div>
<br /><br />
</div>
<div id="thisbox2" class="findbox draggable regbox" style="width: 800px; z-index: 1041; top: 60px; bottom: 30px; overflow: auto;">
<h4><i class="fa fa-bars"></i> <span id="pcap">개인별 출결이력조회</span><a href="#" class="btn btn-default btn-xs f-r closethisbox">닫기</a></h4>
<br />
<table class="regtable">
<colgroup><col width="100" /><col /></colgroup>
<tr>
<th>신청자정보</th>
<td><p class="form-control-static" id="userinfo"></p></td>
<th>신청구분</th>
<td><p class="form-control-static" id="isrebatename"></p></td>
</tr>
</table>
<br />
<section class="panel panel-default">
<div class="table-responsive">
<table class="table table-striped b-t b-light">
<colgroup><col width="50" /><col /><col /><col /><col /><col /><col /><col /></colgroup>
<thead>
<tr>
<th>회차</th>
<th>방식</th>
<th>강의주제</th>
<th>인정시간</th>
<th>학습시간</th>
<th>최초 학습시작일(IP)</th>
<th>최근 학습종료일(IP)</th>
<th>상태</th>
</tr>
</thead>
<tbody id="tbodyinning"></tbody>
</table>
</div>
</section>
<br /><br />
</div>
<script>
$(document).ready(function () {
});
function findme() {
bglayer(); submit();
}
function save() {
var lectnos = "";
$.each($("#tbody1 tr td input.autocheck:checked"), function () {
lectnos += "," + $(this).val();
});
if (lectnos == "") {
msg("출석완료처리할 대상자를 선택해주세요.");
} else if (confirm("선택한 대상자의 모든학습을 출석완료처리하시겠습니까?")) {
capp("/acommon/lectcomplete", { cmno: @Model.CM.cmno, lectnos: lectnos.substr(1), type: 'all' }, "cbsave");
}
}
function cbsave() {
if (capResult.code == 1000) {
msgf("일괄 출석처리했습니다.", "submit('mform', 0, true)");
} else {
msgdev();
}
}
function save2() {
bglayer(); $("#thisbox").slideDown("fast", function () { $("#thisbox").scrollTop(0); });
if ($("#cmino option").length > 1) {
setv("cmino", $("#cmino option:eq(1)").val());
getoff();
}
}
function getoff() {
$("#tdfile").html("");
$("#tbodyoff tr").remove();
$("input[name='attradio']:checked").prop("checked", false);
if ($("#cmino").val() != "") {
capp("/acommon/cminninggetforoff", { cmino: val("cmino") }, "cbcmiget", null, null, null, true);
}
}
var _fgno;
function cbthisfiledel() {
if (capResult.code == 1000) {
$("#tdfile").html("<input type=\"file\" id=\"file\" name=\"file\" />");
msg2("삭제되었습니다.", 1);
}
else {
msg2("삭제할 권한이 없습니다.", 1);
}
}
function cbcmiget() {
var ci = capResult.obj.ci;
setv("fgno", getdb(ci.fgno));
_fgno = ci.fgno;
if (ci.fileno > 0) {
$("#tdfile").html("<div class=\"fileitembox\"><a href=\"/aCommon/DownFile?fno=" + ci.fileno + "\" title=\"다운로드\"><i class=\"fa fa-paperclip\"></i> <span class=\"fileitem\">" + ci.orgname + "</span></a>&nbsp;&nbsp;" +
"<a href=\"#\" class=\"btn_txt btn btn-xxs btn-danger\" onclick=\"javascript:fnFileDeleteNew(" + ci.fileno + ", this, '', true, 'cbthisfiledel()');\" title=\"삭제\">삭제</a></div>");
}
else {
$("#tdfile").html("<input type=\"file\" id=\"file\" name=\"file\" />");
}
$.each(capResult.obj.li, function (i, d) {
$("#tbodyoff").append("<tr data-no=\""+d.lectno+"\" data-attorg=\""+getdb(d.istatus)+"\">" +
"<td>" + d.rnorvt + "</td>" +
"<td>" + getdb(d.asname) + "</td>" +
"<td>" + getdb(d.username) + "(" + getdb(d.userid) +")" + "</td>" +
"<td>" + d.stimehm + "</td>" +
"<td>" + d.etimehm + "</td>" +
"<td><input type=\"radio\" class=\"att att-1\" name=\"istatus" + d.lectno + "\" " + (isnull(d.istatus) ? "checked" : "") + " value=\"\" /></td>" +
"<td><input type=\"radio\" class=\"att att2\" name=\"istatus" + d.lectno + "\" " + (getdb(d.istatus) == "2" ? "checked" : "") + " value=\"2\" /></td>" +
"<td><input type=\"radio\" class=\"att att0\" name=\"istatus" + d.lectno + "\" " + (!isnull(d.istatus) && getdb(d.istatus)=="" || getdb(d.istatus) == "1" ? "checked" : "") + " value=\"0\" /></td></tr>");
});
}
function changeatt(idx) {
$("input.att" + idx).prop("checked", true);
}
function saveatt() {
if (val("cmino") == "") { focus("cmino"); msg2("회차를 선택해주세요."); }
else if ($("#tbodyoff tr").length < 1) { msg2("저장할 출석데이터가 없습니다."); }
else if (confirm("출석데이터를 저장하시겠습니까?")) {
var data = new FormData();
data.append("cmino", val("cmino"));
if ($("#file").length > 0 && $("#file")[0].files.length > 0) {
data.append("file", $("#file")[0].files[0]);
}
var lis = "";
$.each($("#tbodyoff tr"), function (i, r) {
//if ($(r).find("input.att:checked").val() != $(r).attr("data-attorg")) {
lis += ";" + $(r).attr("data-no") + ":" + $(r).find("input.att:checked").val();
//}
});
//if (lis == "") {
// msg2("저장했습니다.");
//} else {
data.append("lis", lis.substr(1));
data.append("fgno", _fgno);
capfile("/acommon/offattsave", data, "cboffattsave", false, null, true, true);
//}
}
}
function cboffattsave() {
if (capResult.code == 1000) {
msgf2("저장했습니다.", "submit('mform', 0, true)");
} else { msgdev(true);}
}
var _no = 0;
function viewatt(no) {
_no = no;
showramemainlayer("/croom/atts?longval=" + no);
}
function childsaved(){
//showramemainlayer("/croom/atts?longval=" + _no + "&IsSavedForParent=1");
$("#mainlayerframe")[0].contentWindow.location.replace("/croom/atts?longval=" + _no + "&IsSavedForParent=1");
}
function pagerefresh() {
findme();
}
</script>