<div class="col-lg-10 col-md-10 col-sm-10 col-xs-10 bodyitem">
    <fieldset style="margin-bottom: 0px; padding-bottom: 0px; border-radius: 10px 10px 0px 0px ">
        <div class="row">
            <form action="<?php echo site_url('gkpos/report/customersfiltered') ?>" method="post"  id="customerReportFilterForm">
                <table class="table table-bg-color table-responsive">
                    <tr>
                        <th>Name</th>
                        <th>Phone</th>
                        <th>Email</th>
                        <th>Postcode</th>
                        <th>city</th>
                        <th><button class="btn btn-default btn-sm" style="width: 100%" type="button" onclick="addCustomer('0')">Add New Customer</button></th>
                    </tr>
                    <tr>
                        <td><?php echo form_input(array('name' => 'name', 'value' => '', 'class' => 'form-control input-sm', 'id' => 'name')); ?></td>
                        <td><?php echo form_input(array('name' => 'phone', 'value' => '', 'class' => 'form-control input-sm', 'id' => 'phone')); ?></td>
                        <td><?php echo form_input(array('name' => 'email', 'value' => '', 'class' => 'form-control input-sm', 'id' => 'name')); ?></td>
                        <td><?php echo form_input(array('name' => 'postcode', 'value' => '', 'class' => 'form-control input-sm', 'id' => 'postcode')); ?></td>
                        <td><?php echo form_input(array('name' => 'city', 'value' => '', 'class' => 'form-control input-sm', 'id' => 'city')); ?></td>
                        <td class="text-center"><button class="btn btn-primary btn-sm" style="width: 100%" type="submit" onclick="filterReport()">Submit</button></td>
                    </tr>
                    <?php if ($pagination != null || $pagination == '' && $pages > 1): ?>
                        <tr>
                            <td colspan="6">
                                <ul class="pagination">
                                    <li <?php $segment == 0 ? print'class="active"' : '' ?>><a href="javascript:void(0)" onclick="getSettingPage('<?php echo site_url('gkpos/report/customers/') ?>', '<?php echo $this->lang->line("gkpos_system_customer") ?>')"><?php echo '>>First>>' ?></a></li>
                                    <?php for ($index = 1; $index <= $pages; $index++): ?>
                                        <li <?php $segment == $index ? print'class="active"' : '' ?>><a href="javascript:void(0)" onclick="getSettingPage('<?php echo site_url('gkpos/report/customers/' . $index) ?>', '<?php echo $this->lang->line("gkpos_system_customer") ?>')"><?php echo $index ?></a></li>
                                    <?php endfor; ?>
                                </ul>
                            </td>
                        </tr>
                    <?php endif; ?>
                </table>
            </form>
        </div>
    </fieldset>
    <div id="filterContent3">
        <?php echo $this->load->view('gkpos/report/customersfiltered'); ?>
    </div>
    <div id="payOpener"></div>
</div>
<div id="customerAddForm"></div>

<script>
    function addCustomer(phone) {
        $.ajax({
            url: "<?php echo site_url('gkpos/report/add_customer') ?>",
            type: "POST",
            data: {
                phone: phone
            },
            success: function (json) {
                $('#customerAddForm').html(json);
                $('#CustomerForm').modal({
                    keyboard: false,
                    backdrop: 'static',
                    width: '700px',
                    show: true
                });
            }
        });
    }

</script>

