|
|
|
俵ÀÌ / 2001-03-09 / ¿ÀÈÄ 2:02:25 / 203.255.3.190
Á¶È¸¼ö : 167
|
[Áú¹®] ÀÌ·± ¿¡·¯´Â ¹«¾ùÀΰ¡¿äy |
> ¾î¶² °æ¿ì³Ä¸é ÀϹÝÀûÀÎ °Ë»ö½Ã¿¡´Â ¾Æ¹« ¹®Á¦°¡ ¾ø´Âµ¥,°¡²û °Ë»öÀ» ÇÒ¶§ board_num°ªÀÎ 1,2,3,4·Î Ãâ·ÂµÇ´Â°ÍÀÌ ¾Æ´Ï¶ó,board_numÀ¸·Î Ãâ·ÂµÇ´Â±º¿ä...
> ¾îµð¿¡¼ À߸øµÈ°ÍÀÎÁö,¾Ë°í ½Í½À´Ï´Ù.
> ù¹ø° select menu¿¡ ÀÖ´Â ÀÛ¼ºÀϷδ °Ë»öÀÌ °¡´ÉÇѵ¥,Áï ¹øÈ£°ªÀÌ Á¤»óÀûÀ¸·Î(1,2,3,4,5)¿Í °°ÀÌ Ãâ·ÂµÇ´Âµ¥,ÀÛ¼ºÀڷδ board_numÀ¸·Î Ãâ·ÂµË´Ï´Ù. Ȥ½Ã ¸ô¶ó¼ Á¦°¡ ¼Ò½º Àüü¸¦ ¿Ã¸³´Ï´Ù.È®ÀÎÁ» ºÎŹµå¸³´Ï´Ù.
>
> <!--#include file=include/dbopen.asp-->
> <%
> Const adOpenForwardOnly = 0
> Const adOpenKeyset = 1
> Const adOpenDynamic = 2
> Const adOpenStatic = 3
>
> ' °Ë»ö°ú Á¤·ÄÀ» À§ÇØ QueryÀÛ¼º
>
> Dim page, sortfield, sortword, keyfield
> Dim keyword, strSQL, DataExist
>
> page = Request("page")
> sortfield = Request("sortfield")
> sortword = Request("sortword")
> keyfield = Request("keyfield")
> keyword = Replace(trim(Request("keyword")),"'","'")
>
> if keyword = "" then ' ±â³É ¸®½ºÆ®¸¸ º¼ ¶§
> strSQL = "SELECT * FROM bulletboard "
> else ' °Ë»öÀÏ ¶§
> '¸¸¾à¿¡ "Ç¥½Ã°¡ bulletboard"·Î ºÙ¾î ÀÖÀ» °æ¿ì ¿¡·¯°¡ ¹ß»ý
> '¹Ýµå½Ã bulletboard "·Î Ç¥½Ã.....
> strSQL = "SELECT * FROM bulletboard " & _
> "WHERE " & keyfield & " LIKE '%" & keyword & "%'"
> end if
>
> if sortfield = "" then '±âº»°ª
> sortfield = "board_num"
> sortword = "desc"
> end if
>
> strSQL = strSQL & " ORDER BY " & sortfield
> strSQL = strSQL & " "
> strSQL = strSQL & sortword
>
> if sortfield <> "board_writer" then
> strSQL = strSQL & ", board_step"
> end if
>
> '¿©±â±îÁö QueryÀÛ¼º ³¡ ÁöÁ¤µÈ Query·Î °Ë»ö
>
> Set rs = Server.CreateObject("ADODB.Recordset")
> 'rs.Open strSQL,Dbcon,adOpenKeyset
> rs.Open strSQL,Dbcon,1,1
>
> '·¹Äڵ尡 Çϳªµµ ¾ø´Ù¸é
> if rs.EOF or rs.BOF then
> DataExist = False
> else '·¹Äڵ尡 ÀÖ´Ù¸é
> DataExist = True
> end if
>
> %>
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
> <html>
> <head>
> <title>Notice °Ô½ÃÆÇ</title>
> <link rel="stylesheet" href="include/style.css">
>
> </head>
>
> <body>
> <table border="0" width="100%">
> <tr>
> <td align="center">
> <%
>
> if DataExist = True then
>
> Dim totalRecord, cPage, lastpg, RowCount
>
> rs.PageSize = 10
>
> '·¹ÄÚµåÀÇ °¹¼ö
> totalRecord = rs.RecordCount
>
> if page = "" or page < 1 Then
> page = 1
> end if
>
> cPage = page
>
> rs.AbsolutePage = cPage
>
> lastpg = int(((totalRecord - 1) / rs.PageSize) + 1)
>
> if page > lastpg then
> page = lastpg
> end if
>
> RowCount = rs.PageSize
>
> ' Á¤·Ä°ú °Ë»öÀ» À§ÇÑ ÀÔ·Ââ
>
> %>
> <table width=600 border="0" cellpadding="0" cellspacing="1">
> <form name="form1" method="post" action="notice.asp">
> <tr>
> <td width="180" align="right" class=fonta>
> <select name="sortfield" size="1" class=select>
> <%
> if sortfield = "board_writer" then
> %>
> <option value="board_num">ÀÛ¼ºÀÏ</option>
> <option selected value="board_writer">ÀÛ¼ºÀÚ</option>
> <%
> else
> %>
> <option selected value="board_num">ÀÛ¼ºÀÏ</option>
> <option value="board_writer">ÀÛ¼ºÀÚ</option>
> <%
> end if
> %>
> </select>
>
> <select name="sortword" size="1" class=select>
> <%
> if sortword = "desc" then
> %>
> <option value="asc">¿À¸§Â÷¼ø</option>
> <option selected value="desc">³»¸²Â÷¼ø</option>
> <%
> else
> %>
> <option selected value="asc">¿À¸§Â÷¼ø</option>
> <option value="desc">³»¸²Â÷¼ø</option>
> <%
> end if
> %>
> </select>
> </td>
> <td width="300" align="right" class=fonta>
> <select name="keyfield" size="1" class=select>
> <%
> if keyfield = "board_writer" then
> %>
> <option value="board_title">Á¦¸ñ</option>
> <option value="board_memo">³»¿ë</option>
> <option selected value="board_writer">ÀÛ¼ºÀÚ</option>
> <%
> else
> if keyfield = "board_memo" then
> %>
> <option value="board_title">Á¦¸ñ</option>
> <option selected value="board_memo">³»¿ë</option>
> <option value="board_writer">ÀÛ¼ºÀÚ</option>
> <%
> else
> %>
> <option selected value="board_title">Á¦¸ñ</option>
> <option value="board_memo">³»¿ë</option>
> <option value="board_writer">ÀÛ¼ºÀÚ</option>
> <%
> end if
> end if
> %>
> </select>
>
> <input type="text" name="keyword" maxlength="20"
> size="20" class=input value=<%= keyword %>>
>
> <input type="image" value="search" name="search" src="images/search3.gif" align="middle" onclick=send(this.form)>
> <!--
> <input type="submit" value="°Ë»ö">
> -->
> </td>
> <td width="120" align="right" class=fonta><font size="2">
> ÆäÀÌÁö : <%= cPage %>/<%= lastpg %></font>
> </td>
> </tr>
> </form>
> </table>
> </td>
> </tr>
> <tr>
> <td align="center" class=fonta>
> <table width=600 cellpadding="2" cellspacing="1" BGCOLOR="white">
> <td width="70" bgcolor="#FF82C8" align="center" class=fonta>¹øÈ£</td>
> <td width="390" bgcolor="#FF82C8" align="center" class=fonta>Á¦¸ñ</td>
> <td width="70" bgcolor="#FF82C8" align="center" class=fonta>ÀÛ¼ºÀÚ</td>
> <td width="50" bgcolor="#FF82C8" align="center" class=fonta>Á¶È¸</td>
> <td width="75" bgcolor="#FF82C8" align="center" class=fonta>ÀÛ¼ºÀÏ</td>
>
>
> <%
> Dim board_no, board_num, board_step, board_id
> Dim board_writer, board_email, board_homepage
> Dim board_title, board_memo, board_count
> Dim board_day, current_num, board_time
>
>
> Do While Not RS.EOF and RowCount > 0
>
> board_no = rs("board_no")
> board_num = rs("board_num")
> board_step = rs("board_step")
> board_id = trim(rs("board_id"))
> board_writer = trim(rs("board_writer"))
> board_email = trim(rs("board_email"))
> board_homepage = trim(rs("board_homepage"))
> board_title = trim(rs("board_title"))
> board_memo = trim(rs("board_memo"))
> board_count = rs("board_count")
> board_day = trim(rs("board_day"))
> board_time = trim(rs("board_time"))
>
> board_day = left(board_day,4) & "-" & Mid(board_day,5,2) & "-" & _
> right(board_day,2)
>
> Response.Write "<tr height=22>"
> Response.Write "<td bgcolor='#FFE8F5' align='center' class='fonta'>"
>
> if sortfield <> "board_writer" then
> if current_num <> board_num then
> Response.Write board_num
> else
> Response.Write " "
> end if
> else
> if board_step = 0 then
> Response.Write "board_num"
> else
> Response.Write " "
> end if
> end if
> %>
> </td>
> <td width="390" align="left" bgcolor=#FFE8F5
> onMouseOut="this.style.backgroundColor='#FFE8F5'"
> onMouseOver="this.style.backgroundColor='D8E5FF'" class=fonta>
> <%
> if sortfield <> "board_writer" then
> if board_step <> 0 then
> 'Á¦¸ñÀÌ 28¹®ÀÚ±æÀ̺¸´Ù ±æ´Ù¸é
>
> if Len(board_title) >= 27 then
> board_title = left(board_title, 26) & "..."
> end if
> %>
> <a href="notice_read_dis.asp?board_no=<%=board_no%>&board_count=<%=board_count%>&keyfield=<%=keyfield%>&keyword=<%=keyword%>&sortfield=<%=sortfield%>&sortword=<%=sortword%>" title='<%=board_num%>¹ø ±Û¿¡ ´ëÇÑ <%=board_writer%>´ÔÀÇ ´äº¯ ±Û'> <img src=images/red1.gif border=0 alt=<%=board_num%>¹ø ±ÛÀÇ ´äº¯> <%=board_title%></a>
> <%
> else
> 'Á¦¸ñÀÌ 30¹®ÀÚ±æÀ̺¸´Ù ±æ´Ù¸é
> if Len(board_title) >= 30 then
> board_title = left(board_title, 29) & "..."
> end if
> %>
> <a href="notice_read_dis.asp?board_no=<%=board_no%>&board_count=<%=board_count%>&keyfield=<%=keyfield%>&keyword=<%=keyword%>&sortfield=<%=sortfield%>&sortword=<%=sortword%>" title='<%=board_writer%> ´ÔÀÇ ±Û'><%=board_title%></a>
> <%
> end if
> else
> if board_step <> 0 then
> 'Á¦¸ñÀÌ 28¹®ÀÚ±æÀ̺¸´Ù ±æ´Ù¸é - ´äº¯½Ã¿¡ ó¸®...
> if Len(board_title) >= 27 then
> board_title = left(board_title, 26) & "..."
> end if
> %>
> [<%=board_num%> <img src=images/red1.gif border=0 alt=´äº¯>]
> <a href="notice_read_dis.asp?board_no=<%=board_no%>&board_count=<%=board_count%>&keyfield=<%=keyfield%>&keyword=<%=keyword%>&sortfield=<%=sortfield%>&sortword=<%=sortword%>"><%=board_title%></a>
> <%
> else
> 'Á¦¸ñÀÌ 30¹®ÀÚ±æÀ̺¸´Ù ±æ´Ù¸é
> if Len(board_title) >= 30 then
> board_title = left(board_title, 29) & "..."
> end if
> %>
> <a href="notice_read_dis.asp?board_no=<%=board_no%>&board_count=<%=board_count%>&keyfield=<%=keyfield%>&keyword=<%=keyword%>&sortfield=<%=sortfield%>&sortword=<%=sortword%>"><%=board_title%></a>
> <%
> end if
> end if
> %>
> </span>
> </td>
> <td align="center" bgcolor="#FFE8F5"
> onMouseOut="this.style.backgroundColor='#FFE8F5'"
> onMouseOver="this.style.backgroundColor='D8E5FF'" class=fonta>
> <%
> if board_email <> "" then
> Response.Write "<a href='mailto:" & board_email & "'>" & _
> board_writer & "</a>"
> else
> Response.Write board_writer
> end if
> %>
>
> </td>
> <td align="center" bgcolor="#FFE8F5" class=fonta><%=board_count%>
> </td>
> <td align="center" bgcolor="#FFE8F5" class=fonta><%=board_day%>
> </td>
> </tr>
>
> <%
>
> current_num = board_num
> RowCount = RowCount - 1
> rs.MoveNext
> Loop
>
> rs.Close
> DbCon.Close
> set rs = nothing
> %>
> </table>
> </td>
> <tr>
> <tr>
> <td align="center" class=fonta>
> <table border="0" width="600">
> <tr>
> <td align="center" width="600" class=fonta><B>
> <%
> ' µ¿ÆäÀÌÁö ¸¸µé±â
>
> Dim PageBlock, temp1, temp2, temp3, prev, post, pagelist
>
> PageBlock = 3
>
> temp1 = int(cPage/PageBlock)
>
> if (cPage mod PageBlock) = 0 then
> temp1 = temp1 - 1
> end if
>
> temp2 = temp1 * PageBlock
>
> temp3 = int(lastpg/PageBlock)
>
> if (lastpg mod PageBlock) = 0 then
> temp3 = temp3 - 1
> end if
>
> prev = temp2
>
> if prev > 0 then
> %>
> <A href=notice.asp?page=<%=prev%>&keyfield=<%=keyfield%>&keyword=<%=keyword%>&sortfield=<%=sortfield%>&sortword=<%=sortword%>>¢¸</A>
> <%
> end if
>
> pagelist = temp2
>
> for i = 1 to PageBlock
>
> pagelist = temp2 + i
>
> if lastpg < pagelist then
> exit for
> end if
>
> if int(pagelist) <> int(cPage) then
> %>
> <A href=notice.asp?page=<%=pagelist%>&keyfield=<%=keyfield%>&keyword=<%=keyword%>&sortfield=<%=sortfield%>&sortword=<%=sortword%>><%=pagelist%></A>
> <%
> else
> %>
> <%=pagelist%>
> <%
> end if
> next
>
> post = temp2 + PageBlock + 1
>
> if temp1 < temp3 then
> %>
> <A href=notice.asp?page=<%=post%>&keyfield=<%=keyfield%>&keyword=<%=keyword%>&sortfield=<%=sortfield%>&sortword=<%=sortword%>>¢º</A>
> <%
> end if
> %>
> </B>
> </td>
> </tr>
> <tr>
> <td align="center" class=fonta>
> <%
> ' ÀÌÀü ÆäÀÌÁö·Î À̵¿
> if cPage > 1 Then
> %>
> <a href=notice.asp?page=<%=cPage-1%>&keyfield=<%=keyfield%>&keyword=<%=keyword%>&sortfield=<%=sortfield%>&sortword=<%=sortword%>>ÀÌÀü</a>
> <% end if %>
>
> <a href=notice.asp><img src=images/e1list.gif border=0 alt=¸®½ºÅ©Ç׸ñÀ¸·Î°¡±â></A>
> <a href="notice_write_dis.asp?IsNew=New"><img src=images/e1write.gif border=0 alt=±ÛÀÔ·ÂÇϱâ></a>
>
> <%
> ' ´ÙÀ½ÆäÀÌÁö·Î À̵¿
> if lastpg - cPage > 0 Then
> %>
> <A href=notice.asp?page=<%=cPage+1%>&keyfield=<%=keyfield%>&keyword=<%=keyword%>&sortfield=<%=sortfield%>&sortword=<%=sortword%>>´ÙÀ½</A>
> <%
> end if
> %>
> </td>
> </tr>
> </table>
> <% else %>
>
> <table width=600 border="0" cellpadding="5">
> <tr>
> <td bgcolor="#FF82C8" align="center" class=fonta>
> nayaBoard - noticeéÄ Á˼ÛÇÕ´Ï´Ù.<br>ÇöÀç °Ë»ö, µî·ÏµÈ ¹®¼°¡ ¾ø½À´Ï´Ù.
> ±ÛÀ» ÀÔ·ÂÇϼ¼¿ä
> </td>
> </tr>
> </table>
> </td>
> </tr>
> <tr>
> <td align="center">
> <table border="0" width="600">
> <tr>
> <td align="center" class=fonta>
> <a href="notice.asp"><img src=images/e1list.gif border=0 alt=List¸ñ·ÏÀ¸·Î></a>
> <a href="notice_write_dis.asp?IsNew=New"><img src=images/e1write.gif border=0 alt=±Û¾²±â></a>
> </td>
> </tr>
> </table>
> <%
> rs.Close
> DbCon.Close
> set rs = nothing
> set DbCon = nothing
> end if
> %>
> </td>
> </tr>
> <tr>
> <td><!--#include file=include/copyright.asp--></td>
> </tr>
> </table>
> </body>
> </html>
>
-----------------------------------------------------------
if board_step = 0 then
Response.Write "board_num"
ÀÌ°Å ¶§¹®ÀΰŠ°°³×¿ä...
|
|
|
|