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

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

if(G5_IS_MOBILE) {
	$css = '_m';
	$type = 'select';
} else {
	$css = '';
	$type = '';
}

?>

<table border=0 class="star-form">
<tbody>
<tr><td>
	<form name="amina_star<?php echo $wr_id; ?>" id="amina_star<?php echo $wr_id; ?>" method="post" action="<?php echo AMINA_URL; ?>/star.php" autocomplete="off">
	<input type="hidden" name="bo_table" value="<?php echo $bo_table; ?>">
	<input type="hidden" name="wr_id"  value="<?php echo $wr_id; ?>">
	<input type="hidden" name="loc"  value="pc">
	<fieldset class="sf<?php echo $css; ?>">
		<legend>별점주기</legend>
		<table border=0 class="st<?php echo $css; ?>">
		<tr>
		<td class="star_avg<?php echo $css; ?>">
				<?php 
					echo amina_star_mark($amina['star_color'], $wr_7, 'l');
					$star = amina_array_star($wr_7);
					if(!$star['people']) $star['people'] = 0;
					$score = 0;
					if($star['people'] > 0) $score = $star['score'] / $star['people'];
					$score = round($score,1);
					echo '<p>( '.$score.'점 / '.$star['people'].'명 )</p>';
				?>
		</td>
		<?php if(G5_IS_MOBILE) { ?>
			</tr>
			<tr>
			<td>
				<select id="star" name="star">
					<option value="" selected>★ 별점선택 ★</option>
					<option value="10">★★★★★</option>
					<option value="8">★★★★☆</option>
					<option value="6">★★★☆☆</option>
					<option value="4">★★☆☆☆</option>
					<option value="2">★☆☆☆☆</option>
				</select>
			</td>
			</tr>
			<tr>
		<?php } else { ?>
			<?php for($i=5; $i > 0; $i--) { $n = $i * 2; ?>
				<td>
					<label for="star<?php echo $n; ?>"><?php echo amina_star_mark($amina['star_color'], $n."|1","s"); ?></label>
					<input type="radio" id="star<?php echo $n; ?>" name="star" value="<?php echo $n; ?>"><span class="none"><?php echo $n; ?>점</span>
				</td>
			<?php } ?>
		<?php } ?>
		<td class='star_btn<?php echo $css; ?>'>
			<a href="javascript:amina_star('<?php echo AMINA_URL; ?>/star.php','amina_star<?php echo $wr_id; ?>','view_star<?php echo $wr_id; ?>','<?php echo $type; ?>');"><img src="<?php echo $star_skin_url; ?>/img/btn_star.gif" alt='별점주기' /></a>
			<noscript><input type="image" src="<?php echo $star_skin_url; ?>/img/btn_star.gif" alt='별점주기' /></noscript>
		</td>
		</tr>
		</table>
	</fieldset>
	</form>
</td>
</tr>
</tbody>
<tfoot>
<tr><td>
	<?php 
		if($amina['star'] == "2") {
			echo '※ 회원만 별점 가능';
		} else {
			echo '※ 비회원도 별점 가능';
		}
	
		if($amina['star_point'] > 0) echo '/ 별점 부여시 <span class="point">'.number_format($amina['star_point']).' MP</span> 획득';
	?>
</td></tr>
<tfoot>
</table>