commit 652863d54f3be70e9e700a9bedd7e16753855f56 Author: Jacek Pyziak Date: Wed Apr 30 23:59:49 2025 +0200 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..e823803 --- /dev/null +++ b/.htaccess @@ -0,0 +1,25 @@ +RewriteEngine On +RewriteBase / +Options +FollowSymlinks +Options -Indexes + +RewriteCond %{HTTP_HOST} ^bilety\.brzezovka\.pl$ +RewriteRule ^$ /tickets/main_view/ [L,R=301] + +RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] +RewriteRule ^(.*)$ https://%1/$1 [R=301,L] +RewriteCond %{SERVER_PORT} !=443 +RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=permanent] + +RewriteCond %{REQUEST_URI} !^(.*)/libraries/(.*) [NC] +RewriteCond %{REQUEST_URI} !^(.*)/layout/(.*) [NC] +RewriteCond %{REQUEST_URI} !^(.*)/resources/(.*) [NC] +RewriteCond %{REQUEST_URI} !^(.*)/images/(.*) [NC] +RewriteCond %{REQUEST_URI} !^(.*)/orders/(.*) [NC] +RewriteCond %{REQUEST_URI} !^(.*)/posters_images/(.*) [NC] +RewriteCond %{REQUEST_URI} !^(.*)/domain_tester_images/(.*) [NC] +RewriteRule ^([^/]*)/([^/]*)/(.*)$ index.php?module=$1&action=$2&$3 [L] + +#RewriteRule $ index.php?module=tickets&action=main_view [L] +RewriteRule ^logowanie$ index.php?module=users&action=login_form [L] +RewriteRule ^finances/tags.json$ index.php?module=finances&action=tags_json [L] \ No newline at end of file diff --git a/.vscode/ftp-kr.json b/.vscode/ftp-kr.json new file mode 100644 index 0000000..40f92c7 --- /dev/null +++ b/.vscode/ftp-kr.json @@ -0,0 +1,17 @@ +{ + "host": "brzezovka.pl", + "username": "jacek@brzezovka.pl", + "password": "nKc36zNdv3fhh5qSRJu5", + "remotePath": "/public_html/tickets/", + "protocol": "ftp", + "port": 0, + "fileNameEncoding": "utf8", + "autoUpload": true, + "autoDelete": false, + "autoDownload": false, + "ignoreRemoteModification": true, + "ignore": [ + ".git", + "/.vscode" + ] +} \ No newline at end of file diff --git a/.vscode/ftp-kr.sync.cache.json b/.vscode/ftp-kr.sync.cache.json new file mode 100644 index 0000000..2e396ee --- /dev/null +++ b/.vscode/ftp-kr.sync.cache.json @@ -0,0 +1,94 @@ +{ + "ftp://brzezovka.pl@www@bilety.brzezovka.pl": { + "public_html": { + ".gitignore": { + "type": "-", + "size": 0, + "lmtime": 0, + "modified": false + }, + ".htaccess": { + "type": "-", + "size": 1031, + "lmtime": 0, + "modified": false + }, + "ajax.php": { + "type": "-", + "size": 1208, + "lmtime": 0, + "modified": false + }, + "api.php": { + "type": "-", + "size": 10554, + "lmtime": 0, + "modified": false + }, + "autoload": {}, + "config.php": { + "type": "-", + "size": 4002, + "lmtime": 0, + "modified": true + }, + "cron.php": { + "type": "-", + "size": 2636, + "lmtime": 0, + "modified": false + }, + "custom.php": { + "type": "-", + "size": 2433, + "lmtime": 0, + "modified": false + }, + "index.php": { + "type": "-", + "size": 1624, + "lmtime": 0, + "modified": false + }, + "layout": {}, + "libraries": {}, + "orders": {}, + "templates": { + "site": { + "layout-cron.php": { + "type": "-", + "size": 2512, + "lmtime": 0, + "modified": false + }, + "layout-logged.php": { + "type": "-", + "size": 5833, + "lmtime": 1713172556038, + "modified": false + }, + "layout-unlogged.php": { + "type": "-", + "size": 4356, + "lmtime": 1713172558543, + "modified": false + }, + "regulamin.php": { + "type": "-", + "size": 9529, + "lmtime": 0, + "modified": false + } + } + }, + "test.txt": { + "type": "-", + "size": 348, + "lmtime": 0, + "modified": false + }, + "upload": {} + } + }, + "$version": 1 +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..18bd1f2 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,14 @@ +{ + "liveSassCompile.settings.formats": [ + { + "format": "compressed", + "extensionName": ".css", + "savePath": "~/../style-css/", + "savePathSegmentKeys": null, + "savePathReplaceSegmentsWith": null + } + ], + "liveSassCompile.settings.generateMap": true, + "liveSassCompile.settings.autoprefix": "defaults", + "liveSassCompile.settings.watchOnLaunch": true +} diff --git a/.vscode/sftp.json b/.vscode/sftp.json new file mode 100644 index 0000000..6993e66 --- /dev/null +++ b/.vscode/sftp.json @@ -0,0 +1,12 @@ +{ + "name": "brzezovka.pl", + "host": "brzezovka.pl", + "protocol": "ftp", + "port": 21, + "username": "jacek@brzezovka.pl", + "password": "nKc36zNdv3fhh5qSRJu5", + "remotePath": "/public_html/tickets/", + "uploadOnSave": false, + "useTempFile": false, + "openSsh": false +} diff --git a/ajax.php b/ajax.php new file mode 100644 index 0000000..12087bf --- /dev/null +++ b/ajax.php @@ -0,0 +1,45 @@ + 'mysql', + 'database_name' => $database['name'], + 'server' => $database['host'], + 'username' => $database['user'], + 'password' => $database['password'], + 'charset' => 'utf8' + ] ); + +$user = \S::get_session( 'user' ); +?> \ No newline at end of file diff --git a/api.php b/api.php new file mode 100644 index 0000000..9598068 --- /dev/null +++ b/api.php @@ -0,0 +1,288 @@ + 'mysql', + 'database_name' => $database['name'], + 'server' => $database['host'], + 'username' => $database['user'], + 'password' => $database['password'], + 'charset' => 'utf8' + ] ); + +\R::setup( 'mysql:host=' . $database['host'] . ';dbname=' . $database['name'], $database['user'], $database['password'] ); +\R::ext( 'xdispense', function( $type ) +{ + return R::getRedBean() -> dispense( $type ); +} ); + +/* usuwanie lock_id z domain_tester */ +\R::exec( 'UPDATE domain_tester SET lock_id = null, lock_date = null WHERE lock_id IS NOT NULL AND DATE_ADD( lock_date, INTERVAL 5 MINUTE ) <= \'' . date( 'Y-m-d H:i:s' ) . '\'' ); +$mdb -> query( 'UPDATE domain_tester SET url_status_date = NULL WHERE url_status_date <= \'' . date( 'Y-m-d H:i:s', strtotime( '-3 days', strtotime( date( 'Y-m-d H:i:s' ) ) ) ) . '\'' ); + + +/* zapisywanie domen do rejestracji */ +if ( \S::get( 'action' ) == 'domain_register_save' ) +{ + $result = explode( '|', \S::get( 'result' ) ); + + $domain = \R::load( 'domain_tester', \S::get( 'domain_id' ) ); + + if ( \S::get( 'result' ) == 'free' ) + { + $domain -> free_to_register = 1; + $domain -> ostatnia_modyfikacja = date( 'Y-m-d' ); + $domain -> koniec_okres_rozliczeniowego = date( 'Y-m-d' ); + $domain -> register_date = date( 'Y-m-d' ); + } + else + { + $domain -> ostatnia_modyfikacja = $result[3]; + $domain -> koniec_okres_rozliczeniowego = $result[5]; + $domain -> register_date = $result[1]; + } + \R::store( $domain ); + + echo json_encode( ['result' => 'ok'] ); + exit; +} + +/* sprawdzanie domen do rejestracji */ +if ( \S::get( 'action' ) == 'domain_register_check' ) +{ + $domain = \R::findOne( 'domain_tester', 'majestic_status = 1 AND cf >= 10 AND tf >= 10 AND url_status = 0 AND register_date IS NULL ORDER BY date_add ASC' ); + if ( $domain ) + { + $result['id'] = $domain -> id; + $result['url'] = $domain -> url; + $result['domains_left'] = \R::count( 'domain_tester', 'majestic_status = 1 AND cf >= 10 AND tf >= 10 AND url_status = 0 AND register_date IS NULL ' ); + $result['result'] = 'ok'; + + echo json_encode( $result ); + } + else + echo json_encode( ['result' => 'bad'] ); +} + +/* zapisywanie parametrów majestic */ +if ( \S::get( 'action' ) == 'domain_majestic_save' ) +{ + $results = json_decode( \S::get( 'result' ), true ); + + $domain = \R::load( 'domain_tester', \S::get( 'domain_id' ) ); + $domain -> feb = $results['ExtBackLinks']; + $domain -> cf = $results['CitationFlow']; + $domain -> tf = $results['TrustFlow']; + $domain -> rd = $results['RefDomains']; + $domain -> majestic_status = 1; + \R::store( $domain ); + + echo json_encode( ['result' => 'ok'] ); +} + +/* pobieranie parametrów majetic */ +if ( \S::get( 'action' ) == 'domain_majestic_check' ) +{ + $domain = \R::findOne( 'domain_tester', 'opr IS NOT NULL AND opr >= 3 AND majestic_status = 0 AND url_status = 0 AND url_status_date IS NOT NULL ORDER BY date_add ASC' ); + if ( $domain ) + { + $result['id'] = $domain -> id; + $result['url'] = $domain -> url; + $result['domains_left'] = \R::count( 'domain_tester', 'opr IS NOT NULL AND opr >= 3 AND majestic_status = 0 AND url_status = 0 AND url_status_date IS NOT NULL' ); + $result['result'] = 'ok'; + + echo json_encode( $result ); + } + else + echo json_encode( ['result' => 'bad'] ); +} + +if ( \S::get( 'action' ) == 'semstorm_traffic_domain_tester_save' ) +{ + $results = json_decode( \S::get( 'result' ), true ); + + foreach ( $results['results'][\S::get( 'url' )] as $key => $val ) + { + if ( $key <= 3 ) + $top3 += $val; + + if ( $key > 3 and $key <= 10 ) + $top10 += $val; + + if ( $key > 10 ) + $top50 += $val; + } + + $domain = \R::load( 'domain_tester', \S::get( 'domain_id' ) ); + $domain -> semstorm_status = 1; + $domain -> sem_traffic = $results['results'][\S::get( 'url' )]['traffic']; + $domain -> semstorm_date = date( 'Y-m-d H:i:s' ); + \R::store( $domain ); + + echo json_encode( ['result' => 'ok'] ); + exit; +} + +if ( \S::get( 'action' ) == 'domain_test_url_check' ) +{ + $pdo = R::getPDO(); + + $lock_id = md5( time() . rand( 0, 9999999999 ) ); + + \R::exec( 'UPDATE ' + . 'domain_tester SET lock_id = ' . $pdo -> quote( $lock_id ) . ', lock_date = ' . $pdo -> quote( date( 'Y-m-d H:i:s' ) ) . ' ' + . 'WHERE ' + . 'lock_id IS NULL ' + . 'AND ' + . '( ' + . 'url_status IS NULL ' + . 'OR ' + . '( ' + . 'url_status = 0 ' + . 'AND ' + . '( url_status_date IS NULL OR url_status_date <= ' . $pdo -> quote( date( 'Y-m-d H:i:s', strtotime( '-3 days', strtotime( date( 'Y-m-d H:i:s' ) ) ) ) ) . ' ) ' + . ') ' + . ') ' + . 'ORDER BY date_add DESC LIMIT 1' + ); + + $domain = \R::findOne( 'domain_tester', 'lock_id = ?', [$lock_id] ); + if ( $domain ) + { + $result['lock_id'] = $lock_id; + $result['id'] = $domain -> id; + $result['url'] = $domain -> url; + $result['domains_left'] = \R::count( 'domain_tester', 'url_status IS NULL OR ( url_status = 0 AND ( url_status_date IS NULL OR url_status_date <= ' . $pdo -> quote( date( 'Y-m-d H:i:s', strtotime( '-3 days', strtotime( date( 'Y-m-d H:i:s' ) ) ) ) ) . ' ) )' ); + $result['result'] = 'ok'; + + echo json_encode( $result ); + } + else + echo json_encode( ['result' => 'bad'] ); + exit; +} + +if ( \S::get( 'action' ) == 'domain_test_url_save' ) +{ + $domain = \R::load( 'domain_tester', \S::get( 'domain_id' ) ); + $domain -> url_status = \S::get( 'result' ); + $domain -> url_status_date = date( 'Y-m-d H:i:s' ); + $domain -> lock_id = null; + $domain -> lock_date = null; + \R::store( $domain ); + + echo json_encode( ['result' => 'ok'] ); + exit; +} + +if ( \S::get( 'action' ) == 'ceidg_firm_save' ) +{ + $ceidg = \R::findOne( 'ceidg', 'hash = ?', [\S::get( 'hash' )] ); + if ( !$ceidg ) + { + $ceidg = \R::xdispense( 'ceidg' ); + $ceidg -> hash = \S::get( 'hash' ); + } + + $ceidg -> imie_nazwisko = \S::get( 'dp_imie' ) . ' ' . \S::get( 'dp_nazwisko' ); + $ceidg -> nip = \S::get( 'dp_nip' ); + $ceidg -> regon = \S::get( 'dp_regon' ); + $ceidg -> firma = \S::get( 'dp_firma' ); + $ceidg -> email = strtolower( \S::get( 'dk_email' ) ); + $ceidg -> www = \S::get( 'dk_www' ); + $ceidg -> telefon = \S::get( 'dk_telefon' ); + $ceidg -> faks = \S::get( 'dk_faks' ); + + $ceidg -> ad1_terc = \S::get( 'da_ad1_terc' ); + $ceidg -> ad1_simc = \S::get( 'da_ad1_simc' ); + $ceidg -> ad1_ulic = \S::get( 'da_ad1_ulic' ); + + $ceidg -> ad1_miejscowosc = \S::get( 'da_ad1_miejscowosc' ); + $ceidg -> ad1_ulica = \S::get( 'da_ad1_ulica' ); + $ceidg -> ad1_budynek = \S::get( 'da_ad1_budynek' ); + $ceidg -> ad1_lokal = \S::get( 'da_ad1_lokal' ); + $ceidg -> ad1_kod_pocztowy = \S::get( 'da_ad1_kod_pocztowy' ); + $ceidg -> ad1_poczta = \S::get( 'da_ad1_poczta' ); + $ceidg -> ad1_gmina = \S::get( 'da_ad1_gmina' ); + $ceidg -> ad1_powiat = \S::get( 'da_ad1_powiat' ); + $ceidg -> ad1_wojewodztwo = mb_strtolower( \S::get( 'da_ad1_wojewodztwo' ), 'UTF-8' ); + + $ceidg -> ad2_terc = \S::get( 'da_ad2_terc' ); + $ceidg -> ad2_simc = \S::get( 'da_ad2_simc' ); + $ceidg -> ad2_ulic = \S::get( 'da_ad2_ulic' ); + + $ceidg -> ad2_miejscowosc = \S::get( 'da_ad2_miejscowosc' ); + $ceidg -> ad2_ulica = \S::get( 'da_ad2_ulica' ); + $ceidg -> ad2_budynek = \S::get( 'da_ad2_budynek' ); + $ceidg -> ad2_lokal = \S::get( 'da_ad2_lokal' ); + $ceidg -> ad2_kod_pocztowy = \S::get( 'da_ad2_kod_pocztowy' ); + $ceidg -> ad2_poczta = \S::get( 'da_ad2_poczta' ); + $ceidg -> ad2_gmina = \S::get( 'da_ad2_gmina' ); + $ceidg -> ad2_powiat = \S::get( 'da_ad2_powiat' ); + $ceidg -> ad2_wojewodztwo = mb_strtolower( \S::get( 'da_ad2_wojewodztwo' ), 'UTF-8' ); + + $ceidg -> obywatelstwo = \S::get( 'da_obywatelstwo' ); + + $ceidg -> rozpoczecie_dzialalnosci = \S::get( 'dd_rozpoczecie_dzialalnosci' ); + $ceidg -> zawieszenie_dzialalnosci = \S::get( 'dd_zawieszenie_dzialalnosci' ) ? \S::get( 'dd_zawieszenie_dzialalnosci' ) : null; + $ceidg -> wznowienie_dzialalnosci = \S::get( 'dd_wznowienie_dzialalnosci' ) ? \S::get( 'dd_wznowienie_dzialalnosci' ) : null; + $ceidg -> zaprzestanie_dzialalnosci = \S::get( 'dd_zaprzestanie_dzialalnosci' ) ? \S::get( 'dd_zaprzestanie_dzialalnosci' ) : null; + $ceidg -> data_wykreslenia = \S::get( 'dd_wykreslenie_dzialalnosci' ) ? \S::get( 'dd_wykreslenie_dzialalnosci' ) : null; + $ceidg -> wspolnosc_majatkowa = \S::get( 'dd_wspolnosc_majatkowa' ); + $ceidg -> status = mb_strtolower( \S::get( 'dd_status' ), 'UTF-8' ); + $ceidg -> pkd = \S::get( 'dd_pkd' ); + + $ceidg -> spolki_cywilne = \S::get( 'spolki_cywilne' ); + $ceidg -> zakazy = \S::get( 'zakazy' ); + $ceidg -> postepowanie_naprawcze = \S::get( 'postepowanie_naprawcze' ); + $ceidg -> pelnomocnicy = \S::get( 'pelnomocnicy' ); + + \R::store( $ceidg ); + + echo 'ok'; + exit; +} + +/* ceidg generowanie excela i wysyłanie go mailem */ +if ( \S::get( 'action' ) == 'firm_list_for_email' ) +{ + $response = \Cron::ceidg_send_excel(); + if ( $response['status'] == 'ok' ) + echo 'ok'; + else + echo 'bad'; + exit; +} + +// if ( \S::get( 'action' ) == 'nowe' ) +// { +// $results = $mdb -> select( 'ceidg', '*', [ 'AND' => [ 'status' => 'Aktywny', 'OR' => [ 'pkd[~]' => '6831', 'pkd[~]' => '6820' ] ], 'LIMIT' => [ 200001, 100000 ] ] ); + +// $fp = fopen( 'ceidg.csv', 'w'); +// fputs( $fp, $bom =( chr(0xEF) . chr(0xBB) . chr(0xBF) ) ); +// foreach ( $results as $row ) +// fputcsv( $fp, $row, ';' ); + +// fclose( $fp ); +// } \ No newline at end of file diff --git a/autoload/.htaccess b/autoload/.htaccess new file mode 100644 index 0000000..7189fc0 --- /dev/null +++ b/autoload/.htaccess @@ -0,0 +1,9 @@ + + +RewriteEngine On +RewriteBase / +RewriteRule ^index\.php$ - [L] +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule . /index.php [L] + \ No newline at end of file diff --git a/autoload/class.Cron.php b/autoload/class.Cron.php new file mode 100644 index 0000000..181c0e4 --- /dev/null +++ b/autoload/class.Cron.php @@ -0,0 +1,536 @@ + select( 'ceidg', '*', [ 'AND' => [ + 'date_add[>=]' => date( 'Y-m-d', strtotime( '-7 days', time() ) ), + 'date_add[<]' => date( 'Y-m-d' ), + 'status' => 'Aktywny', + 'telefon[!]' => '' + ] + ], [ + 'ORDERY' => [ 'date_add' => 'ASC' ] + ] ); + + $title = "CEIDG"; + $xls = new \Excel($title); + $xls -> home(); + $xls -> label( 'Data dodania' ); + $xls -> right(); + $xls -> label( \S::no_pl_excel( 'Data rozpoczęcia działalności' ) ); + $xls -> right(); + $xls -> label( 'Firma' ); + $xls -> right(); + $xls -> label( \S::no_pl_excel( 'Imię i nazwisko' ) ); + $xls -> right(); + $xls -> label( 'NIP' ); + $xls -> right(); + $xls -> label( 'Regon' ); + $xls -> right(); + $xls -> label( 'Telefon' ); + $xls -> right(); + $xls -> label( 'Email' ); + $xls -> right(); + $xls -> label( 'www' ); + $xls -> right(); + $xls -> label( \S::no_pl_excel( 'Województwo' ) ); + $xls -> right(); + $xls -> label( 'kod pocztowy' ); + $xls -> right(); + $xls -> label( \S::no_pl_excel( 'Miejscowość' ) ); + $xls -> right(); + $xls -> label( 'Ulica' ); + $xls -> right(); + $xls -> label( \S::no_pl_excel( 'Województwo' ) . ' - kor.' ); + $xls -> right(); + $xls -> label( 'kod pocztowy - kor.' ); + $xls -> right(); + $xls -> label( \S::no_pl_excel( 'Miejscowość' ) . ' - kor.' ); + $xls -> right(); + $xls -> label( 'Ulica - kor.' ); + $xls -> right(); + $xls -> down(); + + foreach ( $results as $row ) + { + $xls -> home(); + $xls -> label( date( 'Y-m-d', strtotime( $row['date_add'] ) ) ); + $xls -> right(); + $xls -> label( date( 'Y-m-d', strtotime( $row['rozpoczecie_dzialalnosci'] ) ) ); + $xls -> right(); + $xls -> label( \S::no_pl_excel( $row['firma'] ) ); + $xls -> right(); + $xls -> label( \S::no_pl_excel( $row['imie_nazwisko'] ) ); + $xls -> right(); + $xls -> label( $row['nip'] ); + $xls -> right(); + $xls -> label( $row['regon'] ); + $xls -> right(); + $xls -> label( $row['telefon'] ); + $xls -> right(); + $xls -> label( $row['email'] ); + $xls -> right(); + $xls -> label( $row['www'] ); + $xls -> right(); + $xls -> label( \S::no_pl_excel( $row['ad1_wojewodztwo'] ) ); + $xls -> right(); + $xls -> label( $row['ad1_kod_pocztowy'] ); + $xls -> right(); + $xls -> label( \S::no_pl_excel( $row['ad1_miejscowosc'] ) ); + $xls -> right(); + $xls -> label( \S::no_pl_excel( $row['ad1_ulica'] ) ); + $xls -> right(); + $xls -> label( \S::no_pl_excel( $row['ad2_wojewodztwo'] ) ); + $xls -> right(); + $xls -> label( $row['ad2_kod_pocztowy'] ); + $xls -> right(); + $xls -> label( \S::no_pl_excel( $row['ad2_miejscowosc'] ) ); + $xls -> right(); + $xls -> label( \S::no_pl_excel( $row['ad2_ulica'] ) ); + $xls -> down(); + }; + $xls -> send_to_file('ceidg.xls'); + + \S::send_email( 'biuro@project-pro.pl', 'CEIDG - baza firm od ' . date( 'Y-m-d', strtotime( '-7 days', time() ) ) . ' do ' . date( 'Y-m-d', strtotime( '-1 days', time() ) ), 'CEIDG - baza firm', 'ceidg.xls' ); + // \S::send_email( 'andrzej.noga81@gmail.com', 'CEIDG - baza firm od ' . date( 'Y-m-d', strtotime( '-7 days', time() ) ) . ' do ' . date( 'Y-m-d', strtotime( '-1 days', time() ) ), 'CEIDG - baza firm', 'ceidg.xls' ); + // \S::send_email( '4axel@poczta.fm', 'CEIDG - baza firm od ' . date( 'Y-m-d', strtotime( '-7 days', time() ) ) . ' do ' . date( 'Y-m-d', strtotime( '-1 days', time() ) ), 'CEIDG - baza firm', 'ceidg.xls' ); + + unlink( 'ceidg.xls' ); + + return true; + } + + public static function ceidg_download() + { + global $mdb; + + if ( $results = $mdb -> get( 'ceidg_urls', '*', ['date_update[!]' => date( 'Y-m-d' )] ) ) + { + $curl = curl_init(); + curl_setopt( $curl, CURLOPT_HEADER, true ); + curl_setopt( $curl, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)" ); + curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true ); + curl_setopt( $curl, CURLOPT_VERBOSE, true ); + curl_setopt( $curl, CURLOPT_URL, str_replace( '[DATA]', date( "Y-m-d", strtotime( '-1 day', time() ) ), $results['url'] ) ); + curl_setopt( $curl, CURLOPT_TIMEOUT, 60 ); + curl_setopt( $curl, CURLOPT_MAXREDIRS, 60 ); + curl_setopt( $curl, CURLOPT_FOLLOWLOCATION, true ); + $newUpdate = curl_exec( $curl ); + print_r( curl_error( $curl ) ); + curl_close( $curl ); + + $dlHandler = fopen( 'ceidg.zip', 'w' ); + if ( !fwrite( $dlHandler, $newUpdate ) ) + { + exit(); + } + fclose( $dlHandler ); + + ob_start(); + @system( 'unzip ceidg.zip' ); + ob_clean(); + + $mdb -> update( 'ceidg_urls', ['date_update' => date( 'Y-m-d' )], ['id' => $results['id']] ); + + unlink( 'ceidg.zip' ); + + return [ + 'status' => 'ok', + 'msg' => 'Pobieram xml do CEIDG: ' . $results['name'] + ]; + } + return false; + } + + public static function ceidg_import() + { + global $mdb; + + $xml = false; + + if ( file_exists( utf8_decode( 'dzien_ExtendedAddress_dolnoslaskie.xml' ) ) ) + $xml = 'dzien_ExtendedAddress_dolnoslaskie.xml'; + + if ( file_exists( utf8_decode( 'dzien_ExtendedAddress_kujawsko-pomorskie.xml' ) ) ) + $xml = 'dzien_ExtendedAddress_kujawsko-pomorskie.xml'; + + if ( file_exists( utf8_decode( 'dzien_ExtendedAddress_lubelskie.xml' ) ) ) + $xml = 'dzien_ExtendedAddress_lubelskie.xml'; + + if ( file_exists( utf8_decode( 'dzien_ExtendedAddress_lubuskie.xml' ) ) ) + $xml = 'dzien_ExtendedAddress_lubuskie.xml'; + + if ( file_exists( utf8_decode( 'dzien_ExtendedAddress_lódzkie.xml' ) ) ) + $xml = 'dzien_ExtendedAddress_lódzkie.xml'; + + if ( file_exists( utf8_decode( 'dzien_ExtendedAddress_malopolskie.xml' ) ) ) + $xml = 'dzien_ExtendedAddress_malopolskie.xml'; + + if ( file_exists( utf8_decode( 'dzien_ExtendedAddress_mazowieckie.xml' ) ) ) + $xml = 'dzien_ExtendedAddress_mazowieckie.xml'; + + if ( file_exists( utf8_decode( 'dzien_ExtendedAddress_opolskie.xml' ) ) ) + $xml = 'dzien_ExtendedAddress_opolskie.xml'; + + if ( file_exists( utf8_decode( 'dzien_ExtendedAddress_podkarpackie.xml' ) ) ) + $xml = 'dzien_ExtendedAddress_podkarpackie.xml'; + + if ( file_exists( utf8_decode( 'dzien_ExtendedAddress_podlaskie.xml' ) ) ) + $xml = 'dzien_ExtendedAddress_podlaskie.xml'; + + if ( file_exists( utf8_decode( 'dzien_ExtendedAddress_pomorskie.xml' ) ) ) + $xml = 'dzien_ExtendedAddress_pomorskie.xml'; + + if ( file_exists( utf8_decode( 'dzien_ExtendedAddress_slaskie.xml' ) ) ) + $xml = 'dzien_ExtendedAddress_slaskie.xml'; + + if ( file_exists( utf8_decode( 'dzien_ExtendedAddress_swietokrzyskie.xml' ) ) ) + $xml = 'dzien_ExtendedAddress_swietokrzyskie.xml'; + + if ( file_exists( utf8_decode( 'dzien_ExtendedAddress_warminsko-mazurskie.xml' ) ) ) + $xml = 'dzien_ExtendedAddress_warminsko-mazurskie.xml'; + + if ( file_exists( utf8_decode( 'dzien_ExtendedAddress_wielkopolskie.xml' ) ) ) + $xml = 'dzien_ExtendedAddress_wielkopolskie.xml'; + + if ( file_exists( utf8_decode( 'dzien_ExtendedAddress_zachodniopomorskie.xml' ) ) ) + $xml = 'dzien_ExtendedAddress_zachodniopomorskie.xml'; + + if ( $xml ) + { + $reader = new XMLReader(); + $reader -> open( $xml ); + $reader -> read() && $reader -> read(); + + while ( $reader -> next( 'InformacjaOWpisie' ) ) + { + $node = new SimpleXMLElement( $reader -> readOuterXML() ); + if ( !$mdb -> count( 'ceidg', ['hash' => (string)$node -> IdentyfikatorWpisu] ) ) + { + $mdb -> insert( 'ceidg', [ + 'hash' => (string)$node -> IdentyfikatorWpisu, + 'imie_nazwisko' => (string)$node -> DanePodstawowe -> Imie . ' ' . (string)$node -> DanePodstawowe -> Nazwisko, + 'nip' => (string)$node -> DanePodstawowe -> NIP, + 'regon' => (string)$node -> DanePodstawowe -> REGON, + 'firma' => (string)$node -> DanePodstawowe -> Firma, + 'email' => !empty( $node -> DaneKontaktowe -> AdresPocztyElektronicznej ) ? (string)$node -> DaneKontaktowe -> AdresPocztyElektronicznej : null, + 'www' => !empty( $node -> DaneKontaktowe -> AdresStronyInternetowej ) ? (string)$node -> DaneKontaktowe -> AdresStronyInternetowej : null, + 'telefon' => !empty( $node -> DaneKontaktowe -> Telefon ) ? (string)$node -> DaneKontaktowe -> Telefon : null, + 'faks' => !empty( $node -> DaneKontaktowe -> Faks ) ? (string)$node -> DaneKontaktowe -> Faks : null, + 'ad1_terc' => (string)$node -> DaneAdresowe -> AdresGlownegoMiejscaWykonywaniaDzialalnosci -> TERC, + 'ad1_simc' => (string)$node -> DaneAdresowe -> AdresGlownegoMiejscaWykonywaniaDzialalnosci -> SIMC, + 'ad1_ulic' => (string)$node -> DaneAdresowe -> AdresGlownegoMiejscaWykonywaniaDzialalnosci -> ULIC, + 'ad1_miejscowosc' => (string)$node -> DaneAdresowe -> AdresGlownegoMiejscaWykonywaniaDzialalnosci -> Miejscowosc, + 'ad1_terc' => (string)$node -> DaneAdresowe -> AdresGlownegoMiejscaWykonywaniaDzialalnosci -> TERC, + 'ad1_kod_pocztowy' => (string)$node -> DaneAdresowe -> AdresGlownegoMiejscaWykonywaniaDzialalnosci -> KodPocztowy, + 'ad1_poczta' => (string)$node -> DaneAdresowe -> AdresGlownegoMiejscaWykonywaniaDzialalnosci -> Poczta, + 'ad1_gmina' => (string)$node -> DaneAdresowe -> AdresGlownegoMiejscaWykonywaniaDzialalnosci -> Gmina, + 'ad1_powiat' => (string)$node -> DaneAdresowe -> AdresGlownegoMiejscaWykonywaniaDzialalnosci -> Powiat, + 'ad1_wojewodztwo' => (string)$node -> DaneAdresowe -> AdresGlownegoMiejscaWykonywaniaDzialalnosci -> Wojewodztwo, + 'ad2_terc' => (string)$node -> DaneAdresowe -> AdresDoDoreczen -> TERC, + 'ad2_simc' => (string)$node -> DaneAdresowe -> AdresDoDoreczen -> SIMC, + 'ad2_ulic' => (string)$node -> DaneAdresowe -> AdresDoDoreczen -> ULIC, + 'ad2_miejscowosc' => (string)$node -> DaneAdresowe -> AdresDoDoreczen -> Miejscowosc, + 'ad2_ulica' => (string)$node -> DaneAdresowe -> AdresDoDoreczen -> Ulica . ' ' . (string)$node -> DaneAdresowe -> AdresDoDoreczen -> Budynek . ' ' . ( $node -> DaneAdresowe -> AdresDoDoreczen -> Budynek != '' ? ' lok. ' . (string)$node -> DaneAdresowe -> AdresDoDoreczen -> Budynek : '' ), + 'ad2_kod_pocztowy' => (string)$node -> DaneAdresowe -> AdresDoDoreczen -> KodPocztowy, + 'ad2_poczta' => (string)$node -> DaneAdresowe -> AdresDoDoreczen -> Poczta, + 'ad2_gmina' => (string)$node -> DaneAdresowe -> AdresDoDoreczen -> Gmina, + 'ad2_powiat' => (string)$node -> DaneAdresowe -> AdresDoDoreczen -> Powiat, + 'ad2_wojewodztwo' => (string)$node -> DaneAdresowe -> AdresDoDoreczen -> Wojewodztwo, + 'obywatelstwo' => (string)$node -> DaneAdresowe -> PrzedsiebiorcaPosiadaObywatelstwaPanstw, + 'rozpoczecie_dzialalnosci' => (string)$node -> DaneDodatkowe -> DataRozpoczeciaWykonywaniaDzialalnosciGospodarczej, + 'zaprzestanie_dzialalnosci' => !empty( $node -> DaneDodatkowe -> DataZaprzestaniaWykonywaniaDzialalnosciGospodarczej ) ? (string)$node -> DaneDodatkowe -> DataZaprzestaniaWykonywaniaDzialalnosciGospodarczej : null, + 'data_wykreslenia' => !empty( $node -> DaneDodatkowe -> DataWykresleniaWpisuZRejestru ) ? (string)$node -> DaneDodatkowe -> DataWykresleniaWpisuZRejestru : null, + 'wspolnosc_majatkowa' => !empty( $node -> DaneDodatkowe -> MalzenskaWspolnoscMajatkowa ) ? (string)$node -> DaneDodatkowe -> MalzenskaWspolnoscMajatkowa : null, + 'status' => !empty( $node -> DaneDodatkowe -> Status ) ? (string)$node -> DaneDodatkowe -> Status : null, + 'pkd' => !empty( $node -> DaneDodatkowe -> KodyPKD ) ? (string)$node -> DaneDodatkowe -> KodyPKD : null, + 'spolki_cywilne' => !empty( $node -> SpolkiCywilneKtorychWspolnikiemJestPrzedsiebiorca ) ? json_encode( $node -> SpolkiCywilneKtorychWspolnikiemJestPrzedsiebiorca ) : null, + 'zakazy' => !empty( $node -> Zakazy ) ? json_encode( $node -> Zakazy ) : null, + 'postepowanie_naprawcze' => !empty( $node -> InformacjeDotyczaceUpadlosciPostepowaniaNaprawczego ) ? json_encode( $node -> InformacjeDotyczaceUpadlosciPostepowaniaNaprawczego ) : null + ] ); + $i++; + } + else + { + $mdb -> update( 'ceidg', [ + 'imie_nazwisko' => (string)$node -> DanePodstawowe -> Imie . ' ' . (string)$node -> DanePodstawowe -> Nazwisko, + 'nip' => (string)$node -> DanePodstawowe -> NIP, + 'regon' => (string)$node -> DanePodstawowe -> REGON, + 'firma' => (string)$node -> DanePodstawowe -> Firma, + 'email' => !empty( $node -> DaneKontaktowe -> AdresPocztyElektronicznej ) ? (string)$node -> DaneKontaktowe -> AdresPocztyElektronicznej : null, + 'www' => !empty( $node -> DaneKontaktowe -> AdresStronyInternetowej ) ? (string)$node -> DaneKontaktowe -> AdresStronyInternetowej : null, + 'telefon' => !empty( $node -> DaneKontaktowe -> Telefon ) ? (string)$node -> DaneKontaktowe -> Telefon : null, + 'faks' => !empty( $node -> DaneKontaktowe -> Faks ) ? (string)$node -> DaneKontaktowe -> Faks : null, + 'ad1_terc' => (string)$node -> DaneAdresowe -> AdresGlownegoMiejscaWykonywaniaDzialalnosci -> TERC, + 'ad1_simc' => (string)$node -> DaneAdresowe -> AdresGlownegoMiejscaWykonywaniaDzialalnosci -> SIMC, + 'ad1_ulic' => (string)$node -> DaneAdresowe -> AdresGlownegoMiejscaWykonywaniaDzialalnosci -> ULIC, + 'ad1_miejscowosc' => (string)$node -> DaneAdresowe -> AdresGlownegoMiejscaWykonywaniaDzialalnosci -> Miejscowosc, + 'ad1_terc' => (string)$node -> DaneAdresowe -> AdresGlownegoMiejscaWykonywaniaDzialalnosci -> TERC, + 'ad1_kod_pocztowy' => (string)$node -> DaneAdresowe -> AdresGlownegoMiejscaWykonywaniaDzialalnosci -> KodPocztowy, + 'ad1_poczta' => (string)$node -> DaneAdresowe -> AdresGlownegoMiejscaWykonywaniaDzialalnosci -> Poczta, + 'ad1_gmina' => (string)$node -> DaneAdresowe -> AdresGlownegoMiejscaWykonywaniaDzialalnosci -> Gmina, + 'ad1_powiat' => (string)$node -> DaneAdresowe -> AdresGlownegoMiejscaWykonywaniaDzialalnosci -> Powiat, + 'ad1_wojewodztwo' => (string)$node -> DaneAdresowe -> AdresGlownegoMiejscaWykonywaniaDzialalnosci -> Wojewodztwo, + 'ad2_terc' => (string)$node -> DaneAdresowe -> AdresDoDoreczen -> TERC, + 'ad2_simc' => (string)$node -> DaneAdresowe -> AdresDoDoreczen -> SIMC, + 'ad2_ulic' => (string)$node -> DaneAdresowe -> AdresDoDoreczen -> ULIC, + 'ad2_miejscowosc' => (string)$node -> DaneAdresowe -> AdresDoDoreczen -> Miejscowosc, + 'ad2_ulica' => (string)$node -> DaneAdresowe -> AdresDoDoreczen -> Ulica . ' ' . (string)$node -> DaneAdresowe -> AdresDoDoreczen -> Budynek . ' ' . ( $node -> DaneAdresowe -> AdresDoDoreczen -> Budynek != '' ? ' lok. ' . (string)$node -> DaneAdresowe -> AdresDoDoreczen -> Budynek : '' ), + 'ad2_kod_pocztowy' => (string)$node -> DaneAdresowe -> AdresDoDoreczen -> KodPocztowy, + 'ad2_poczta' => (string)$node -> DaneAdresowe -> AdresDoDoreczen -> Poczta, + 'ad2_gmina' => (string)$node -> DaneAdresowe -> AdresDoDoreczen -> Gmina, + 'ad2_powiat' => (string)$node -> DaneAdresowe -> AdresDoDoreczen -> Powiat, + 'ad2_wojewodztwo' => (string)$node -> DaneAdresowe -> AdresDoDoreczen -> Wojewodztwo, + 'obywatelstwo' => (string)$node -> DaneAdresowe -> PrzedsiebiorcaPosiadaObywatelstwaPanstw, + 'rozpoczecie_dzialalnosci' => (string)$node -> DaneDodatkowe -> DataRozpoczeciaWykonywaniaDzialalnosciGospodarczej, + 'zaprzestanie_dzialalnosci' => !empty( $node -> DaneDodatkowe -> DataZaprzestaniaWykonywaniaDzialalnosciGospodarczej ) ? (string)$node -> DaneDodatkowe -> DataZaprzestaniaWykonywaniaDzialalnosciGospodarczej : null, + 'data_wykreslenia' => !empty( $node -> DaneDodatkowe -> DataWykresleniaWpisuZRejestru ) ? (string)$node -> DaneDodatkowe -> DataWykresleniaWpisuZRejestru : null, + 'wspolnosc_majatkowa' => !empty( $node -> DaneDodatkowe -> MalzenskaWspolnoscMajatkowa ) ? (string)$node -> DaneDodatkowe -> MalzenskaWspolnoscMajatkowa : null, + 'status' => !empty( $node -> DaneDodatkowe -> Status ) ? (string)$node -> DaneDodatkowe -> Status : null, + 'pkd' => !empty( $node -> DaneDodatkowe -> KodyPKD ) ? (string)$node -> DaneDodatkowe -> KodyPKD : null, + 'spolki_cywilne' => !empty( $node -> SpolkiCywilneKtorychWspolnikiemJestPrzedsiebiorca ) ? json_encode( $node -> SpolkiCywilneKtorychWspolnikiemJestPrzedsiebiorca ) : null, + 'zakazy' => !empty( $node -> Zakazy ) ? json_encode( $node -> Zakazy ) : null, + 'postepowanie_naprawcze' => !empty( $node -> InformacjeDotyczaceUpadlosciPostepowaniaNaprawczego ) ? json_encode( $node -> InformacjeDotyczaceUpadlosciPostepowaniaNaprawczego ) : null + ], [ + 'hash' => (string)$node -> IdentyfikatorWpisu + ] ); + $j++; + } + } + + if ( $xml == 'dzien_ExtendedAddress_dolnoslaskie.xml' ) + unlink( utf8_decode( 'dzien_ExtendedAddress_dolnoslaskie.xml' ) ); + + if ( $xml == 'dzien_ExtendedAddress_kujawsko-pomorskie.xml' ) + unlink( utf8_decode( 'dzien_ExtendedAddress_kujawsko-pomorskie.xml' ) ); + + if ( $xml == 'dzien_ExtendedAddress_lubelskie.xml' ) + unlink( utf8_decode( 'dzien_ExtendedAddress_lubelskie.xml' ) ); + + if ( $xml == 'dzien_ExtendedAddress_lubuskie.xml' ) + unlink( utf8_decode( 'dzien_ExtendedAddress_lubuskie.xml' ) ); + + if ( $xml == 'dzien_ExtendedAddress_lódzkie.xml' ) + unlink( utf8_decode( 'dzien_ExtendedAddress_lódzkie.xml' ) ); + + if ( $xml == 'dzien_ExtendedAddress_malopolskie.xml' ) + unlink( utf8_decode( 'dzien_ExtendedAddress_malopolskie.xml' ) ); + + if ( $xml == 'dzien_ExtendedAddress_mazowieckie.xml' ) + unlink( utf8_decode( 'dzien_ExtendedAddress_mazowieckie.xml' ) ); + + if ( $xml == 'dzien_ExtendedAddress_opolskie.xml' ) + unlink( utf8_decode( 'dzien_ExtendedAddress_opolskie.xml' ) ); + + if ( $xml == 'dzien_ExtendedAddress_podkarpackie.xml' ) + unlink( utf8_decode( 'dzien_ExtendedAddress_podkarpackie.xml' ) ); + + if ( $xml == 'dzien_ExtendedAddress_podlaskie.xml' ) + unlink( utf8_decode( 'dzien_ExtendedAddress_podlaskie.xml' ) ); + + if ( $xml == 'dzien_ExtendedAddress_pomorskie.xml' ) + unlink( utf8_decode( 'dzien_ExtendedAddress_pomorskie.xml' ) ); + + if ( $xml == 'dzien_ExtendedAddress_slaskie.xml' ) + unlink( utf8_decode( 'dzien_ExtendedAddress_slaskie.xml' ) ); + + if ( $xml == 'dzien_ExtendedAddress_swietokrzyskie.xml' ) + unlink( utf8_decode( 'dzien_ExtendedAddress_swietokrzyskie.xml' ) ); + + if ( $xml == 'dzien_ExtendedAddress_warminsko-mazurskie.xml' ) + unlink( utf8_decode( 'dzien_ExtendedAddress_warminsko-mazurskie.xml' ) ); + + if ( $xml == 'dzien_ExtendedAddress_wielkopolskie.xml' ) + unlink( utf8_decode( 'dzien_ExtendedAddress_wielkopolskie.xml' ) ); + + if ( $xml == 'dzien_ExtendedAddress_zachodniopomorskie.xml' ) + unlink( utf8_decode( 'dzien_ExtendedAddress_zachodniopomorskie.xml' ) ); + + return [ + 'status' => 'ok', + 'msg' => 'Importuję firmy do CEIDG. Zaimportowano ' . (int)$i . ' firm. Zaktualizowano ' . (int)$j . ' firm.' + ]; + } + + return false; + } + + public static function recursive_tasks() + { + global $mdb; + + $results = $mdb -> query( 'SELECT ' + . 't.*, ' + . '( SELECT COUNT(0) FROM tasks WHERE parent_id = t.id ) AS quantity ' + . 'FROM ' + . 'tasks AS t ' + . 'WHERE ' + . 'recursively = 1 AND date_end IS NOT NULL AND date_end < \'' . date( 'Y-m-d', strtotime( '+1 months', time() ) ) . '\' ' + . 'HAVING quantity = 0' ) -> fetchAll(); + if ( is_array( $results ) and count( $results ) ) + foreach ( $results as $row ) + { + if ( $row['date_end_month_day'] == null ) + { + $mdb -> update( 'tasks', ['date_end_month_day' => date( 'j', strtotime( $row['date_end'] ) )], ['id' => $row['id']] ); + $row['date_end_month_day'] = date( 'j', strtotime( $row['date_end'] ) ); + } + + if ( $row['date_start_month_day'] == null ) + { + $mdb -> update( 'tasks', ['date_start_month_day' => date( 'j', strtotime( $row['date_start'] ) )], ['id' => $row['id']] ); + $row['date_start_month_day'] = date( 'j', strtotime( $row['date_start'] ) ); + } + + /* powtarzanie co x dni */ + if ( $row['period'] == 1 ) + { + $new_date_end = date( 'Y-m-d', strtotime( '+' . $row['frequency'] . ' days', strtotime( $row['date_end'] ) ) ); + + if ( $row['date_start'] ) + $new_date_start = date( 'Y-m-d', strtotime( '+' . $row['frequency'] . ' days', strtotime( $row['date_start'] ) ) ); + } + + /* powtarzanie do x miesięcy */ + if ( $row['period'] == 2 ) + { + $new_date_end = date( 'Y-m', strtotime( '+' . $row['frequency'] . ' months', strtotime( date( 'Y-m', strtotime( $row['date_end'] ) ) ) ) ); + $max_days = date( 't', strtotime( $new_date_end ) ); + + if ( $max_days <= $row['date_end_month_day'] ) + $new_date_end = date( 'Y-m-d', strtotime( $new_date_end . '-' . $max_days ) ); + else + $new_date_end = date( 'Y-m-d', strtotime( $new_date_end . '-' . $row['date_end_month_day'] ) ); + + if ( $row['date_start'] ) + { + $new_date_start = date( 'Y-m', strtotime( '+' . $row['frequency'] . ' months', strtotime( date( 'Y-m', strtotime( $row['date_start'] ) ) ) ) ); + $max_days = date( 't', strtotime( $new_date_start ) ); + + if ( $max_days <= $row['date_start_month_day'] ) + $new_date_start = date( 'Y-m-d', strtotime( $new_date_start . '-' . $max_days ) ); + else + $new_date_start = date( 'Y-m-d', strtotime( $new_date_start . '-' . $row['date_start_month_day'] ) ); + } + } + + /* powtarzanie co x lat */ + if ( $row['period'] == 3 ) + { + $new_date_end = date( 'Y-m', strtotime( '+' . $row['frequency'] . ' years', strtotime( date( 'Y-m', strtotime( $row['date_end'] ) ) ) ) ); + $max_days = date( 't', strtotime( $new_date_end ) ); + + if ( $max_days <= $row['date_end_month_day'] ) + $new_date_end = date( 'Y-m-d', strtotime( $new_date_end . '-' . $max_days ) ); + else + $new_date_end = date( 'Y-m-d', strtotime( $new_date_end . '-' . $row['date_end_month_day'] ) ); + + if ( $row['date_start'] ) + { + $new_date_start = date( 'Y-m', strtotime( '+' . $row['frequency'] . ' years', strtotime( date( 'Y-m', strtotime( $row['date_start'] ) ) ) ) ); + $max_days = date( 't', strtotime( $new_date_start ) ); + + if ( $max_days <= $row['date_start_month_day'] ) + $new_date_start = date( 'Y-m-d', strtotime( $new_date_start . '-' . $max_days ) ); + else + $new_date_start = date( 'Y-m-d', strtotime( $new_date_start . '-' . $row['date_start_month_day'] ) ); + } + } + + $task_users = $mdb -> select( 'task_user', 'user_id', ['task_id' => $row['id']] ); + + \factory\Projects::task_save( + null, $row['id'], $row['created_by'], $row['name'], $row['text'], $new_date_start, $new_date_end, $row['project_id'], $row['client'], $row['reminders'] ? 'on' : 'off', + $row['reminders_interval'], $row['recursively'] ? 'on' : 'off', $row['frequency'], $row['period'], $row['gantt'] ? 'on' : 'off', $row['on_top'] ? 'on' : 'off', $task_users, $row['date_end_month_day'], + $row['date_start_month_day'] + ); + + return [ + 'status' => 'ok', + 'msg' => 'Dodawanie rekursywnych zadań' + ]; + } + return false; + } + + public static function tasks_emails() + { + global $mdb, $setttings; + + include_once 'libraries/phpmailer/class.phpmailer.php'; + include_once 'libraries/phpmailer/class.smtp.php'; + + $results = $mdb -> query( 'SELECT ' + . 't.* ' + . 'FROM ' + . 'tasks AS t ' + . 'WHERE ' + . 'reminders = 1 AND reminders_send = 0 AND status = 0 AND deleted = 0' ) -> fetchAll(); + if ( is_array( $results ) and!empty( $results ) ) foreach ( $results as $row ) + { + $days_counter = explode( ',', $row['reminders_interval'] ); + rsort( $days_counter ); + + if ( is_array( $days_counter ) and!empty( $days_counter ) ) foreach ( $days_counter as $dc ) + { + if ( !$mdb -> count( 'tasks_reminders', ['AND' => ['task_id' => $row['id'], 'day_counter' => $dc]] ) ) + { + $send = false; + $date_tmp = date( 'Y-m-d', strtotime( '+' . $dc . 'days', strtotime( date( 'Y-m-d' ) ) ) ); + if ( $date_tmp >= $row['date_end'] ) + { + if ( !$mdb -> count( 'tasks_reminders', ['AND' => ['task_id' => $row['id'], 'day_counter' => $dc]] ) ) + { + $users = $mdb -> select( 'task_user', 'user_id', ['task_id' => $row['id']] ); + + if ( is_array( $users ) and count( $users ) ) + { + foreach ( $users as $user ) + { + $user_email = $mdb -> get( 'users', 'email', ['id' => $user] ); + + date( 'Y-m-d', strtotime( $row['date_end'] ) ) == date( 'Y-m-d' ) ? $date = 'dzisiaj' : $date = date( 'Y-m-d', strtotime( $row['date_end'] ) ); + + + $subject = 'crmPRO - ' . $row['name']; + $text = '

