<!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.lblAffiliatePayments}</title>
{include file='CommonStyles.tpl'}
{include file='CommonJavaScript.tpl'}
{include file='CommonCustomStyles.tpl'}
<link rel="stylesheet" type="text/css" href="{$view_styles}/grid_listing.css" />
<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}/ui.daterangepicker.css" />
<link href="{$view_styles}/right-menu.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/colorbox.css" />
</head><body>
<div class="outer_container"> {include file='CommonTop.tpl'} 
  <!--End:Header Container--> 
  <!--End:Header Container--> 
  <!--***********************************************************************END HEADER CONTAINER******************************************************-->
  <div class="content_container2 clearfix">
    <div class="right-sidebar">
      <div class="side_wrapper"> {if $affaddprivilage}
		{html->anchor href="affiliate/new/" caption="<strong><span class='add'></span>{$language.lblAddNewAffiliate}</strong>" class="custom-btnt"  }
		{/if}{include file='AffiliateRightLinks.tpl'} </div>
    </div>
    <!--End: Right Block-->
    <div class="left_wrapper">
      <div class="content_wrapper"> {html->anchor href="affiliate/paymentnotpaid/$link" caption="{$language.lblBack}" class="back-link fixing_right top-space"}
          <div class="search_tab fixing_right margin-b-10">
            <ul>
              <li>{html->anchor href="/affiliate/affiliateOrderPaymentNotPaid/id/$affiliateUserID/$link" class="search_tab_a active" caption=$language.lblNotPaid}</li>
              <li>{html->anchor href="/affiliate/affiliateOrderPaymentPaid/id/$affiliateUserID/$link"  class="search_tab_a"  caption=$language.lblPaid}</li>
              <li>{html->anchor href="affiliate/affiliateOrderTransaction/id/$affiliateUserID/$link"  class="search_tab_a"  caption=$language.lblTransactions}</li>
            </ul>
          </div>
        <h2>{$language.lblAffiliatePayments} - {$affiliateName}</h2>
        <div id="common_message" ></div>
        {form->start name="formOrderSearch" action="" method="post" enctype="multipart/form-data"}
        {form->hidden name="affiliateUserID"}
        <div class="search_container">
          <div class="inner single-box">
            <ul class="clearfix">
            	<li class="column">
                	<p class="label-field01">{$language.lblActionDate}</p>
                    <span class="form-field01">  <div class="text-box-div-date">{assign var="fromDate" value=$fromDate|customDate|default:''}
                      {form->textbox id="payDate" name="payDate" readonly="readonly" class="date-field" value=$payDate} </div></span>
                </li>
                <li class="column">
                	<p class="label-field01">{$language.lblType}</p>
                    <span class="form-field01"> {form->select name="commissionType" 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} </span>
                </li>
                <li class="column">
                	{form->submit name="submitSearch" form="formOrderSearch" class="button01"  value="{$language.lblSearch}"}
                  {html->anchor href="/affiliate/affiliateOrderPaymentNotPaid/id/$affiliateUserID/" class="action-link" content="{$language.lblListAll}"}
                </li>
          </ul>
          </div>
        </div>
        {if $resAffiliateNotPaid}  {form->submit name="notPaidExport" form="formOrderSearch" class="button-link01 fixing_right" value=$language.lblExport}
        <div class="clear"></div>
        {/if}
        {form->close} 
        {form->start name="formNotPaidOrder" action="" method="post" enctype="multipart/form-data"}
        {form->hidden name="businessID_notPaid" value=$id|default:''}
        {if $resAffiliateNotPaid}
        <div class="grid_table00">
          <table width="100%" border="0" cellspacing="0" cellpadding="0"   >
            <tr>
              <th align="left" valign="middle"  class="checkbox_column" width="30"> <div class="chekingdiv">{form->checkbox id="ListStatusLinkCheckbox"  class="fixing_left" tabindex="1"}
                  </div>
              </th>
              <th  align="left" valign="middle" width="28%" >{$language.lblType}</th>
              <th align="left" valign="middle">{$language.lblActionDate}</th>
              <th align="left" valign="middle">{$language.lblSubtotal}</th>
              <th align="left" valign="middle">{$language.lblSiteCommission}(%)</th>
              <th align="left" valign="middle">{$language.lblCommissionAmount}</th>
            </tr>
            {foreach from=$resAffiliateNotPaid item="notPaidPay" key="key1"}
            {assign var="orderID" value=$notPaidPay.orderID}
            {assign var="affiliateCommissionID" value=$notPaidPay.affiliateCommissionID}
            {assign var="TotalOrders" value=$TotalOrders|default:0+$notPaidPay.subTotal} 
            {assign var="TotalCommission" value=$TotalCommission|default:0+$notPaidPay.commissionAmount} 
            {assign var="orNum" value=$notPaidPay.orderNumber}
            <tr >
              <td align="left" valign="top" > {form->checkbox id="check_$affiliateCommissionID" name="checkNotPaidOrderIDs[]" value=$affiliateCommissionID class="checkbox01 ListAll List"|cat :{$paidPay.affiliateStatus|default:''}}</td>
              <td align="left" valign="middle"> {$notPaidPay.orderNumber} </td>
              <td align="left" valign="middle">{$notPaidPay.createdDate|date_format:$date_format}&nbsp;&nbsp;{$notPaidPay.createdDate|date_format:$time_format}</td>
              <td align="left" valign="middle">{$notPaidPay.subTotal|price}</td>
              <td align="left" valign="middle">{$notPaidPay.commPercent}</td>
              <td align="left" valign="middle">{$notPaidPay.commissionAmount|price}</td>
            </tr>
            {/foreach}
            <tfoot>
              <tr >
                <td align="left" valign="top" colspan="3" >{$language.lblTotal}</td>
                <td align="left" valign="top" colspan="2">{$TotalOrders|price}</td>
                <td align="left" valign="top" colspan="3">{$TotalCommission|price}</td>
              </tr>
            </tfoot>
          </table>
        </div>
        {form->submit name="submitNotPaid" class="update_btn_table button04" value=$language.lblPayNow title=$language.lblPayNow} 
        {html->anchor class="fancylink" title=$language.lblPayNow  href="/affiliate/transaction/"}
        
        {else}
        <div class="message_info">{$language.msgNoAffiliatePayments}</div>
        {/if} 
        
        {form->close} </div>
    </div>
  </div>
  <!--End:Content Container--> 
  {include file='CommonBottom.tpl'} </div>
{include file='CommonJavaScriptBottom.tpl'}
  {form->rootpath_script}
  {form->basepath_script} 
  <script type="text/javascript" src="{$view_javascript}/table.plugin.js"></script> 
  <script type="text/javascript" src="{$common_js}/date.js"></script> 
  <script type="text/javascript" src="{$view_javascript}/daterangepicker.jQuery.js"></script> 
  <script type="text/javascript">
{literal}
$(document).ready(function(){
	 $('#payDate').daterangepicker({arrows: false}); 
});
{/literal}
$('.side_wrapper ul li a[rel=affiliate-payments]').addClass('selected');
setSideMenu(); 
var msgSelectItem = '{$language.msgSelectItem}';
</script> 
  <script type="text/javascript" src="{$view_javascript}/jquery.colorbox.js"></script> 
  <script type="text/javascript" src="{$view_javascript}/tab.plugin.js"></script> 
  <script type="text/javascript" src="{$view_javascript}/affiliateOrderPayments.page.js"></script> 
 {html->messages_script id="common_message"}
</body>
</html>