ok
Direktori : /home2/selectio/public_html/mm-tailor-billing/themes/default/views/reports/ |
Current File : /home2/selectio/public_html/mm-tailor-billing/themes/default/views/reports/customers.php |
<?php (defined('BASEPATH')) OR exit('No direct script access allowed'); ?> <script type="text/javascript"> $(document).ready(function() { var table = $('#CuData').DataTable({ 'ajax' : { url: '<?=site_url('reports/get_customers');?>', type: 'POST', "data": function ( d ) { d.<?=$this->security->get_csrf_token_name();?> = "<?=$this->security->get_csrf_hash()?>"; }}, "buttons": [ { extend: 'copyHtml5', 'footer': false, exportOptions: { columns: [ 0, 1, 2, 3 ] } }, { extend: 'excelHtml5', 'footer': false, exportOptions: { columns: [ 0, 1, 2, 3 ] } }, { extend: 'csvHtml5', 'footer': false, exportOptions: { columns: [ 0, 1, 2, 3 ] } }, { extend: 'pdfHtml5', orientation: 'landscape', pageSize: 'A4', 'footer': false, exportOptions: { columns: [ 0, 1, 2, 3 ] } }, { extend: 'colvis', text: 'Columns'}, ], "pageLength": 25, "columns": [ { "data": "id", "visible": false }, { "data": "name" }, { "data": "phone", "className": "text-center"}, { "data": "Balance" }, /* { "data": "cf2", "className": "text-center"}, { "data": "Clone" }, { "data": "DC Count" } { "data": "Actions", "searchable": false, "orderable": false }*/ ] }); $('#search_table').on( 'keyup change', function (e) { var code = (e.keyCode ? e.keyCode : e.which); if (((code == 13 && table.search() !== this.value) || (table.search() !== '' && this.value === ''))) { table.search( this.value ).draw(); } }); }); </script> <section class="content"> <div class="row"> <div class="col-xs-12"> <div class="box box-primary"> <div class="box-header"> <h3 class="box-title"><?= lang('list_results'); ?></h3> </div> <div class="box-body"> <div class="table-responsive"> <table id="CuData" class="table table-bordered table-hover table-striped"> <thead> <tr> <td colspan="4" class="p0"><input type="text" class="form-control b0" name="search_table" id="search_table" placeholder="<?= lang('type_hit_enter'); ?>" style="width:100%;"></td> </tr> <tr> <th style="max-width:30px;"><?= lang("id"); ?></th> <th style="width: 500px;"><?= lang("name"); ?></th> <th style="width: 500px;"><?= lang("phone"); ?></th> <th style="width: 500px;">Customer Balance Amount</th> <!--<th><?= lang("additional_phone_no"); ?></th> <th>DC History</th> <th>Total DC Count</th>--> <!--<th><?//= lang("address"); ?></th> <th><?//= lang("email_address"); ?></th>--> </tr> </thead> <tbody> <tr> <td colspan="4" class="dataTables_empty"><?= lang('loading_data_from_server') ?></td> </tr> </tbody> <tfoot> </tfoot> </table> </div> <div class="clearfix"></div> </div> </div> </div> </div> </section> <!-- Clone Details Starts Here --> <div class="modal" data-easein="flipYIn" id="customerCloneSales" tabindex="-1" role="dialog" aria-labelledby="cModalLabel" aria-hidden="true"> <div class="modal-dialog" style="opacity: 1;display: block;width: 60%;"> <div class="modal-content"> <div class="modal-header modal-primary"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button> <h4 class="modal-title" id="cModalLabel"> Customer Sales History List </h4> </div> <div class="modal-body"> <div id="c-alert" class="alert alert-danger" style="display:none;"></div> <div class="row"> <div class="col-xs-12"> <div id="clone_details"></div> </div> </div> <div class="row"> <div class="col-xs-6"></div> <div class="col-xs-6"></div> </div> </div> <div class="modal-footer" style="margin-top:0;"> <button type="button" class="btn btn-default pull-left" data-dismiss="modal"> <?=lang('close')?> </button> </div> </div> </div> </div> <!-- Clone Details Ends Here --> <script type="text/javascript"> $(function () { $("#clone").click(function () { var customer_cus_id=$('#spos_customer').val(); console.log('customer id:'+customer_cus_id); console.log('customerDetails inside Function Working:'); var customer_id=$('#spos_customer').val(); console.log('Customer Id:'+customer_id); $.ajax({ type: "get", url: base_url + "pos/saleHistoryByCustomers", data : {customer_id:customer_id}, dataType: "json", success: function(t) { console.log('response:'+t['customer_name']); console.log('response:'+t['customer_phone_no']); } }); $.ajax({ type: "get", url: '<?=site_url('pos/get_all_sale_items');?>', data : {customer_id:customer_id}, dataType: "text", success: function(t) { console.log('response:'+t['customer_name']); $("#customerCloneSales").modal("show"); $('#clone_details').append(t); }, error:function(err){ alert(err); } }); $('#clone_details').empty(); }); }); </script> <script type="text/javascript"> $(document).ready(function() { $(document).on('click', '.clone', function() { console.log('CustomerDetails Inside Function Working:'); /*alert(this.id); alert($(this).attr('id'));*/ var customer_id = $(this).attr('id'); console.log(customer_id); $.ajax({ type: "get", url: '<?=site_url('customers/get_all_sale_items');?>', data : {customer_id:customer_id}, dataType: "text", success: function(t) { $("#customerCloneSales").modal("show"); $('#clone_details').append(t); }, error:function(err){ alert(err); } }); $('#clone_details').empty(); }); }); </script>