<!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.lblAffiliate} : {$language.lblDashboard}</title>
{include file='CommonStyles.tpl'}
<link rel="stylesheet" type="text/css" href="{$view_styles}/affiliate-dashboard.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/ui.daterangepicker.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/chosen.css" />
{include file='CommonJavaScript.tpl'}
</head>
<body>
<!-- Outer container starts-->
<div class="outer_container"> 
  <!-- Header Container starts--> 
  {include file='CommonTop.tpl'} 
  <!-- Header Container ends--> 
  <!-- Content Container starts-->
  <div class="content_container">
    <div class="content_wrapper">
      <h2>{$language.lblDashboard}</h2>
      <!-- Inner Content Container starts-->
      <div class="inner_content_wrapper clearfix"> 
        <!-- left block starts-->
        <div class="clearfix">
        <div class="left_block">
          <div class="listing-section clearfix">
            <div class="list-devider"></div>
            <div class="listing-section-01 fixing_left">
              <h3>{$language.lblQuickOverview}</h3>
              <div class="listing-style01">
                <ul>
				<li><span>{$quickOverview[0]['dayRevenue']|price}</span>{$language.lblTodayRevenue}</li>
                  <li><span>{$quickOverview[0]['monthRevenue']|price}</span>{$language.lblRevenueThisMonth}</li>
                  <li><span>{$quickOverview[0]['totalRevenue']|price} </span>{$language.lblTotalRevenue}</li>
                  <li><span>{$transactionAlert}</span>{$language.lblTransactionAlert}</li>
                </ul>
              </div>
            </div>
            <div class="listing-section-01 fixing_right">
              <h3>{$language.lblTrafficSummary}</h3>
              <div class="listing-style01">
                <ul>
                  <li><span>{$quickOverview[0]['visitors']} {$language.lblViists}<br /></span>{$language.lblTotalTraffic}</li>
                  <li> <span>{$quickOverview[0]['sales']} {$language.lblOrders} </span>{$language.lblApprovedSales}</li>
                  <li><span>{$quickOverview[0]['registrations']}</span>{$language.lblUserAllRegistrations}</li>
                  <li><span>{$quickOverview[0]['subcriptions']} </span>{$language.lblAllSubscriptions}</li>
				</ul>
              </div>
            </div>
          </div>
          </div>
           <div class="right_block"> 
            {if ($resOrders)}
          {html->anchor href="/reports/orders/" class="link-text02 fixing_right" caption=$language.lblViewAll}
          {/if}
          <h3>{$language.lblRecentOrders}</h3>
          {if ($resOrders)}
          <div class="grid_table00">
          <table width="100%" border="0" cellspacing="0" cellpadding="0" id="tablesorter-order">
            <thead>
              <tr>
                <th align="left" valign="middle" > {$language.lblOrderID}</th>
                <th align="left" valign="middle" > {$language.lblOrderDate}</th>
                <th align="left" valign="middle" > {$language.lblOrderAmount}</th>
                <th align="left" valign="middle" > {$language.lblCommission}</th>
                <th align="left" valign="middle" > {$language.lblOrderStatus}</th>
              </tr>
            </thead>
            <tbody>
            {foreach from=$resOrders item='resOrder' key="key1"}
            <tr>
              <td align="left" valign="middle">{$resOrder.orderNumber}</td>
              <td align="left" valign="middle">{$resOrder.orderCreatedDate|date_format:$settingsDateFormat} {$resOrder.orderCreatedDate|date_format:$settingsTimeFormat} </td>
              <td align="left" valign="middle">{$resOrder.orderSubtotal|price} </td>
              <td align="left" valign="middle">{$resOrder.commissionAmount|price}</td>
              <td align="left" valign="middle">{$resOrder.orderStatus}</td>
            </tr>
            {/foreach}
              </tbody>
          </table>
          </div>
          {else}
          <div class="grid01 message_info"> {$language.msgNoRecords} </div>
          {/if}
         
          </div>
          </div>
          <!-- Product sales summary starts-->
          <div class="clearfix">
          <div class="left_block">
          <h3>{$language.lblTrafficOverview}</h3>
          <div class="graph">
            <div class="graph_info "> <div class="affiliateHoldergraphTotalHolder" id="hourlyReportgraphTotalHolder"></div>          
             {html->anchor class="settings"}
              	
             <div class="show-box" style="display:none;">
              <div class="clearfix">                
                <div class="fixing_left text-box-div combo-width130">
                  <input name="" type="text" readonly="readonly" class="date-field summary_date" id="daterange" value="{$dateFrom|date_format:$dateFormat} - {$dateTo|date_format:$dateFormat}"/>
                </div>
                <ul class="fixing_left chk-bx-listing">
                  <li class="fixing_left">                    
                      <input type="checkbox" checked="checked" class='labels' id="check-1" value="Sales"/>
                      <label for="check-1" class="">{$language.lblSales} </label>                    
                  </li>
                  <li  class="fixing_left">                   
                      <input type="checkbox" checked="checked" class='labels' id="check-2" value="Visits"/>
                      <label for="check-2" class="">{$language.lblDailyVisit} </label>                   
                  </li>
                  <li  class="fixing_left">                   
                      <input type="checkbox" checked="checked" class='labels' id="check-3" value="Registration"/>
                      <label for="check-3" class="">{$language.lblRegistrations} </label>                   
                  </li>
                  <li  class="fixing_left">                    
                      <input type="checkbox" checked="checked" class='labels' id="check-4" value="Subscriptions"/>
                      <label for="check-4" class="">{$language.lblSubscriptions} </label>                    
                  </li>
				  <li  class="fixing_left">                    
                      <input type="checkbox" checked="checked" class='labels' id="check-5" value="Imported Users"/>
                      <label for="check-5" class="">{$language.lblImportedUser} </label>                    
                  </li>
				  <li  class="fixing_left">                    
                      <input type="checkbox" checked="checked" class='labels' id="check-6" value="Imported Subscribers"/>
                      <label for="check-6" class="">{$language.lblImportedSubscriber} </label>                    
                  </li>
				  
                </ul>
                <div class="clear"></div>
                <input type="button" class="fixing_right btn-style" value='{$language.lblGo}' id='replotGraph'>
              </div>
              </div>
                <div id="affiliateHolderLegend"></div>   
              <div id="affiliateHolder" style="height:304px; width:98%;">{$graphData}</div> 
                                        
            </div>
          </div>
          <!-- Product sales summary ends--> 
        </div>
        <!-- left block ends--> 
        <!-- right block starts-->
        <div class="right_block"> 
          <!-- right block top starts--> 
          {html->anchor href="/reports/demographics/" class="link-text02 fixing_right" caption=$language.lblViewAll}
          <div class="fixing_right margin-r-10">
            <select name="select-product" id="widgetSelect" style="width:150px;" >
              <option value="">{$language.lblSelect} {$language.lblWidget}</option>
			 {foreach from=$widgets item='widget' key="key"}
              <option value="{$widget['affiliateWidgetDetailID']}">{$widget['widgetName']}</option>
            {/foreach}    
            </select>
          </div>
          <h3>{$language.lblUserDemographics}</h3>
          {if ($demoGraphic)}
          <div class="grid_table00">
          <table id="tableSort-demo" width="100%" border="0" cellspacing="0" cellpadding="0">
            <thead>
              <tr>
                <th width="25%" align="left" valign="middle" class="sortasc" >{$language.lblLocation}</th>
                <th align="left" valign="middle"> {$language.lblViists} </th>
                <th align="left" valign="middle">{$language.lblSubscriptions} </th>
                <th align="left" valign="middle">{$language.lblRegistrations} </th>
                <th align="left" valign="middle">{$language.lblOrders} </th>
                <th align="left" valign="middle"> {$language.lblSales} </th>
                <th align="left" valign="middle">{$language.lblRevenue} </th>
              </tr>
            </thead>
            <tbody>
            {foreach from=$demoGraphic item="data"}
            {$visitor=$visitor|default:''+$data['visitors']}
            {$subscription=$subscription|default:''+$data['subscription']}
            {$registration=$registration|default:''+$data['registration']}
            {$sales=$sales|default:''+$data['sales']}
            {$salescount=$salescount|default:''+$data['salescount']}
            {$revenue=$revenue|default:''+$data['revenue']}
            {$count=$count|default:''+1}
            <tr>
              <td align="left" valign="middle">{$data['location']} <br /></td>
              <td align="left" valign="middle">{$data['visitors']} </td>
              <td align="left" valign="middle"> {$data['subscription']} </td>
              <td align="left" valign="middle">{$data['registration']}</td>
              <td align="left" valign="middle">{$data['salescount']}</td>
              <td align="left" valign="middle"> {$data['sales']|price} </td>
              <td align="left" valign="middle">{$data['revenue']|price}</td>
            </tr>
            {/foreach}
              </tbody>
            {if $count>0}
            <tfoot>
              <tr class='no-sort'>
                <td align="left" valign="middle">{$language.lblTotalAvg}</td>
                <td align="left" valign="middle">{$visitor}</td>
                <td align="left" valign="middle"> {$subscription} </td>
                <td align="left" valign="middle">{$registration}</td>
                <td align="left" valign="middle">{$salescount}</td>
                <td align="left" valign="middle">{$sales|price} </td>
                <td align="left" valign="middle">{$revenue|price}</td>
              </tr>
            </tfoot>
            {/if}
          </table>
          </div>
          <div class="grid01 message_info" id='demo' style="display:none"> {$language.msgNoRecords} </div>
          {else}
          <div class="grid01 message_info" id='demo' style="display:block"> {$language.msgNoRecords} </div>
          {/if} 
          <!-- right block top ends--> 
          <!-- right block bottom starts--> 
          <!-- right block bottom ends--> 
        </div>
        <!-- right block ends--> 
        </div>
      </div>
      <!-- Inner Content Container ends-->
      <div class="clear"></div>
    </div>
  </div>
  <!-- Content Container ends--> 
  <!-- Footer starts--> 
  {include file='CommonBottom.tpl'} 
  <!-- Footer ends--> 
</div>
<div   id="blockUILoader" style="display:none;"> <img alt="Loading...." src="{$view_images}/spinner-big.gif"/> </div>
{form->globalpath_script} 
<script type="text/javascript" src="{$view_javascript}/jquery.blockUI.js"></script> 
<script type="text/javascript" src="{$view_javascript}/chosen.pluggin.js"></script> 
<script type="text/javascript"   src="{$view_javascript}/affiliate-dashboard.page.js"></script> 
<script type="text/javascript"   src="{$view_javascript}/json2.js"></script> 
<script>
var  noRecoredFound="{$language.msgNoRecords}";
{literal}
$(document).ready(function(){
//$('#daterange').daterangepicker({arrows: false,dateFormat: datePickerDateFormat});	
$("#widgetSelect").chosen();
});
{/literal}
$(document).ready(function () {
	$(".settings").click(function () {
		$(this).next(".show-box").slideToggle();
		$(this).toggleClass("menu-open");
	});
});
</script>
</body>
</html>