<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$language.lblAdmin} :{$language.lblManageBussiness}</title>
{include file='CommonStyles.tpl'}
{include file='CommonStyles.tpl'}
{include file='CommonJavaScript.tpl'}
<link rel="stylesheet" type="text/css" href="{$view_styles}/manage-product.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/grid_listing.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/colorbox.css" />
{include file='CommonCustomStyles.tpl'}
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
</head>
<body>
<div class="outer_container"> {include file='CommonTop.tpl'} 
  <!--End:Header Container-->
  <div class="content_container">
    <div class="content_wrapper">
    {if $businessName!=''}
        {html->anchor href=$previousURl caption="{$language.lblBack}" class="back-link fixing_right topspacing"} 
     {include file='ContentLanguageOptions.tpl'}
	 {if $editprivilege}
     {html->anchor  href="business/edit/id/$businessID/"  caption="{$language.lblEdit}" class="button-link01 fixing_right"}{/if}
      <h2> {$businessName} <span class="{$businessStatus|lower}-txt"> {$businessStatus} </span>  </h2>
      <div class="first-block clearfix">
        <h3><span>{$language.lblBusinessInfo}</span></h3>
        <div class="img-block">
          <div>{if $businessLogo==''} <img src="{$view_images}/logo_noimg.gif" alt="logo img" width="140" height="125"  /> {else} <img src="{$view_public_path}/uploads/business/thumb/{$businessLogo}"></img> {/if}</div>
        </div>
        <div class="details-right">
            <div class="strict_fixing_left width-auto">
          <address>
          {$businessAddress|address_format:$languageIDs}
          </address>
          {$language.lblEmail} :<a href="mailto:{$businessEmail}">{$businessEmail}</a> {if $businessWebsite}<br />
          {$language.lblWebsite} : {if $businessWebsite|stripos:"http://" !== false}                  
          {assign var="Website" value=$businessWebsite}                  
          {else}                  
          {assign var="Website" value="http://"|cat:$businessWebsite}                  
          {/if} {html->anchor href="{$Website}" target="_blank" content="{$businessWebsite|wordwrap:85:'<br />':true}"}
          {/if} <span>{$language.lblPhone} :&nbsp; {$businessPhone}</span>{if $businessFax|escape}<span>&nbsp; | &nbsp;</span><span>{$language.lblFax} :&nbsp;</span>{$businessFax}{/if} 
        
          {if $api_id neq ''}<br>
             {$language.lblMerchantAPI} :&nbsp; {$api_id}
          {/if}
      </div>
     
      </div>
      </div>
       <div class="detail_listing02">
       <div class="default-style">{$businessProfile|unescape:"html"}</div>
       </div>
      <h3><span>{$language.lblAccountDetails}</span></h3>
      <div class="clearfix">
    <div class="mapcontainer fixing_right"> {form->hidden name="locLatitude" value=$locLatitude id="frmLat"}
              {form->hidden name="locLongitude"  id="frmLon"}
              <div id="map_canvas_" style="width: 100%;">
			  <img src="http://maps.google.com/maps/api/staticmap?center={$locLatitude},{$locLongitude}&amp;zoom=13&amp;markers={$locLatitude},{$locLongitude}&amp;size=621x300&amp;sensor=false" border="0">
			  </div>
            </div>
      <div class="detail_listing02 fixing_left">
        <ul>  
        <li class="clearfix">
            <div class="left fixing_left">{$language.lblLogin} : </div>
            <div class="right fixing_right">{$businessLogin}</div>
          </li>
        <li class="clearfix">
            <div class="left fixing_left">{$language.lblRegisterNum} : </div>
            <div class="right fixing_right">{$businessRegNum}</div>
          </li>
        <li class="clearfix">
            <div class="left fixing_left">{$language.lblEstablishment} : </div>
            <div class="right fixing_right">{$businessEstablish}</div>
          </li>
        
          <li class="clearfix">
            <div class="left fixing_left">{$language.lblProfileLanguage} : </div>
            <div class="right fixing_right">{$languageName}</div>
          </li>    
            <li class="clearfix">
            <div class="left fixing_left">{$language.lblFollowCount} :</div>
            <div class="right fixing_right">{if $followCount gt 0}
                    {html->anchor href="/business/follow/id/$businessID/" class="add-link" caption="{$followCount}"} <div class='tooltip' id='product_tooltip_{$businessID}'>Followers</div>{else}{$followCount}{/if}
                  </div>
          </li>
          <li class="clearfix">
            <div class="left fixing_left">{$language.lblBusinessURL} :</div>
            <div class="right fixing_right">
            
            {html->anchor href="{$view_host}/store/{$businessKey}/" target="_blank" content="{$view_host}/store/{$businessKey}/"}</div>
          </li>
          <li class="clearfix">
            <div class="left fixing_left">{$language.lblBusinessKey} : </div>
            <div class="right fixing_right"> {$businessKey}</div>
          </li>
          <li class="clearfix">
            <div class="left fixing_left">{$language.lblBusinessType} : </div>
            <div class="right fixing_right"> {if $businessTypeName}{$businessTypeName} - > {/if}{$subBusinessTypeName}</div>
          </li>
          <li class="clearfix">
            <div class="left fixing_left">{$language.lblContactName} : </div>
            <div class="right fixing_right">{$businessCFirstName|wordwrap:40:"<br />
                    \n":true}&nbsp;{$businessCLastName|wordwrap:40:"<br />\n":true}</div>
          </li>
           {if $businessCDesignation}
          <li class="clearfix">
            <div class="left fixing_left">{$language.lblDesignation} : </div>
            <div class="right fixing_right">{$businessCDesignation|wordwrap:40:"<br />\n":true}</div>
          </li>
          {/if}
          </ul>
          </div></div>
          {if $businessAccountType || $businessAccountName || $businessPaypalEmail || $businessAccountDetails}
          	<h3><span>{$language.lblPayableAccountInformation}</span></h3>
         
          {/if}
          <div class="clearfix">
          <div class="detail_listing02 fixing_left">
          <ul>
           {if $businessAccountType}
          <li class="clearfix">
            <div class="left fixing_left">{$language.lblAccountType} :</div>
            <div class="right fixing_right">{$businessAccountType|wordwrap:40:"<br />\n":true}</div>
          </li>
          {/if}   
          {if $businessAccountName}
                 <li class="clearfix">
                   <div class="left fixing_left">{$language.lblNameonAccount} :</div>
                  <div class="right fixing_right">{$businessAccountName}</div>
                </li>
          {/if}   
          {if $businessPaypalEmail}
                 <li class="clearfix">
                   <div class="left fixing_left">{$language.lblPaypalEmail} :</div>
                  <div class="right fixing_right">{$businessPaypalEmail}</div>
                </li>
         {/if}   
         {if $businessAccountDetails}
          <li class="clearfix">
            <div class="left fixing_left">{$language.lblAccountDetails} :</div>
            <div class="right fixing_right">{$businessAccountDetails|nl2br}</div>
          </li>
          {/if}   
          
         
        </ul>
       
      </div>
      </div>
	  {*
       {if $editprivilege}
       {assign var="lblTitle" value="{$language.lblWarehouses} {$language.lblFor}  {$businessName}"}
       {html->anchor   href="business/location/id/$businessID/" caption="{$language.lblAddEditBusinessLocation}" class="button-link01 add-new-loc fixing_right"}
       <span style="display:none;">{$lblTitle}</span> 
       <h3 id="locations-list"><span>{$language.lblOtherLocationsForBusiness}</span></h3>
      {if $businessLocDetails} <div class="grid_table00" > 
            <table width="100%" border="0" cellspacing="0" cellpadding="0"   >
             <thead> <tr>
                <th align="left" valign="middle"  width="140"> {$language.lblLocationName}</th>
                <th align="left" valign="middle" width="186" >{$language.lblCity} & {$language.lblState}</th>
                <th align="left" valign="middle" width="144" >{$language.lblCountry}</th>
                <th align="left" valign="middle" width="274" >{$language.lblAddress}</th>
                <th align="left" valign="middle"  width="135">{$language.lblPhone}</th>
                <th align="left" valign="middle"  width="208">{$language.lblEmailID}</th>
                <th align="center" valign="middle"  width="69">{$language.lblStatus}</th>
              </tr>
              </thead>
              <tbody>
              {foreach from=$businessLocDetails item="location" key="key1"} 
              {assign var="businessLocID" value=$location.businessLocID}
              <tr >
                <td align="left" valign="top">{$location.tempName|wordwrap:30}<br /></td>
                <td align="left" valign="top">{if $location.city}{$location.city} ,{/if} {if $location.stateName} {$location.stateName|wordwrap:30}{else} {$location.province|wordwrap:30}{/if}<br /></td>
                <td align="left" valign="top">{$location.countryName}<br /></td>
                <td align="left" valign="top">{$full_add|default:''}{$location.add1}{if $location.add2|wordwrap:30},{$location.add2|wordwrap:30}{/if}<br /></td>
                <td align="left" valign="top">{$location.locPhone}<br /></td>
                <td align="left" valign="top">{$location.locEmail|wordwrap:30:"<br />
                  \n":true}<br /></td>
                <td align="left" valign="top"> {if $location.locStatus=="Active"} <span class="status_Active">{$location.locStatus} </span> {elseif $location.locStatus=="Inactive"} <span class="status_Inactive">{$location.locStatus}</span> {/if}</td>
              </tr>
              {/foreach}
             </tbody></table>
             </div>
              <div class="fixing_right pagination_outer" >
                   {paginate->layout  key="page" label_record="{$language.lblRecorsFound}" label_pages="{$language.lblPages}" class="pagination location-pagination"}
                    <div class="clear"></div>
               </div>
                  <div class="clear"></div>
            {else}
            <div  class="message_info"> {$language.msgNoRecords}</div>
            {/if} {/if}
			*}
            {if $businessStatus!=''} 
    <h3 id="reviews-list"><span id="businessReview">{$language.lblThisBusinessReviews}</span></h3>
            <div class="review-listing clearfix"> 
                
            <div class="total_rating fixing_right"> {if $resBusinessRatings.ratingCount > 0}
            {assign var="avgRating" value=$resBusinessRatings.ratingTotal/$resBusinessRatings.ratingCount}
            {assign var="avgRating" value=$avgRating|number_format:1}
            {else}
            {assign var="avgRating" value=0}
            {/if}
            <div class="rating-count ">{$language.lblRated} {$avgRating} {$language.lblOutOf} 5</div>
            <div>
              <ul id="unit_ul1" class="unit-rating">
                <li id="current-rating" class="current-rating" style="width:{16 * $avgRating}px;">{$language.lblRated} {$avgRating}/5</li>
              </ul>
            </div>
          </div> 
            
            <div id="common_message"></div>
				{if $resBusinessReviews}
					{foreach from=$resBusinessReviews item="review" key="key1"}
                    <div class="clearfix listing "> 
          <div class="clearfix">
            <div class="rv-left fixing_left">
            	<ul id="unit_ul1" class="unit-rating ">
					<li id="current-rating" class="current-rating" style="width:{16 * $review.userRating}px;">{$review.userRating}/5</li>
				</ul>
              
              <span class="name">{$review.userFirstName} {$review.userLastName}</span> <br>
              <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> </div>
            <div class="rv-right fixing_right">
              <div class="fixing_right "> <span class="{if $review.reviewStatus eq 'Active'}active-txt {else} {if $review.reviewStatus eq 'Inactive'}inactive-txt {/if}{if $review.reviewStatus eq 'New'}new-txt{/if}{/if} ">{$review.reviewStatus} </span></div>
             <!-- <strong><span class="fade-color">Merchant : </span>Business11</strong> -->
			                                            <div class="position"> 
							{if $editreviewprivilege}							
                                                        {if $review.reviewID}
									{html->anchor href="business/review/id/{$review.reviewID}/user/{$review.userID}/business/{$businessID}/" title="{$language.lblEditUserReview}" class="icon-set edit03" content=""}
								{/if}{/if}
								{if $delreviewprivilege}
								{html->anchor href="" rel="/business/destroyreview/id/{$review.reviewID}/status/delete/busid/{$businessID}/" title="{$language.lblDelete}" class="icon-set delete05" task="review_delete"}
				{/if}
                 </div>
              <div class="rv-title">{$review.productTitle}</div>
              <div class="cmt "> 
               
              <span class="reviewReadLessDet">{$review.userComment|nl2br|truncate:300}</span> 
            
               </div>
            </div>
          </div>
          <div class="clearfix review-detail"><span class="fixing_left">{$language.lblShippingTime}&nbsp;</span>
           <ul id="unit_ul1" class="unit-rating2 fixing_left">
			<li id="current-rating" class="current-rating" style="width:{10 * $review.shippingTimeRatings}px;">{$review.shippingTimeRatings}/5</li>
								</ul>
            <span class="fixing_left">&nbsp;&nbsp;/&nbsp;&nbsp;{$language.lblShippingCost}&nbsp;</span>
           <ul id="unit_ul1" class="unit-rating2 fixing_left">
									<li id="current-rating" class="current-rating" style="width:{10 * $review.shippingCostRatings}px;">{$review.shippingCostRatings}/5</li>
								</ul>
            <span class="fixing_left">&nbsp;&nbsp;/&nbsp;&nbsp;{$language.lblProductQuality}&nbsp;</span>
            <ul id="unit_ul1" class="unit-rating2 fixing_left">
									<li id="current-rating" class="current-rating" style="width:{10 * $review.productQualityRatings}px;">{$review.productQualityRatings}/5</li>
								</ul>
          </div>
       </div>
						
                    {/foreach}
                
             
              {else}
            <div class="message_info"> {$language.msgNoRecords}</div>
            {/if}
            </div>	
            {/if}
           
              <div class=" submit-block textto_right"> <span></span> 
        {html->anchor href=$previousURl caption="{$language.lblBack}" class="back-link fixing_right topspacing"} 
    {if $editprivilege}
     {html->anchor href="business/edit/id/$businessID/"  caption="{$language.lblEdit}" class="button-link01 fixing_right"}{/if} </div>
   
    {else}
     <div  class="message_info"> {$language.msgNoDetailsAvailable}</div>
    
    {/if}
     {if $resBusinessReviews}
            <div class="fixing_right pagination_outer" >
                   {paginate->layout  key="review-page" label_record="{$language.lblRecorsFound}" label_pages="{$language.lblPages}" class="pagination review-pagination"}
                    <div class="clear"></div>
               </div>
    {/if}
     </div>        </div>
  {include file='CommonBottom.tpl'} </div> 
{html->messages_script id="common_message"}
{form->rootpath_script}
{form->basepath_script}
{include file='CommonJavaScriptBottom.tpl'} 
<script type="text/javascript"  src="{$view_javascript}/jquery.colorbox.js"></script>
<script type="text/javascript">
var lblConfirmDeleteGeneral	='{$language.msgConfirmDelete}';
$(function(){
$(".add-link").hover(function()
	{
	$(this).parent().find(".tooltip").css("visibility","visible");
	},function()
	{
	$(this).parent().find(".tooltip").css("visibility","hidden");
	}
);
	if($("#common_message:visible").length>0){
	
		// $("html, body").animate({ scrollTop: $(document).height() }, 1000);
		   $("html, body").animate({ scrollTop: $("#businessReview").offset().top }, 1000);
	}
});
{literal}
$(document).ready(function(){
	$(".edit03").colorbox({iframe:true, innerWidth:"60%", innerHeight:300});
	$(".add-new-loc").colorbox({title:function(){var colorboxTitle=$(this).next("span").html();return colorboxTitle;},iframe:true, innerWidth:"80%", innerHeight:"80%",onClosed:function(){parent.location.reload();}});
	$("[task=review_delete]").click(function()
	{
		var thehref	= $(this).attr("rel");
		jConfirm(lblConfirmDeleteGeneral, 'Delete', function(r)
		{
			if(r==true)
			{
				window.location.href = GLOBAL_BASE_PATH+thehref;
				return true;
			}
			else{
				return false;
			}
			});
	});
	//Provides Location section focusing in pagination
	$(".location-pagination a").each(function(){
		$(this).attr("href",$(this).attr("href")+"#locations-list");
	});
	//Provides Review section focusing in pagination
	$(".review-pagination a").each(function(){
		$(this).attr("href",$(this).attr("href")+"#reviews-list");
	});
 });
{/literal}
</script>
</body>
</html>