Witaj.

' . + '

Otrzymałeś ten email z powodu ustawionego przypomnienia. Poniżej znajdziesz jego treść.

' . + '

---------------------------------------------------------------------------------------

' . + '

' . $row['name'] . ' (termin zadania: ' . $date . ')

' . + '

' . $row['text'] . '

'; + + if ( \S::send_email( $user_email, $subject, $text ) ); + $send = true; + } + + if ( $send ) + { + $mdb -> insert( 'tasks_reminders', ['task_id' => $row['id'], 'day_counter' => $dc] ); + return [ + 'status' => 'ok', + 'msg' => 'Wiadomość została wysłana na adres: ' . $user_email + ]; + } + } + else + { + $mdb -> insert( 'tasks_reminders', ['task_id' => $row['id'], 'day_counter' => $dc] ); + return [ + 'status' => 'ok', + 'msg' => 'Wiadomość nie wysłana z powodu braku odbiorców.' + ]; + } + } + } + } + } + + if ( count( $days_counter ) == $mdb -> count( 'tasks_reminders', ['task_id' => $row['id']] ) ) + $mdb -> update( 'tasks', ['reminders_send' => 1], ['id' => $row['id']] ); + } + return ['status' => 'empty']; + } +} \ No newline at end of file diff --git a/autoload/class.DbModel.php b/autoload/class.DbModel.php new file mode 100644 index 0000000..8ecc2e0 --- /dev/null +++ b/autoload/class.DbModel.php @@ -0,0 +1,58 @@ + get( $this -> table, '*', [ $this -> table_key => $id ] ); + if ( is_array( $result ) ) foreach ( $result as $key => $val ) + $this -> $key = $val; + } + } + + public function __get( $variable ) + { + if ( array_key_exists( $variable, $this -> data ) ) + return $this -> data[$variable]; + } + + public function __set( $variable, $value ) + { + $this -> data[$variable] = $value; + } + + public function save() + { + global $mdb; + + if ( $this -> __get( $this -> table_key ) ) + { + $table_id_param = $this -> table_key; + $table_id_value = $this -> __get( $this -> table_key ); + $data_tmp = $this -> data; + unset( $data_tmp[ $table_id_param ] ); + + return $mdb -> update( $this -> table, $data_tmp, [ $table_id_param => $table_id_value ] ); + } + else + { + $mdb -> insert( $this -> table, $this -> data ); + $this -> __set( $this -> table_key, $mdb -> id() ); + } + return $this -> __get( $this -> table_key ); + } + + public function delete() + { + global $mdb; + return $mdb -> delete( $this -> table, [ $this -> table_key => $this -> __get( $this -> table_key ) ] ); + } + +} diff --git a/autoload/class.Excel.php b/autoload/class.Excel.php new file mode 100644 index 0000000..a0c656b --- /dev/null +++ b/autoload/class.Excel.php @@ -0,0 +1,167 @@ +title = $title; + $this->col = 0; + $this->row = 0; + $this->data = ''; + $this->bofMarker(); + } + + /** + * Transmits the proper headers to cause a download to occur and to identify the file properly + * @return nothing + */ + function headers() { + header("Content-Type: application/force-download"); + header("Content-Type: application/octet-stream"); + header("Content-Type: application/download"); + header("Content-Disposition: attachment;filename=" . Excel::filename($this->title) . ".xls "); + header("Content-Transfer-Encoding: binary "); + } + + function send_to_file( $loc ) + { + $this->eofMarker(); + file_put_contents($loc, $this->data); + } + + function send() { + $this->eofMarker(); + $this->headers(); + echo $this->data; + } + + /** + * Writes the Excel Beginning of File marker + * @see pack() + * @return nothing + */ + private function bofMarker() { + $this->data .= pack("ssssss", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); + } + + /** + * Writes the Excel End of File marker + * @see pack() + * @return nothing + */ + private function eofMarker() { + $this->data .= pack("ss", 0x0A, 0x00); + } + + /** + * Moves internal cursor left by the amount specified + * @param optional integer $amount The amount to move left by, defaults to 1 + * @return integer The current column after the move + */ + function left($amount = 1) { + $this->col -= $amount; + if($this->col < 0) { + $this->col = 0; + } + return $this->col; + } + + /** + * Moves internal cursor right by the amount specified + * @param optional integer $amount The amount to move right by, defaults to 1 + * @return integer The current column after the move + */ + function right($amount = 1) { + $this->col += $amount; + return $this->col; + } + + /** + * Moves internal cursor up by amount + * @param optional integer $amount The amount to move up by, defaults to 1 + * @return integer The current row after the move + */ + function up($amount = 1) { + $this->row -= $amount; + if($this->row < 0) { + $this->row = 0; + } + return $this->row; + } + + /** + * Moves internal cursor down by amount + * @param optional integer $amount The amount to move down by, defaults to 1 + * @return integer The current row after the move + */ + function down($amount = 1) { + $this->row += $amount; + return $this->row; + } + + /** + * Moves internal cursor to the top of the page, row = 0 + * @return nothing + */ + function top() { + $this->row = 0; + } + + /** + * Moves internal cursor all the way left, col = 0 + * @return nothing + */ + function home() { + $this->col = 0; + } + + /** + * Writes a number to the Excel Spreadsheet + * @see pack() + * @param integer $value The value to write out + * @return nothing + */ + function number($value) { + $this->data .= pack("sssss", 0x203, 14, $this->row, $this->col, 0x0); + $this->data .= pack("d", $value); + } + + /** + * Writes a string (or label) to the Excel Spreadsheet + * @see pack() + * @param string $value The value to write out + * @return nothing + */ + function label($value) { + $length = strlen($value); + $this->data .= pack("ssssss", 0x204, 8 + $length, $this->row, $this->col, 0x0, $length); + $this->data .= $value; + } +} \ No newline at end of file diff --git a/autoload/class.Html.php b/autoload/class.Html.php new file mode 100644 index 0000000..2af941d --- /dev/null +++ b/autoload/class.Html.php @@ -0,0 +1,93 @@ + params = $params; + return $tpl -> render( 'html/form-text' ); + } + + public static function input_switch( array $params = [] ) + { + $tpl = new Tpl; + $tpl -> params = $params; + return $tpl -> render( 'html/input-switch' ); + } + + public static function select( array $params = [] ) + { + $tpl = new Tpl; + $tpl -> params = $params; + return $tpl -> render( 'html/select' ); + } + + public static function textarea( array $params = [] ) + { + $defaults = [ + 'rows' => 4, + ]; + + $params = array_merge( $defaults, $params ); + + $tpl = new Tpl; + $tpl -> params = $params; + return $tpl -> render( 'html/textarea' ); + } + + public static function input_icon( array $params = [] ) + { + $defaults = [ + 'type' => 'text', + ]; + + $params = array_merge( $defaults, $params ); + + $tpl = new Tpl; + $tpl -> params = $params; + return $tpl -> render( 'html/input-icon' ); + } + + public static function input( array $params = [] ) + { + $defaults = [ + 'type' => 'text', + ]; + + $params = array_merge( $defaults, $params ); + + $tpl = new Tpl; + $tpl -> params = $params; + return $tpl -> render( 'html/input' ); + } + + public static function button( array $params = [] ) + { + $defaults = [ + 'class' => 'btn-sm btn-info', + ]; + + $params = array_merge( $defaults, $params ); + + $tpl = new Tpl; + $tpl -> params = $params; + return $tpl -> render( 'html/button' ); + } + + public static function panel( array $params = [] ) + { + $defaults = [ + 'title' => 'panel-title', + 'class' => 'panel-primary', + 'content' => 'panel-content' + ]; + + $params = array_merge( $defaults, $params ); + + $tpl = new Tpl; + $tpl -> params = $params; + return $tpl -> render( 'html/panel' ); + } + +} \ No newline at end of file diff --git a/autoload/class.S.php b/autoload/class.S.php new file mode 100644 index 0000000..355fe03 --- /dev/null +++ b/autoload/class.S.php @@ -0,0 +1,250 @@ + $value ) + $query[$key] = urlencode( $key ) . '=' . urlencode( $value ); + return implode( '&', $query ); + } + else + return false; + } + + public static function seo( $val, $delete_rhombs = false ) + { + $array_rep1 = array( '*', '_', ' ', '+', '"', "'", '?', '-', ',', '!', '~', '<', '>', '@', '#', '$', '%', '^', '&', '*' . '(', ')' . '-', '=', '\\', '|', '[', ']', ':', '(', ')' ); + $array_rep2 = array( '-', '-', '-', '-', '', '', '', '-', '-', '', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '', '-', '-', '-', '-', '-', '-', '-', '-' ); + + $val = self::noPl( $val ); + $val = str_replace( $array_rep1, $array_rep2, $val ); + $val = strtolower( $val ); + $val = preg_replace( '/(-){2,}/', '-', $val ); + if ( $delete_rhombs ) + $val = str_replace( '/', '', $val ); + + return $val; + } + + static public function no_pl_excel( $val ) + { + $table = Array( + "\xc4\x85" => "a", "\xc4\x84" => "A", "\xc4\x87" => "c", "\xc4\x86" => "C", + "\xc4\x99" => "e", "\xc4\x98" => "E", "\xc5\x82" => "l", "\xc5\x81" => "L", + "\xc3\xb3" => "o", "\xc3\x93" => "O", "\xc5\x9b" => "s", "\xc5\x9a" => "S", + "\xc5\xbc" => "z", "\xc5\xbb" => "Z", "\xc5\xba" => "z", "\xc5\xb9" => "Z", + "\xc5\x84" => "n", "\xc5\x83" => "N" + ); + + $val = strtr( $val, $table ); + + return $val; + } + + public static function noPL( $val ) + { + $table = array( + "А" => "a", "Б" => "b", "В" => "v", "Г" => "g", "Д" => "d", + "Е" => "e", "Ё" => "yo", "Ж" => "zh", "З" => "z", "И" => "i", + "Й" => "j", "К" => "k", "Л" => "l", "М" => "m", "Н" => "n", + "О" => "o", "П" => "p", "Р" => "r", "С" => "s", "Т" => "t", + "У" => "u", "Ф" => "f", "Х" => "kh", "Ц" => "ts", "Ч" => "ch", + "Ш" => "sh", "Щ" => "sch", "Ъ" => "", "Ы" => "y", "Ь" => "", + "Э" => "e", "Ю" => "yu", "Я" => "ya", "а" => "a", "б" => "b", + "в" => "v", "г" => "g", "д" => "d", "е" => "e", "ё" => "yo", + "ж" => "zh", "з" => "z", "и" => "i", "й" => "j", "к" => "k", + "л" => "l", "м" => "m", "н" => "n", "о" => "o", "п" => "p", + "р" => "r", "с" => "s", "т" => "t", "у" => "u", "ф" => "f", + "х" => "kh", "ц" => "ts", "ч" => "ch", "ш" => "sh", "щ" => "sch", + "ъ" => "", "ы" => "y", "ь" => "", "э" => "e", "ю" => "yu", + "я" => "ya", " " => "-", "." => "", "," => "", + ":" => "", ";" => "", "—" => "", "–" => "-" + ); + + $val = strtr( $val, $table ); + + $val = iconv( 'UTF-8', 'ASCII//TRANSLIT', $val ); + + $table = Array( + "\xc4\x85" => "a", "\xc4\x84" => "A", "\xc4\x87" => "c", "\xc4\x86" => "C", + "\xc4\x99" => "e", "\xc4\x98" => "E", "\xc5\x82" => "l", "\xc5\x81" => "L", + "\xc3\xb3" => "o", "\xc3\x93" => "O", "\xc5\x9b" => "s", "\xc5\x9a" => "S", + "\xc5\xbc" => "z", "\xc5\xbb" => "Z", "\xc5\xba" => "z", "\xc5\xb9" => "Z", + "\xc5\x84" => "n", "\xc5\x83" => "N" + ); + + $val = strtr( $val, $table ); + + return $val; + } + + public static function alert( $text ) + { + \S::set_session( 'alert', $text ); + } + + public static function hash( $qtd ) + { + $Caracteres = 'ABCDEFGHIJKLMOPQRSTUVXWYZ0123456789'; + $QuantidadeCaracteres = strlen($Caracteres); + $QuantidadeCaracteres--; + + $Hash =NULL; + for ( $x = 1; $x <= $qtd; $x++ ) + { + $Posicao = rand( 0, $QuantidadeCaracteres ); + $Hash .= substr( $Caracteres, $Posicao, 1 ); + } + + return $Hash; + } + + public static function sort_array_of_array( &$array, $subfield, $type = SORT_ASC ) + { + $sortarray = array(); + foreach ( $array as $key => $row ) + $sortarray[$key] = $row[$subfield]; + + array_multisort( $sortarray, $type, $array ); + } + + public static function json_to_array( $json ) + { + $values_tmp = json_decode( $json, true ); + + if ( is_array( $values_tmp ) ) foreach ( $values_tmp as $val ) + { + if ( isset( $values[ $val['name'] ] ) ) + { + if ( is_array( $values[ $val['name'] ] ) ) + $values[ $val['name'] ][] = $val['value']; + else + $values[ $val['name'] ] = array( $values[ $val['name'] ], $val['value'] ); + } + else + $values[ $val['name'] ] = $val['value']; + } + return $values; + } + + public static function get_session( $var ) + { + return $_SESSION[ $var ]; + } + + public static function del_session( $var ) { + unset( $_SESSION[ $var ] ); + } + + public static function set_session( $var, $val ) + { + $_SESSION[ $var ] = $val; + } + + public static function get( $var ) + { + if ( isset( $_POST[ $var ] ) ) + { + if ( is_string( $_POST[ $var ] ) ) + return $_POST[ $var ]; + else + return $_POST[ $var ]; + } + else + { + if ( isset( $_GET[ $var ] ) ) + { + if ( is_string( $_GET[ $var ] ) ) + return $_GET[ $var ]; + else + return $_GET[ $var ]; + } + } + } + + public static function pre( $data , $type = '' ) + { + $data = str_replace( 'Array +(' , '' , $data ); + $data = str_replace( ')' , '' , $data ); + + echo '' . print_r( $data , true ) . ''; + } + + public static function email_check( $email ) + { + return filter_var( $email, FILTER_VALIDATE_EMAIL ); + } + + public static function send_email( $email, $subject, $text, $file = '' ) + { + global $settings; + + $mail = new PHPMailer; + $mail -> IsSMTP(); + $mail -> SMTPAuth = true; + $mail -> Host = $settings['email_host']; + $mail -> Port = $settings['email_port']; + $mail -> Username = $settings['email_login']; + $mail -> Password = $settings['email_password']; + $mail -> CharSet = "UTF-8"; + $mail -> SMTPOptions = array( + 'ssl' => array( + 'verify_peer' => false, + 'verify_peer_name' => false, + 'allow_self_signed' => true + ) + ); + $mail -> From = 'bilety@brzezovka.pl'; + $mail -> FromName = 'KOMPLEKS TURYSTYCZNY BRZEZÓVKA'; + $mail -> addAddress( $email, $email ); + $mail -> addBCC( 'bilety@brzezovka.pl' ); + $mail -> addReplyTo( 'bilety@brzezovka.pl', 'KOMPLEKS TURYSTYCZNY BRZEZÓVKA' ); + $mail -> isHTML( true ); + + $mail -> Subject = $subject; + $mail -> Body = $text; + + if ( is_array( $file ) ) + { + foreach ( $file as $file_tmp ) + { + if ( file_exists( $file_tmp ) ) + $mail -> AddAttachment( $file_tmp ); + } + } + else + { + if ( file_exists( $file ) ) + $mail -> AddAttachment( $file ); + } + + return $mail -> send(); + } +} diff --git a/autoload/class.Tpl.php b/autoload/class.Tpl.php new file mode 100644 index 0000000..72960f5 --- /dev/null +++ b/autoload/class.Tpl.php @@ -0,0 +1,73 @@ + dir = $dir; + } + + public static function view( $file, $values = '' ) + { + $tpl = new \Tpl; + if ( is_array( $values ) ) foreach ( $values as $key => $val ) + $tpl -> $key = $val; + return $tpl -> render( $file ); + } + + public function secureHTML( $val ) + { + $out = stripslashes( $val ); + $out = str_replace( "'", "'", $out ); + $out = str_replace( '"', """, $out ); + $out = str_replace( "<", "<", $out ); + $out = str_replace( ">", ">", $out ); + return $out; + } + + public function render( $file ) + { + if ( file_exists( 'templates_user/' . $file . '.php' ) ) + { + ob_start(); + include 'templates_user/' . $file . '.php'; + $out = ob_get_contents(); + ob_end_clean(); + + return $out; + } + else if ( file_exists( 'templates/' . $file . '.php' ) ) + { + ob_start(); + include 'templates/' . $file . '.php'; + $out = ob_get_contents(); + ob_end_clean(); + + return $out; + } + else if ( file_exists( $file . '.php' ) ) + { + ob_start(); + include $file . '.php'; + $out = ob_get_contents(); + ob_end_clean(); + + return $out; + } + else + return ' \ No newline at end of file diff --git a/templates/html/input-icon.php b/templates/html/input-icon.php new file mode 100644 index 0000000..eab58d3 --- /dev/null +++ b/templates/html/input-icon.php @@ -0,0 +1,71 @@ + params['label'] ) +{ + $out .= '
'; + $out .= ''; + $out .= '
'; +} + $out .= '
'; + $out .= ' params['type'] . '" '; + + if ( $this -> params['id'] ) + $out .= 'id="' . $this -> params['id'] . '" '; + else + $out .= 'id="' . $this -> params['name'] . '" '; + + if ( $this -> params['class'] or $this -> params['label'] ) + { + if ( $this -> params['label'] ) + $out .= 'class="' . $this -> params['class'] . ' form-control" '; + else if ( $this -> params['class'] ) + $out .= 'class="' . $this -> params['class'] . '" '; + } + + $out .= 'name="' . $this -> params['name'] . '" '; + $out .= 'value="' . $this -> secureHTML( $this -> params['value'] ) . '" '; + + if ( $this -> params['style'] ) + $out .= 'style="' . $this -> params['style'] . '" '; + + if ( $this -> params['readonly'] ) + $out .= 'readonly="readonly" '; + + if ( $this -> params['required'] ) + $out .= 'required '; + + if ( $this -> params['autocomplete'] == 'off' ) + $out .= 'autocomplete="off" '; + + $out .= ' />'; + + $out .= ' params['icon_js'] ) + $out .= 'onclick="' . htmlspecialchars( $this -> params['icon_js'] ) . '" '; + + $out .= '>'; + $out .= $this -> params['icon_content']; + $out .= ''; + $out .= '
'; + +if ( $this -> params['label'] ) +{ + $out .= '
'; + $out .= '
'; +} + +echo $out; \ No newline at end of file diff --git a/templates/html/input-switch.php b/templates/html/input-switch.php new file mode 100644 index 0000000..b23bf6f --- /dev/null +++ b/templates/html/input-switch.php @@ -0,0 +1,36 @@ + params['label'] ) +{ + $out .= '
'; + $out .= ''; + $out .= '
'; +} + + $out .= '
'; + $out .= ' params['id'] ) + $out .= 'id="' . $this -> params['id'] . '" '; + else + $out .= 'id="' . $this -> params['name'] . '" '; + $out .= 'name="' . $this -> params['name'] . '" type="checkbox"'; + + if ( $this -> params['checked'] ) + $out .= 'checked="checked" '; + + $out .= '>'; + $out .= ''; + $out .= '
'; + +if ( $this -> params['label'] ) +{ + $out .= '
'; + $out .= '
'; +} + +echo $out; \ No newline at end of file diff --git a/templates/html/input.php b/templates/html/input.php new file mode 100644 index 0000000..765a259 --- /dev/null +++ b/templates/html/input.php @@ -0,0 +1,59 @@ + params['label'] ) +{ + $out .= '
'; + $out .= ''; + $out .= '
'; +} + + $out .= ' params['type'] . '" '; + + if ( $this -> params['id'] ) + $out .= 'id="' . $this -> params['id'] . '" '; + + if ( $this -> params['class'] or $this -> params['label'] ) + { + if ( $this -> params['label'] ) + $out .= 'class="' . $this -> params['class'] . ' form-control" '; + else if ( $this -> params['class'] ) + $out .= 'class="' . $this -> params['class'] . '" '; + } + + $out .= 'name="' . $this -> params['name'] . '" '; + $out .= 'value="' . $this -> secureHTML( $this -> params['value'] ) . '" '; + + if ( $this -> params['style'] ) + $out .= 'style="' . $this -> params['style'] . '" '; + + if ( $this -> params['readonly'] ) + $out .= 'readonly="readonly" '; + + if ( $this -> params['required'] ) + $out .= 'required '; + + if ( $this -> params['autocomplete'] == 'off' ) + $out .= 'autocomplete="off" '; + + if ( $this -> params['placeholder'] ) + $out .= 'placeholder="' . $this -> params['placeholder'] . '" '; + + $out .= ' />'; + +if ( $this -> params['label'] ) +{ + $out .= '
'; + $out .= '
'; +} + +echo $out; \ No newline at end of file diff --git a/templates/html/panel.php b/templates/html/panel.php new file mode 100644 index 0000000..5dfa42e --- /dev/null +++ b/templates/html/panel.php @@ -0,0 +1,8 @@ +
+
+ params['title'];?> +
+
+ params['content'];?> +
+
diff --git a/templates/html/select.php b/templates/html/select.php new file mode 100644 index 0000000..57f23ac --- /dev/null +++ b/templates/html/select.php @@ -0,0 +1,56 @@ + params['label'] ) +{ + $out .= '
'; + $out .= ''; + $out .= '
'; +} + + $out .= ''; + +if ( $this -> params['label'] ) +{ + $out .= '
'; + $out .= '
'; +} + +echo $out; \ No newline at end of file diff --git a/templates/html/textarea.php b/templates/html/textarea.php new file mode 100644 index 0000000..6a54b75 --- /dev/null +++ b/templates/html/textarea.php @@ -0,0 +1,49 @@ + params['label'] ) +{ + $out .= '
'; + $out .= ''; + $out .= '
'; +} + + $out .= ''; + +if ( $this -> params['label'] ) +{ + $out .= '
'; + $out .= '
'; +} + +echo $out; \ No newline at end of file diff --git a/templates/site/layout-cron.php b/templates/site/layout-cron.php new file mode 100644 index 0000000..3627a6b --- /dev/null +++ b/templates/site/layout-cron.php @@ -0,0 +1,63 @@ + + + + + + + + crmPro + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+
+
+ +
+
+ alert ):?> +
alert;?>
+ + content;?> +
+
+ + + \ No newline at end of file diff --git a/templates/site/layout-logged.php b/templates/site/layout-logged.php new file mode 100644 index 0000000..188075e --- /dev/null +++ b/templates/site/layout-logged.php @@ -0,0 +1,132 @@ + + + + + + + + Bilety online - brzezovka.pl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+ +
+
+ + +
+
+ +
+ +
+ +
+
+
+ content;?> +
+ + + + + + \ No newline at end of file diff --git a/templates/site/layout-unlogged.php b/templates/site/layout-unlogged.php new file mode 100644 index 0000000..fe8fdaa --- /dev/null +++ b/templates/site/layout-unlogged.php @@ -0,0 +1,85 @@ + + + + + + + + Bilety online - brzezovka.pl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/templates/site/regulamin-for-gifts.php b/templates/site/regulamin-for-gifts.php new file mode 100644 index 0000000..d198d59 --- /dev/null +++ b/templates/site/regulamin-for-gifts.php @@ -0,0 +1,24 @@ +
+
+
+
Regulamin biletów prezentowych
+
+
BILETY NA PREZENT
+
    +
  • Bilet na prezent (w wersji papierowej) ważny jest do końca sezonu w którym był wydany lub do daty wskazanej na voucherze.
  • +
  • Bilet obejmuje atrakcje wskazane na voucherze.
  • +
  • Bilet upoważnia do korzystania ze wszystkich atrakcji wskazanego parku bez dodatkowych opłat (nie wliczamy w to gastronomi oraz gier zręcznościowych).
  • +
  • Bilet jest jednorazowy.
  • +
  • Do biletów naliczana jest opłata za wysyłkę.
  • +
  • Biletów prezentowych nie można przenieść na sezon inny niż wskazany na voucherze.
  • +
  • Bilety prezentowe są imienne i należy mieć ze sobą dokument potwierdzający tożsamość.
  • +
