<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$language.lblBusiness} :{$language.lblProductReview} :{$language.lblTitleProduct}</title>
{include file='CommonStyles.tpl'}
{include file='CommonJavaScript.tpl'}
<link href="{$view_styles}/jquery-ui-1.8.19.custom.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/choosen.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/listing.css" />
<script type="text/javascript" src="{$view_javascript}/chosen.jquery.min.js"></script>
    
{include file='CommonCustomStyles.tpl'}
{form->basepath_script}
{form->rootpath_script}
</head>
<body class="{$languageDirection}">
<div class="outer" id="main">{include file='CommonHeader.tpl'} 
  <!--*******************************START CONTAINER SECTION******************************************************-->
	 <div class="content-wrapper">
    <div class="container-fluid">
    <noscript>
        <div class="message_info">{$language.lblJsEnable} !!</div>
    </noscript>
	<!--{if $resMerchantReviewCount|default:0 >0}
      <div class=" fixing_right tab02">
       <span><strong>{$language.lblProductReviews}</strong></span>
      {html->anchor  href="/user/showreviews/" caption="<strong>{$language.lblMerchantReviews}</strong>"}
      </div>
	  {/if}-->
				<div id="common_message"></div>
				<!-- Inner Content Container starts-->
				<div class="container-section"> 
					<!-- Search container starts --> 
					<h3 class="border-bottom">{$language.lblProductReview}</h3>
					{form->start name="frmSearchProducts" action="" method="post"}         
						<div class="content-block">
								<div class="row">
									<div class="form-group col-md-3 col-xs-12">
										<label>{$language.lblProductIDTitle}</label>
										<span class="form-field01"> {form->textbox name="searchProductName" class="form-control"} </span>
									</div>
									<div class="form-group col-md-3 col-xs-12">
										<label>{$language.lblDate}</label>
										<span class="form-field01">
										  {form->textbox id="searchProductFromDate" name="searchProductFromDate" readonly="readonly" class="form-control date-picker" value=$searchProductFromDate} </span> 
									</div>
									<div class="form-group col-md-3 col-xs-12">
										<label>{$language.lblUserName}</label>
										<span class="form-field01"> {form->textbox name="searchUserName" class="form-control"}  </span> 
									</div>
									<div class="form-group col-md-3 col-xs-12">
										<label>{$language.lblStatus}</label>
										<span class="form-field01">{form->select class="form-control selectpicker"  name="status" options="->{$language.lblSelect}~*New->{$language.lblNew|default:''}~*Active->{$language.lblActive}~*Inactive->{$language.lblInactive}"} </span>
									</div>
									<div class="col-xs-12">
										{form->submit name="submitProductReviewSearch" id="submitProductReviewSearch" class="btn btn-primary btn-sm"   value="{$language.lblSearch}"}
										{html->anchor href="/product/review/" class="action-link" content="{$language.lblListAll}"}
									</div>
								</div>
						
						</div>
					{form->close} 
                </div>
					<!-- Search container ends --> 
					{if !$resAllProductReviewDetails|@count eq 0}
						{form->start name="formProductReviews" action="" method="post"}
							{form->hidden name="hidProductReviewID" value=0}
					<div class="container-section clearfix">
							{* <!-- sort by starts --> *}
								<div class="sort_links clearfix">  
								{* <!-- Language selection --> *}
								<div class="pull-left left">
						            {include file='ContentLanguageOptions.tpl'}
					            </div>
								<span class="sort-link"></span>
									{if $sortby=='did'}
										{assign var="sortLabel" value=$language.lblProductID}
									{elseif $sortby=='dtitle'}                	
										{assign var="sortLabel" value=$language.lblProductTitle}
									{elseif $sortby=='rdate'}
										{assign var="sortLabel" value=$language.lblReviewdDate}
									{elseif $sortby=='rat'}
										{assign var="sortLabel" value=$language.lblRating}
									{elseif $sortby=='helpful'}
										{assign var="sortLabel" value=$language.lblReviewHelpful}
									{elseif $sortby=='nothelpful'}
										{assign var="sortLabel" value=$language.lblReviewNotHelpful}
             						{/if} 
									{if $orderby=='asc' || $orderby==''}
										{assign var="sortOrderAsc" value="active"}
										{assign var="sortOrderDesc" value="inactive"}
									{else}
										{assign var="sortOrderAsc" value="inactive"}
										{assign var="sortOrderDesc" value="active"}
									{/if} 
									{if $orderby=="asc"}
										{assign var="orderByNew" value="desc"}
									{else if $orderby=="desc"}  
										{assign var="orderByNew" value="asc"}
									{else}
										{assign var="orderByNew" value="desc"}
									{/if} 
									<span class="sortby-list btn btn-default pull-right"> 
										{if $sortby==''}  {$language.lblSortby} <span class="caret"></span> </span> 
										{else}<strong>{$sortLabel} </strong></span>
											{html->anchor class="asnd {$sortOrderAsc}" href="/product/review/{$link}/sortby/{$sortby}/orderby/asc/" content="<span class='arw'></span> <span class='line'></span>"}
											{html->anchor  class="dsnd {$sortOrderDesc}" href="/product/review/{$link}/sortby/{$sortby}/orderby/desc/" 	content="<span class='line'></span> <span class='arw'></span>"}
										{/if}
									<ul class="sort_links_ul" >
										<li>{html->anchor href="/product/review/{$link}/sortby/dtitle/orderby/{$orderByNew}/" class="{if $sortby=="dtitle"}selected{/if}" title="{$language.lblProductTitle}" content="{$language.lblProductTitle}"}</li>
										<li class="last">{html->anchor href="/product/review/{$link}/sortby/rdate/orderby/{$orderByNew}/" class="{if $sortby=="rdate"}selected{/if}" title="{$language.lblReviewdDate}" content="{$language.lblReviewdDate}"}</li>
										<li class="last">{html->anchor href="/product/review/{$link}/sortby/rat/orderby/{$orderByNew}/" class="{if $sortby=="rat"}selected{/if}" title="{$language.lblRating}" content="{$language.lblRating}"}</li>
										<li class="last">{html->anchor href="/product/review/{$link}/sortby/helpful/orderby/{$orderByNew}/" class="{if $sortby=="helpful"}selected{/if}" title="{$language.lblReviewHelpful}" content="{$language.lblReviewHelpful}"}</li>
										<li class="last">{html->anchor href="/product/review/{$link}/sortby/nothelpful/orderby/{$orderByNew}/" class="{if $sortby=="helpful"}selected{/if}" title="{$language.lblReviewNotHelpful}" content="{$language.lblReviewNotHelpful}"}</li>
									</ul>
								</div>
							<!-- sort by ends --> 
							<!--Start: Product List--> 
							<div class="review-listing">
								{foreach from=$resAllProductReviewDetails item="product_review_details_list" key="key1"}
								{assign var ='currProductReviewID' value=$product_review_details_list.ProductReviewID}
                               
                                <div class="clearfix listing ">
                                  <div class="detail-blk col-md-2 col-xs-12">
                                    <ul id="unit_ul1" class="unit-rating ">
                                      <li id="current-rating" class="current-rating" style="width:{16 * $product_review_details_list.productRating}px;">{$product_review_details_list.productRating}/5</li>
                                    </ul>
                                    <span class="name">{$product_review_details_list.userFirstName|default:''}  {$product_review_details_list.userLastName|default:''}</span> <br />
                                    <span class="date"> {$product_review_details_list.reviwedDate|date_format:"$date_format"} {$product_review_details_list.reviwedDate|date_format:"$time_format"}  </span> 
                                    </div>
                                    <div class="detail-blk last col-md-2 col-xs-12 pull-right">
                                        <span class="item-ip">IP : {$product_review_details_list.userIP}</span>
                                    </div>
                                      <div class="detail-blk col-md-7 col-xs-12">
                                            {if $product_review_details_list.reviewStatus eq 'Inactive'}
                                                <span class="inactive"> {$language.lblInactive} </span>
                                            {else if $product_review_details_list.reviewStatus eq 'Active'}
                                                <span class="active"> {$language.lblActive} </span>
                                            {else if $product_review_details_list.reviewStatus eq 'New'}
                                                <span class="new"> {$language.lblNew} </span>
                                            {/if} 

                                             {if $view_common_languages|@count>1} 
                                                {if $product_review_details_list.languageID} <img class="flag" id="flag"  src="{$view_root_path}/public/uploads/languages/{$product_review_details_list.languageImage|escape}" alt="flag" /> {/if}
                                             {/if}
                                        <br />

                                        <span class="review-item">{$language.lblProduct}: {$product_review_details_list.productTitle|default:''}</span> 
                                        <br />{if $product_review_details_list.helpfulVoteCount|default:0 >0 || $product_review_details_list.notHelpfulVoteCount|default:0 >0} 

                                                                            {$product_review_details_list.helpfulVoteCount|default:0} {$language.lblOf} {$product_review_details_list.notHelpfulVoteCount|default:0 + $product_review_details_list.helpfulVoteCount|default:0} {$language.lblReviewHelpfulText} 
                                                                        {/if} 
                                        {assign var="reviewtext" value=$product_review_details_list.reviewText|unescape:"html"}
                                        {assign var="reviewtextCharCount" value=$reviewtext|count_characters:true}
                                        {assign var="reviewtextCharLimit" value=100}

                                        <div class="rv-title"><strong>{$product_review_details_list.reviewTitle}</strong></div>

                                        {if $reviewtextCharCount > $reviewtextCharLimit}
                                        <span class="reviewReadLessDet" id="reviewReadLessDet_{$currProductReviewID}">{$reviewtext|mb_substr:0:$reviewtextCharLimit}...</span>

                                        <span class="reviewReadMoreDet" id="reviewReadMoreDet_{$currProductReviewID}"  style="display:none;">
                                        {$reviewtext|nl2br}
                                        </span>

                                        {else}
                                        {$reviewtext|nl2br}										
                                        {/if}

                                         <div class="position pull-right"> 
                                          {*html->anchor href="" rel="/product/reviewedit/id/$currProductReviewID/do/delete/" priv_href="product/reviewedit/" title="{$language.lblDelete}" class=" icon-set delete05" task="review_delete"*}
                                          {if $reviewtextCharCount > $reviewtextCharLimit} 
                                            {html->anchor class="reviewReadMore icon-plus2" title="{$language.lblViewMore}" rel="{$currProductReviewID}" }

                                          {/if} 
                                          </div>
                                      </div>
          
        </div>
            {/foreach} 
        </div>
