<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" class="no-js" ng-app="myapp" lang="{$SelCurrLanguage}">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>{$language.lblbottomlinkmyaccount} : {$commonMetaTitle}</title> 
    <meta name="viewport" content="width=device-width">
    <meta name="Description" content="{$commonMetaDescription}" />
    <meta name="Keywords" content="{$commonMetaKeywords}" />
    {include file='CommonStyles.tpl'}
    <link href="{$view_styles}/myaccount.css" rel="stylesheet" type="text/css" media="screen" />
    {include file='CommonJavaScript.tpl'}
   {html->script_group_start name="{$compiled_js_path}/account.myaccount.js"}
    {html->script src="{$common_frontend_js}/smartpaginator.js"}
  {html->script_group_end}
    <script type="text/javascript">
      var transactionCount 	= {$listTransactions|@count};
      var lblRecordsFound   	= '{$language.lblRecordsFound}' + ': ';
      var lblPages   			= ' ' + '{$language.lblPages}' ;
      	{literal}
      		$(document).ready(function(){
      			$('.panelmenu a[rel=certificates]').parent().addClass('active');
//                        $('.right-panel a[rel=certificates]').parent().addClass('active');
                 $('#smart-paginator').smartpaginator({ totalrecords: transactionCount, recordsperpage: 12,
                     onchange:function onChange(){ $('html, body').animate({scrollTop: $(".right-panel").offset().top},500);}, 
                     //datacontainer: 'myTable',dataelement: 'li.refer-listing',initval:0 , controlsalways:true,display:'single',recordsfoundlabel:lblRecordsFound, pageslabel:lblPages
                     datacontainer: 'myTable',dataelement: 'li.list',initval:0 , controlsalways:true,display:'single',recordsfoundlabel:lblRecordsFound, pageslabel:lblPages
               	});		
      	});		
      	{/literal}
    </script>
  </head>
  <body ng-controller="SearchCtrl" class="{$languageDirection}">
      
    {assign var="purchasedCurrency" value=$resProductOrderDetails.0.purchasedCurrency}
    {assign var="userCurrency" value=$resProductOrderDetails.0.userCurrencyID}
    {assign var="excRate" value=$resProductOrderDetails.0.userCurrencyExcRate}
      {*<!-- Begin : Outer Pane -->*}
    <div class="outer">
      {*<!-- Begin : Header Pane--> *}
      {include file='CommonTop.tpl'} 
      {*<!-- End : Header -->*}
      <div id="content-wrapper" ng-show="!query" class="pt-3 pb-4">
        <div class="container">
          <div  id="message_cart"></div>
        <div class="row">
            {include file='account/CommonAccountRightMenu.tpl'}
            <div class="col-12 col-lg-9">
            <div class="py-2 bg-white border-bottom">
                <h2 class="acc-title shadow-box px-md-4 px-3 py-md-1 py-0 text-capitalize text-dark m-0">{$language.lblMyWallet}</h2>
            </div>
            <div class="right-panel bg-white settngs p-md-4 p-3">
            <div id="common_messages"></div>
            <p>{$language.lblWalletDesc}</p>
            
           {* <!-- Begin : Gift Block --> *}
            {*<!-- Begin : Content Pane -->*}
                 {if $listTransactions}

            <div class="clearfix table-listing">
              {*<!-- Begin : First Row -->*}
              <div class="grid-section clearfix mb-2">
                  <ul class="clearfix content-tab border border-bottom-0 col-12" id="myTable">
                        <li class="row table-head border-bottom d-md-flex d-none text-dark p-2">
                            <div class="col-md-5 col-12">{$language.lblDescription}</div>
                            <div class="col-md-3 col-12">{$language.lblDate}</div>
                            <div class="col-md-2 col-12">{$language.lblDebit}</div>
                            <div class="col-md-2 col-12">{$language.lblCredit}</div>
                        </li>
                      {foreach $listTransactions as $transaction}
                        <li class="row table-list list border-bottom py-3 px-2">
                           <div class="col-md-5 col-12">
                                <label class="m-0">{$transaction.transactionDescription}</label>
                                {if !empty($transaction.appliedCashBackPromo)}
                                    <div id="applied_promotions_wallet " class="applied_promotions pos-rel">
                                       <h6 class="block strong cashbackPromoView" rel="{$transaction.userTransactionID}"> {$language.lblViewCashBackPromotions}</h6>
                                       <span class="fillit"></span>
                                       <div id="cashbackPromo_{$transaction.userTransactionID}" class="cashback-drop" style="display:none;">
                                       <span class="icon-close"></span>
                                       {foreach $transaction.appliedCashBackPromo as $key=>$cashbackpromo}
                                          <div class="promo-item">
                                            <div>
                                              <span>{$cashbackpromo['ruleName']|default:''}</span>
                                              {if $cashbackpromo.termsAndConditions|default:''!=''}
                                              <a class="offer_tc bpfc" rel="group_{$key}" href="#content-div_{$key}" data-toggle="collapse">View T&C</a>
                                              <div class="collapse margin-vertical" id="content-div_{$key}">
                                                  {$cashbackpromo.termsAndConditions|unescape:"html"}
                                              </div>
                                              {/if}
                                            </div> 
                                          </div> 

                                       {/foreach}                    
                                       </div>
                                       </div> 
                                    {/if}
                                </div>
                                <div class="col-md-3 col-12">
                                    <label class="m-0">{$transaction.transactionDate|date_format:$date_format} {$transaction.transactionDate|date_format:$time_format}</label>
                                </div>
                                {if $transaction.transactionType == 'Debit'}
                                <div class="col-md-2 col-12">
                                   <label class="d-md-none d-inline-block float-left pr-2 m-0">{$language.lblDebit} :</label> <span class="font-arial"> {$transaction.transactionAmount|price}</span>
                                </div>
                                <div class="col-md-2 col-12">
                                  <label class="d-md-none d-inline-block float-left pr-2 m-0">{$language.lblCredit} :</label> --
                                </div>
                                {else}
                                <div class="col-md-2 col-12">
                                    <label class="d-md-none d-inline-block float-left pr-2 m-0">{$language.lblDebit} :</label> --
                                </div>
                                <div class="col-md-2 col-12">
                                  <label class="d-md-none d-inline-block float-left pr-2 m-0">{$language.lblCredit} :</label><span class="font-arial "> {$transaction.transactionAmount|price}</span>
                                </div>
                                {/if}
                            </li>
                      {/foreach}
                  </ul>
                  
                {*<!-- Begin : Cart box --><!-- End : Cart box -->*}
              </div>
              {*<!-- End : First Row --> *}
              {*<!-- Begin : Second Row --><!-- End : Second Row --> *}
            </div>
            <div id="smart-paginator"> </div>
            {else}
            <div  class="warning">{$language.msgNoRecords}</div>
            {/if} 
            {*<!-- End : Content Pane --> *}
            {*<!-- Begin : Account Pane --><!-- End : Account Pane -->*}
            {*<!-- End : Cart Block --> *}
            {*<!-- Begin : Payment Block --><!-- End : Payment Block --> *}
          </div>
            </div>
        </div>
        </div>
      </div>
     {* <!-- Begin : Footer	Pane --> *}
      {include file='CommonBottom.tpl'} 
      {*<!-- End : Footer Pane --> *}
    </div>
    <script type="text/javascript">
      $(document).ready(function() {
      	var default_value = $('#couponCode').val();
      	$('#couponCode').focus(function() {
          	if(this.value == default_value) {
              	this.value = '';
          	}
      	});
        $(document).on('click','.cashbackPromoView',function(){
                var tid = $(this).attr('rel');
                $("#cashbackPromo_"+tid).show();
        	$(".fillit").addClass('on');
        });
        $(document).on('click','.icon-close',function(){
          $(".cashback-drop").hide();
          $(".fillit").removeClass('on');
        });

      });
    </script> 
    {include file='CommonJavaScriptBottom.tpl'}
    {html->messages_script section="User" id="message_cart"}
    {html->messages_script section="User" id="common_messages"}
  </body>
  
</html>