<!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.lblBusiness} : {$language.lblAnalyticsReport}: {$language.lblTopProducts|default:''}</title>
{include file='CommonJavaScript.tpl'}
{include file='CommonStyles.tpl'}
<link rel="stylesheet" type="text/css" href="{$view_styles}/right-menu.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/listing.css" />
<link href="{$view_styles}/jqueryui.plugin.css" rel="stylesheet" type="text/css" media="screen" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/analytics/chosen.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/analytics/ui.daterangepicker.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/analytics/jquery-ui-1.8.19.custom.css" />
{include file='CommonCustomStyles.tpl'}
{form->basepath_script}
{form->rootpath_script}

</head>
<body class="{$languageDirection}">
<div class="outer" id="main">
  {include file='CommonHeader.tpl'}
  <!--End:Header Container--> 
  <!--***********************************************************************END HEADER CONTAINER******************************************************-->
<div class="content-wrapper">
    <!-- left wrapper starts-->
     <div class="container-fluid">
      <div class="content_wrapper">
     
       <div id="common_message" ></div>
          
        <div class="container-section status-01"> 
             <h3 class="border-bottom">{$language.lblTopProductReport|default:''}</h3>   
      <div class="search_container content-block">
           {form->start name="formTopProducts" action="" method="post" enctype="multipart/form-data"}
        <div class="inner">
            <div class="row">
            <div class="form-group col-xs-12 col-sm-3">
                <label>{$language.lblDate}</label>
                 <div class="text-box-div-date">
                      {form->textbox name="date" readonly="readonly" class="date-field form-control"}
                 </div>
            </div>
            <div class="col-xs-12">
            {form->submit name="submitSearch" id="submit" class="btn btn-sm btn-primary"  value="{$language.lblSearch}"}{html->anchor href="/analytics/topproduct/" class="action-link" content="{$language.lblListAll}"}
            </div>
            </div>
            <!--Searched Time:{$searchedDate}-->
            
            
            </div>
          </div>
          </div>
          {if $resTopProduct|@count>0} 
          <div class="container-section">
                <div class="grid_table00 product-list order-list">
                {assign var="sortLink" value="topproduct/"}
                
                {assign var="performanceClass" value="sort"} 
                {if $totalweigtagesortorder!=''}
                {if $totalweigtagesortorder=='asc'}
                {assign var=totweightsort value='desc'}
           		{assign var="performanceClass" value="sort"|cat:$totweightsort} 
                {else}
                 {assign var=totweightsort value='asc'}
           		{assign var="performanceClass" value="sort"|cat:$totweightsort}
                {/if}
				{else}
				{assign var=totweightsort value='asc'}
                {/if}
                
                {assign var="alluniqueviewsClass" value="sort"} 
                {if $alluniqueviewssortorder!=''}
                {if $alluniqueviewssortorder=='asc'}
                {assign var=alluniquesort value='desc'}
           		{assign var="alluniqueviewsClass" value="sort"|cat:$alluniquesort} 
                {else}
                {assign var=alluniquesort value='asc'}
           		{assign var="alluniqueviewsClass" value="sort"|cat:$alluniquesort}
                {/if}
                {else}
                {assign var=alluniquesort value='asc'}
                {/if}
                
                {assign var="uniqueviewClass" value="sort"} 
                {if $uniqueviewsortorder!=''}
                {if $uniqueviewsortorder=='asc'}
                {assign var=uniquesort value='desc'}
           		{assign var="uniqueviewClass" value="sort"|cat:$uniquesort} 
                {else}
                {assign var=uniquesort value='asc'}
           		{assign var="uniqueviewClass" value="sort"|cat:$uniquesort}
                {/if}
                {else}
                {assign var=uniquesort value='asc'}
                {/if}
                
                {assign var="alltotalviewsClass" value="sort"} 
                {if $alltotalviewssortorder!=''}
                {if $alltotalviewssortorder=='asc'}
                {assign var=alltotalviewsort value='desc'}
           		{assign var="alltotalviewsClass" value="sort"|cat:$alltotalviewsort} 
                {else}
                {assign var=alltotalviewsort value='asc'}
           		{assign var="alltotalviewsClass" value="sort"|cat:$alltotalviewsort}
                {/if}
                {else}
                {assign var=alltotalviewsort value='asc'}
                {/if}
                
                {assign var="alltotalviewsClass" value="sort"} 
                {if $alltotalviewssortorder!=''}
                {if $alltotalviewssortorder=='asc'}
                {assign var=alltotalviewsort value='desc'}
           		{assign var="alltotalviewsClass" value="sort"|cat:$alltotalviewsort} 
                {else}
                {assign var=alltotalviewsort value='asc'}
           		{assign var="alltotalviewsClass" value="sort"|cat:$alltotalviewsort}
                {/if}
                {else}
                {assign var=alltotalviewsort value='asc'}
                {/if}
                
                {assign var="viewsClass" value="sort"} 
                {if $viewssortorder!=''}
                {if $viewssortorder=='asc'}
                {assign var=viewsSort value='desc'}
           		{assign var="viewsClass" value="sort"|cat:$viewsSort} 
                {else}
                {assign var=viewsSort value='asc'}
           		{assign var="viewsClass" value="sort"|cat:$viewsSort}
                {/if}
                {else}
                {assign var=viewsSort value='asc'}
                {/if}
                
                {assign var="allqtyClass" value="sort"} 
                {if $allqtysortorder!=''}
                {if $allqtysortorder=='asc'}
                {assign var=allqtySort value='desc'}
           		{assign var="allqtyClass" value="sort"|cat:$allqtySort} 
                {else}
                {assign var=allqtySort value='asc'}
           		{assign var="allqtyClass" value="sort"|cat:$allqtySort}
                {/if}
                {else}
                {assign var=allqtySort value='asc'}
                {/if}
                
                {assign var="orderClass" value="sort"} 
                {if $qtysortorder!=''}
                {if $qtysortorder=='asc'}
                {assign var=qtySort value='desc'}
           		{assign var="orderClass" value="sort"|cat:$qtySort} 
                {else}
                {assign var=qtySort value='asc'}
           		{assign var="orderClass" value="sort"|cat:$qtySort}
                {/if}
                {else}
                {assign var=qtySort value='asc'}
                {/if}
                <table width="100%" border="0" cellspacing="0" cellpadding="0" >
           
            <thead>
              <tr >
                <th align="left" valign="top">
               {$language.lblProduct}
                </th>               
                 <th align="left" valign="top"  class={$orderClass}>
             {if $resTopProduct|@count gt 1} {html->anchor href="/analytics/{$sortLink}{$link}sort/searchspanQty/order/$qtySort" content="{$language.lblSales}"}{else}{$language.lblSales}{/if}
                </th> 
                <th align="left" valign="top"  width="50" class={$allqtyClass}>
                {if $resTopProduct|@count gt 1} {html->anchor href="/analytics/{$sortLink}{$link}sort/allqty/order/$allqtySort" content="{$language.lblTotalOrders}"}{else}{$language.lblTotalOrders}{/if}
                </th> 
                 <th align="left" valign="top"  class={$viewsClass}>
                	 {if $resTopProduct|@count gt 1} {html->anchor href="/analytics/{$sortLink}{$link}sort/totalviews/order/$viewsSort" content="{$language.lblViews}"}{else}{$language.lblViews}{/if}
                </th>               
                 <th align="left" valign="top" width="50"  class={$alltotalviewsClass}>
                	{if $resTopProduct|@count gt 1} {html->anchor href="/analytics/{$sortLink}{$link}sort/alltotalviews/order/$alltotalviewsort" content="{$language.lblTotalViews}"}{else}{$language.lblTotalViews}{/if}
                </th>
            <th align="left" valign="top" width="50" class={$uniqueviewClass}>
                	{if $resTopProduct|@count gt 1} {html->anchor href="/analytics/{$sortLink}{$link}sort/uniqueviews/order/$uniquesort" content="{$language.lblUniqueViews}"}{else}{$language.lblUniqueViews}{/if}
                </th>
                 <th align="left" valign="top" width="80" class={$alluniqueviewsClass}>
                	{if $resTopProduct|@count gt 1} {html->anchor href="/analytics/{$sortLink}{$link}sort/alluniqueviews/order/$alluniquesort" content="{$language.lblTotalUniqueViews}"}{else}{$language.lblTotalUniqueViews}{/if}
                </th>
             
                  <th align="left" valign="top"  class={$performanceClass}>
                {if $resTopProduct|@count gt 1} {html->anchor href="/analytics/{$sortLink}{$link}sort/totalweigtage/order/$totweightsort" content="{$language.lblPerformance}"}{else}{$language.lblPerformance}{/if}
                </th>
			 </tr>
            </thead>
            <tbody>
            {assign var="countofarray" value =$resTopProduct|@count}
             {foreach from=$resTopProduct item="topProductDet" key="key1"}
             {assign var="spanclass" value=$topProductDet.remarks|lower}
             {assign var="productClass" value=$topProductDet.productclass|default:''} 
              <tr >         
				<td align="left" valign="top" class={$productClass}><div class="product-head">{$topProductDet.productTitle|truncate:50}<div style="float:right;"></div></div>
               </td>
                <td align="left" valign="top">{$topProductDet.ordersinsearchspan}</td>
                <td align="left" valign="top">{$topProductDet.allorders}</td>   
                <td align="left" valign="top">{$topProductDet.totalviews}</td>              
                <td align="left" valign="top">{$topProductDet.alltotalviews}</td>     
                <td align="left" valign="top">{$topProductDet.uniqueviews}</td>             
                <td align="left" valign="top">{$topProductDet.alluniqueviews}</td>                 
                <td align="left" valign="top"> {if $topProductDet.totalweigtage >0}{$topProductDet.totalweigtage}{else}-{/if}</td>
               
                   
                </tr>
                {/foreach}
                
            </tbody>
          </table>
              </div></div>
         <!-- <div class="pagination_outer fixing_right">
              {paginate->layout  key="page"}
                    <div class="clear"></div>    
             </div>-->
             <!---Once A Delete Button Exists Here-->
             <div class="clear"></div>  
             {form->close}  
             {else}
            <div  class="message_info">
            
             {$language.msgNoRecords}</div>
            {/if}
      <!---Grid ends--->
      </div>
      <!-- Inner Content Container ends-->
      <div class="clear"></div>
    </div>

    <!-- left wrapper ends-->
    <!-- right side bar starts-->
    <div class="right-sidebar">
    <div class="side_wrapper">    
    <!-- right side menu starts-->
    {*{include file='AnalyticsSideMenu.tpl'}*}
    <!-- right side menu ends-->
    </div>
      
    </div>
    <!-- right side bar ends-->
  </div>
  <!--End:Content Container--> 
   {include file='CommonFooter.tpl'}
</div>
<!--End:Outer Container--> 
{include file='CommonJavaScriptBottom.tpl'} 
<script type="text/javascript" src="{$common_js}/date.js"></script>
<script type="text/javascript" src="{$view_javascript}/analytics/daterangepicker.jQuery.js"></script>
<script type="text/javascript" src="{$view_javascript}/analyticsTopProducts.page.js"></script>
<script type="text/javascript" src="{$view_javascript}/chosen.jquery.min.js"></script>
<script type="text/javascript" src="{$view_javascript}/analyticsTopDeals.page.js"></script>   
<script type="text/javascript">
 {literal}
 $(".chzn-select").chosen(); $(".chzn-single").chosen({allow_single_deselect:true}); 
 //expandable collapsable table  :: Starts
 {/literal}   

</script>
<script type="text/javascript" src="{$common_js}/jquery-ui-1.10.2.custom.min.js"></script>
<script type="text/javascript">
$('.side_wrapper div ul li a[rel=analytics_topproduct]').addClass('selected');
$('.side_wrapper div ul li a[rel=analytics_agegender]').addClass('removeborder');
</script>
</body>
</html>