<!--end: Product List--> 
		{form->close} 		  
				{else}
                    <div class="review-listing margin-vertical">
                        <div  class="message_info"> {$language.msgNoRecords}</div>
                    </div>
					{/if} 
				
			</div>
			<!--Start: Pagination-->
                       {if !$resAllProductReviewDetails|@count eq 0}
									<div class="fixing_right pagination_outer"> {paginate->layout  key="page" label_record="{$language.lblRecorsFound}" results_per_page="{$language.lblResultsperpage}" label_pages="{$language.lblPages}"} 
								<!--end: Pagination-->
								<div class="clear"></div>
							</div>
                        {/if} 
		</div>
    </div>
  </div>
  {include file='CommonFooter.tpl'} </div>
<script  type="text/javascript">
var lblSelectBusiness = "{$language.lblSelectBusiness}";
var lblSelectCitys = "{$language.lblSelectCitys}";
var lblselected 	= "{$language.lblselected}";
var msgConfirmDeletepdt 	= "{$language.msgConfirmDeletepdt}";
var lblSelectCategory="{$language.lblSelectCategory}";
</script> 
<script type="text/javascript" src="{$view_javascript}/productreview.page.js"></script> 

<script type="text/javascript" src="{$view_javascript}/jquery.multiselect.widget.js"></script> 
<script type="text/javascript" src="{$view_javascript}/moment.min.js"></script>
<script type="text/javascript" src="{$view_javascript}/bootstrap-daterangepicker-min.js"></script>

