'; echo '
'; /*try { $items = ACL::getAclByNamespace('default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA')->buildQuery([ 'cols' => [ // TODO:? propertyName = [] 'ID', 'L_APPOITMENT_USER', 'default_db__x3A__BI_audit_ENERGA_PRACOWNICY:BI_audit_ENERGA_PRACOWNICY', 'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI:BI_audit_ENERGA_RUM_KONTRAHENCI', 'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row', 'default_db__x3A__BI_audit_KW_requested_person:BI_audit_KW_requested_person', ] ])->getItems([ 'limit' => 10 ]); DBG::nicePrint($items, '$items BiAudit'); UI::inlineJS(__FILE__ . '.view.js', [ 'URL_FETCH_TEST' => $this->getLink('fetchEnergaRumKontrahenciPowiazaniaAjax'), 'URL_FETCH_TEST_KRS' => $this->getLink('fetchTestKrsAjax'), 'URL_FETCH_TEST_CEIDG' => $this->getLink('fetchTestCeidgAjax'), 'URL_FETCH_PRACOWNICY' => $this->getLink('fetchPracownicyAjax'), 'DBG' => V::get('DBG', 0, $_GET), ]); throw new Exception("TODO..."); } catch (Exception $e) { DBG::log($e); UI::alert('danger', $e->getMessage()); }*/ UI::inlineJS(__FILE__ . '.view.js', [ 'URL_FETCH_TEST' => $this->getLink('fetchEnergaRumKontrahenciPowiazaniaAjax'), 'URL_FETCH_TEST_KRS' => $this->getLink('fetchTestKrsAjax'), 'URL_FETCH_TEST_CEIDG' => $this->getLink('fetchTestCeidgAjax'), 'URL_FETCH_PRACOWNICY' => $this->getLink('fetchPracownicyAjax'), 'URL_FETCH_KONTRAHENCI' => $this->getLink('fetchKontrahenciAjax'), 'DBG' => V::get('DBG', 0, $_GET), 'VIEW_KONTRAHENCI' => $this->htmlViewFormBiAudit([], 'KONTRAHENCI'), 'VIEW_PRACOWNICY' => $this->htmlViewFormBiAudit([], 'PRACOWNICY'), ]); echo ''; // #smad-wrapper UI::dol(); } /* public function fetchEnergaRumKontrahenciPowiazaniaAjaxAction() { Response::sendTryCatchJson(array($this, 'fetchEnergaRumKontrahenciPowiazaniaAjax')); // , $args = 'JSON_FROM_REQUEST_BODY'); } public function fetchEnergaRumKontrahenciPowiazaniaAjax($args) { $id = V::get('ID', 1, $_REQUEST, 'int'); $items = ACL::getAclByNamespace('default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA')->buildQuery([ 'cols' => [ // TODO:? propertyName = [] 'ID', 'A_ADM_COMPANY', 'L_APPOITMENT_USER', 'A_CLASSIFIED', 'A_STATUS', 'A_STATUS_INFO', 'BI_analiza_depth', 'BI_analiza_reloadCache', 'FILE_STATUS', 'FILE_STATUS_info', 'L_APPOITMENT_USER', 'default_db__x3A__BI_audit_ENERGA_PRACOWNICY:BI_audit_ENERGA_PRACOWNICY', 'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI:BI_audit_ENERGA_RUM_KONTRAHENCI', 'default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row', 'default_db__x3A__BI_audit_KW_requested_person:BI_audit_KW_requested_person', ], //'f_ID' => $id, ])->getItems([ 'limit' => 10 ]); // $items = [ // [ 'ID' => 1, 'L_APPOITMENT_INFO' => 'x', 'BI_analiza_depth' => 'a', 'FILE_STATUS' => 1, 'FILE_STATUS_info' => 'test1'], // [ 'ID' => 2, 'L_APPOITMENT_INFO' => 'y', 'BI_analiza_depth' => 'b', 'FILE_STATUS' => 0, 'FILE_STATUS_info' => 'test2'], // [ 'ID' => 3, 'L_APPOITMENT_INFO' => 'z', 'BI_analiza_depth' => 'c', 'FILE_STATUS' => 1, 'FILE_STATUS_info' => 'test3'], // ]; return [ 'type' => 'success', 'msg' => 'OK', '__req_args' => $_REQUEST, '__args' => $args, 'body' => [ 'items' => $items, 'view' => $this->showPowiazaniaEnergaRumKontrahenciPowiazania($items), ] ]; } public function showPowiazaniaEnergaRumKontrahenciPowiazania($items) { $view = ''; return $view; } */ public function fetchTestKrsAjaxAction() { Response::sendTryCatchJson(array($this, 'fetchTestKrsAjax')); // , $args = 'JSON_FROM_REQUEST_BODY'); } public function fetchTestKrsAjax($args) { $id = V::get('ID', 1, $_REQUEST, 'int'); $items = ACL::getAclByNamespace('default_db/BI_audit_KRS/BI_audit_KRS')->buildQuery([ 'cols' => [ // TODO:? propertyName = [] 'A_kod', 'A_kraj', 'A_miejscowosc', 'A_nrDomu', 'A_nrLokalu', 'A_poczta', 'A_ulica', 'ID', 'S_gmina', 'S_kraj', 'S_miejscowosc', 'S_powiat', 'S_wojewodztwo', 'dataDokumentu', 'default_db__x3A__BI_audit_KRS_company:BI_audit_KRS_company/ID', 'default_db__x3A__BI_audit_KRS_company:BI_audit_KRS_company/krs', 'default_db__x3A__BI_audit_KRS_company:BI_audit_KRS_company/nazwa', 'default_db__x3A__BI_audit_KRS_company:BI_audit_KRS_company/regon', 'default_db__x3A__BI_audit_KRS_person:BI_audit_KRS_person/ID', 'default_db__x3A__BI_audit_KRS_person:BI_audit_KRS_person/imiona', 'default_db__x3A__BI_audit_KRS_person:BI_audit_KRS_person/nazwisko', 'default_db__x3A__BI_audit_KRS_person:BI_audit_KRS_person/pesel', 'krs', 'nazwa', 'nip', 'regon', ], 'f_ID' => "{$id}", ])->getItems([ 'limit' => 10 ]); return [ 'type' => 'success', 'msg' => 'KRS', '__req_args' => $_REQUEST, '__args' => $args, 'body' => [ 'items' => $items, ] ]; } public function fetchTestCeidgAjaxAction() { Response::sendTryCatchJson(array($this, 'fetchTestCeidgAjax')); // , $args = 'JSON_FROM_REQUEST_BODY'); } public function fetchTestCeidgAjax($args) { $id = V::get('ID', 0, $_REQUEST, 'int'); $items = ACL::getAclByNamespace('default_db/BI_audit_CEIDG/BI_audit_CEIDG')->buildQuery([ 'cols' => [ // TODO:? propertyName = [] 'ID', 'budynek', 'firma', 'gmina', 'identyfikatorWpisu', 'imie', 'kodPocztowy', 'kraj', 'lokal', 'miejscowosc', 'nazwisko', 'nip', 'poczta', 'powiat', 'regon', 'ulica', 'default_db__x3A__BI_audit_CEIDG_pelnomocnicy:BI_audit_CEIDG_pelnomocnicy/ID', 'default_db__x3A__BI_audit_CEIDG_pelnomocnicy:BI_audit_CEIDG_pelnomocnicy/budynek', 'default_db__x3A__BI_audit_CEIDG_pelnomocnicy:BI_audit_CEIDG_pelnomocnicy/gmina', 'default_db__x3A__BI_audit_CEIDG_pelnomocnicy:BI_audit_CEIDG_pelnomocnicy/kodPocztowy', 'default_db__x3A__BI_audit_CEIDG_pelnomocnicy:BI_audit_CEIDG_pelnomocnicy/lokal', 'default_db__x3A__BI_audit_CEIDG_pelnomocnicy:BI_audit_CEIDG_pelnomocnicy/miejscowosc', 'default_db__x3A__BI_audit_CEIDG_pelnomocnicy:BI_audit_CEIDG_pelnomocnicy/nazwa', 'default_db__x3A__BI_audit_CEIDG_pelnomocnicy:BI_audit_CEIDG_pelnomocnicy/nip', 'default_db__x3A__BI_audit_CEIDG_pelnomocnicy:BI_audit_CEIDG_pelnomocnicy/poczta', 'default_db__x3A__BI_audit_CEIDG_pelnomocnicy:BI_audit_CEIDG_pelnomocnicy/powiat', 'default_db__x3A__BI_audit_CEIDG_pelnomocnicy:BI_audit_CEIDG_pelnomocnicy/ulica', 'default_db__x3A__BI_audit_CEIDG_pelnomocnicy:BI_audit_CEIDG_pelnomocnicy/wojewodztwo', 'default_db__x3A__BI_audit_CEIDG_powiazania:BI_audit_CEIDG_powiazania/ID', 'default_db__x3A__BI_audit_CEIDG_powiazania:BI_audit_CEIDG_powiazania/nip', 'default_db__x3A__BI_audit_CEIDG_powiazania:BI_audit_CEIDG_powiazania/regon', ], // 'f_ID' => $id, ])->getItems([ 'limit' => 10 ]); return [ 'type' => 'success', 'msg' => 'CEIDG', '__req_args' => $_REQUEST, '__args' => $args, 'body' => [ 'items' => $items, ] ]; } /** * KONTRAHENCI */ //TODO: NIE wiem czemu nie mogę pobrać infoamcji o kontrahentach public function fetchKontrahenciAjaxAction() { Response::sendTryCatchJson(array($this, 'fetchKontrahenciAjax')); } public function fetchKontrahenciAjax($args) { //$id = V::get('ID', 1, $_REQUEST, 'int'); $items = ACL::getAclByNamespace('default_db/BI_audit_ENERGA_RUM_KONTRAHENCI/BI_audit_ENERGA_RUM_KONTRAHENCI')->buildQuery([ 'cols' => [ // TODO:? propertyName = [] 'ID', 'Nazwa_grupy_kapitalowej', 'Pelna_nazwa_kontrahenta', 'NIP', 'KRS', 'REGON', 'Miejscowosc', 'Kod_pocztowy', 'Telefon' ], //'f_ID' => $id, ])->getItems([ 'limit' => 10 ]); return [ 'type' => 'success', 'msg' => 'showKontrahenci', '__req_args' => $_REQUEST, '__args' => $args, 'body' => [ 'items' => $items, 'view' => $this->htmlViewFormBiAudit($items, 'KONTRAHENCI') ] ]; } public function showListKontrahenci($items) { $view = ''; return $view; } /** * Pracownicy */ public function fetchPracownicyAjaxAction() { // sleep(2); Response::sendTryCatchJson(array($this, 'fetchPracownicyAjax')); } public function fetchPracownicyAjax($args) { $limitstart = V::get('limitstart', 0, $_REQUEST, 'int'); if ($limitstart < 0) $limitstart = 0; $search = V::get('search', '', $_REQUEST); $searchParams = []; if (!empty($search)) { $ogcSearch = "*{$search}*"; // wildCard="*" -> mysql '%' $searchParams['ogc:Filter'] = '