+
+
+
BILETY PREZENTOWE - IDEALNY PREZENT DLA NAJBLIŻSZYCH, PRACOWNIKÓW, KONTRAHENTÓW, NA KONKURSY I LOTERIE
+

Bilet Prezent w ekskluzywnym opakowaniu, to wyjątkowy upominek dla najbliższych. Już teraz można zakupić bilety prezentowe ważne do końca sezonu w którym był wydany lub do daty wskazanej na voucherze. Bilet obejmuje wszystkie atrakcje Parku wskazanego na voucherze.

+

Zapraszamy Firmy i Instytucje do zakupubiletów w formie biletów prezentowych, wówczas pracownicy mogą odwiedzić Park w dowolnym terminie bez konieczności organizacji wycieczki grupowej.

+
+
+
+
\ No newline at end of file diff --git a/templates/site/regulamin.php b/templates/site/regulamin.php new file mode 100644 index 0000000..d2c4ddb --- /dev/null +++ b/templates/site/regulamin.php @@ -0,0 +1,139 @@ +
+
+
+
Regulamin sprzedaży biletów
+
REGULAMIN SPRZEDAŻY BILETÓW PRZEZ ZAŁADKĘ „KUP BILET” NA STRONIE INTERNETOWEJ WWW.BRZEZOVKA.PL
+
+
§1 Zasady ogólne
+
    +
  • Fun&Sun Sp. z o.o. z siedzibą w Kolbuszowej, ul. Zbożowa 7, 36-100 Kolbuszowa, wpisana do rejestru przedsiębiorców Krajowego Rejestru Sądowego pod numerem KRS 0001035236, posiadająca NIP: 8141698219 i REGON: 525271764, działająca pod nazwą KTB BRZEZOVKA [dalej „KTB BRZEZOVKA”], + prowadzi sprzedaż detaliczną biletów [dalej „Bilet”] za pośrednictwem strony + internetowej KTB BRZEZOWKA https://bilety.brzezovka.pl/ [dalej „Strona”] oraz punktów + sprzedażowych [dalej „Punkt”], której zasady reguluje niniejszy regulamin [dalej + „Regulamin”]. Regulamin dotyczy sprzedaży zarówno na imprezy własne jak i na + imprezy organizowane przez podmioty trzecie i w tym zakresie BRZEZOVKA działa + jako pośrednik w imieniu i na rzecz Organizatora.
  • +
  • Przez Bilet rozumiany jest dokument uprawniający do udziału w wydarzeniu [dalej + „Wydarzenie”].
  • +
  • Regulamin jest integralną częścią umowy sprzedaży zawieranej z Klientem.
  • +
  • Ceny podane na Stronie są cenami brutto (zawierają podatek VAT).
  • +
  • Przed zakupem Klient zobowiązany jest zapoznać się z regulaminem Wydarzenia na + które wystawiony jest bilet, regulaminem obiektu na którym Wydarzenie się odbywa + oraz niniejszym Regulaminem Sprzedaży. Poprzez zakup biletu uczestnik akceptuje + owe regulaminy.
  • +
  • Termin realizacji biletów upływa z końcem sezonu w którym dokonano zakupu, chyba że zasady danej promocji określają inny termin podany w informacji dołączonej do promocji.
  • +
