Guest User

Dokter

a guest
Jan 7th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.09 KB | None | 0 0
  1. <div class="content-wrapper">
  2. <section class="content">
  3. <div class="row">
  4. <div class="col-xs-12">
  5. <div class="box box-warning box-solid">
  6.  
  7. <div class="box-header">
  8. <h3 class="box-title">KELOLA DATA DOKTER</h3>
  9. </div>
  10.  
  11. <div class="box-body">
  12. <div style="padding-bottom: 10px;"'>
  13. <?php echo anchor(site_url('dokter/create'), '<i class="fa fa-wpforms" aria-hidden="true"></i> Tambah Data', 'class="btn btn-danger btn-sm"'); ?></div>
  14. <table class="table table-bordered table-striped" id="mytable">
  15. <thead>
  16. <tr>
  17. <th width="30px">No</th>
  18. <th>Nama Dokter</th>
  19. <th>Jenis Kelamin</th>
  20. <th>Id Status Menikah</th>
  21. <th>Id Spesialis</th>
  22. <th>Golongan Darah</th>
  23. <th width="200px">Action</th>
  24. </tr>
  25. </thead>
  26. <tfoot>
  27. <tr>
  28. <td></td>
  29. <td></td>
  30. <td></td>
  31. <td></td>
  32. <td></td>
  33. <td></td>
  34. <td></td>
  35. </tr>
  36. </tfoot>
  37.  
  38. </table>
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. </section>
  44. </div>
  45. <script src="<?php echo base_url('assets/js/jquery-1.11.2.min.js') ?>"></script>
  46. <script src="<?php echo base_url('assets/datatables/jquery.dataTables.js') ?>"></script>
  47. <script src="<?php echo base_url('assets/datatables/dataTables.bootstrap.js') ?>"></script>
  48. <script type="text/javascript">
  49. $(document).ready(function() {
  50. $.fn.dataTableExt.oApi.fnPagingInfo = function(oSettings)
  51. {
  52. return {
  53. "iStart": oSettings._iDisplayStart,
  54. "iEnd": oSettings.fnDisplayEnd(),
  55. "iLength": oSettings._iDisplayLength,
  56. "iTotal": oSettings.fnRecordsTotal(),
  57. "iFilteredTotal": oSettings.fnRecordsDisplay(),
  58. "iPage": Math.ceil(oSettings._iDisplayStart / oSettings._iDisplayLength),
  59. "iTotalPages": Math.ceil(oSettings.fnRecordsDisplay() / oSettings._iDisplayLength)
  60. };
  61. };
  62.  
  63. var t = $("#mytable").dataTable({
  64. initComplete: function() {
  65. var api = this.api();
  66. /* $('#mytable_filter input')
  67. .off('.DT')
  68. .on('keyup.DT', function(e) {
  69. if (e.keyCode === 13) {
  70. api.search(this.value).draw();
  71. }
  72. }); */
  73.  
  74.  
  75. this.api().columns().every( function () {
  76. var column = this;
  77. var select = $('<select><option value=""></option></select>')
  78. .appendTo( $(column.footer()).empty() )
  79. .on( 'change', function () {
  80. var val = $.fn.dataTable.util.escapeRegex(
  81. $(this).val()
  82. );
  83.  
  84. column
  85. .search( val ? '^'+val+'$' : '', true, false )
  86. .draw();
  87. } );
  88.  
  89. column.data().unique().sort().each( function ( d, j ) {
  90. select.append( '<option value="'+d+'">'+d+'</option>' )
  91. } );
  92. } );
  93.  
  94.  
  95. },
  96. oLanguage: {
  97. sProcessing: "loading..."
  98. },
  99. processing: true,
  100. serverSide: true,
  101. ajax: {"url": "dokter/json", "type": "POST"},
  102. columns: [
  103. {
  104. "data": "kode_dokter",
  105. "orderable": false
  106. },{"data": "nama_dokter"},{"data": "jenis_kelamin"},{"data": "id_status_menikah"},{"data": "id_spesialis"},{"data": "golongan_darah"},
  107. {
  108. "data" : "action",
  109. "orderable": false,
  110. "className" : "text-center"
  111. }
  112. ],
  113. order: [[0, 'desc']],
  114. rowCallback: function(row, data, iDisplayIndex) {
  115. var info = this.fnPagingInfo();
  116. var page = info.iPage;
  117. var length = info.iLength;
  118. var index = page * length + (iDisplayIndex + 1);
  119. $('td:eq(0)', row).html(index);
  120. }
  121. });
  122. });
  123.  
  124. </script>
Advertisement
Add Comment
Please, Sign In to add comment