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

// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
//add_stylesheet('<link rel="stylesheet" href="'.$latest_skin_url.'/style.css">', 0);
$thumb_width = 1200;
$thumb_height = 800;
?>
<div id="carousel-example" class="carousel slide" data-ride="carousel">
  <div class="carousel-inner product-slider">
<?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'];
          $thumb['alt'] = $list[$i]['subject'];
      } else {
          $img = 'http://fakeimg.pl/1920x884/?text=Product'.$i;
          $thumb['alt'] = '제품소개';
      }
      $img_content = '<img src="'.$img.'" alt="'.$thumb['alt'].'" >';
      ?>

      <div class="<?php if($i==0){echo "active ";}?> item">
              <a href="#"><img src="<?php echo $img;?>" ></a>
              <div class="hover-product"><a data-toggle="modal" title="<?php echo $list[$i]['subject'];?>" class="btn btn-info btn-sm" href="#productModal<?php echo $i;?>">자세히 보기</a>
              </div>
        </div>

        <!--modal -->
        <div id="productModal<?php echo $i;?>" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
                            <div class="modal-dialog modal-lg">
                            <div class="modal-content">
                            	<div class="modal-body">
                            		<h2><?php echo $list[$i]['subject'];?></h2>
                            		<p><?php echo $list[$i]['wr_content'];?></p>
                            		<br/>
                            		<button class="btn btn-primary btn-lg center-block" data-dismiss="modal" aria-hidden="true">OK <i class="ion-android-close"></i></button>
                            	</div>
                            </div>
                            </div>
                        </div>

<?php }  ?>
  </div>

</div>
