<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 
?>

<?php if($action == "list") { ?>

	<div class="btn-basic" style="margin:10px 0px;">
		<div class="left">
			<?php if($is_admin_href) { ?>
				<a class="active" href="javascript:amina_show('as-list-admin');"><i class="fa fa-gear fa-lg" title="관리자설정"></i></a>
			<?php } ?>

			<?php if($rss_href) { ?>
				<a href="<?php echo $rss_href; ?>" target="_blank"><i class="fa fa-rss fa-lg" title="RSS 2.0"></i></a>
			<?php } ?>

			<a href="javascript:amina_show('as-list-search')"><i class="fa fa-search fa-lg" title="검색하기"></i></a>
		</div>
		<div class="right">
			<a href="<?php echo $write_href; ?>"><i class="fa fa-pencil fa-lg"></i> <b>글쓰기</b></a>
		</div>
		<div class="clear"></div>
	</div>

	<div id="as-list-search" style="display:<?php echo $stx_str ? 'block' : 'none'; ?>;">
		<form name="fsearch" method="get" onsubmit="return amina_search(this);" data-ajax="false">
		<input type="hidden" name="bo_table" value="<?php echo $bo_table; ?>">
	    <input type="hidden" name="sca"      value="<?php echo $sca; ?>">
		<input type="hidden" name="frame"	 value="<?php echo $frame; ?>">
		<ul>
		<li>
			<select id="list-sch-sfl" name="sfl" style="width:100px;">
				<option value="wr_subject||wr_content">제목+내용</option>
				<option value="wr_subject">제목</option>
				<option value="wr_content">내용</option>
				<option value="mb_id,1">회원아이디</option>
				<option value="mb_id,0">회원아이디(댓글)</option>
				<option value="wr_name,1">글쓴이</option>
				<option value="wr_name,0">글쓴이(댓글)</option>
			</select>
		</li>
		<li>
			<select name="sop">
				<option value="and">그리고</option>
				<option value="or">또는</option>
			</select>
		</li>
		<li>
			<input type="text" id="list-sch-stx" name="stx" size=10 placeholder="검색어" value="<?php echo stripslashes($stx_str);?>" style="width:120px;"/>
		</li>
		<li>
			<button type="submit" class="active" data-role="none"><i class="fa fa-search fa-lg"></i></button>
		</li>
		</ul>
		</form>
	</div>

	<script type="text/javascript">
		if ('<?php echo $stx_str; ?>') {
		   document.fsearch.sfl.value = '<?php echo $sfl_str; ?>';

			if ('<?php echo $sop; ?>' == 'and') 
				document.fsearch.sop[0].checked = true;

			if ('<?php echo $sop; ?>' == 'or')
		        document.fsearch.sop[1].checked = true;
		} else {
		    document.fsearch.sop[0].checked = true;
		}
	</script>

	<div class="clear"></div>

	<?php if ($is_admin_href) { //관리자설정 ?>
		<div id="as-list-admin" style="display:none; background:#fafafa; border:1px solid #ddd; padding:10px; margin:10px 0px; text-align:center;">
			<ul class="bar11c">
			<?php if ($is_checkbox) { ?>
				<li class="first"><input type="checkbox" id="chkall" onclick="if (this.checked) all_checked(true); else all_checked(false);"></li>
				<li><a href="javascript:select_delete();">삭제</a></li>
				<li><a href="javascript:select_copy('copy');">복사</a></li>
				<li><a href="javascript:select_copy('move');">이동</a></li>
			<?php } ?>
			<?php if ($admin_href) { ?>
				<li<?php if(!$is_checkbox) echo ' class="first"'; ?>><a href="<?php echo $amina_href; ?>">아미나설정</a></li>
				<li><a href="<?php echo $admin_href; ?>">그누설정</a></li>
				<li class="last"><a href="<?php echo AMINA_URL; ?>/blind.list.php">블라인드관리</a></li>
			<?php } ?>
			</ul>
			<div class="clear"></div>
		</div>
	<?php } ?>

<?php } else if($action == "view") { ?>

	<div style="border-top:1px solid #ddd; padding:10px 0px 30px; margin-top:10px;">
		<div class="btn-basic">
			<div class="left">
				<?php if ($is_admin) { ?>
					<a class="active" href="javascript:amina_show('as-view-admin');"><i class="fa fa-eye fa-lg" title="글통계 및 관리"></i></a>
				<?php } else if($is_writer) { ?>
					<a class="active" href="javascript:amina_stats('<?php echo $bo_table; ?>','<?php echo $wr_id; ?>');"><i class="fa fa-eye fa-lg" title="게시물 통계"></i></a>
				<?php } ?>
				<?php if ($prev_href) { ?>
					<a href="<?php echo $prev_href; ?>" title="<?php echo $prev_wr_subject; ?>"><i class="fa fa-chevron-sign-left fa-lg"></i> <b>이전글</b></a>
				<?php } ?>
				<?php if ($next_href) { ?>
					<a href="<?php echo $next_href; ?>" title="<?php echo $next_wr_subject; ?>"><i class="fa fa-chevron-sign-right fa-lg"></i> <b>다음글</b></a>
				<?php } ?>
			</div>
			<div class="right">
				<?php if ($move_href) { ?>
					<a <?php echo $move_href; ?>><b>이동</b></a>
				<?php } ?>
				<?php if ($copy_href) { ?>
					<a <?php echo $copy_href; ?>><b>복사</b></a>
				<?php } ?>
				<?php if ($delete_href) { ?>
					<a <?php echo $delete_href; ?>><b>삭제</b></a>
				<?php } ?>
				<?php if ($update_href) { ?>
					<a href="<?php echo $update_href; ?>"><b>수정</b></a>
				<?php } ?>
				<?php if ($reply_href) { ?>
					<a class="btn-basic" href="<?php echo $reply_href; ?>"><b>답변</b></a>
				<?php } ?>
				<?php if ($search_href) { ?>
					<a href="<?php echo $search_href; ?>"><b>검색목록</b></a>
				<?php } ?>

				<a href="<?php echo $list_href; ?>"><b>목록</b></a>

				<?php if ($write_href) { ?>
					<a href="<?php echo $write_href; ?>"><i class="fa fa-pencil fa-lg"></i> <b>글쓰기</b></a>
				<?php } ?>
			</div>
			<div class="clear"></div>
		</div>

		<?php if($is_admin) { ?>
			<div id="as-view-admin" style="display:none; border:1px solid #ddd; background:#fafafa; text-align:center; padding:10px; margin-top:10px;">
				<ul class="bar11c">
					<li class="first"><a href="javascript:amina_stats('<?php echo $bo_table; ?>','<?php echo $wr_id; ?>');">게시물 통계</a></li>
					<li><a href="javascript:amina_shingo('<?php echo AMINA_URL; ?>/blind.php?bo_table=<?php echo $bo_table; ?>&wr_id=<?php echo $wr_id; ?>&act=lock','lock');">블라인드 처리</a></li>
					<li><a href="javascript:amina_shingo('<?php echo AMINA_URL; ?>/blind.php?bo_table=<?php echo $bo_table; ?>&wr_id=<?php echo $wr_id; ?>&act=unlock','unlock');">블라인드 해제</a></li>
					<li><a href="<?php echo $amina_href; ?>">아미나설정</a></li>
					<li><a href="<?php echo $admin_href; ?>">그누설정</a></li>
					<li class="last"><a class="fbox-win" href="<?php echo AMINA_URL; ?>/blind.list.php?frame=2">블라인드관리</a></li>
				</ul>
				<div class="clear"></div>
			</div>
		<?php } ?>
	</div>

<?php } else if($action == "write") { ?>

	<div class="btn-basic" style="text-align:right; margin:10px;">
		<a id="btn_submit" href="javascript://" class="active"><b><i class="fa fa-upload fa-lg"></i> 글등록</b></a>
		<a id="btn_list" href="<?php echo $list_url; ?>"><b>글목록</b></a>
	</div>

<?php } ?>

