<?php

if ($permissions->hasPermission('addBankAccount')) {
    include("Views/Accounting/addBankAccount.php");
}
?>
<style>
    .table thead tr >th{

        background-color:#4c0870;
        width:16% !important;
        color:#fff;
    }
    .table thead tr th[class*='sorting_'] {
        color: #fff;
    }
    .bg-master-lighter {
        border:none;
        background-color:#fff;
        border-top:1px solid #ddd;  
    }
    #selected_entry{
        height:90px;
        color: black;
        margin-top:20px;
        font-size: 16px;
        padding-top: 2%;
    }
    .select_table td{
        padding-left: 70px;
    }
    .dataTables_wrapper .dataTables_paginate .paginate_button.current, .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover,.dataTables_wrapper .dataTables_paginate .paginate_button:hover{
        color:#fff !important;
        border-radius: 50%;
        background: #ed9421 !important;
        border-color: #4c0870
    }
    .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover{
        color:#fff !important;
    }
</style>
<div class="container-fluid container-fixed-lg bg-white">
    <div class="panel panel-transparent">
        <div class="panel-heading">
            <div class="panel-title"><?php print CommonLanguage::getMessage('bank_account'); ?></div>
                        <?php echo Forms::FloatingAddButton('4c0870', '#add_AccountBank', CommonLanguage::getMessage('add_bank_account')); ?>

        </div>
        <div class="panel-body">

            <table class="table table-bordered table-hover demo-table-search" id="tableWithSearch">
                <thead>
                    <tr>
                        <th class="text-center" ><?php print CommonLanguage::getMessage('bank_name'); ?></th>
                        <th class="text-center" ><?php print CommonLanguage::getMessage('account_name'); ?></th>
                        <th class="text-center" ><?php print CommonLanguage::getMessage('account_number'); ?></th>
                        <th class="text-center" ><?php print CommonLanguage::getMessage('credit_card_number'); ?></th>
                        <th class="text-center" ><?php print CommonLanguage::getMessage('currency'); ?></th>
                        <th class="text-center" ><?php print CommonLanguage::getMessage('Action'); ?></th>
                    </tr>
                </thead>
                <tbody>


                </tbody>
            </table>
        </div>

    </div>
</div>
<script>
    var title = <?php echo json_encode(CommonLanguage::getMessage('bank_account')); ?>;

    $(function () {
        RebuildDataTable(title, [0, 1, 2, 3, 4], 'ACCAjax/viewBankAccountRequest', 1);
        $('#tableWithSearch').on('click', '.EditBank', function () { 
            bank_account_id = $(this).parents('div.Action').attr('data-id')
            CommonViewById('ACCAjax/getBankInfo', {bank_account_id: bank_account_id},
                           '#jobOrderOptionLoader', function (response) {
                            data = response[0]
                            $("#Bank_Name").val(data['Bank_Name'])
                            $("#Bank_Account_Name").val(data['Bank_Account_Name'])
                            $("#Bank_Account_Number").val(data['Bank_Account_Number'])
                            $("#Credit_Card_Number").val(data['Credit_Card_Number'])
                            $("#Bank_Account_ID").val(data['Bank_Account_ID'])
                            $("#UpdateAccountBank").show()
                            $("#UpdateAccountBank").removeClass('disabled')
                            $("#SubmitAccountBank").hide()
            });
        });
    })
</script>
