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

if(!defined('RELATED_BASIC')) {
	define('RELATED_BASIC', true);
	echo '<link rel="stylesheet" href="'.$related_skin_url.'/related.css">'."\n";
}

$mrs = G5_IS_MOBILE ? 'm' : 'r';

if($is_related == 'board') { 
	$list['thumb'] = amina_thumb($list, 50, 50, '', 'none', 's', true);
?>
	<div class="related">
		<div class="<?php echo $mrs; ?>head">관련글</div>
		<div class="<?php echo $mrs; ?>body">
			<?php echo $list['thumb']; ?>
			<div class="<?php echo $mrs; ?>tail">
				<a href="<?php echo $list['href']; ?>" target="_top"><span class="direct">바로가기</span></a>
			</div>
			<p><a href="<?php echo $list['href']; ?>" target="_top"><b><?php echo $list['subject']; ?></b></a></p>
			<div class="related-info">
				<span><i class="fa fa-th-large"></i> <?php echo $list['bo_subject']; ?></span>
				<?php if($list['ca_name']) { ?>
					<span><i class="fa fa-tag"></i> <?php echo $list['ca_name']; ?></span>
				<?php } ?>
				<span><i class="fa fa-user"></i> <?php echo $list['wr_name']; ?></span>
			    <?php if ($list['wr_comment'] > 0) { ?> <span><i class="fa fa-comment"></i> <?php echo $list['wr_comment']; ?></span><?php } ?>
				<span><i class="fa fa-eye"></i> <?php echo $list['wr_hit']; ?></span>
				<span><i class="fa fa-clock-o"></i> <?php echo date("Y.m.d", strtotime($list['wr_datetime'])); ?></span>
			</div>
			<div class="clear"></div>
		</div>
	</div>
<?php } else if($is_related == 'youngcart') { ?>
	<div class="related">
		<div class="<?php echo $mrs; ?>head">관련상품</div>
		<div class="<?php echo $mrs; ?>body">
			<div class="thumb">
				<a href="<?php echo $g4['shop_path']; ?>/item.php?it_id=<?php echo $it['it_id']; ?>" target="_top"><img src="<?php echo amina_make_thumb($it_thumb, 50, 50); ?>" alt="" /></a>
			</div>
			<div class="<?php echo $mrs; ?>tail">
				<a href="<?php echo $g4['shop_path']; ?>/item.php?it_id=<?php echo $it['it_id']; ?>" target="_top"><span class="direct">바로가기</span></a>
			</div>
			<p><a href="<?php echo $g4['shop_path']; ?>/item.php?it_id=<?php echo $it['it_id']; ?>" target="_top"><b><?php echo it_name_icon($it, stripslashes($it['it_name']), false); ?></b></a></p>
			<div class="related-info">
				<?php if($it['it_use']) { 
						if($it['it_tel_inq']) {
							echo '<span><i class="fa fa-phone"></i> 전화문의</span>';
						} else {
							if ($it['it_cust_amount']) echo '<span><del><i class="fa fa-krw"></i> '.number_format($it['it_cust_amount'], 0).'원</del> &nbsp; <i class="fa fa-arrow-circle-right></i></span>';
							echo '<span class="amount"><i class="fa fa-krw"></i> '.number_format(get_amount($it), 0).'원</span>';
						}
					?>
					<span><i class="fa fa-plus-circle"></i> <?php echo number_format($it['it_point']); ?> MP 획득</span>
				<?php } else {?>
					<span><i class="fa fa-shopping-cart"></i> 판매가 종료된 상품입니다.</span>
				<?php } ?>
			</div>
			<div class="clear"></div>
		</div>
	</div>
<?php } ?>