<div class="row">
    <div class="col-md-12">
        <div class="portlet box grey-cascade">
            <div class="portlet-title">
                <div class="caption">
                    <i class="fa fa-gift"></i>Settle Creditor
                </div>
            </div>
            <div class="portlet-body form">
                <!-- BEGIN FORM-->
                <form id="save_settle_creditor" class="form-horizontal" method="POST" enctype="multipart/form-data">
                    <div class="form-body">
                        <div class="form-group">
                            <label class="control-label col-md-3">Date</label>
                            <div class="col-md-3">
                                <input class="form-control form-control-inline input-medium date-picker" size="16" type="text" data-date-format=dd-mm-yyyy name="credit_date" value="<?php echo date('d-m-Y') ?>"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-md-3">Creditor Name</label>
                            <div class="col-md-3">
                                <select class="form-control input-large select2me" data-placeholder="Select..." id="settle_creditor" name="select_creditor">
                                    <option value="">Select Creditor</option>
                                    <?php
                                        $creditors = $this->admin_db->get_creditors_to_settle();
                                        foreach ($creditors as $creditor) {
                                            $sel = '';
                                    ?>

                                    <option value="<?php echo $creditor['id']; ?>" <?php echo $sel; ?> item_id="<?php echo $creditor['contact_number']; ?>"><?php echo $creditor['creditor_name']; ?></option>

                                    <?php } ?>
                                </select>
                            </div>
                        </div>
                        <div id="div_creditor_details" class="hidden">
                            <div class="form-group">
                                <label class="control-label col-md-3">Mobile Number</label>
                                <div class="col-md-3">
                                    <div class="control-label pull-left" id="div_cre_mob_num"></div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-3">Telephone Number</label>
                                <div class="col-md-3">
                                    <div class="control-label pull-left" id="div_cre_tel_num"></div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-3">Creditor Type</label>
                                <div class="col-md-3">
                                    <div class="control-label pull-left" id="div_cre_type"></div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-3">Total Credit Amount</label>
                                <div class="col-md-3">
                                    <div class="control-label pull-left" id="div_cre_tot_amount"></div>
                                    <input class="form-control" type="hidden" id="txt_cre_tot_amount" name="txt_cre_tot_amount"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-3">Total Paid Amount</label>
                                <div class="col-md-3">
                                    <div class="control-label pull-left" id="div_cre_paid_amount"></div>
                                    <input class="form-control" type="hidden" id="txt_cre_paid_amount" name="txt_cre_paid_amount"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-3">Total Balance Amount</label>
                                <div class="col-md-3">
                                    <div class="control-label pull-left" id="div_cre_bal_amount"></div>
                                    <input class="form-control" type="hidden" id="txt_cre_bal_amount" name="txt_cre_bal_amount"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-3">Payment Amount</label>
                                <div class="col-md-3">
                                    <input class="form-control input-large" type="number" id="payment_amount_settle_creditor" name="payment_amount"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-md-3">Payment Method</label> 
                                <div class="col-md-3">
                                    <select class="form-control input-large" name="payment_method" id="payment_method_expense">
                                        <option value="Cash">Cash</option>
                                        <option value="Cheque">Cheque</option>
                                        <option value="Bank Transfer">Bank Transfer</option>
                                        <option value="Bank Deposit">Bank Deposit</option>
                                    </select>
                                </div>
                            </div>
                            <div id="div_cheque_details_expense" class="hidden">
                                <div class="form-group">
                                    <label class="control-label col-md-3">From Bank Account</label>
                                    <div class="col-md-3">
                                        <select class="form-control input-large select2me" name="cheq_bank_account" id="cheq_bank_account">
                                        <?php
                                            $accounts = $this->admin_db->get_bank_accounts_for_receipts();
                                            foreach ($accounts as $account) {
                                                $sel = '';
                                        ?>

                                        <option value="<?php echo $account['id']; ?>" <?php echo $sel; ?>><?php echo $account['account_name'].' - '.$account['account_number'].' - '.$account['bank_name']; ?></option>

                                        <?php } ?>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-md-3">Cheque Number</label>
                                    <div class="col-md-3">
                                        <input class="form-control input-large" type="number" name="cheq_cheque_number" id="cheq_cheque_number"/>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-md-3">Deposit Date</label>
                                    <div class="col-md-3">
                                        <input class="form-control form-control-inline input-large date-picker" size="16" type="text" data-date-format=dd-mm-yyyy name="cheq_deposit_date" value="<?php echo date('d-m-Y') ?>"/>
                                    </div>
                                </div>
                            </div>
                            <div id="div_bank_details_expense" class="hidden">
                                <div id="div_bank_tranfer_expense" class="hidden">
                                    <div class="form-group">
                                        <label class="control-label col-md-3">From Account Number</label>
                                        <div class="col-md-3">
                                            <select class="form-control input-large select2me" name="transfer_bank_account" id="transfer_bank_account">
                                            <?php
                                                $accounts = $this->admin_db->get_bank_accounts_for_receipts();
                                                foreach ($accounts as $account) {
                                                    $sel = '';
                                            ?>

                                            <option value="<?php echo $account['id']; ?>" <?php echo $sel; ?>><?php echo $account['account_name'].' - '.$account['account_number'].' - '.$account['bank_name']; ?></option>

                                            <?php } ?>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-md-3">To Bank Name</label>
                                    <div class="col-md-3">
                                        <select class="form-control input-large select2me" name="bank_bank_name" id="bank_bank_name">
                                        <?php
                                            $banks = $this->admin_db->get_banks_for_receipts();
                                            foreach ($banks as $bank) {
                                                $sel = '';
                                        ?>

                                        <option value="<?php echo $bank['id']; ?>" <?php echo $sel; ?>><?php echo $bank['bank_name']; ?></option>

                                        <?php } ?>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-md-3">To Bank Account Number</label>
                                    <div class="col-md-3">
                                        <input class="form-control input-large" type="number" name="bank_account_number" id="bank_account_number"/>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="form-actions fluid">
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="col-md-offset-3 col-md-9">
                                        <button type="submit" class="btn green">
                                            Submit <i class="fa fa-check"></i>
                                        </button>
                                        <button type="button" class="btn default">Cancel</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>