<!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.lblPaymentReport} : {$language.lblReceivedPayments}</title>
{include file='CommonStyles.tpl'}
<link rel="stylesheet" type="text/css" href="{$view_styles}/ui.daterangepicker.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/affiliates.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_container2"> 
    <!-- left wrapper starts-->
    <div class="left_wrapper">
      <div class="content_wrapper">
      <div class="search_tab fixing_right">
                <ul>
                  <li class="first">
                  {html->anchor href="/payment/pending/$link" class="search_tab_a " caption=$language.lblPendingPayments}
                  </li>
                  <li>{html->anchor href="/payment/recieved/$link" class="search_tab_a active"  caption=$language.lblReceivedPayments}</li>
                  <li class="last">{html->anchor href="/payment/transaction/$link" class="search_tab_a" caption=$language.lblTransactions}</li>
                </ul>
      </div>
        <h2>{$language.lblReceivedPayments}</h2>
        <!-- Inner Content Container starts-->
        <div class="inner_content_wrapper"> 
          <!-- Search container starts -->
          <div class="search_container">
            <div class="inner"> 
             {form->start name="frmSearchProduct"  method="post"}
            {form->hidden id="searchAlert" name="searchAlert" value=$language.errStartEndDate}
              <table width="100%" border="0" cellspacing="0" cellpadding="0"   >
                <tr>
                
                  <td width="6%" align="left" valign="middle" class="left">{$language.lblType}</td>
                  <td width="16%" align="left" valign="middle"><div class="textfield">
                      <div class="textfield"> 
                     {form->select name="type" id="type" class="select-box" options="Order->"|cat:$language.lblOrder|cat:"~*Registration->"|cat:$language.lblRegistration|cat:"~*Subscription->"|cat:$language.lblSubscription|cat:"~*Imported User->"|cat:$language.lblImportedUsers|cat:"~*Imported Subscriber->"|cat:$language.lblImportedSubscribers|cat:"" caption="->"|cat:$language.lblSelect}
                      </div>
                    </div></td>
                  
                  <td width="9%" align="left" valign="middle" class="left" >{$language.lblActionDate}</td>
                  <td width="25%" align="left" valign="middle" ><div class="textfield">
                      <div class="text-box-div-date">{form->textbox name="date" type="text" id="daterange" class="text-box date-field" readonly="true"} </div>
                    </div></td>
                  <td width="12%" align="left" valign="middle" class="left">{$language.lblTransactionID} &nbsp;</td>
                  <td width="16%" align="left" valign="middle">
                    <div class="textfield">
                      <div class="text-box-div">
                        {form->textbox name="transactionID" value=$transactionID type="text" class="text-box"}
                      </div>
                    </div>
                  </td> 
                  <td width="22%" align="left" valign="middle"> 
                  	{form->submit name="formSubmitSearch" value={$language.lblSearch} class="button01"}
                    {html->anchor href="/payment/received/" class="action-link" caption=$language.lblResetFields}</td>
                </tr>
              </table>
              {form->close}
              <div class="clear"></div>
            </div>
          </div>
          <!--End:Search container-->  
          {if $resListPaymentOrders} {html->anchor class="link-style01 fixing_right" href="/payment/received/{$normallink}/export/1/" caption="{$language.lblExportToCsv}"}</a>
          <div class="clear"></div>
          <div class="grid01"> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="grid_table00">
              <thead>
                <tr>
                  <th width="15%" align="left" valign="middle"  class="sort{if $sortByOption eq 'stype'}{$sortByOrder}{/if}">
                  {$language.lblType}
                  </th>
                  <th width="12%" align="left" valign="middle"  class="sort{if $sortByOption eq 'stransId'}{$sortByOrder}{/if}">
                  {html->anchor href="/payment/received/$normallink/sortby/stransId/orderby/$sortBytransactionID/" title=$language.lblTransactionID content=$language.lblTransactionID}
                  </th>
                   <th width="15%" align="left" valign="middle" class="sort{if $sortByOption eq 'sactionDate'}{$sortByOrder}{/if}">
                  {html->anchor href="/payment/received/$normallink/sortby/sactionDate/orderby/$sortByActionDate/" title=$language.lblActionDate content=$language.lblActionDate}
                  </th>
                  <th width="15%" align="left" valign="middle" class="sort{if $sortByOption eq 'stransDate'}{$sortByOrder}{/if}">
                  {html->anchor href="/payment/received/$normallink/sortby/stransDate/orderby/$sortBytransDate/" title=$language.lblTransactionDate content=$language.lblTransactionDate}
                  </th>
                  <th width="10%" align="left" valign="middle"  class="sort{if $sortByOption eq 'sorderTotal'}{$sortByOrder}{/if}">
                  {html->anchor href="/payment/received/$normallink/sortby/sorderTotal/orderby/$sortByOrderTotal/" title=$language.lblOrderTotal content=$language.lblOrderTotal}
                  </th>
                  <th width="13%" align="left" valign="middle"  class="sort{if $sortByOption eq 'scommission'}{$sortByOrder}{/if}">
                  {html->anchor href="/payment/received/$normallink/sortby/scommission/orderby/$sortByCommission/" title=$language.lblCommissionPercentage content=$language.lblCommissionPercentage}
                  </th>
                  <th width="22%" align="left" valign="middle"  class="sort{if $sortByOption eq 'scommissionAmt'}{$sortByOrder}{/if}">
                  {html->anchor href="/payment/received/$normallink/sortby/scommissionAmt/orderby/$sortByCommissionAmt/" title=$language.lblCommissionAmount content=$language.lblCommissionAmount}
                  </th>
                </tr>
              </thead>
              <tbody>
              {foreach from=$resListPaymentOrders item="orderList" key="key1"}
              {assign var="TotalOrders" value=$TotalOrders|default:0+$orderList.subTotal} 
              {assign var="TotalCommission" value=$TotalCommission|default:0+$orderList.commissionAmount} 
              <tr>
                <td align="left" valign="middle">{$orderList.orderNumber}
                 {if !( ($orderList.orderStatus =='Completed' &&  $orderList.paymentStatus=='Received') ||
				($orderList.orderStatus=='Pending' &&  $orderList.paymentStatus=='Received')	||
				($orderList.orderStatus=='Process' &&  $orderList.paymentStatus=='Received')) && $orderList.type =='Order'}{$language.lblCancelled}{/if}
                 </td>
                <td align="left" valign="middle">{$orderList.transactionID}</td>
                <td align="left" valign="middle">{$orderList.createdDate|date_format:$settingsDateFormat} {$orderList.createdDate|date_format:$settingsTimeFormat} </td>
                <td align="left" valign="middle">{$orderList.affiliateTransDate|date_format:$settingsDateFormat} {$orderList.affiliateTransDate|date_format:$settingsTimeFormat} </td>
                <td align="left" valign="middle">{if $orderList.subTotal > 0}{$orderList.subTotal|price}{else} - {/if}</td>
                 <td align="left" valign="middle">{$orderList.commPercent}</td>
                <td align="left" valign="middle">{$orderList.commissionAmount|price}</td>
              </tr>
              {/foreach}
                </tbody>
                 <tfoot>
               <tr class="bottom">
                  <td align="left" valign="middle"  colspan="4" ><div class="fixing_left" >
                   <strong>{$language.lblTotal}</strong>
                    <div class="clear"></div></td>
                  <td align="left" valign="top">{$TotalOrders|price}</td>
                  <td align="left" valign="top">&nbsp;</td>
                  <td align="left" valign="top">{$TotalCommission|price}</td>
               </tr>
			  </tfoot>
            </table>
             <!-- <div class="pagination_outer fixing_right">{paginate->layout  key="page" label_record="{$language.lblRecorsFound}" label_pages="{$language.lblPages}"}</div>  -->
            <div class="clear"></div>
          </div>
          {else}
          <div class="clear"></div>
          <div class="grid01 message_info"> {$language.msgNoRecords} </div>
          {/if} </div>
        <!-- Inner Content Container ends-->
        <div class="clear"></div>
      </div>
    </div>
    <!-- left wrapper ends--> 
    <!-- right side bar starts-->
    <div class="right-sidebar">
      <div class="side_wrapper"> 
        <!-- right side menu starts--> 
        {include file='AffReportSideMenu.tpl'} 
        <!-- right side menu ends--> 
      </div>
    </div>
    <!-- right side bar ends-->
    <div class="clear"></div>
  </div>
  <!-- Content Container ends--> 
  <!-- Footer starts--> 
  {include file='CommonBottom.tpl'} 
  <!-- Footer ends--> 
