YNICTE/BO/Views/croom/atts.cshtml

235 lines
10 KiB
Plaintext

@model NP.Model.VMLect
@{ Layout = "~/Views/Shared/_PopupLayout.cshtml";}
<ul class="pagination pagination-md">
<li class="active"><a href="#" onclick="gotab(0);" data-toggle="tab">출결이력</a></li>
<li style="display:none;"><a href="#" onclick="gotab(1);" data-toggle="tab">활동이력</a></li>
</ul>
<table class="regtable" style="margin-top: 0;">
<colgroup><col width="100" /><col width="300" /><col width="100" /><col /></colgroup>
<tr><th>신청자 정보</th><td>@string.Format("({0}) {1}", Model.Lect.asname, Model.Lect.usernameid)</td><th>신청구분</th><td>@Model.Lect.isrebatename</td></tr>
</table>
<br />
<div id="tab0">
<section class="panel panel-default">
<div class="table-responsive" id="excel1">
<table class="table table-striped b-t b-light no-odd">
<thead>
<tr>
<th width="20">회차</th>
<th>방식</th>
<th>강의주제</th>
<th>인정시간</th>
<th>학습시간(페이지)</th>
<th>최초학습시작일(IP)</th>
<th>최근학습종료일(IP)</th>
<th>상태</th>
</tr>
</thead>
<tbody class="data" id="tbody1">
@foreach(var iseq in Model.LectInningPages.Select(s=>s.iseq).Distinct())
{
var inning = Model.LectInningPages.Where(w => w.iseq == iseq).First();
<tr data-cmino="@inning.cmino" data-cpno="@inning.cpno">
<td>@inning.iseq</td>
<td>@inning.isonlinename2</td>
<td>@inning.ititle</td>
<td>@inning.atimename</td>
<td class="@(inning.isonline==1 && inning.istatus != null ?"link":"") text-center">
@if (inning.isonline == 1 && inning.istatus != null @*&& inning.cpno > 0*@)
{
<a href="#" onclick="viewpage(@inning.cmino, this)">@inning.litotstudymin 분 <i class="fa fa-level-down"></i></a>
}
else
{
@:-
}
</td>
<td>@inning.listimeymdhms<br />@string.Format("({0}|{1})", inning.liispcsname, inning.lisips)</td>
<td>@inning.lietimeymdhms<br />@string.Format("({0})", inning.lieips)</td>
<td>
@if (inning.isonline == 1 && ((inning.istatus == 0 || inning.istatus == 1) || (inning.istatus==2 && inning.statustime != null)))
{
<a href="#" class="link" style="color: #0094ff; text-decoration: underline;" onclick="viewabs(@inning.lectno, @inning.cmino, @inning.istatus, '@inning.statususername', '@inning.statususerid', '@inning.statustimename', '@((inning.statusreason??"").Replace("\n","newline"))')">@inning.istatusname</a>
}
else
{
@inning.istatusname
}
</td>
</tr>
if (inning.isonline == 1 && inning.istatus != null/* && inning.cpno > 0*/)
{
var innings = Model.LectInningPages.Where(w => w.iseq == iseq);
<tr class="trpage hide trpage@(inning.cmino)">
<td colspan="4">&nbsp;</td>
<td>
<ul>
@foreach (var d in innings)
{
<li>@string.Format("{0}분 ({1})", d.totstudymin, d.pseqname)</li>
}
</ul>
</td>
<td>
<ul>
@foreach (var d in innings)
{
<li>@d.stimeymdhms<br />@string.Format("({0}|{1})", d.ispcsname, d.sip)</li>
}
</ul>
</td>
<td>
<ul>
@foreach (var d in innings)
{
<li>@d.etimeymdhms<br />@string.Format("({0})", d.eip)</li>
}
</ul>
</td>
<td>&nbsp;</td>
</tr>
}
}
</tbody>
</table>
</div>
</section>
</div>
<div id="tab1" style="display: none;">
<div>
@Html.Partial("./Partial/Date", Model.Lect.sstime, new ViewDataDictionary { { "name", "start" } })
~
@Html.Partial("./Partial/Date", Model.Lect.setime, new ViewDataDictionary { { "name", "end" } })
<a href="#" class="btn btn-find btn-info btn-sm" onclick="findme()">검색</a>
</div>
<section class="panel panel-default">
<div class="table-responsive" id="excel1">
<table class="table table-striped b-t b-light no-odd">
<thead>
<tr>
<th>접속시간</th>
<th>접속IP</th>
<th>페이지</th>
</tr>
</thead>
<tbody id="tbody2">
</tbody>
</table>
</div>
</section>
</div>
<div class="botfixempty">&nbsp;</div>
<div class="form-group botfix" style="margin-left: -20px;">
<a href="#" class="btn btn-danger" onclick="goparent(val('IsSavedForParent') == '1');">닫기</a>
</div>
<div id="thisbox" class="findbox draggable regbox" style="width: 500px; z-index: 1041; top: 60px; 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>
<table class="regtable">
<colgroup><col style="width:150px;"><col></colgroup>
<tbody>
<tr>
<th>담당자</th>
<td><p id="statususer" class="form-static-control"></p></td>
</tr>
<tr>
<th>정정일</th>
<td><p id="statustime" class="form-static-control"></p></td>
</tr>
<tr>
<th>사유</th>
<td><textarea id="statusreason" class="form-control" style="resize: none;" maxlength="90"></textarea></td>
</tr>
</tbody>
</table>
<div class="findboxbtnbox">
<a href="#" class="btn btn-primary" id="btnsavereason" onclick="savereason();">저장</a>
</div>
<br><br>
</div>
<form id="mform" method="post">
@Html.HiddenFor(m => m.longval)
@Html.HiddenFor(m => m.IsSavedForParent)
</form>
@section styles{
<style type="text/css">
.panel .table-striped.no-odd > tbody > tr:nth-child(odd).trpage > td{background-color: #f7f7f7 !important}
tr.hide{display: none;}
</style>
}
@section scriptsHeader{
@Html.Partial("./Partial/ScriptDate")
}
@section scripts{
<script>
$(document).ready(function () {
});
var _ischanged = false;
function viewpage(cmino, a) {
if ($(a).find("i").hasClass("fa-level-down")) {
$("tr.trpage" + cmino).removeClass("hide");
$(a).find("i").removeClass("fa-level-down").addClass("fa-level-up");
} else {
$("tr.trpage" + cmino).addClass("hide");
$(a).find("i").removeClass("fa-level-up").addClass("fa-level-down");
}
}
var _lectno = 0;
var _cmino = 0;
function viewabs(lectno, cmino, istatus, statususername, statususerid, statustimename, statusreason) {
$("#statusreason").removeAttr("readonly");
$("#btnsavereason").show();
_lectno = 0;
_cmino = 0;
$("#statustime,#statusreason,#statusreason").text("");
if (istatus == 2) {
$("#statususer").text(statususername + "(" + statususerid + ")");
$("#statustime").text(statustimename);
$("#statusreason").text(statusreason.replace(/newline/gi,'\n'));
$("#btnsavereason").hide();
$("#statusreason").attr("readonly", "readonly");
} else {
_lectno = lectno;
_cmino = cmino;
$("#statususer").text('@ViewBag.SSUserName');
}
bglayer(); $("#thisbox").slideDown("fast", function () {
$("#statusreason").focus();
});
}
function savereason() {
if (check("statusreason", null, "사유를 입력해주세요.", true)) { }
else if (confirm("출석처리하시겠습니까?")) {
capp("/acommon/attabs", { lectno: _lectno, cmino: _cmino, reason: val("statusreason") }, "cbsavereason", null, null, null, true);
}
}
function cbsavereason() {
if (capResult.code == 1000) {
_ischanged = true;
parent.childsaved();
} else {
msgdev(true);
}
}
function gotab(idx) {
$("#tab0,#tab1").hide();
$("#tab" + idx).show();
}
function findme() {
if (check("start", null, "접속시작일자를 입력해주세요.")) { }
else if (check("end", null, "접속종료일자를 입력해주세요.")) { }
else {
$("#tbody2 tr").remove();
capp("/acommon/pagelogs", { userno: @Model.Lect.userno, start: val("start"), end: val("end"), logsite: 1 }, "cbpagelogs");
}
}
function cbpagelogs() {
$.each(capResult.obj, function (i, d) {
$("#tbody2").append("<tr><td>" + d.cdtymdhm + "</td><td>" + getdb(d.uip) + "</td><td class=\"text-left\">" + getdb(d.loginfo) + "</td></tr>");
});
}
</script>
}