+
+
+
§2 Zamówienie i płatność
+
    +
  • Zamówienia można składać poprzez formularz dostępny na Stronie,
  • +
  • Opłatę za Bilet należy uiścić przez Stronę, za pomocą Przelewy24;
  • +
  • Bilety będą wygenerowane bezpośrednio po zakupie biletu w formie kodu QR.
  • +
  • Za zakupione Bilety można otrzymać fakturę AT. + W przypadku zakupu Biletu przez Stronę, należy zgłosić dane do faktury oraz podać numer zamówienia + wysyłając + wiadomość na adres info@brzezovka.pl. Faktura zostanie wysłana w pliku typu PDF na adres e-mail podany w + profilu Klienta.
  • +
  • Klient zobowiązany jest do zachowania dowodu zakupu Biletu – paragonu fiskalnego + lub faktury VAT.
  • +
  • Szczegółowe warunki zakupu przez Stronę: + Warunkiem realizacji zamówienia poprzez Stronę jest podanie wszystkich wymaganych danych pozwalających + na + weryfikację Klienta i odbiorcy Biletu. KTB BRZEZOVKA potwierdza przyjęcie zamówienia za pomocą poczty + email. +

    - Dla stron wiążące są informacje zawarte na Stronie podczas zamawiania Biletu, w szczególności: cena + i + charakterystyka Biletu.

    +

    - Informacje znajdujące się na Stronie nie stanowią oferty w rozumieniu Kodeksu Cywilnego. Klient + składając zamówienie składa ofertę zakupu określonego Biletu. Do zawarcia umowy sprzedaży dochodzi w + momencie odnotowania wpłaty za zarezerwowane Bilety zgodnie z ustaloną ceną.

    +

    - KTB BRZEZOVKA nie bierze odpowiedzialności za błędnie wpisane przez klienta dane do formularza.

    +
  • +
  • Zamówienie uważa się za złożone w momencie gdy Klient wybierze rodzaj Biletów, określi ich ilość, + uiści + zapłatę.
  • +
  • Zamówienie zostanie automatycznie anulowane w przypadku jego nieopłacenia: +

    - w terminie 2 dni od dnia złożenia zamówienia na Stronie, gdy transakcja ma być wykonana za pomocą + systemu przelewy24, a w tym terminie nie będzie pozytywnej autoryzacji płatności.

    +
  • +
