YNICTE/BO/Views/cc/memos.cshtml

101 lines
4.3 KiB
Plaintext
Raw Permalink Normal View History

2020-10-12 14:39:23 +09:00
@model NP.Model.VMCC
<header class="panel-heading bg-light" id="thistabbox">
<ul class="nav nav-tabs nav-justified">
<li class="active"><a href="#" data-toggle="tab">받은쪽지</a></li>
<li><a href="#" onclick="gotab(1);" data-toggle="tab">보낸쪽지</a></li>
</ul>
</header>
<form id="mform" method="post" action="/cc/memos">
<div class="buttonbox" style="height: 30px; line-height: 30px;">
<strong><i class="fa fa-bars"></i> 읽지않은 쪽지가 @Model.Memos.Where(w => w.isread < 1).Count()통 있습니다.(전체 받은 쪽지: @Model.Memos.Count()통)</strong>
</div>
<div class="buttonbox" style="height: 30px; line-height: 30px;">
<a href="#" onclick="del(1)" class="btn btn-xs btn-info">선택삭제</a>
<a href="#" onclick="del(0)" class="btn btn-xs btn-danger">전체삭제</a>
<a href="#" onclick="showramemainlayer('/cc/memosend');" class="btn btn-xs btn-primary f-r">쪽지발송</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="60"><input type="checkbox" onclick="javascript: checkall('excel1', this);" /></th>
<th>열람</th>
<th>보낸사람</th>
<th>제목</th>
<th>받은날짜</th>
</tr>
</thead>
<tbody class="data" id="tbody1">
@foreach (var item in Model.Memos)
{
<tr>
<td><input type="checkbox" class="autocheck" value="@item.mno" /></td>
<td><i class="fa fa-@(item.isread > 0 ? "check-" : "")circle-o"></i></td>
<td>@item.sendusername (@(item.email ?? "-"))</td>
<td class="text-left"><a class="link" href="#" onclick="view(@item.mno)">@item.mtitle</a></td>
<td>@item.cdtymdhms</td>
</tr>
}
</tbody>
</table>
</div>
@Html.Pager((int)Model.pagenum, 10, Model.pagerowcount, Model.pagetotalcount)
</section>
</form>
<form id="dform" method="post" action="">
@Html.Partial("./Partial/DForm", Model, new ViewDataDictionary { { "preform", 1 } })
</form>
@section styles{
<style type="text/css">
section.panel.panel-default {
background-color: #fff;
}
</style>
}
@section scriptsHeader{
}
@section scripts{
<script>
function del(no) {
if (no < 1) {
if ('@(Model.Memos.Count())' == '0') {
msg("삭제할 쪽지가 없습니다.");
}
else if (confirm("모든 쪽지를 삭제하시겠습니까?")) {
capp("/acommon/delmemo", { sendrcv: "R", isall: true }, "cbdel");
}
}
else if ($("#tbody1 tr input.autocheck:checked").length < 1) {
msg("삭제할 쪽지를 체크해주세요.");
}
else if (confirm("선택한 쪽지를 삭제하시겠습니까?")) {
var mnos = "";
$.each($("#tbody1 tr td input.autocheck:checked"), function (i, c) {
mnos += "," + $(c).val();
});
capp("/acommon/delmemo", { sendrcv: "R", mnos: mnos.substr(1) }, "cbdel");
}
}
function cbdel() {
if (capResult.code == 1000) {
msg("삭제되었습니다.");
$("#PageNum").val(1);
timesubmitauto();
}
}
function view(no) {
showramemainlayer("/cc/memoview?mno=" + no + "&sendorrcv=R");
}
function gotab(idx) {
if (idx == 1) {
$("#dform").attr("action","/cc/memosends");
$("#dform_pagenum").val(1);
} else if (idx == 2) {
$("#dform").attr("action","/cc/memosend");
}
timesubmit("dform", 1);
}
</script>
}