
            <div class="row">
                <div class="col-md-12">
                    <?php if(isset($success_msg) && $success_msg!=NULL){ ?>
                    <div class="alert alert-success"><?php echo $success_msg; ?></div>
                    <?php } ?>
                    <div id="response_msg"></div>
                
                    <div class="">
                        <div class="tab-content">
                            <div class="tab-pane active" id="tab_1">
                                <script type="text/javascript" language="javascript" >
                                    $(document).ready(function () {
                                        var dataTable = $('#table_other_income').DataTable({
                                            order: [[ 0, "desc" ]],
                                            select: true,
                                            pageLength: 10,
                                            processing: true,
                                            serverSide: true,
                                            ajax: {
                                                url: "Json_data/json_data_records?json_type=other_income", // json datasource
                                                type: "post", // method  , by default get
                                                error: function () {  // error handling
                                                    $(".employee-grid-error").html("");
                                                    $("#employee-grid").append('<tbody class="employee-grid-error"><tr><th colspan="6">No data found in the server</th></tr></tbody>');
                                                    $("#employee-grid_processing").css("display", "none");

                                                }
                                            }, "aoColumns": [
                                                {"sTitle": "", "sClass": "hidden"},
                                                {"sTitle": "ID"},
                                                {"sTitle": "Date"},
                                                {"sTitle": "Income Name"},
                                                {"sTitle": "Payment Method"},
                                                {"sTitle": "Amount"},
                                                {"sTitle": "Status"},
                                                {"sTitle": "Actions", "sClass": "actionWidthMembers"}
                                            ], "fnCreatedRow": function (nRow, aData, iDataIndex) {
                                                $(nRow).attr('id', '' + aData[0]);

                                            }
                                        });

                                    });
                                </script>
                                
                                <div id="add_new_other_income" class="modal fade" tabindex="-1" aria-hidden="true">
                                    <div class="modal-dialog">
                                        <div class="modal-content">
                                            <div class="modal-header">
                                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                                                <h4 class="modal-title">Add New Other Income</h4>
                                            </div>
                                            <form id="add_other_income" class="form-horizontal" method="post">
                                                <div class="modal-body">
                                                    <div id="response_msg_modal"></div>
                                                    <div class="scroller" style="height:400px" data-always-visible="1" data-rail-visible1="1">
                                                        <div class="row">
                                                            <div class="col-md-12">
                                                                <div class="form-body">
                                                                    <div class="form-group">
                                                                        <label class="control-label col-md-4">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="income_date" value="<?php echo date('d-m-Y') ?>"/>
                                                                        </div>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="control-label col-md-4">Other Income</label>
                                                                        <div class="col-md-3">
                                                                            <select class="form-control input-large select2me" name="other_income" id="other_income">
                                                                                <option value="">Please select a other income</option>
                                                                                <option value="Old Gold">Old Gold</option>
                                                                                <option value="Profit">Profit</option>
                                                                                <option value="Other">Other</option>
                                                                            </select>
                                                                        </div>
                                                                    </div>
                                                                    <div id="div_other_income" class="form-group hidden">
                                                                        <label class="control-label col-md-4">Other Income Name</label>
                                                                        <div class="col-md-3">
                                                                            <input type="text" class="form-control input-large" name="txt_other_income"/>
                                                                        </div>
                                                                    </div>
                                                                    <div id="div_customers" class="form-group hidden">
                                                                        <div class="form-group">
                                                                            <label class="control-label col-md-4">Customer Name</label>
                                                                            <div class="col-md-3">
                                                                                <select class="form-control input-large select2me" data-placeholder="Select..." id="sales_add_customer" name="select_customer">
                                                                                    <option value="">Select Customer</option>
                                                                                    <option value="Add New Customer">Add New Customer</option>
                                                                                    <?php
                                                                                        $customers = $this->admin_db->get_customers_to_do_sales();
                                                                                        foreach ($customers as $customer) {
                                                                                            $sel = '';
                                                                                    ?>

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

                                                                                    <?php } ?>
                                                                                </select>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                    <div id="div_customer_details" class="hidden">
                                                                        <div class="form-group">
                                                                            <label class="control-label col-md-4">Mobile Number</label>
                                                                            <div class="col-md-3">
                                                                                <input class="form-control input-large" size="16" type="text" id="txt_cus_contact_num" disabled="disabled"/>
                                                                            </div>
                                                                        </div>
                                                                        <div class="form-group">
                                                                            <label class="control-label col-md-4">Telephone Number</label>
                                                                            <div class="col-md-3">
                                                                                <input class="form-control input-large" size="16" type="text" id="txt_cus_tel_num" disabled="disabled"/>
                                                                            </div>
                                                                        </div>
                                                                        <div class="form-group">
                                                                            <label class="control-label col-md-4">Customer Type</label>
                                                                            <div class="col-md-3">
                                                                                <input class="form-control input-large" type="text" id="txt_cus_type" disabled="disabled"/>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                    <div id="add_new_customer" class="hidden">
                                                                        <div class="form-group">
                                                                            <label class="control-label col-md-4">Customer Name</label>
                                                                            <div class="col-md-3">
                                                                                <input type="text" name="customer_name" id="customer_name" placeholder="Shafraz & Co." class="form-control input-large"/>
                                                                            </div>
                                                                        </div>
                                                                        <div class="form-group">
                                                                            <label class="control-label col-md-4">Mobile Number</label>
                                                                            <div class="col-md-3">
                                                                                <input type="number" name="contact_num" id="contact_num" placeholder="0777123456" class="form-control input-large"/>
                                                                            </div>
                                                                        </div>
                                                                        <div class="form-group">
                                                                            <label class="control-label col-md-4">Telephone Number</label>
                                                                            <div class="col-md-3">
                                                                                <input type="number" name="tel_number" id="tel_number" placeholder="0342235122" class="form-control input-large"/>
                                                                            </div>
                                                                        </div>
                                                                        <div class="form-group">
                                                                            <label class="control-label col-md-4">Customer Type</label>
                                                                            <div class="col-md-3">
                                                                                <select class="form-control input-large" name="customer_type" id="customer_type">
                                                                                    <option value="">Select Customer Type</option>
                                                                                    <option value="Priority">Priority</option>
                                                                                    <option value="Walk-In">Walk-In</option>
                                                                                </select>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="control-label col-md-4">Payment Amount</label>
                                                                        <div class="col-md-3">
                                                                            <div class="input-group input-small">
                                                                                <span class="input-group-addon">
                                                                                    Rs. 
                                                                                </span>
                                                                                <input class="form-control input-small" type="number" id="payment_amount" name="payment_amount"/>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label class="control-label col-md-4">Payment Method</label> 
                                                                        <div class="col-md-3">
                                                                            <select class="form-control input-large" name="payment_method" id="payment_method_income">
                                                                                <option value="Cash">Cash</option>
                                                                                <option value="Cheque">Cheque</option>
                                                                                <option value="Bank Deposit">Bank Deposit</option>
                                                                            </select>
                                                                        </div>
                                                                    </div>
                                                                    <div id="div_cheque_details_income" class="hidden">
                                                                        <div class="form-group">
                                                                            <label class="control-label col-md-4">Bank Name</label>
                                                                            <div class="col-md-3">
                                                                                <select class="form-control input-large select2me" name="cheq_bank" id="cheq_bank">
                                                                                <?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-4">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-4">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_income" class="hidden">
                                                                        <div class="form-group">
                                                                            <label class="control-label col-md-4">Bank Account</label>
                                                                            <div class="col-md-3">
                                                                                <select class="form-control input-large select2me" name="deposit_bank_account" id="deposit_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-4">Description</label>
                                                                        <div class="col-md-3">
                                                                            <textarea name="description" id="description" class="form-control input-large"></textarea>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="modal-footer">
                                                    <button type="button" data-dismiss="modal" class="btn default">Close</button>
                                                    <button type="submit" class="btn green">Save changes</button>
                                                </div>
                                            </form>
                                        </div>
                                    </div>
                                </div>
                                
                                <div class="modal fade" id="success_modal" tabindex="-1" role="basic" aria-hidden="true">
                                    <div class="modal-dialog">
                                        <div class="modal-content">
                                            <div class="modal-header">
                                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                                                <h4 class="modal-title">Success!</h4>
                                            </div>
                                            <div class="modal-body">
                                                Other Income Added Successfully
                                            </div>
                                            <div class="modal-footer">
                                                <button type="button" class="btn green" data-dismiss="modal" onclick="window.location.reload()">Ok</button>
                                            </div>
                                        </div>
                                        <!-- /.modal-content -->
                                    </div>
                                    <!-- /.modal-dialog -->
                                </div>
                                <!-- /.modal -->
                                
                                <!-- BEGIN EXAMPLE TABLE PORTLET-->
                                <div class="portlet box grey-cascade">
                                    <div class="portlet-title">
                                        <div class="caption">
                                            <i class="fa fa-money"></i>Other Income
                                        </div>
                                    </div>
                                    <div class="portlet-body">
                                        <div class="table-toolbar">
                                            <div class="btn-group">
                                                <a class="btn green" data-toggle="modal" href="#add_new_other_income">
                                                    Add New <i class="fa fa-plus"></i>
                                                </a>
                                            </div>
                                        </div>
                                        <table id="table_other_income" class="table table-striped table-bordered table-hover"></table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div> 
            </div>
            <!-- END DASHBOARD STATS -->
        </div>
    </div>
    <!-- END CONTENT -->
</div>
<!-- END CONTAINER -->