<script src="<?php echo URL::to('/'); ?>/assets/js/jquery-1.11.0.min.js"></script>
<script src="<?php echo URL::to('/'); ?>/assets/js/toastr.js"></script>
<script src="<?php echo URL::to('/'); ?>/assets/js/jquery-ui/js/jquery-ui-1.10.3.minimal.min.js"></script>
<script src="<?php echo URL::to('/'); ?>/assets/js/select2/select2.min.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo URL::to('/'); ?>/assets/js/select2/select2-bootstrap.css">
<link rel="stylesheet" type="text/css" href="<?php echo URL::to('/'); ?>/assets/js/select2/select2.css">
<link rel="stylesheet" type="text/css" href="<?php echo URL::to('/'); ?>/assets/js/dataTables.bootstrap.js">
<link rel="stylesheet" type="text/css" href="<?php echo URL::to('/'); ?>/assets/js/jquery.dataTables.min.js">
<?php $__env->startSection('content'); ?>
<header class="x-title">
    <div class="payment-strip">
        <div class="x-content">
            <div class="x-row">
                <div class="x-span8">
                    <?php if(isset($Invoice)): ?>
                    <div>
                        <div class="due"><?php if($Invoice->InvoiceStatus == Invoice::PAID): ?> <?php echo cus_lang('CUST_PANEL_PAGE_INVOICE_CVIEW_LBL_PAID'); ?> <?php else: ?> <?php echo cus_lang('CUST_PANEL_PAGE_INVOICE_CVIEW_LBL_DUE'); ?> <?php endif; ?></div>
                    </div>
                    <div class="amount">
                        <span class="overdue"><?php echo $CurrencySymbol; ?><?php echo number_format($DueAmount,get_round_decimal_places($Invoice->AccountID)); ?>

                            <?php if(!empty($CreditCardFee)): ?>
                                + <?php echo $CreditCardFee; ?><?php echo $CreditCardFeeType; ?>(Card Fee)
                            <?php endif; ?>
                        </span>
                    </div>
                    <?php elseif(isset($request["Amount"])): ?>
                    <div class="amount">
                        <span class="overdue"><?php echo $CurrencySymbol; ?><?php echo number_format($request["Amount"],get_round_decimal_places($Account->AccountID)); ?></span>
                    </div>
                    <?php endif; ?>
                </div>
                <div class="x-span4 pull-left">
                    <h1 class="text-center">
                        <h1 class="text-center">Payment</h1>
                    </h1>
                </div>
            </div>
        </div>
    </div>
</header>
<?php if($PaymentGatewayID==PaymentGateway::AuthorizeNet || $PaymentGatewayID==PaymentGateway::Cardknox || $PaymentGatewayID==PaymentGateway::Stripe || $PaymentGatewayID==PaymentGateway::FideliPay || $PaymentGatewayID==PaymentGateway::PeleCard || $PaymentGatewayID==PaymentGateway::MerchantWarrior): ?>)
<?php echo $__env->make('invoices.invoice_creditcard', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php endif; ?>
<?php if($PaymentGatewayID==PaymentGateway::StripeACH): ?>
<?php echo $__env->make('invoices.invoice_bankaccount', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php endif; ?>
<?php if($PaymentGatewayID==PaymentGateway::Forte): ?>
<?php echo $__env->make('invoices.invoice_bankaccountforte', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php endif; ?>
<?php if($PaymentGatewayID==PaymentGateway::AuthorizeNetEcheck): ?>
<?php echo $__env->make('invoices.invoice_authorizebankaccount', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php endif; ?>

<script>
    var PaymentGatewayID = '<?php echo $PaymentGatewayID; ?>';
    toastr_opts = {
        "closeButton": true,
        "debug": false,
        "positionClass": "toast-top-right",
        "onclick": null,
        "showDuration": "300",
        "hideDuration": "1000",
        "timeOut": "5000",
        "extendedTimeOut": "1000",
        "showEasing": "swing",
        "hideEasing": "linear",
        "showMethod": "fadeIn",
        "hideMethod": "fadeOut"
    };

    if ($.isFunction($.fn.select2)) {
        $("select.select2").each(function(i, el) {
            var $this = $(el),
                opts = {
                    allowClear: attrDefault($this, 'allowClear', false)
                };
            if ($this.hasClass('small')) {
                opts['minimumResultsForSearch'] = attrDefault($this, 'allowClear', Infinity);
                opts['dropdownCssClass'] = attrDefault($this, 'allowClear', 'no-search')
            }
            $this.select2(opts);
            if ($this.hasClass('small')) {
                $this.select2('container').find('.select2-search').addClass('hidden');
            }
            //$this.select2("open");
        }).promise().done(function() {
            $('.select2').css('visibility', 'visible');
        });


        if ($.isFunction($.fn.perfectScrollbar)) {
            $(".select2-results").niceScroll({
                cursorcolor: '#d4d4d4',
                cursorborder: '1px solid #ccc',
                railpadding: {
                    right: 3
                }
            });
        }
    }

    // Element Attribute Helper
    function attrDefault($el, data_var, default_val) {
        if (typeof $el.data(data_var) != 'undefined') {
            return $el.data(data_var);
        }

        return default_val;
    }
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layout.blank', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>