<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<style>
.board_top { clear:both; }

.board_list { clear:both; width:100%; table-layout:fixed; margin:5px 0 0 0; }
.board_list th { font-weight:bold; font-size:12px; } 
.board_list th { background:url(<?=$new_skin_path?>/img/title_bg.gif) repeat-x; } 
.board_list th { white-space:nowrap; height:34px; overflow:hidden; text-align:center; } 
.board_list th { border-top:1px solid #ddd; border-bottom:1px solid #ddd; } 

.board_list tr.bg0 { background-color:#fafafa; } 
.board_list tr.bg1 { background-color:#ffffff; } 

.board_list td { padding:.5em; }
.board_list td { border-bottom:1px solid #ddd; } 
.board_list td.num { color:#999999; text-align:center; }
.board_list td.checkbox { text-align:center; }
.board_list td.subject { overflow:hidden; }
.board_list td.name { padding:0 0 0 10px; }
.board_list td.datetime { font:normal 11px tahoma; color:#BABABA; text-align:center; }
.board_list td.hit { font:normal 11px tahoma; color:#BABABA; text-align:center; }
.board_list td.good { font:normal 11px tahoma; color:#BABABA; text-align:center; }
.board_list td.nogood { font:normal 11px tahoma; color:#BABABA; text-align:center; }

.board_list .notice { font-weight:normal; }
.board_list .current { font:bold 11px tahoma; color:#E15916; }
.board_list .comment { font-family:Tahoma; font-size:10px; color:#EE5A00; }

.board_button { clear:both; margin:10px 0 0 0; }

.board_page { clear:both; text-align:center; margin:3px 0 0 0; }
.board_page a:link { color:#777; }

.board_search { text-align:center; margin:10px 0 0 0; }
.board_search .stx { height:21px; border:1px solid #9A9A9A; border-right:1px solid #D8D8D8; border-bottom:1px solid #D8D8D8; }
</style>
<div class="list_status">
    <form id="fnew" method="get" action="#">
    <div>
        <?php echo $group_select; ?>
        <select name="view" id="view" onchange="select_change()">
            <option value="">전체게시물</option>
            <option value="w">원글만</option>
            <option value="c">코멘트만</option>
        </select>

        <label for="mb_id">회원아이디</label>
        <input type="text" id="mb_id" name="mb_id" size="15" class="ed" accesskey="S" value="<?php echo $mb_id?>" />
        <input type="image" src="<?php echo $new_skin_path; ?>/img/btn_search.gif" alt="검색" align="absmiddle"/>
    </div>
    </form>
</div>

<table cellspacing="0" class="board_list">
    <col width="100" />
    <col width="100" />
    <col width="*" />
    <col width="110" />
    <col width="100" />
    <tr>
        <th>그룹</th>
        <th>게시판</th>
        <th>제목</th>
        <th>이름</th>
        <th>날짜</th>
    </tr>
<?php
if(count($list)) {
	for ($i=0; $i<count($list); $i++) {
			$gr_subject = cut_str($list[$i]['gr_subject'], 15);
			$bo_subject = cut_str($list[$i]['bo_subject'], 15);
			$wr_subject = get_text(cut_str($list[$i]['wr_subject'], 60));

			$date = date("y.m.d", strtotime($list[$i]['bn_datetime']));

			echo"
			<tr>
					<td class='num'><a href='./new.php?gr_id={$list[$i]['gr_id']}'>{$gr_subject}</a></td>
					<td class='num'><a href='./board.php?bo_table={$list[$i]['bo_table']}'>{$bo_subject}</a></td>
					<td class='subject'><a href='{$list[$i]['href']}'>{$list[$i]['comment']}{$wr_subject}</a></td>
					<td class='num'>{$list[$i]['name']}</td>
					<td class='num'>{$list[$i]['datetime']}</td>
			</tr>
			";
	}
} else {
	echo "<tr><td colspan='5' style='text-align:center; height:100px;'>게시물이 없습니다.</td></tr>";
}
?>
</table>

<div class="page">
    <?php echo $write_pages?>
</div>

<script type="text/javascript">
//<![CDATA[
function select_change()
{
    document.getElementById("fnew").submit();
}
document.getElementById("gr_id").value = "<?php echo $gr_id?>";
document.getElementById("view").value = "<?php echo $view?>";

$(function() {
    /*
    $(".board_list tbody tr")
    .each(function(i) {
        if (i%2==0)
            $(this).addClass("list_even");
        else
            $(this).addClass("list_odd");
    })
    .hover(
        function() {
            $(this).toggleClass("mouse_over");
        },
        function() {
            $(this).toggleClass("mouse_over");
        }
    );
    */
    /*
    $(".board_list tbody tr")
    .each(function(i) {
        if (i%2==0)
            $(this).css("background", "#ffffff");
        else
            $(this).css("background", "#fcfcfc");
    })
    .bind("mouseover", function() {
        $(this).attr("rel", $(this).css("background"));
        $(this).css("background", "#f1f1f1");
    })
    .bind("mouseout", function() {
        $(this).css("background", $(this).attr("rel"));
    })
    */
});
//]]>
</script>
