1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/2.1.2/sweetalert.min.js"></script>
- <script type="text/javascript">
- $('.show_confirm').click(function(event) {
- var form = $(this).closest("form");
- var name = $(this).data("name");
- event.preventDefault();
- swal({
- title: `Are you sure you want to delete this record?`
- , text: "If you delete this, it will be gone forever."
- , icon: "warning"
- , buttons: true
- , dangerMode: true
- , })
- .then((willDelete) => {
- if (willDelete) {
- form.submit();
- }
- });
- });
- function myFunction() {
- document.getElementById("demo").innerHTML = "Hello World";
- }
- var myModal = document.getElementById('myModal')
- var myInput = document.getElementById('myInput')
- myModal.addEventListener('shown.bs.modal', function() {
- myInput.focus()
- })
- $('form input').on('change', function() {
- $(this).closest('form').submit();
- });
- </script>
- <script>
- $(function() {
- $('.toggle-class').change(function() {
- var etat = $(this).prop('checked') == true ? 1 : 0;
- var Id = $(this).data('id');
- $.ajax({
- type: "GET"
- , dataType: "json"
- , url: '/changeStatusPresentation'
- , data: {
- 'etat': etat
- , 'Id': Id
- }
- , success: function(data) {
- console.log(data.success)
- }
- });
- })
- })
- </script>
|