%PDF- %PDF-
Direktori : /home/ugotscom/public_html/dg/application/modules/bemp/views/ |
Current File : /home/ugotscom/public_html/dg/application/modules/bemp/views/emp_view.php |
<link href="<?php echo base_url().'assets/css/bootstrap.css'?>" rel="stylesheet" type="text/css"/> <link href="<?php echo base_url().'assets/css/jquery.datatables.min.css'?>" rel="stylesheet" type="text/css"/> <link href="<?php echo base_url().'assets/css/dataTables.bootstrap.css'?>" rel="stylesheet" type="text/css"/> <script src="<?php echo base_url().'assets/js/jquery-3.2.1.js'?>"></script> <script src="<?php echo base_url().'assets/js/bootstrap.js'?>"></script> <script src="<?php echo base_url().'assets/js/jquery.datatables.min.js'?>"></script> <script src="<?php echo base_url().'assets/js/dataTables.bootstrap.js'?>"></script> <div class="content-wrapper"> <section class="content-header"> <h1>Dashboard</h1> </section> <section class="content"> <div class="row"> <div class="col-md-12"> <!-- BEGIN EXAMPLE TABLE PORTLET--> <button class="btn btn-success pull-right" onclick="window.location.href = '<?php echo site_url('emp/add');?> ';">Add New</button> <table class="table table-striped" id="mytable"> <thead> <tr> <th>Lead Id</th> <th>Lead Name</th> <th>Enquiry Source</th> <th>Mobile No</th> <th>Passport No</th> <th>added by</th> <th></th> <th></th> </tr> </thead> </table> <!-- Modal Add Product--> <!-- END EXAMPLE TABLE PORTLET--> </div> </div> </section> </div> <script> $(document).ready(function(){ // Setup datatables $.fn.dataTableExt.oApi.fnPagingInfo = function(oSettings) { return { "iStart": oSettings._iDisplayStart, "iEnd": oSettings.fnDisplayEnd(), "iLength": oSettings._iDisplayLength, "iTotal": oSettings.fnRecordsTotal(), "iFilteredTotal": oSettings.fnRecordsDisplay(), "iPage": Math.ceil(oSettings._iDisplayStart / oSettings._iDisplayLength), "iTotalPages": Math.ceil(oSettings.fnRecordsDisplay() / oSettings._iDisplayLength) }; }; var table = $("#mytable").dataTable({ initComplete: function() { var api = this.api(); $('#mytable_filter input') .off('.DT') .on('input.DT', function() { api.search(this.value).draw(); }); }, oLanguage: { sProcessing: "loading..." }, processing: true, serverSide: true, ajax: {"url": "<?php echo base_url().'index.php/bemp/get_product_json'?>", "type": "POST"}, columns: [ {"data": "lead_id"}, {"data": "customer_name"}, //render number format for price {"data": "enquiry_source"}, {"data": "mobile_no"}, {"data": "passport_no"}, {"data": "added_by"}, {"render": function (data, type, full, meta) { return '<a class="btn btn-info" href="<?php echo base_url();?>emp/edit/' + full.lead_id + '">Edit</a>'; } }, {"render": function (data, type, full, meta) { return '<a class="btn btn-info" href="<?php echo base_url();?>emp/view/' + full.lead_id + '">View</a>'; } } ], order: [[0, 'desc']], rowCallback: function(row, data, iDisplayIndex) { var info = this.fnPagingInfo(); var page = info.iPage; var length = info.iLength; $('td:eq(0)', row).html(); } }); // end setup datatables // get Edit Records $('#mytable').on('click','.edit_record',function(){ var code=$(this).data('code'); var name=$(this).data('name'); var price=$(this).data('price'); var category=$(this).data('category'); $('#ModalUpdate').modal('show'); $('[name="user_id"]').val(code); $('[name="product_name"]').val(name); $('[name="price"]').val(price); $('[name="category"]').val(category); }); // End Edit Records // get delete Records $('#mytable').on('click','.delete_record',function(){ var code=$(this).data('code'); $('#ModalDelete').modal('show'); $('[name="user_id"]').val(code); }); // End delete Records }); </script>