<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{$language.lblBusiness} : {$language.lblMerchantReviews}</title>
{include file='CommonStyles.tpl'}
<link rel="stylesheet" type="text/css" href="{$view_styles}/business-reviews.css" />
{include file='CommonJavaScript.tpl'}
</head>
<body class="{$languageDirection}">
	<!-- Outer container starts-->
	<div id="main" class="outer"> 
        {include file='CommonHeader.tpl'} 
	<!-- Content Container starts-->
		 <div class="content-wrapper">
            <div class="container-fluid">
                <div id="common_message" ></div>
                {if $resProductReviewCount >0}
                <div class="margin-bottom">
                  {html->anchor  href="/product/review/" caption="<strong>{$language.lblProductReviews}</strong>"} >
                    <span><strong>{$language.lblMerchantReviews}</strong></span>
                  </div>
                  {/if}
                <div class="container-section">
                <div class="padding-top margin-horizontal clearfix">
                  <h2 class="pull-left">{$language.lblMerchantReviews}</h2>
                    {if $resBusinessRatings.ratingCount|default:0 > 0} 
                    <div class="total_rating margin-left pull-left padding-top">
                          {if $resBusinessRatings.ratingCount|default:0 > 0}
                            {assign var="avgRating" value=$resBusinessRatings.ratingTotal/$resBusinessRatings.ratingCount}
                            {assign var="avgRating" value=$avgRating|number_format:1}
                        {else}
                            {assign var="avgRating" value=0}
                        {/if}
							
                        <ul id="unit_ul1" class="unit-rating">
							<li id="current-rating" class="current-rating" style="width:{16 * $avgRating}px;">&nbsp;</li>
						</ul> 
                        {*<span class="rating-cnt1">&nbsp;{$language.lblRated} {$avgRating} {$language.lblOutOf} 5</span>*}
				    </div>
                    {/if}
                </div>
					
                
                <!--End: Right Block--> 
                {if empty($resBusinessReviews)}
                <div class="message_info">{$language.lblNoResultFound}</div>
				{else}
                    
                <div class="review-listing clearfix">
                        {foreach from=$resBusinessReviews item="review" key="key1"}
					 {assign var ="currReviewID" value=$review.reviewID}
                     <div class="margin-bottom review-sec">
                       
                        <div class="row">
                         
                          <div class="col-sm-4 col-xs-12 col-mob">
                              <span class="name pull-left margin-right font-semibold">{$review.userFirstName} {$review.userLastName} </span>
                              <ul id="unit_ul1" class="unit-rating pull-left">
                                <li id="current-rating" class="current-rating" style="width:{16 * $review.userRating}px;">{$review.userRating}/5</li>
                            </ul>
                          </div>
                          
                            <div class="col-sm-4 col-xs-12 col-mob text-center">
                                <span class="fade-color"><span class="font-semibold">{$language.lblip} : </span>  {$review.userIP}</span>
                            </div>
                            <div class="col-sm-4 col-xs-12 col-mob text-right">
                                <span class="date">{if $review.userReviewedTimeStamp} 
                                            {$review.userReviewedTimeStamp|date_format:$date_format} {$review.userReviewedTimeStamp|date_format:$time_format}
                                        {else}
                                            {$review.userRatedTimeStamp|date_format:$date_format} {$review.userRatedTimeStamp|date_format:$time_format}
                                        {/if} </span> 
                                          <br><span class="font-semibold">{$language.lblStatus} : </span>
                                          <span class="status">
                                          
                                  {if $review.reviewStatus == 'Active'}
                        {$language.lblActive}
                        {else if $order.orderStatus == 'Inactive'}
                        {$language.lblInactive}
                        {else if $order.orderStatus == 'New'}
                        {$language.lblNew}
                        {/if}
                              </span>
                                {*if $view_common_languages|@count>1} 
                                {if $review.languageID} <img class="flag " id="flag"  src="{$view_root_path}/public/uploads/languages/{$review.languageImage|escape}" alt="flag" /> {/if}
                                {/if*} 
                            </div>
                           </div>
                           
                           <div class="clearfix padding-top list-review">
                               <span class="pull-left">{$language.lblShippingTime}&nbsp;</span>
                                <ul id="unit_ul1" class="unit-rating pull-left">
                                    <li id="current-rating" class="current-rating" style="width:{16 * $review.shippingTimeRatings}px;">{$review.shippingTimeRatings}/5</li>
                                </ul>
                            <span class="pull-left"><span class="hidden-xs">&nbsp;&nbsp;/&nbsp;&nbsp;</span>{$language.lblShippingCost}&nbsp;</span>
                                <ul id="unit_ul1" class="unit-rating pull-left">
                                    <li id="current-rating" class="current-rating" style="width:{16 * $review.shippingCostRatings}px;">{$review.shippingCostRatings}/5</li>
                                </ul>
                            <span class="pull-left"><span class="hidden-xs">&nbsp;&nbsp;/&nbsp;&nbsp;</span>{$language.lblProductQuality}&nbsp;</span>
                                <ul id="unit_ul1" class="unit-rating pull-left">
                                    <li id="current-rating" class="current-rating" style="width:{16 * $review.productQualityRatings}px;">{$review.productQualityRatings}/5</li>
                                </ul>
                           </div>
                         <div class="clearfix margin-top">
                             {assign var="reviewtext" value=$review.userComment|unescape:"html"}
                          {assign var="reviewtextCharCount" value=$reviewtext|count_characters:true}
                          {assign var="reviewtextCharLimit" value=100}
                          <div class="position"> 
                            {if $reviewtextCharCount > $reviewtextCharLimit} 
                            {html->anchor class="reviewReadMore  add01 icon-set" title="{$language.lblViewMore}" rel="{$currReviewID}" }
                            {else} {* <span style="display:inline-block;width:15px;">&nbsp;</span> *} {/if} </div>
                          <div class="rv-title margin-bottom font-semibold">{$review.productTitle}</div>
                          <div class="cmt "> 
                          {if $reviewtextCharCount > $reviewtextCharLimit} 
                          <span class="reviewReadLessDet" id="reviewReadLessDet_{$currReviewID}">{$reviewtext|mb_substr:0:$reviewtextCharLimit}... </span> 
                          
                          <span class="reviewReadMoreDet" id="reviewReadMoreDet_{$currReviewID}"  style="display:none;"> {$reviewtext|nl2br} </span> 
                          {html->anchor class="reviewReadMore font-semibold" rel="{$currReviewID}" content="
                          <span class='more'>{$language.lblViewMore}</span>
                          <span class='less'>{$language.lblViewLess}</span>
                          "}
                          {else}
                            {$reviewtext|nl2br}										
                            {/if} </div>
                         </div>

						</div>
					{/foreach} 
					</div> 
                <div class="col-xs-12 margin-top pull-right pagination_outer" > {paginate->layout key="review-page" label_record="{$language.lblRecorsFound}" label_pages="{$language.lblPages}" results_per_page="{$language.lblResultsperpage}" }
					</div> 
                    
				{/if} 
                </div>
			</div>
			<!--End:From Listing--> 
		</div>
	</div>

  <!-- Content Container ends--> 
  <!-- Footer starts--> 
  {include file='CommonFooter.tpl'} 
  <!-- Footer ends--> 
<!-- Outer container ends--> 
{form->basepath_script}
{html->messages_script id="common_message"} 
<script type="text/javascript">
$(document).ready(function () {
		$(document).on('click','.reviewReadMore', function () {
			var thisRel = $(this).attr("rel");			
			if($(this).hasClass("minus01"))
			{
				$(this).removeClass("minus01");
//                $(this).next(".reviewReadMoreDet").hide();
				$("#reviewReadMoreDet_"+thisRel).hide();
				$("#reviewReadLessDet_"+thisRel).show();
			}
			else
			{
				$(this).addClass("minus01");
//                $(this).next(".reviewReadMoreDet").show();
				$("#reviewReadLessDet_"+thisRel).hide();
				$("#reviewReadMoreDet_"+thisRel).show();
				
			}
		});
	});
</script>
</body>
</html>