+
+
+
§3 Odbiór biletu
+
    +
  • Warunkiem wydania Biletu jest zapłata za Bilet.
  • +
  • Klient zobowiązany jest do sprawdzenia zgodności informacji umieszczonych na Bilecie z danymi + zawartymi + w złożonym przez Klienta zamówieniu.
  • +
  • Bilet zamówiony przez Stronę KTB BRZEZOVKA generuje się bezpośrednio po autoryzacji płatności.
  • +
  • Bilet nieczytelny, zniszczony lub uszkodzony w taki sposób, iż nie jest możliwe jego odczytanie nie + uprawnia do uczestniczenia w Wydarzeniu i zostanie uznany za nieważny.
  • +
  • Bilety zakupione w Punkcie, Bilety zamówione na Stronie i przesłane Klientowi, Bilety zamówione na + Stronie i odebrane przed Wydarzeniem, nie są spersonalizowane.
  • +
  • KTB BRZEZOVKA nie ponosi odpowiedzialności za skutki nieuprawnionego powielenia raz otrzymanego Biletu + domowego przez rezerwującego lub osoby trzecie, którym udostępnił on dane otrzymanego Biletu + elektronicznego w formie kodu QR.
  • +
+
+
+
§4 Odwołanie lub zmiana
+
    +
  • Zwroty biletów przyjmowane są w wypadku odwołania imprezy oraz w wypadku zmiany programu imprezy, + zmiany + miejsca lub terminu odbycia się imprezy. Organizator każdorazowo ogłasza informację o możliwości i + terminach zwrotu biletów na Stronie.
  • +
  • Podstawą zwrócenia Biletu jest przedstawienie przez Klienta dowodu zakupu towaru (paragon fiskalny lub + faktura VAT).
  • +
  • Zwrotu Biletów dokonujemy poprzez kontakt: e-mail na adres info@brzezowka.pl, telefonicznie na numer 781 116 909 lub + osobiście + w Punkcie określonym przez KTB BRZEZOVKA, po uprzednim kontakcie.
  • +
  • KTB BRZEZOVKA informuje, że zgodnie z art. 38 pkt. 12 ustawy z dnia 30 maja 2014 r. o prawach + konsumenta + (DzU 2014, poz.827), Klientowi nie przysługuje prawo od odstąpienia od umowy zawartej na odległość w + trybie określonym w art. 27 ww. ustawy.
  • +
