Created
April 5, 2023 11:56
-
-
Save cesarockstar1985/859e51c46355a56eed7f14d787ee52c5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="view" style="overflow:scroll;"> | |
<div class="table-responsive" style="overflow-x: auto; max-width: 100%"> | |
<?php | |
echo $this->Form->create($followUp, [ | |
'id' => 'enableFollowUp', | |
'url' => [ | |
'plugin' => false, | |
'prefix' => 'Admin', | |
'controller' => 'Bonds', | |
'action' => 'enableFollowUp', | |
] | |
]); | |
echo $this->Form->submit(__('Enable Follow Up')); | |
echo $this->Form->hidden('bond_id', ['value' => $bond->id]); | |
echo $this->Form->end(); | |
?> | |
</div> | |
</div> | |
<?php $this->end() ?> | |
<?php $this->append('script'); ?> | |
<script type="text/javascript"> | |
$(document).ready(function($) { | |
$('#enableFollowUp').on('submit', function(e) { | |
e.preventDefault(); | |
var form = $(this); | |
var loading = new KTDialog({ | |
'type': 'loader', | |
'placement': 'top center', | |
'message': 'Loading ...' | |
}); | |
$.ajax({ | |
url: "<?= $url ?>", | |
type: 'post', | |
data: $(this).serialize(), | |
dataType: "json", | |
beforeSend: function(xhr) { | |
xhr.setRequestHeader('X-CSRF-Token', "<?= $this->getRequest()->getParam('_csrfToken') ?>"); | |
}, | |
complete: function(response) { | |
... | |
}); | |
} | |
}); | |
}); | |
}); | |
</script> | |
<?php $this->end(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment