BiAuditRaport.php.view.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. console.log('test1... DBG:', DBG)
  2. if (!URL_FETCH_TEST) {
  3. throw "Brak zmiennej URL_FETCH_TEST"
  4. }
  5. // Documentation: https://github.com/github/fetch
  6. fetch(URL_FETCH_TEST, {
  7. credentials: 'same-origin'
  8. })
  9. .then(function parseJSON(response) {
  10. return response.json()
  11. })
  12. .then(function(data) {
  13. //$( ".container" ).append( data.body.view );
  14. console.log('request succeeded with JSON response', data)
  15. }).catch(function(error) {
  16. console.log('request failed', error)
  17. })
  18. fetch(URL_FETCH_TEST_KRS, {
  19. credentials: 'same-origin'
  20. })
  21. .then(function parseJSON(response) {
  22. return response.json()
  23. })
  24. .then(function(data) {
  25. console.log('request succeeded with JSON response', data)
  26. }).catch(function(error) {
  27. console.log('request failed', error)
  28. })
  29. fetch(URL_FETCH_TEST_CEIDG, {
  30. credentials: 'same-origin'
  31. })
  32. .then(function parseJSON(response) {
  33. return response.json()
  34. })
  35. .then(function(data) {
  36. console.log('request succeeded with JSON response', data)
  37. }).catch(function(error) {
  38. console.log('request failed', error)
  39. })
  40. fetch(URL_FETCH_PRACOWNICY, {
  41. credentials: 'same-origin'
  42. })
  43. .then(function parseJSON(response) {
  44. return response.json()
  45. })
  46. .then(function(data) {
  47. $( ".container-bi_audit_raport" ).append( data.body.view );
  48. console.log('request succeeded with JSON response', data)
  49. }).catch(function(error) {
  50. console.log('request failed', error)
  51. })
  52. function checkAll() {
  53. $('#checkAll').change(function(){
  54. console.log('checkeddd');
  55. var checkboxes = $('form').find(':checkbox');
  56. if($(this).prop('checked')) {
  57. checkboxes.prop('checked', true);
  58. } else {
  59. checkboxes.prop('checked', false);
  60. }
  61. });
  62. }
  63. $(document).ready(function(){
  64. checkAll();
  65. });
  66. global.checkAll = checkAll;