</div>
<!-- Outer container ends--> 
<script type="text/javascript" src="{$view_javascript}/message.plugin.js"></script>
<script>
{literal}
var d 		= new Date();
var nd 		= new Date(d.getFullYear(),d.getMonth(),d.getDate()+1,d.getHours()-1,d.getMinutes(),d.getSeconds());	
 $(function(){	  
	 $('#daterange').daterangepicker({arrows: false,presets:{		
			specificDate: 'Specific Date', 
			dateRange: 'Date Range'
		},presetRanges: [
			{text: 'Today', dateStart: 'today', dateEnd: 'today' },
			{text: 'Last 7 days', dateStart: 'today-7days', dateEnd: 'today' },
			{text: 'Month to date', dateStart: function(){ return Date.parse('today').moveToFirstDayOfMonth();  }, dateEnd: 'today' },
			{text: 'Previous Month', dateStart: function(){ return Date.parse('1 month ago').moveToFirstDayOfMonth();  }, dateEnd: function(){ return Date.parse('1 month ago').moveToLastDayOfMonth();  } }

		],latestDate:nd,dateFormat:datePickerDateFormat,placeHolder:'dateOverView',rangeDays:90,rangeSplitter:' - ',datepickerOptions: {maxDate:nd}});
	});
	
$('.ui-daterangepicker-dateRange').addClass('ui-state-active');	

$(document).ready(function(e) {
$('.side_menu').find("a[rel='payment']").addClass('selected').removeBorder();
$('.main_menu').find("a[rel='affReports']").addClass('active');


});
{/literal}
</script>
</body>
</html>