+
+
+
§5 Ochrona danych i własność intelektualna
+
    +
  • Składając zamówienie Klient wyraża zgodę na przetwarzanie jego danych osobowych wyłącznie w celu + realizacji zamówienia.
  • +
  • Klient może również wyrazić odrębną zgodę na otrzymywanie od KTB BRZEZOVKA materiałów reklamowo - + promocyjnych, w tym biuletynu handlowego. Taka zgoda może być w każdej chwili cofnięta.
  • +
  • Klient ma prawo wglądu do swoich danych i ich korekty.
  • +
  • Zabrania się wykorzystywania jakichkolwiek materiałów publikowanych na Stronie (w tym zdjęć i opisów + biletów) bez pisemnej zgody właściciela Strony.
  • +
+
+
+
§6 Wejście w życie i zmiany
+
    +
  • Regulamin wchodzi w życie z dniem publikacji na Stronie.
  • +
  • KTB BRZEZOWKA zastrzega sobie możliwość zmian w Regulaminie, które wchodzą w życie z dniem ich + publikacji na Stronie.
  • +
+
+
+
§7 Uwagi końcowe
+
    +
  • KTB BRZEZOVKA dokłada wszelkich starań, by usługi świadczone w ramach Strony były na najwyższym + poziomie, jednakże nie wyklucza możliwości czasowego zawieszenia dostępności Strony przypadku + konieczności + przeprowadzenia prac konserwacyjnych. Klient winien sygnalizować wszelkie nieprawidłowości w + funkcjonowaniu Strony.
  • +
  • KTB BRZEZOVKA nie ponosi odpowiedzialności za blokowanie przez administratorów serwerów pocztowych + przesyłania wiadomości na adres email wskazany przez Klienta oraz za usuwanie i blokowanie emaili przez + oprogramowanie zainstalowane na komputerze używanym przez Klienta.
  • +
  • Odpowiedzialność za przebieg Wydarzenia na które sprzedawane są Bilety ponosi jego organizator.
  • +
  • W sprawach nieuregulowanych w niniejszym Regulaminie zastosowanie będą miały przepisy Kodeksu + Cywilnego. +
  • +
  • W razie sporów z Klientem, sądem właściwym do ich rozpoznawania jest sąd powszechny właściwy na + podstawie obowiązujących przepisów.
  • +
