YNICTE/FO/Views/My/BoardList.cshtml

138 lines
4.8 KiB
Plaintext

@model NP.Model.VMCC
<form id="mform" action="/My/BoardList" method="get">
@Html.HiddenFor(m => m.opno)
@Html.HiddenFor(m => m.scc)
@Html.HiddenFor(m => m.pagenum)
</form>
<form id="mform2" action="" method="get">
@Html.HiddenFor(m => m.BNo)
<input type="hidden" name="opno" value="@Model.opno" />
<input type="hidden" name="scc" value="@Model.scc" />
<input type="hidden" name="pagenum" value="@Model.pagenum" />
</form>
<ul class="faqTab">
@if (Model.BM.isuseopening == 1)
{
<li class="@(Model.opno == null ? "current" : "")"><a href="#" onclick="setv('opno', ''); findme(1)">전체</a></li>
foreach (var op in Model.BMOs)
{
<li class="@(Model.opno == op.opno ? "current" : "")"><a href="#" onclick="setv('opno', @op.opno); findme(1)">@op.opname</a></li>
}
}
</ul>
@if (Model.BM.disptype == 1)
{
<dl class="faqList">
@foreach (var b in Model.Boards.Where(w => w.pbno == null))
{
<dt>
<table>
<tr>
<th>Q.</th>
<td>@Html.Raw(b.subject ?? "")</td>
</tr>
</table>
</dt>
<dd>
<table>
<tr>
<th>A.</th>
<td>
@Html.Raw(b.contents ?? "")
</td>
</tr>
</table>
</dd>
}
</dl>
}
else
{
<div class="brdSch"><div>
<input type="text" value="@Model.scc" id="subcon" placeholder="제목이나 내용을 입력하세요"><input type="button" onclick="$('#scc').val($('#subcon').val());findme(1)" value="검색"></div></div>
if (Model.BM.bmtype > 0)
{
<div class="notiBtn top"><a href="#" onclick="gow()">게시글 등록</a></div>
}
else
{
<br />
}
<table class="notiList">
@foreach (var b in Model.Boards)
{
<tr class="@(b.istop == 1 ? "visit" : "") @(b.pbno == null ? "" : "reply")">
<th>
<a href="#" onclick="gov(@b.bno, @b.cno, @b.issecr)">
<p>
<h5><span>@b.opname2</span> @b.subject <em>@b.rpcountname</em> @Html.Raw(b.issecr == 0 ? "" : "<img src=\"/img/customer/notice_ico.png\" alt=\"\" />")</h5>
<p>@Html.Raw(b.issecr == 1 && b.cno != ViewBag.SSUserNo ? "-" : System.Text.RegularExpressions.Regex.Replace(System.Text.RegularExpressions.Regex.Replace(b.contents, @"<[^>]*>", String.Empty), @"<.*?>", String.Empty))</p>
</p>
</a>
</th>
<td>
<dl>
<dd>@b.cdtymd</dd>
<dd>@(b.usertype > 11?"관리자":b.cnoname)</dd>
</dl>
</td>
</tr>
}
@if (Model.Boards.Count() < 1)
{
<tr><th>공지사항이 없습니다.</th></tr>
}
</table>
if (Model.BM.bmtype > 0)
{
<div class="notiBtn bot">
<a href="#" onclick="gow()">게시글 등록</a>
</div>
}
}
@Html.Pager2((int)Model.pagenum, 10, Model.pagerowcount, Model.pagetotalcount)
@section scripts{
<script>
$(document).ready(function () {
$('.faqList dt').click(function () {
if ($(this).is('.on')) {
$(this).removeClass('on');
$(this).next().slideUp(300);
} else {
$('.faqList dt').removeClass('on');
$('.faqList dd').slideUp(300);
$(this).addClass('on');
$(this).next().slideDown(300);
}
});
$("#subcon").on("keydown", function (e) {
if (e.keyCode == 13) {
$("#scc").val($(this).val());
findme(1);
}
});
});
function findme(pno) {
$("#mform #pagenum").val(pno || @Model.pagenum);
$("#mform").submit();
}
function gov(bno, cno, issecr) {
if (@ViewBag.SSUserNo < 1) {
gologin(null, location.pathname.replace(/#/gi, '') + location.search.replace(/#/gi,''));
}
else if (issecr == 1 && cno != @ViewBag.SSUserNo) {
msg("비밀글입니다.");
} else {
setv("BNo", bno);
bglayer();
$("#mform2").attr("action", "/My/BoardView").submit();
}
}
function gow() {
setv("BNo", 0);
bglayer();
$("#mform2").attr("action", "/My/BoardWrite").submit();
}
</script>
}