Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cesarockstar1985/859e51c46355a56eed7f14d787ee52c5 to your computer and use it in GitHub Desktop.
Save cesarockstar1985/859e51c46355a56eed7f14d787ee52c5 to your computer and use it in GitHub Desktop.
<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