This commit is contained in:
hyunho 2020-12-09 07:57:47 +00:00
parent c9fc093fdf
commit 0af9f4a8cf
4 changed files with 88 additions and 40 deletions

View File

@ -1916,5 +1916,21 @@
,cmisno =case when #cmisno# is not null then #cmisno# else cmisno end
where lectno=#lectno#
</update>
<select id="cm.cms.offs" parameterClass="hashtable" resultClass="cm">
select
a.cmno,a.ismaster,a.cgno,a.pcmno,a.cname,a.kname,a.tmno,a.classno,a.rstime,a.retime,a.sstime,a.setime,a.gstime,a.getime,a.cshape,a.typeman,a.typeedu,a.typegrade
,a.typejob,a.infee,a.outfee,a.quota,a.introhtml,a.targethtml,a.goalhtml,a.contenthtml,a.studyplace,a.studytime,a.certcc,a.certgradecc,a.jobcc,a.jobpositiongrade,a.difficulty
,a.isrefund,a.isuse,a.isseq,a.isdel,a.fgnocm,a.iscertificate,a.ischkatt
,(select count(l.lectno) cnt from lect l where l.cmno = a.cmno and l.status =1 and l.ischanged=0) lectcnt
from cm a
inner join cminning b on a.cmno = b.cmno
where a.ismaster=0 and a.isuse=1 and a.isdel=0 and a.cshape in ('1','2')
<isNotNull property="cmno">and a.cmno=#cmno#</isNotNull>
<isNotNull property="year">and year(a.sstime)=#year#</isNotNull>
<isNotNull property="month">and month(a.sstime)=#month#</isNotNull>
<isNotNull property="cnamelike">and a.cname like concat('%', #cnamelike#,'%')</isNotNull>
<isNotNull property="studyplace">and a.studyplace=#studyplace#</isNotNull>
order by a.sstime,a.setime
</select>
</statements>
</sqlMap>

View File

@ -269,8 +269,10 @@ namespace NP.FO.Controllers
}
public ActionResult Offs(VMCourse vm)
{
vm.pcgcode = vm.pcgcode ?? OffCode;
vm.CMs = Dao.Get<CM>("cm.cms.forbuy", new System.Collections.Hashtable() { { "pcgcode", vm.pcgcode }, { "cgcode", vm.cgcode }, { "userno", SUserInfo.UserNo }, { "year", DateTime.Now.Year }, { "contents", vm.Contents } });
//vm.pcgcode = vm.pcgcode ?? OffCode;
//vm.CMs = Dao.Get<CM>("cm.cms.forbuy", new System.Collections.Hashtable() { { "pcgcode", vm.pcgcode }, { "cgcode", vm.cgcode }, { "userno", SUserInfo.UserNo }, { "year", DateTime.Now.Year }, { "contents", vm.Contents } });
vm.CMs = Dao.Get<CM>("cm.cms.offs", new System.Collections.Hashtable() {{ "year", DateTime.Now.Year }, { "month", vm.stringval }, { "cnamelike", vm.stringval2 } });
vm.ComCodes = GetComCodes("studyplace", true);
vm.viewname = vm.viewname ?? "OffList";
vm.viewname2 = vm.viewname2 ?? "OffSearch";
vm.viewname3 = "";

View File

@ -3,15 +3,10 @@
Layout = null;
}
<div class="offTab">
<span class="offtName">@(Model.cgcode == "Off001"?"단과": Model.cgcode == "Off002" ? "종합연수" : Model.cgcode == "Off003" ? "전문연구":"전체")</span>
<ul class="offtList">
<li class="@(string.IsNullOrEmpty(Model.cgcode)?"current":"")"><a href="#" onclick="gothis('')">전체</a></li>
<li class="@("Off001".Equals(Model.cgcode)?"current":"")"><a href="#" onclick="gothis('Off001')">단과</a></li>
<li class="@("Off002".Equals(Model.cgcode)?"current":"")"><a href="#" onclick="gothis('Off002')">종합연수</a></li>
<li class="@("Off003".Equals(Model.cgcode)?"current":"")"><a href="#" onclick="gothis('Off003')">전문연구</a></li>
<li><a href="/Course/CC1">위탁교육</a></li>
<li><a href="/Course/CC2">준법교육</a></li>
<li><a href="/Course/CC3">ISO 내부심사교육</a></li>
<li class="@(string.IsNullOrEmpty(Model.cshape)?"current":"")"><a href="#" onclick="gothis('')">전체</a></li>
<li class="@("1".Equals(Model.cshape)?"current":"")"><a href="#" onclick="gothis('1')">교육장교육</a></li>
<li class="@("2".Equals(Model.cshape)?"current":"")"><a href="#" onclick="gothis('2')">혼합교육</a></li>
</ul>
</div>
<div class="offMonth">
@ -30,46 +25,80 @@
<li><a href="#" onclick="viewmonth(12)">12월</a></li>
</ul>
</div>
<div class="offDesc">
<p>※ 강좌명 선택시 상세정보를 확인할 수 있습니다.</p>
<a href="#" onclick="viewmonth(0)">전체일정 보기</a>
<ul>
<li class="current"><a href="#">전체</a></li>
@foreach (var t in Model.ComCodes.Where(w => w.cgroup.ToString() == "studyplace"))
{
<li><a href="#">@t.cname 교육장</a></li>
}
</ul>
<a href="#" onclick="viewmonth(0)">올해일정 조회</a>
</div>
@foreach (var m in Model.CMs.Select(s => s.sstime.Value.Month).Distinct())
{
<div class="offList month@(m) @(DateTime.Now.Month == m ? "current":"")"style=@(DateTime.Now.Month==m?"":"display:none;")>
<h5>@(m)월 교육일정</h5>
<table>
@foreach (var d in Model.CMs.Where(w => w.sstime.Value.Month == m))
{
<tr class="@(!(DateTime.Now >= d.rstime.Value && DateTime.Now < d.retime.Value) ? "disable" : "")">
<th style="@((DateTime.Now >= d.rstime.Value && DateTime.Now < d.retime.Value) ? "style=font-weight:600; color:#00b1ed;" : "")">@string.Format("{0}({1})", d.sstime.Value.Day, d.sstime.Value.ToString("ddd", System.Globalization.CultureInfo.CreateSpecificCulture("ko-KR")))</th>
<td>
<a href="#" onclick="godetail(@(!(DateTime.Now >= d.rstime.Value && DateTime.Now < d.retime.Value) ? 0 : d.cmno))" style="@(!(DateTime.Now >= d.rstime.Value && DateTime.Now < d.retime.Value) ? "cursor: default" : "")">
<p><span class="grn" style="@(d.isrefund==0 ? "display:none;":"")">환급</span><span>[@d.cgname]</span> @(d.cname)(@(d.studyplacename)) (@(d.studytime)시간)</p>
<p>회원 : @d.infee.ToString("#,0")원 비회원 : @d.outfee.ToString("#,0")원</p>
</a>
</td>
</tr>
}
</table>
</div>
<div class="offList month@(m) @(DateTime.Now.Month == m ? "current":"")" @*style=@(DateTime.Now.Month==m?"":"display:none;")*@>
<h5>@(m)월 교육일정</h5>
@foreach (var d in Model.CMs.Where(w => w.sstime.Value.Month == m))
{
<ul class="schList">
<li>
<h4 style="@((DateTime.Now < d.rstime.Value || DateTime.Now >= d.retime.Value) ? "color:#888;" : "")")>
@string.Format("{0}({1})", d.sstime.Value.Day, d.sstime.Value.ToString("ddd", System.Globalization.CultureInfo.CreateSpecificCulture("ko-KR")))
~
@string.Format("{0}({1})", d.setime.Value.Day, d.setime.Value.ToString("ddd", System.Globalization.CultureInfo.CreateSpecificCulture("ko-KR")))
</h4>
<div>
<h6 style="@((DateTime.Now < d.rstime.Value || DateTime.Now >= d.retime.Value) ? "color:#888;" : "")">
@if (d.cshape == 1)
{
<span class="blu" style="@((DateTime.Now < d.rstime.Value || DateTime.Now >= d.retime.Value) ? "color:#888;" : "")">[교육장교육]</span>
}
else
{
<span class="blu" style="@((DateTime.Now < d.rstime.Value || DateTime.Now >= d.retime.Value) ? "color:#888;" : "")">[혼합교육]</span>
}
@d.cname
</h6>
</div>
@if (DateTime.Now >= d.rstime.Value && DateTime.Now < d.retime.Value)
{
if (d.quota - d.lectcnt <= 0)
{
<span class="smtlChkBtn smtlChk04">대기접수</span>
}
else
{
<span class="smtlChkBtn smtlChk01">신청가능</span>
}
}
else
{
<span class="smtlChkBtn smtlChk04">종료</span>
}
</li>
</ul>
@*<tr class="@(!(DateTime.Now >= d.rstime.Value && DateTime.Now < d.retime.Value) ? "disable" : "")">
<th style="@((DateTime.Now >= d.rstime.Value && DateTime.Now < d.retime.Value) ? "style=font-weight:600; color:#00b1ed;" : "")">@string.Format("{0}({1})", d.sstime.Value.Day, d.sstime.Value.ToString("ddd", System.Globalization.CultureInfo.CreateSpecificCulture("ko-KR")))</th>
<td>
<a href="#" onclick="godetail(@(!(DateTime.Now >= d.rstime.Value && DateTime.Now < d.retime.Value) ? 0 : d.cmno))" style="@(!(DateTime.Now >= d.rstime.Value && DateTime.Now < d.retime.Value) ? "cursor: default" : "")">
<p><span class="grn" style="@(d.isrefund==0 ? "display:none;":"")">환급</span><span>[@d.cgname]</span> @(d.cname)(@(d.studyplacename)) (@(d.studytime)시간)</p>
<p>회원 : @d.infee.ToString("#,0")원 비회원 : @d.outfee.ToString("#,0")원</p>
</a>
</td>
</tr>*@
}
</div>
}
<form id="thisform" action="/Course/Offs" method="get">
@Html.HiddenFor(m => m.cgcode)
@Html.HiddenFor(m => m.cshape)
@Html.HiddenFor(m => m.previewname)
@Html.HiddenFor(m => m.cmno)
</form>
<script type="text/javascript" src="/js/sly.min.js"></script>
<script>
$('.offtName').click(function () {
if ($(this).is('.on')) {
$(this).removeClass('on');
$(this).next().slideUp(300);
} else {
$('.offtName').addClass('on');
$('.offtList').slideDown(300);
}
});
$(function () {
var $frame = $('.offMonth');
var $slidee = $frame.children('ul').eq(0);
@ -102,7 +131,7 @@
$(".offDesc").find("a").attr("class", "current");
}
}
function gothis(cgcode) {
function gothis(cshape) {
setv("cgcode", cgcode);
$("#thisform").submit();
}

View File

@ -11,6 +11,7 @@ namespace NP.Model
public String pcgcode { get; set; }
public String cgcode { get; set; }
public String cname { get; set; }
public String cshape { get; set; }
public CM CM { get; set; }
public IList<CM> CMs { get; set; }
public IList<CM> CMsEtc { get; set; }