| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- console.log('test1... DBG:', DBG)
- if (!URL_FETCH_TEST) {
- throw "Brak zmiennej URL_FETCH_TEST"
- }
- // // Documentation: https://github.com/github/fetch
- // fetch(URL_FETCH_TEST, {
- // credentials: 'same-origin'
- // })
- // .then(function parseJSON(response) {
- // return response.json()
- // })
- // .then(function(data) {
- // //$( ".container" ).append( data.body.view );
- // console.log('request succeeded with JSON response', data)
- // }).catch(function(error) {
- // console.log('request failed', error)
- // })
- //
- // fetch(URL_FETCH_TEST_KRS, {
- // credentials: 'same-origin'
- // })
- // .then(function parseJSON(response) {
- // return response.json()
- // })
- // .then(function(data) {
- // console.log('request succeeded with JSON response', data)
- // }).catch(function(error) {
- // console.log('request failed', error)
- // })
- //
- // fetch(URL_FETCH_TEST_CEIDG, {
- // credentials: 'same-origin'
- // })
- // .then(function parseJSON(response) {
- // return response.json()
- // })
- // .then(function(data) {
- // console.log('request succeeded with JSON response', data)
- // }).catch(function(error) {
- // console.log('request failed', error)
- // })
- var valueUrl = global.location.hash;
- console.log('hash url', valueUrl);
- console.log('URL_FETCH_KONTRAHENCI', URL_FETCH_KONTRAHENCI);
- switch (valueUrl) {
- case '#KONTRAHENCI':
- console.log('kontrahent');
- $( ".container-bi_audit_raport" ).append( VIEW_KONTRAHENCI );
- urlFetchKontrahenci();
- break;
- case '#PRACOWNICY':
- $( ".container-bi_audit_raport" ).append( VIEW_PRACOWNICY );
- urlFetchPracownicy();
- break;
- default:
- $( ".container-bi_audit_raport" ).append( VIEW_PRACOWNICY );
- urlFetchPracownicy();
- break;
- }
- function urlFetchKontrahenci() {
- fetch(URL_FETCH_KONTRAHENCI, {
- credentials: 'same-origin'
- })
- .then(function parseJSON(response) {
- return response.json()
- })
- .then(function(data) {
- $( ".container-bi_audit_raport" ).append( data.body.view );
- console.log('request succeeded with JSON response', data)
- }).catch(function(e) {
- console.log('request failed', e)
- })
- }
- function urlFetchPracownicy() {
- fetch(URL_FETCH_PRACOWNICY, {
- credentials: 'same-origin'
- })
- .then(function parseJSON(response) {
- return response.json()
- })
- .then(function(data) {
- $( ".container-bi_audit_raport" ).append( data.body.view );
- console.log('request succeeded with JSON response', data)
- }).catch(function(error) {
- console.log('request failed', error)
- })
- }
- function checkAll() {
- $('#checkAll').change(function(){
- console.log('checkeddd');
- var checkboxes = $('form').find(':checkbox');
- if($(this).prop('checked')) {
- checkboxes.prop('checked', true);
- } else {
- checkboxes.prop('checked', false);
- }
- });
- }
- $(document).ready(function(){
- checkAll();
- });
- global.checkAll = checkAll;
|