| .. | |||||
| contact-datatable.php | |||||
| contact.php | |||||
| identity-datatable.php | |||||
| identity.php |
| 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/web/ |
Upload File : |
<script type="text/javascript">
let tableContact;
$(document).ready(function(){
tableContact = $('#tableContact').DataTable({
processing: true,
serverSide: true,
order: [],
ajax: {
'url': "<?= base_url('back/contact/ajax_list') ?>",
'type': "POST"
},
columnDefs: [
{
'targets': [0, 1, 2, 3],
'orderable': false,
}
],
});
});
// Reload Table
function reload_table(){
tableContact.ajax.reload(null, false);
}
//Edit
function edit_contact(id){
$('#form')[0].reset();
$.ajax({
url : '<?= base_url('back/contact/get_data/') ?>',
data: {id: id},
type: 'post',
dataType: 'json',
success: function(data){
$('[name="id"]').val(data.id);
$('[name="contact_name"]').val(data.contact_name);
$('[name="description"]').val(data.description);
$('.modal-title').text('Edit Kontak Website');
$('#modalContact').modal('show');
},
});
}
// Save Button Modal
function save(){
$('#btn_save').text('Saving...');
$('#btn_save').attr('disabled', true);
$.ajax({
type: 'post',
dataType: 'json',
url: '<?= base_url('back/contact/update') ?>',
data: $('#form').serialize(),
success: function(data){
if(data.status){
$('#modalContact').modal('hide');
Swal.fire({
icon: 'success',
title: 'Success',
showConfirmButton: true
});
tableContact.draw();
}
$('#btn_save').text('Save');
$('#btn_save').attr('disabled', false);
},
error: function(){
Swal.fire({
icon: 'error',
title: 'Oops...',
text: 'Terjadi Suatu Kesalahan!',
showConfirmButton: true
});
$('#modalContact').modal('hide');
$('#btn_save').text('Save');
$('#btn_save').attr('disabled', false);
}
});
}
</script>| .. | |||||
| contact-datatable.php | |||||
| contact.php | |||||
| identity-datatable.php | |||||
| identity.php |