YNICTE/BO/Views/cm/pcs.cshtml

94 lines
4.6 KiB
Plaintext
Raw Normal View History

2020-10-12 14:39:23 +09:00
@model NP.Model.VMCM
<form id="mform" method="post">
<section class="panel panel-default clearfix devsearch" data-cleartbody="tbody1">
@Html.Partial("./Partial/SearchCaption")
<div class="step-content">
<div class="step-pane active form-inline">
<div class="form-group">
<select id="stringval" name="stringval" class="form-control">
<option value="">-년도선택</option>
@foreach (var t in Model.Terms.Select(s=>s.tyear).Distinct())
{
<option value="@t" @(Model.stringval == t.ToString() ? "selected":"")>@t 년</option>
}
</select>
<select id="stringval2" name="stringval2" class="form-control">
<option value="">-기수선택</option>
@foreach (var t in Model.Terms.Where(w => w.tyear.ToString() == Model.stringval))
{
<option value="@t.tseq" @(Model.stringval2 == t.tseq.ToString() ? "selected":"")>@t.tseq 기</option>
}
</select>
@Html.Partial("./Partial/Text", Model.stringval4, Helpers.DicText(new NP.Model.TextDic() { Name = "stringval4", Value = Model.stringval4, PH = "패키지명을 입력하세요.", CssClass = "ff" }))
@Html.Partial("./Partial/Button", new NP.Model.Button() { Special = "search" })
</div>
</div>
</div>
</section>
<div class="tar buttonbox">
@Html.Partial("./Partial/pagerow", new ViewDataDictionary { { "tbodyid", "tbody1" }, { "searchmethod", "submit()" }, { "pagesize", Model.pagerowcount } })
<a href="#" onclick="javascript:reg(0);" class="btn btn-s-xs btn-info">등록</a>
</div>
<section class="panel panel-default">
<div class="table-responsive" id="excel1">
<table class="table table-striped b-t b-light">
<thead>
<tr>
<th width="20">No</th>
<th width="60">패키지ID</th>
<th>기수</th>
<th>상위분류</th>
<th>분류</th>
<th>패키지명</th>
<th>강좌수</th>
<th>회원할인가</th>
<th>비회원할인가</th>
</tr>
</thead>
<tbody class="data" id="tbody1">
@foreach (var item in Model.CMs)
{
<tr>
<td>@item.rnorvt</td>
<td>@item.cmno</td>
<td>@item.tmname</td>
<td>@item.pcgname</td>
<td>@item.cgname</td>
<td class="link cname"><a href="#" onclick="reg(@item.cmno)">@item.cname</a></td>
<td>@Model.CMs2.Where(w => w.pcno == item.cmno).Count()</td>
<td class="text-right">@Model.CMs2.Where(w => w.pcno == item.cmno).Sum(s => s.infee).ToString("#,0")</td>
<td class="text-right">@Model.CMs2.Where(w => w.pcno == item.cmno).Sum(s => s.outfee).ToString("#,0")</td>
</tr>
}
</tbody>
</table>
</div>
@Html.Pager((int)Model.pagenum, 10, Model.pagerowcount, Model.pagetotalcount)
</section>
</form>
<form id="dform" method="post" action="/cm/pcr">
@Html.Partial("./Partial/dform", Model, new ViewDataDictionary { { "preform", 1 } })
</form>
@section scripts{
<script>
var _terms = '@(string.Join(";", Model.Terms.Select(s=>string.Format("{0}:{1}:{2}", s.tmno, s.tyear, s.tseq))))';
$(document).ready(function () {
$("#stringval").on("change", function () {
$("#stringval2").val("");
$("#stringval2 option:gt(0)").remove();
if ($(this).val() != "") {
var _y = $(this).val();
$.each(_terms.split(';'), function (i, t) {
if (t.split(':')[1] == _y) {
$("#stringval2").append("<option value=\"" + t.split(':')[2]+"\">" + t.split(':')[2]+" 기</option>")
}
});
}
});
});
function reg(no) {
setv("dform_intval", no);
$("#dform").submit();
}
</script>
}