<?php echo $this->render('module/header_mobi.phtml'); ?>

<style>

.optionBox{
	margin:10px;
	padding:15px;
	-webkit-box-shadow: 3px 3px 5px 0px rgba(50, 50, 50, 0.75);
    -moz-box-shadow: 3px 3px 5px 0px rgba(50, 50, 50, 0.75);
    box-shadow: 3px 3px 5px 0px rgba(50, 50, 50, 0.75);
}

.opinionType{
	color: #fff;
    text-align: center;
    padding: 5px;
    display: inline-block;
    border-radius: 5px;
    font-size: 12px;
    width: 80px;
    margin-right: 10px;
}

.opinionSignature{
	font-weight:bold;
}

.opinionButton{
	padding:15px;
    padding-left: 50px;
}

.opinionButton > a{
	color: #fff;
    text-align: center;
    padding: 5px;
    display: inline-block;
    border-radius: 5px;
    font-size: 14px;
    margin-right: 10px;
}

.opinionButtonA{
	opacity:0.5;
//	filter: grayscale(100%);
}

.opinionButtonASelected{
	opacity:1;
//	filter: none;
}

.opinionSort{
    padding-top: 20px;
    padding-right: 40px;
}

</style>

	
<script type="text/javascript" language="javascript">

	$(document).ready(function () {
	
		$('.opinionButtonA').click(function(){		
			$('.opinionButtonA').removeClass('opinionButtonASelected');
			$(this).addClass('opinionButtonASelected');		
			$('.optionBox').hide();
			
			if( $(this).attr('cmd') == 'all' ){
				$('.optionBox').show();
			}else{
				$('.opinionBox'+$(this).attr('cmd')).show();			
			}
		});
	
		$('.opinionSortSelect').change(function(){
			$('#opinionSortForm').submit();
		});
	
	});

</script>	

<div class="conBox">
<div class="container widthDiv" style="padding-top:15px;">
	<div class="row">
		<div class="col-xs-12 categoryBox" style="padding-bottom:15px;">
		
		
		<h1 style="margin:0;font-size:26px;"><?php echo @Lib_Lang::translate(opinion_top); ?></h1>
		
		
		
		<div class="row">		
		
			<?php
			
				$opinionCount0 = round(($this->opinionCount0 * 100)/$this->opinionCount,2); 
				$opinionCount1 = round(($this->opinionCount1 * 100)/$this->opinionCount,2);
				$opinionCount2 = round(($this->opinionCount2 * 100)/$this->opinionCount,2);
			
			?>
		
			<div class="col-xs-8 opinionButton">
				<a href="javascript:void(0);" cmd='all' class="opinionButtonA opinionButtonASelected" style="background: #000;"><?php echo @Lib_Lang::translate(front_account_addopinion_all); ?> (<?php echo$this->opinionCount; ?>)</a>
				<a href="javascript:void(0);" cmd='0' class="opinionButtonA" style="background: #478a00;"><?php echo @Lib_Lang::translate(front_account_addopinion_type0); ?> (<?php echo$opinionCount0; ?>%)</a>
				<a href="javascript:void(0);" cmd='1' class="opinionButtonA" style="background: #0c528e;"><?php echo @Lib_Lang::translate(front_account_addopinion_type1); ?> (<?php echo$opinionCount1; ?>%)</a>
				<a href="javascript:void(0);" cmd='2' class="opinionButtonA" style="background: #df0000;"><?php echo @Lib_Lang::translate(front_account_addopinion_type2); ?> (<?php echo$opinionCount2; ?>%)</a>
			</div>
			<div class="col-xs-4 text-right opinionSort">
			
				<form method="get" id="opinionSortForm">
				<?php echo @Lib_Lang::translate(front_opinion_sort); ?>
				
				<select name="sort1" class="opinionSortSelect">
					<option value="1" <?php if( $this->sort1 == 1 ) echo'selected'; ?>><?php echo @Lib_Lang::translate(front_opinion_sort1_1); ?></option>
					<option value="2" <?php if( $this->sort1 == 2 ) echo'selected'; ?>><?php echo @Lib_Lang::translate(front_opinion_sort1_2); ?></option>
				</select>
				
				<select name="sort2" class="opinionSortSelect">
					<option value="1" <?php if( $this->sort2 == 1 ) echo'selected'; ?>><?php echo @Lib_Lang::translate(front_opinion_sort2_1); ?></option>
					<option value="2" <?php if( $this->sort2 == 2 ) echo'selected'; ?>><?php echo @Lib_Lang::translate(front_opinion_sort2_2); ?></option>
				</select>
				
				</form>
			
			</div>
		</div>
		
		
		<?php $i = 0; foreach ($this->dataTable as $key => $val): $i++; ?>
		
		
		<div class="row optionBox opinionBox<?php echo$val['opinion_type']; ?>">
		
			<div class="col-xs-6">
			
			
				<?php if( $val['opinion_type'] == 0 ){ ?>
					<p class="opinionType" style="background: #478a00;"><?php echo @Lib_Lang::translate(front_account_addopinion_type0); ?></p>
				<?php } ?>
				
				<?php if( $val['opinion_type'] == 1 ){ ?>
					<p class="opinionType" style="background: #0c528e;"><?php echo @Lib_Lang::translate(front_account_addopinion_type1); ?></p>
				<?php } ?>
				
				<?php if( $val['opinion_type'] == 2 ){ ?>
					<p class="opinionType" style="background: #df0000;"><?php echo @Lib_Lang::translate(front_account_addopinion_type2); ?></p>
				<?php } ?>
				
				
				<font class="opinionSignature"><?php echo$val['opinion_signature']; ?></font>
			</div>
			<div class="col-xs-6 text-right"><?php echo$val['opinion_ins']; ?></div>
			
			<div class="col-xs-12"><?php echo$val['opinion_contents']; ?></div>
		
		</div>
		
		
		<?php endforeach; ?>
	
		</div>
	</div>
</div>
</div>

<?php echo $this->render('module/footer_mobi.phtml'); ?>

