script.blade.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. <script type="text/javascript">
  2. $('.buttonDetail').click(function(){
  3. var id = $(this).attr('data-id');
  4. $.ajax
  5. ({
  6. url: '{{URL::current()}}/' + id,
  7. type: 'get',
  8. success: function(result){
  9. console.log(result);
  10. $('#detailClientId').text(result.clnt_id);
  11. $('#detailClientName').text(result.clnt_name);
  12. $('#detailSidLong').text(result.sid_long);
  13. $('#detailSidLat').text(result.sid_lat);
  14. $('#detailCity').text(result.city);
  15. $('#detailSiteId').text(result.site_id);
  16. },
  17. error: function () {
  18. $('#detailClose').click();
  19. $.confirm({
  20. title: 'Something Wrong',
  21. content: 'Wait few Minutes',
  22. type: 'red',
  23. typeAnimated: true,
  24. icon: 'fas fa-exclamation-triangle',
  25. buttons: {
  26. close: function () {
  27. }
  28. }
  29. });
  30. }
  31. });
  32. });
  33. </script>