+
+
+
+
\ No newline at end of file diff --git a/templates/tickets/add-ticket.php b/templates/tickets/add-ticket.php new file mode 100644 index 0000000..211702c --- /dev/null +++ b/templates/tickets/add-ticket.php @@ -0,0 +1,33 @@ + \ No newline at end of file diff --git a/templates/tickets/basket-form.php b/templates/tickets/basket-form.php new file mode 100644 index 0000000..7ae277b --- /dev/null +++ b/templates/tickets/basket-form.php @@ -0,0 +1,57 @@ + + + + + + + + + cart as $ticket_id => $combinations) : ?> + $value) : ?> + + + + + + + + + +
+

BILETY

+
+

CENA

+
+

WARTOŚĆ

+
+

ZMIENIĆ ILOŚĆ

+
+

USUŃ

+
settings['tickets'][$ticket_id]['name']; ?> (x) + + + + + + + + + + + + + + +
+
+ Dodaj ochronę kupującego (5 zł / bilet) +
+

Wszystkie bilety zostaną objęte ochroną kupującego. Pozwoli Ci to na zmianę terminu biletu.

+
+
\ No newline at end of file diff --git a/templates/tickets/basket-summary.php b/templates/tickets/basket-summary.php new file mode 100644 index 0000000..64b82a1 --- /dev/null +++ b/templates/tickets/basket-summary.php @@ -0,0 +1,19 @@ +
+

