Files
KIN/knowledge/b_list.asp
2025-09-29 17:55:08 +09:00

222 lines
7.3 KiB
Plaintext

<!-- #include virtual = "include/header.asp" -->
<!-- #include virtual = "include/left.asp" -->
<%
b_type = request("b_type")
searchtype = request("searchtype")
if searchtype = "" then
searchtype = "0"
end if
searchword = request("searchword")
if request("gotopage") <> "" then
tmp_currentpage = request("gotopage")
else
tmp_currentpage = 1
end if
tmp_menuname = ""
Select case b_type
case "not"
tmp_menuname = "공지사항"
case "con"
tmp_menuname = "제안용 서류함"
case "rule"
tmp_menuname = "사내규정"
case "sug"
tmp_menuname = "업무 매뉴얼"
case "klg"
tmp_menuname = "교육창고"
case "fre"
tmp_menuname = "통계지식"
End Select
%>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<div class="content-header">
<h1><%=tmp_menuname%></h1>
</div>
<!-- /.content-header -->
<!-- Main content -->
<div class="content-body">
<div class="content">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<form name="b_board" method="post">
<input type="hidden" name="b_type" value="<%=b_type%>">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<%
query = "SELECT * "
query = query & "FROM [intranet_board] "
query = query & "WHERE b_type='" & b_type & "' "
if searchtype = "0" then
query = query & "and b_subject like '%" & searchword & "%' "
elseif searchtype = "1" then
query = query & "and b_content like '%" & searchword & "%' "
elseif searchtype = "2" then
query = query & "and (b_subject like '%" & searchword & "%' or b_content like '%" & searchword & "%') "
elseif searchtype = "3" then
query = query & "and b_name like '%" & searchword & "%' "
end if
query = query & "AND b_delok='N' "
query = query & "ORDER BY b_sn DESC "
'Response.Write query & "<BR>"
Rs.Open query, adoConn, 1
%>
<tr>
<td style="padding:5">목록결과 : 총 <b class="tahoma_orange"><%=Rs.RecordCount%></b>개의 항목이 있습니다.</td>
<td align="right">
<select id="searchType">
<option value="0">제목</option>
<option value="1">내용</option>
<option value="2">제목+내용</option>
<option value="3">작성자</option>
</select>
<input type="text" id="searchWord" value="" />
<input type="button" id="searchBtn" value="검색" />
</td>
</tr>
<tr>
<td align="center" colspan="2">
<table class="table table-sm table-sm2 table-bordered table-head tr-colors mt-1">
<tr>
<td align="center" height="26" width="2%" >No.</td>
<td align="center" height="26" width="50%" >제목</td>
<td align="center" height="26" >분류</td>
<td align="center" height="26" >작성자</td>
<td align="center" height="26" >작성일</td>
<td align="center" height="26" >읽음</td>
<td align="center" height="26" >첨부</td>
</tr>
<%
if Rs.RecordCount > 0 then
Rs.PageSize = 20
tmp_ok = 1
PageCount = Rs.PageCount
Rs.absolutepage = tmp_Currentpage
tmp_total_record = Rs.RecordCount
tmp_for = Cint(tmp_total_record) - ((Cint(tmp_Currentpage) - 1) * Rs.PageSize)
if Rs.PageSize <= tmp_for then
if Rs.RecordCount <= Rs.PageSize then
tmp_for = Rs.recordcount
else
tmp_for = Rs.PageSize
end if
else
tmp_for = tmp_for
end if
for i = 1 to tmp_for
if Cint(tmp_Currentpage)=1 then
Num=Cint(tmp_total_record)- i+1
else
Num=Cint(tmp_total_record) - ((Cint(tmp_Currentpage) - 1) * Rs.PageSize) - i +1
end if
tmp_subject = Rs("b_subject")
query = " SELECT p_team_name as d_name FROM project2.dbo.V_Person WHERE p_no = '" & Rs("b_namecode") & "' "
Adors.Open query, adoConn, 1
if Adors.RecordCount > 0 then
tmp_depart = Adors("d_name")
else
tmp_depart = "-"
end if
Adors.Close
if Rs("b_filename") <> "" then
fileArray = Split(replace(Rs("b_filename"),",,",","),",")
tmp_file = Ubound(fileArray)
If tmp_file=0 then
tmp_file = 1
End If
tmp_file = tmp_file & "개"
else
tmp_file = "-"
end if
if isnull(Rs("b_reply_cnt")) OR Rs("b_reply_cnt") = "0" then
tmp_reply_cnt = ""
else
tmp_reply_cnt = "[ " & Rs("b_reply_cnt") & " ]"
end if
%>
<!--- Loop Set Start --->
<tr>
<td align="center" height="26" ><%=Num%></td>
<td align="left" height="26"><a href="javascript:goit('2','<%=Rs("b_sn")%>')" class="blue"><%=tmp_subject%></a> <%=tmp_reply_cnt%></td>
<td align="center" height="26"><%=tmp_depart%></td>
<td align="center" height="26"><%=Rs("b_name")%></td>
<td align="center" height="26" ><%=left(Rs("b_regdate"), 10)%></td>
<td align="center" height="26" ><%=Rs("b_readcnt")%></td>
<td align="center" height="26">
<%=tmp_file%>
</td>
</tr>
<!--- Loop Set End --->
<%
Rs.MoveNext
next
end if
Rs.Close
%>
</table>
<!--- Paging Start --->
<%=Pagelist("b_list.asp",tmp_currentpage ,tmp_bcolor , "", pagecount, "&b_type=" & b_type & "&searchtype=" & searchtype & "&searchword=" & searchword)%>
<!--- Paging End --->
</td>
</tr>
<tr>
<td align="right" colspan="2">
<img src="/images/common/btn_write.jpg" align="absmiddle" onClick="goit('1')" style="CURSOR:pointer;">
</td>
</tr>
</table>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- /.content -->
<!-- REQUIRED SCRIPTS -->
<script>
function goit(a, b){
if (a == 1){
document.b_board.action = "b_write.asp";
document.b_board.submit();
}else if (a == 2){
document.b_board.action = "b_view.asp?b_sn=" + b;
document.b_board.submit();
}else if (a == 3){
document.b_board.action = "b_list.asp";
document.b_board.submit();
}
}
$(function(){
$("#searchBtn").on("click", function(){
var searchType = $("#searchType option:selected").val();
var searchWord = $("#searchWord").val();
searchWord = searchWord.replace(/'/g, "");
location.href="./b_list.asp?b_type=<%=b_type%>&searchtype=" + searchType + "&searchword=" + searchWord;
});
$("#searchWord").on("keyup", function(e){
e.preventDefault();
var keycode = event.which ? event.which : event.keyCode;
if(keycode == 13){
$("#searchBtn").click();
}
});
$("#searchType").val("<%=searchtype%>");
$("#searchWord").val("<%=searchword%>");
});
</script>
</div>
<!-- /.content-wrapper -->
<!-- #include virtual = "include/footer.asp" -->