<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH . '/thumbnail.lib.php');
add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0);
?>

<section class="news-view temha_board">
  <div class="contents-container container-md">
    <div class="contents-inner">
      <div class="con-top">
        <div class="con-tit">
          <div class="h3 subject">
            <!--<span class="p2 badge badge-mono">공지</span>-->
            <?php echo get_text($view['wr_subject']); ?>			
          </div>
	<div class="modify_btn">
		<?php if ($update_href) { ?><a class="btnset btnset-line-dark" href="<?php echo $update_href ?>">수정</a><?php } ?> 
		 <?php if ($delete_href) { ?><a class="btnset btnset-line-dark" href="<?php echo $delete_href ?>" onclick="del(this.href); return false;">삭제</a><?php } ?>
	</div>
        </div>
        <div class="p2 date"><span><?php echo date('Y.m.d', strtotime($view['wr_datetime'])) ?></span> </div>
      </div>
		
		
      <div class="con-body">
        <?php echo get_view_thumbnail($view['content']); ?>      
			<?php
			for ($i=0; $i<count($view['file']); $i++) {
				if (isset($view['file'][$i]['source']) && $view['file'][$i]['source'] ){
			?>		  
			<ul class="download-list">
				<li class="download-item"><a href="<?php echo $view['file'][$i]['href'];  ?>" class="btnset-icon ff-ico ti-download-folder"> <?php echo $view['file'][$i]['source'] ?> <?php echo $view['file'][$i]['content'] ?> (<?php echo $view['file'][$i]['size'] ?>)  </a></li>		
			</ul>
			<?php
				}
			}
			?>
		<?php if(isset($view['link']) && array_filter($view['link'])) { ?>
        <ul class="download-list">
        <?php
        // 링크
        $cnt = 0;
        for ($i=1; $i<=count($view['link']); $i++) {
            if ($view['link'][$i]) {
                $cnt++;
                $link = cut_str($view['link'][$i], 70);
            ?>	
            <li class="download-item ">            
                <a href="<?php echo $view['link_href'][$i] ?>" class="btnset-icon ff-ico ti-lin" target="_blank"> <?php echo $link ?></a>             
            </li>		
            <?php
            }
        }
        ?>
        </ul>
    <?php } ?>  
		</div>

      <div class="con-bottom btn-box">
        <?php if ($prev_href) { ?>
          <a class="link-btn prev-btn active" href="<?php echo $prev_href ?>">
            <span class="h4">
              <i class="ico-arrow"></i>
              <strong>PREV</strong>
            </span>
            <p class="p2"><?php echo $prev['wr_subject']; ?></p>
          </a>
        <?php } else { ?>
          <div class="link-btn prev-btn">
            <span class="h4">
              <i class="ico-arrow"></i>
              <strong>PREV</strong>
            </span>
            <p class="p2">이전글이 없습니다.</p>
          </div>
        <?php } ?>
        <?php if ($next_href) { ?>
          <a class="link-btn next-btn active" href="<?php echo $next_href ?>">
            <span class="h4">
              <strong>NEXT</strong>
              <i class="ico-arrow"></i>
            </span>
            <p class="p2"><?php echo $next['wr_subject']; ?></p>
          </a>
        <?php } else { ?>
          <div class="link-btn next-btn ">
            <span class="h4">
              <strong>NEXT</strong>
              <i class="ico-arrow"></i>
            </span>
            <p class="p2">다음글이 없습니다.</p>
          </div>
        <?php } ?>
        <a class="list-btn" href="<?php echo ($search_href ? $search_href : $list_href); ?>">
          <span class="blind">리스트 보기</span>
        </a>
      </div>
    </div>
  </div>
</section>
</main>