Suma:

+ cart as $data => $value ) + { + foreach ( $value as $key => $val ) + { + $price = $val['ticket_price']; + $quantity = $val['quantity']; + + $finalPrice += $price * $quantity; + } + } + ?> +

+ + +
\ No newline at end of file diff --git a/templates/tickets/basket-view.php b/templates/tickets/basket-view.php new file mode 100644 index 0000000..22c0086 --- /dev/null +++ b/templates/tickets/basket-view.php @@ -0,0 +1,294 @@ + + +
+
+
+
+ + + + + + + + + cart as $ticket_id => $combinations) : ?> + $value) : ?> + + + + + + + + + +
+

BILETY

+
+

CENA

+
+

WARTOŚĆ

+
+

ZMIENIĆ ILOŚĆ

+
+

USUŃ

+
settings['tickets'][$ticket_id]['name']; ?> (x) + + + + + + + + +
+
+ Dodaj ochronę kupującego (5 zł / bilet) +
+

Wszystkie bilety zostaną objęte ochroną kupującego. Pozwoli Ci to na zmianę terminu biletu.

+
+
+
+
+
+
+
+
+

TWOJE DANE

+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + +
+ Musisz wyrazić zgodę przed przesłaniem. +
+
+
+
+
+
+
+

Suma:

+ cart ) as $data => $value ) + { + foreach ( $value as $key => $val ) + { + $price = $val['ticket_price']; + $quantity = $val['quantity']; + + $finalPrice += $price * $quantity; + } + } + ?> +

+ +
+
+
+
+
+
+
+
+ + \ No newline at end of file diff --git a/templates/tickets/disabled-sell.php b/templates/tickets/disabled-sell.php new file mode 100644 index 0000000..7fdc8d9 --- /dev/null +++ b/templates/tickets/disabled-sell.php @@ -0,0 +1,4 @@ +
+ Sprzedaż biletów jest obecnie wyłączona.
+ Zapraszamy do zakupu biletów w kasach biletowych. +
\ No newline at end of file diff --git a/templates/tickets/main-view.php b/templates/tickets/main-view.php new file mode 100644 index 0000000..8b886de --- /dev/null +++ b/templates/tickets/main-view.php @@ -0,0 +1,362 @@ +diff($selected); + $days_diff = (int)$interval->format('%r%a'); + + function date_price($item, $days_diff) { + if($days_diff == 0) { + $price = $item['price'] + $item['dynamic_prices']['day0']; + return $price . ' zł'; + } + elseif ($days_diff == 1 || $days_diff == 2) { + $price = $item['price'] + $item['dynamic_prices']['day1_2']; + return $price . ' zł'; + } + elseif ($days_diff >= 3 && $days_diff <= 7) { + $price = $item['price'] + $item['dynamic_prices']['day3_7']; + return $price . ' zł'; + } + else { + $price = $item['price']; + return $price . ' zł'; + } + } +} +?> + + + + + +
+
+
Wybierz datę przyjazdu:
+ +
+
+ + +
+ + + + +
+
+

Bilet ulgowy

+

do 140cm wzrostu

+
+ settings['bilety-ulgowe'] as $key => $item) : ?> +
+
+

settings['tickets'][$item]['name'])[0]; ?>

+

bilet całodniowy

+ + settings['tickets'][$item]['alert']) : ?> +

settings['tickets'][$item]['alert']; ?>

+ +
+

+ settings['tickets'][$item], + $days_diff + ); + ?> +

+ +
+ + 1x + +
+
+ +
+ + +
+
+

Bilet normalny

+

od 140cm wzrostu

+
+ + settings['bilety-normalne'] as $key => $item) : ?> +
+
+

settings['tickets'][$item]['name'])[0]; ?>

+

bilet całodniowy

+ + settings['tickets'][$item]['alert']) : ?> +

settings['tickets'][$item]['alert']; ?>

+ +
+

+ settings['tickets'][$item], + $days_diff + ); + ?> +

+
+ + 1x + +
+
+ +
+ + = DateTime::createFromFormat('d-m-Y', '28-06-2025')): ?> + +
+
+

Bilet ALL OPEN

+

bilety do wszystkich parków

+
+ + settings['bilety-all-open'] as $key => $item) : ?> + +
+
+ +

settings['tickets'][$item]['name']); ?>

+

bilet całodniowy

+
+

+ settings['tickets'][$item], + $days_diff + ); + ?> +

+
+ + 1x + +
+
+ +
+ + + = DateTime::createFromFormat('d-m-Y', '28-06-2025')): ?> +
+
+

Bilety rodzinne

+

bilety dla rodzin

+
+ settings['bilety-rodzinne'] as $key => $item) : ?> +
+
+

settings['tickets'][$item]['name']; ?>

+

bilet całodniowy

+
+

+ settings['tickets'][$item], + $days_diff + ); + ?> +

+
+ + 1x + +
+
+ +
+ + +
+
+

Karnety

+

Na cały sezon

+
+ settings['karnety'] as $key => $item) : ?> +
+
+

settings['tickets'][$item]['name']; ?>

+ +
+

+ settings['tickets'][$item], + $days_diff + ); + ?> +

+
+ + 1x + +
+
+ +
+
+ + +
+
+

KASA NIE ZWRACA PIENIĘDZY ZA NIEWYKORZYSTANE ATRAKCJE ZE WZGLĘDU NA ZŁĄ POGODĘ, NAGŁĄ AWARIĘ TECHNICZNĄ ORAZ + OGRANICZONĄ PRZEPUSTOWOŚĆ DANYCH ATRAKCJI.

+

Przed zakupem biletu do Kompleksu Turystycznego BRZEZÓVKA należy zapoznać się z + regulaminem, oraz regulaminem biletów prezentowych.

+
+
+
+
+
"> +
+
+

Bilety

+
+
    + cart as $ticket_id => $combinations) : + foreach ($combinations as $key => $value) : + $summary_ticket = $value['ticket_price'] * $value['quantity']; + $summary += $summary_ticket; + ?> +
  • +

    + settings['tickets'][$ticket_id]['name'] . ' x' . $value["quantity"] . '' ?> +

    +

    cena:

    + +
  • + +
+
+

Łączna suma:

+

+
+ Kup teraz + +
+
+ \ No newline at end of file diff --git a/templates/tickets/order-confirm.php b/templates/tickets/order-confirm.php new file mode 100644 index 0000000..1c2b09e --- /dev/null +++ b/templates/tickets/order-confirm.php @@ -0,0 +1,178 @@ +order_successful === true) : ?> + + + +order_fail === true) : ?> + + + +order; +?> + +
+
+
+
+ + + + + + + $value) : ?> + + + + + + +
+

BILETY

+
+

CENA

+
+

WARTOŚĆ

+
( x )
+
+
+
+
+
+
+

TWOJE DANE

+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+ + +
+ +
+ name="vat" disabled> +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+

Suma:

+

+
+

Status:

+ +

Zapłacono

+ + +

Nie zapłacono

+ Powtórz transakcję + +
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/templates/tickets/przelewy24.php b/templates/tickets/przelewy24.php new file mode 100644 index 0000000..0f28542 --- /dev/null +++ b/templates/tickets/przelewy24.php @@ -0,0 +1,69 @@ +order; +$merchant_id = $this->settings['p24']['merchant_id']; +$pos_id = $this->settings['p24']['pos_id']; + +$crc_key = ''; + +if($this->settings['p24']['sandbox']) { + $crc_key = $this->settings['p24']['sandbox_crc_key']; +} else { + $crc_key = $this->settings['p24']['crc_key']; +} +?> + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + +
+ + \ No newline at end of file diff --git a/templates/tickets/scanner-view.php b/templates/tickets/scanner-view.php new file mode 100644 index 0000000..0ecb317 --- /dev/null +++ b/templates/tickets/scanner-view.php @@ -0,0 +1,61 @@ +
+
+
+
+ + + \ No newline at end of file diff --git a/templates/tickets/shopping-cart.php b/templates/tickets/shopping-cart.php new file mode 100644 index 0000000..36eb706 --- /dev/null +++ b/templates/tickets/shopping-cart.php @@ -0,0 +1,71 @@ +cart) : ?> + +
+ +
+ + +
+ +
+
+

Bilety

+
+
    + cart as $data => $value ) + { + foreach ( $value as $key => $val ) + { + $summary_ticket = $val['ticket_price'] * $val['quantity']; + $summary += $summary_ticket; + + $ticket_box = ' +
  • +

    ' . $this->settings['tickets'][$data]['name'] . ' x' . $val["quantity"] . '

    +

    cena: ' . $summary_ticket . ' zł

    + ' . write_btn($data, $key ) . ' +
  • + '; + + echo $ticket_box; + } + } + + // foreach ( $this -> cart as $ticket_id => $combinations ) + // { + // foreach ($combinations as $key => $value) + // { + // $summary_ticket = $value['ticket_price'] * $value['quantity']; + // $summary += $summary_ticket; + + // $ticket_box = ' + //
  • + //

    ' . $this->settings['tickets'][$ticket_id]['name'] . ' x' . $value["quantity"] . '

    + //

    cena: ' . $summary_ticket . ' zł

    + // ' . write_btn($ticket_id, $key ) . ' + //
  • + // '; + + // echo $ticket_box; + // } + // } + + + function write_btn($data, $diffDays) { + if (strpos($data, "gift-price") !== false) { + return ''; + } else { + return ''; + } + }; + ?> +
+
+

Łączna suma:

+

+
+ Kup teraz + +
\ No newline at end of file diff --git a/templates/users/login-form.php b/templates/users/login-form.php new file mode 100644 index 0000000..50e555c --- /dev/null +++ b/templates/users/login-form.php @@ -0,0 +1,104 @@ +
+ +
+ + \ No newline at end of file diff --git a/templates/users/settings.php b/templates/users/settings.php new file mode 100644 index 0000000..f6bcc5b --- /dev/null +++ b/templates/users/settings.php @@ -0,0 +1,84 @@ +
+
+
+
+

pushover API

+ uzupełnił dane potrzebne do wysyłania powiadomień PUSH +
+
+
+ 'Pushover API', + 'name' => 'pushover_api', + 'value' => $this -> user['pushover_api'], + 'inline' => false + ] + );?> + 'Pushover User', + 'name' => 'pushover_user', + 'value' => $this -> user['pushover_user'], + 'inline' => false + ] + );?> + 'btn-success', + 'text' => 'Zapisz ustawienia', + 'icon' => 'fa-check', + 'js' => '$( "#pushover-settings" ).submit();' + ] + );?> +
+
+
+
+
+
+
+

zmiana hasła

+ zmień swoje stare hasło na nowe +
+
+
+ 'Stare hasło', + 'name' => 'password_old', + 'type' => 'password', + 'inline' => false, + 'required' => true, + 'icon_content' => '', + 'icon_js' => 'password_toggle( $( this ).children( "i" ), "password_old" ); return false;' + ] + );?> + 'Nowe hasło', + 'name' => 'password_new', + 'type' => 'password', + 'inline' => false, + 'required' => true, + 'icon_content' => '', + 'icon_js' => 'password_toggle( $( this ).children( "i" ), "password_new" ); return false;' + ] + );?> + 'btn-success', + 'type' => 'submit', + 'text' => 'Zmień hasło', + 'icon' => 'fa-check' + ] + );?> +
+
+
+
+
+ \ No newline at end of file diff --git a/test.txt b/test.txt new file mode 100644 index 0000000..5bf2041 --- /dev/null +++ b/test.txt @@ -0,0 +1 @@ +false /* POST */ {"p24_session_id":"351a4f706b95a8e6d249f754e0b377c7","p24_amount":"2200","p24_order_id":"317317988","p24_pos_id":"156101","p24_merchant_id":"156101","p24_method":"154","p24_currency":"PLN","p24_statement":"p24-H31-B79-H88","p24_sign":"1f6867c69a444db7501d3592040393c2"} /* GET */ {"module":"tickets","action":"przelewy24_response"} \ No newline at end of file