<script type="text/javascript">
 var msgSelectSearchCriteria = "{$language.msgSelectSearchCriteria}";
 var lblFrom="{$language.lblFrom}";
var lblTo="{$language.lblTo}";
var lblCancel="{$language.lblCancel}";
var applyLabel="{$language.applyLabel}";
var customRangeLabel="{$language.customRangeLabel}";
</script> 
<!--//*********sales rep***********//--> 
<script language="javascript" type="text/javascript">
$(".salesRep").chosen()
$(".sortby-list").click(function(){ 
 if($(this).siblings(".sort_links_ul").is(':visible'))
 {
 $(this).removeClass("active");
 $(".sort_links_ul").hide();
 }
 else{
 $(this).siblings(".sort_links_ul").slideDown("fast");
 $(this).addClass("active"); 
 } 
$('body').click(function (e) {       
  if ($(".sort_links ").has(e.target).length === 0) {
     $(".sort_links_ul").hide();
	 $(".sortby-list").removeClass("active");
        }
    });
 
});
$(document).ready(function () {
		$(document).on('click','.reviewReadMore', function () {
			var thisRel = $(this).attr("rel");			
			if($(this).hasClass("icon-icon-plus"))
			{
				$(this).removeClass("icon-icon-plus");
				$("#reviewReadMoreDet_"+thisRel).hide();
				$("#reviewReadLessDet_"+thisRel).show();
			}
			else
			{
				$(this).addClass("icon-icon-plus");
				$("#reviewReadLessDet_"+thisRel).hide();
				$("#reviewReadMoreDet_"+thisRel).show();
				
			}
		});
	});
</script> 
{html->messages_script id="common_message"}
</body>
</html>