<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH.'/thumbnail.lib.php');

$thumb_width = 210;
$thumb_height = 150;
?>

<link rel="stylesheet" href="<?php echo $latest_skin_url;?>/style.css">

<div class="card">
    <div class="card-header"><a href="<?php echo G5_BBS_URL ?>/board.php?bo_table=<?php echo $bo_table ?>"><?php echo $bo_subject ?></a>
      <span class="float-right"><a href="<?php echo G5_BBS_URL ?>/board.php?bo_table=<?php echo $bo_table ?>" class="lt_more"><span class="sr-only"><?php echo $bo_subject ?></span><i class="fa fa-plus" aria-hidden="true"></i><span class="sr-only"> 더보기</span></a></span></div>
    <div class="card-body">
      <ul>
    <?php
    for ($i=0; $i<count($list); $i++) {
    $thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $thumb_width, $thumb_height, false, true);

    if($thumb['src']) {
        $img = $thumb['src'];
    } else {
        $img = G5_IMG_URL.'/no_img.png';
        $thumb['alt'] = '이미지가 없습니다.';
    }
    $img_content = '<img class="img-fluid" src="'.$img.'" alt="'.$thumb['alt'].'" >';
    ?>
        <li class="text-center">
            <?php echo $img_content; ?>
            <?php

            echo "<br> ";
                echo $list[$i]['subject'];
            ?><br>
            <span class="text-danger"><?php echo number_format($list[$i]['wr_1']) ?>원</span>
        </li>
    <?php }  ?>
    <?php if (count($list) == 0) { //게시물이 없을 때  ?>
    <li class="empty_li">게시물이 없습니다.</li>
    <?php }  ?>
    </ul>
  </div>

</div>
