Compare commits

...

10 Commits

Author SHA1 Message Date
Markus
995e2ec111 redesign for mulituser
change validation concept (client and server)
using entities
2026-10-06 08:55:35 +02:00
Markus
14e050e4ba make sure logged in before passwort manager 2026-10-06 07:05:39 +02:00
Markus
bff75d5011 Neuer User für Verwaltung 2026-10-06 00:25:01 +02:00
Markus
6c03f2885e remove old assets 2026-10-06 00:18:16 +02:00
Markus
c0343f9163 update Codeigniter 4.7.3 2026-06-10 10:51:37 +02:00
Markus
6457f38f01 rechnungsanhang handlign
charts bugfix only empty database
2026-06-08 15:58:11 +02:00
Markus
aedd66202a upgrade Codeigniter4.6.1 2025-05-18 11:24:33 +02:00
Markus
8f28ed82da * jquery removed
* charts auf lokal umgestellt
* Rechnungen mit Anhang
* neues Interface Sync automatische
2025-05-17 09:06:12 +02:00
Markus
842d9050dc html5 datetime instead of jquery
anhang pdf rechnung
2025-05-16 21:21:09 +02:00
Markus
de4bd6e366 update auf neuen codeigniter
benutzerverwaltung hinzugefügt
sync scheduled implementiert
2024-11-26 11:45:22 +01:00
225 changed files with 5282 additions and 49289 deletions

2
.gitignore vendored
View File

@@ -125,3 +125,5 @@ nb-configuration.xml
/phpunit*.xml
/.phpunit.*.cache
.env
public/js/env.js

View File

@@ -1,6 +1,6 @@
<IfModule authz_core_module>
Require all denied
Require all denied
</IfModule>
<IfModule !authz_core_module>
Deny from all
Deny from all
</IfModule>

View File

@@ -4,12 +4,12 @@
* The goal of this file is to allow developers a location
* where they can overwrite core procedural functions and
* replace them with their own. This file is loaded during
* the bootstrap process and is called during the frameworks
* the bootstrap process and is called during the framework's
* execution.
*
* This can be looked at as a `master helper` file that is
* loaded early on, and may also contain additional functions
* that you'd like to use throughout your entire application
*
* @see: https://codeigniter4.github.io/CodeIgniter4/
* @see: https://codeigniter.com/user_guide/extending/common.html
*/

View File

@@ -3,7 +3,6 @@
namespace Config;
use CodeIgniter\Config\BaseConfig;
use CodeIgniter\Session\Handlers\FileHandler;
class App extends BaseConfig
{
@@ -12,32 +11,41 @@ class App extends BaseConfig
* Base Site URL
* --------------------------------------------------------------------------
*
* URL to your CodeIgniter root. Typically this will be your base URL,
* URL to your CodeIgniter root. Typically, this will be your base URL,
* WITH a trailing slash:
*
* http://example.com/
*
* If this is not set then CodeIgniter will try guess the protocol, domain
* and path to your installation. However, you should always configure this
* explicitly and never rely on auto-guessing, especially in production
* environments.
*
* @var string
* E.g., http://example.com/
*/
public $baseURL = 'https://finanzen.mawim.at/';
public string $baseURL = 'https://finanzen.mawim.at';
//public $nodeRedUrl = 'https://mqtt.mawim.at/api/';
public string $nodeRedUrl = 'http://localhost:1880/api/';
public string $speedTestUrl = 'http://mqtt.mawim.at:3000/d/qsjZJaYVz/ping-results?orgId=1&from=now-2d&to=now&var-client=nextcloud&kiosk';
public string $spritPreisUrl = 'https://mqtt.mawim.at/mychart/sprit';
public bool $disableShield = false;
/**
* Allowed Hostnames in the Site URL other than the hostname in the baseURL.
* If you want to accept multiple Hostnames, set this.
*
* E.g.,
* When your site URL ($baseURL) is 'http://example.com/', and your site
* also accepts 'http://media.example.com/' and 'http://accounts.example.com/':
* ['media.example.com', 'accounts.example.com']
*
* @var list<string>
*/
public array $allowedHostnames = [];
/**
* --------------------------------------------------------------------------
* Index File
* --------------------------------------------------------------------------
*
* Typically this will be your index.php file, unless you've renamed it to
* something else. If you are using mod_rewrite to remove the page set this
* variable so that it is blank.
*
* @var string
* Typically, this will be your `index.php` file, unless you've renamed it to
* something else. If you have configured your web server to remove this file
* from your site URIs, set this variable to an empty string.
*/
public $indexPage = 'index.php';
public string $indexPage = 'index.php';
/**
* --------------------------------------------------------------------------
@@ -45,18 +53,40 @@ class App extends BaseConfig
* --------------------------------------------------------------------------
*
* This item determines which server global should be used to retrieve the
* URI string. The default setting of 'REQUEST_URI' works for most servers.
* URI string. The default setting of 'REQUEST_URI' works for most servers.
* If your links do not seem to work, try one of the other delicious flavors:
*
* 'REQUEST_URI' Uses $_SERVER['REQUEST_URI']
* 'QUERY_STRING' Uses $_SERVER['QUERY_STRING']
* 'PATH_INFO' Uses $_SERVER['PATH_INFO']
* 'REQUEST_URI': Uses $_SERVER['REQUEST_URI']
* 'QUERY_STRING': Uses $_SERVER['QUERY_STRING']
* 'PATH_INFO': Uses $_SERVER['PATH_INFO']
*
* WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded!
*
* @var string
*/
public $uriProtocol = 'REQUEST_URI';
public string $uriProtocol = 'REQUEST_URI';
/*
|--------------------------------------------------------------------------
| Allowed URL Characters
|--------------------------------------------------------------------------
|
| This lets you specify which characters are permitted within your URLs.
| When someone tries to submit a URL with disallowed characters they will
| get a warning message.
|
| As a security measure you are STRONGLY encouraged to restrict URLs to
| as few characters as possible.
|
| By default, only these are allowed: `a-z 0-9~%.:_-`
|
| Set an empty string to allow all characters -- but only if you are insane.
|
| The configured value is actually a regular expression character group
| and it will be used as: '/\A[<permittedURIChars>]+\z/iu'
|
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
|
*/
public string $permittedURIChars = 'a-z 0-9~%.:_\-\x{0080}-\x{00ff}';
/**
* --------------------------------------------------------------------------
@@ -67,10 +97,8 @@ class App extends BaseConfig
* is viewing the site from. It affects the language strings and other
* strings (like currency markers, numbers, etc), that your program
* should run under for this request.
*
* @var string
*/
public $defaultLocale = 'de';
public string $defaultLocale = 'de';
/**
* --------------------------------------------------------------------------
@@ -81,10 +109,8 @@ class App extends BaseConfig
* language to use based on the value of the Accept-Language header.
*
* If false, no automatic detection will be performed.
*
* @var bool
*/
public $negotiateLocale = false;
public bool $negotiateLocale = false;
/**
* --------------------------------------------------------------------------
@@ -95,9 +121,11 @@ class App extends BaseConfig
* by the application in descending order of priority. If no match is
* found, the first locale will be used.
*
* @var string[]
* IncomingRequest::setLocale() also uses this list.
*
* @var list<string>
*/
public $supportedLocales = ['de'];
public array $supportedLocales = ['de'];
/**
* --------------------------------------------------------------------------
@@ -107,9 +135,10 @@ class App extends BaseConfig
* The default timezone that will be used in your application to display
* dates with the date helper, and can be retrieved through app_timezone()
*
* @var string
* @see https://www.php.net/manual/en/timezones.php for list of timezones
* supported by PHP.
*/
public $appTimezone = 'Europe/Vienna';
public string $appTimezone = 'Europe/Vienna';
/**
* --------------------------------------------------------------------------
@@ -120,210 +149,20 @@ class App extends BaseConfig
* that require a character set to be provided.
*
* @see http://php.net/htmlspecialchars for a list of supported charsets.
*
* @var string
*/
public $charset = 'UTF-8';
public string $charset = 'UTF-8';
/**
* --------------------------------------------------------------------------
* URI PROTOCOL
* Force Global Secure Requests
* --------------------------------------------------------------------------
*
* If true, this will force every request made to this application to be
* made via a secure connection (HTTPS). If the incoming request is not
* secure, the user will be redirected to a secure version of the page
* and the HTTP Strict Transport Security header will be set.
*
* @var bool
* and the HTTP Strict Transport Security (HSTS) header will be set.
*/
public $forceGlobalSecureRequests = false;
/**
* --------------------------------------------------------------------------
* Session Driver
* --------------------------------------------------------------------------
*
* The session storage driver to use:
* - `CodeIgniter\Session\Handlers\FileHandler`
* - `CodeIgniter\Session\Handlers\DatabaseHandler`
* - `CodeIgniter\Session\Handlers\MemcachedHandler`
* - `CodeIgniter\Session\Handlers\RedisHandler`
*
* @var string
*/
public $sessionDriver = FileHandler::class;
/**
* --------------------------------------------------------------------------
* Session Cookie Name
* --------------------------------------------------------------------------
*
* The session cookie name, must contain only [0-9a-z_-] characters
*
* @var string
*/
public $sessionCookieName = 'ci_session';
/**
* --------------------------------------------------------------------------
* Session Expiration
* --------------------------------------------------------------------------
*
* The number of SECONDS you want the session to last.
* Setting to 0 (zero) means expire when the browser is closed.
*
* @var int
*/
public $sessionExpiration = 7200;
/**
* --------------------------------------------------------------------------
* Session Save Path
* --------------------------------------------------------------------------
*
* The location to save sessions to and is driver dependent.
*
* For the 'files' driver, it's a path to a writable directory.
* WARNING: Only absolute paths are supported!
*
* For the 'database' driver, it's a table name.
* Please read up the manual for the format with other session drivers.
*
* IMPORTANT: You are REQUIRED to set a valid save path!
*
* @var string
*/
public $sessionSavePath = WRITEPATH . 'session';
/**
* --------------------------------------------------------------------------
* Session Match IP
* --------------------------------------------------------------------------
*
* Whether to match the user's IP address when reading the session data.
*
* WARNING: If you're using the database driver, don't forget to update
* your session table's PRIMARY KEY when changing this setting.
*
* @var bool
*/
public $sessionMatchIP = false;
/**
* --------------------------------------------------------------------------
* Session Time to Update
* --------------------------------------------------------------------------
*
* How many seconds between CI regenerating the session ID.
*
* @var int
*/
public $sessionTimeToUpdate = 300;
/**
* --------------------------------------------------------------------------
* Session Regenerate Destroy
* --------------------------------------------------------------------------
*
* Whether to destroy session data associated with the old session ID
* when auto-regenerating the session ID. When set to FALSE, the data
* will be later deleted by the garbage collector.
*
* @var bool
*/
public $sessionRegenerateDestroy = false;
/**
* --------------------------------------------------------------------------
* Cookie Prefix
* --------------------------------------------------------------------------
*
* Set a cookie name prefix if you need to avoid collisions.
*
* @var string
*
* @deprecated use Config\Cookie::$prefix property instead.
*/
public $cookiePrefix = '';
/**
* --------------------------------------------------------------------------
* Cookie Domain
* --------------------------------------------------------------------------
*
* Set to `.your-domain.com` for site-wide cookies.
*
* @var string
*
* @deprecated use Config\Cookie::$domain property instead.
*/
public $cookieDomain = '';
/**
* --------------------------------------------------------------------------
* Cookie Path
* --------------------------------------------------------------------------
*
* Typically will be a forward slash.
*
* @var string
*
* @deprecated use Config\Cookie::$path property instead.
*/
public $cookiePath = '/';
/**
* --------------------------------------------------------------------------
* Cookie Secure
* --------------------------------------------------------------------------
*
* Cookie will only be set if a secure HTTPS connection exists.
*
* @var bool
*
* @deprecated use Config\Cookie::$secure property instead.
*/
public $cookieSecure = false;
/**
* --------------------------------------------------------------------------
* Cookie HttpOnly
* --------------------------------------------------------------------------
*
* Cookie will only be accessible via HTTP(S) (no JavaScript).
*
* @var bool
*
* @deprecated use Config\Cookie::$httponly property instead.
*/
public $cookieHTTPOnly = true;
/**
* --------------------------------------------------------------------------
* Cookie SameSite
* --------------------------------------------------------------------------
*
* Configure cookie SameSite setting. Allowed values are:
* - None
* - Lax
* - Strict
* - ''
*
* Alternatively, you can use the constant names:
* - `Cookie::SAMESITE_NONE`
* - `Cookie::SAMESITE_LAX`
* - `Cookie::SAMESITE_STRICT`
*
* Defaults to `Lax` for compatibility with modern browsers. Setting `''`
* (empty string) means default SameSite attribute set by browsers (`Lax`)
* will be set on cookies. If set to `None`, `$cookieSecure` must also be set.
*
* @var string|null
*
* @deprecated use Config\Cookie::$samesite property instead.
*/
public $cookieSameSite = 'Lax';
public bool $forceGlobalSecureRequests = false;
/**
* --------------------------------------------------------------------------
@@ -332,116 +171,21 @@ class App extends BaseConfig
*
* If your server is behind a reverse proxy, you must whitelist the proxy
* IP addresses from which CodeIgniter should trust headers such as
* HTTP_X_FORWARDED_FOR and HTTP_CLIENT_IP in order to properly identify
* X-Forwarded-For or Client-IP in order to properly identify
* the visitor's IP address.
*
* You can use both an array or a comma-separated list of proxy addresses,
* as well as specifying whole subnets. Here are a few examples:
* You need to set a proxy IP address or IP address with subnets and
* the HTTP header for the client IP address.
*
* Comma-separated: '10.0.1.200,192.168.5.0/24'
* Array: ['10.0.1.200', '192.168.5.0/24']
* Here are some examples:
* [
* '10.0.1.200' => 'X-Forwarded-For',
* '192.168.5.0/24' => 'X-Real-IP',
* ]
*
* @var string|string[]
* @var array<string, string>
*/
public $proxyIPs = '';
/**
* --------------------------------------------------------------------------
* CSRF Token Name
* --------------------------------------------------------------------------
*
* The token name.
*
* @deprecated Use `Config\Security` $tokenName property instead of using this property.
*
* @var string
*/
public $CSRFTokenName = 'csrf_test_name';
/**
* --------------------------------------------------------------------------
* CSRF Header Name
* --------------------------------------------------------------------------
*
* The header name.
*
* @deprecated Use `Config\Security` $headerName property instead of using this property.
*
* @var string
*/
public $CSRFHeaderName = 'X-CSRF-TOKEN';
/**
* --------------------------------------------------------------------------
* CSRF Cookie Name
* --------------------------------------------------------------------------
*
* The cookie name.
*
* @deprecated Use `Config\Security` $cookieName property instead of using this property.
*
* @var string
*/
public $CSRFCookieName = 'csrf_cookie_name';
/**
* --------------------------------------------------------------------------
* CSRF Expire
* --------------------------------------------------------------------------
*
* The number in seconds the token should expire.
*
* @deprecated Use `Config\Security` $expire property instead of using this property.
*
* @var int
*/
public $CSRFExpire = 7200;
/**
* --------------------------------------------------------------------------
* CSRF Regenerate
* --------------------------------------------------------------------------
*
* Regenerate token on every submission?
*
* @deprecated Use `Config\Security` $regenerate property instead of using this property.
*
* @var bool
*/
public $CSRFRegenerate = true;
/**
* --------------------------------------------------------------------------
* CSRF Redirect
* --------------------------------------------------------------------------
*
* Redirect to previous page with error on failure?
*
* @deprecated Use `Config\Security` $redirect property instead of using this property.
*
* @var bool
*/
public $CSRFRedirect = true;
/**
* --------------------------------------------------------------------------
* CSRF SameSite
* --------------------------------------------------------------------------
*
* Setting for CSRF SameSite cookie token. Allowed values are:
* - None
* - Lax
* - Strict
* - ''
*
* Defaults to `Lax` as recommended in this link:
*
* @see https://portswigger.net/web-security/csrf/samesite-cookies
* @deprecated `Config\Cookie` $samesite property is used.
*
* @var string
*/
public $CSRFSameSite = 'Lax';
public array $proxyIPs = [];
/**
* --------------------------------------------------------------------------
@@ -458,8 +202,6 @@ class App extends BaseConfig
*
* @see http://www.html5rocks.com/en/tutorials/security/content-security-policy/
* @see http://www.w3.org/TR/CSP/
*
* @var bool
*/
public $CSPEnabled = false;
public bool $CSPEnabled = false;
}

View File

@@ -2,13 +2,28 @@
declare(strict_types=1);
/**
* This file is part of CodeIgniter Shield.
*
* (c) CodeIgniter Foundation <admin@codeigniter.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Config;
use CodeIgniter\Shield\Config\Auth as ShieldAuth;
use CodeIgniter\Shield\Authentication\Actions\ActionInterface;
use CodeIgniter\Shield\Authentication\AuthenticatorInterface;
use CodeIgniter\Shield\Authentication\Authenticators\AccessTokens;
use CodeIgniter\Shield\Authentication\Authenticators\HmacSha256;
use CodeIgniter\Shield\Authentication\Authenticators\JWT;
use CodeIgniter\Shield\Authentication\Authenticators\Session;
use CodeIgniter\Shield\Authentication\Passwords\CompositionValidator;
use CodeIgniter\Shield\Authentication\Passwords\DictionaryValidator;
use CodeIgniter\Shield\Authentication\Passwords\NothingPersonalValidator;
use CodeIgniter\Shield\Authentication\Passwords\PwnedValidator;
use CodeIgniter\Shield\Authentication\Passwords\ValidatorInterface;
use CodeIgniter\Shield\Models\UserModel;
@@ -19,9 +34,20 @@ class Auth extends ShieldAuth
* AUTHENTICATION
* ////////////////////////////////////////////////////////////////////
*/
// Constants for Record Login Attempts. Do not change.
public const RECORD_LOGIN_ATTEMPT_NONE = 0; // Do not record at all
public const RECORD_LOGIN_ATTEMPT_FAILURE = 1; // Record only failures
public const RECORD_LOGIN_ATTEMPT_ALL = 2; // Record all login attempts
/**
* --------------------------------------------------------------------
* View files
* --------------------------------------------------------------------
*/
public array $views = [
'login' => '\CodeIgniter\Shield\Views\login',
'register' => '\CodeIgniter\Shield\Views\register',
'login' => 'auth/login',
'register' => 'auth/register',
'layout' => '\CodeIgniter\Shield\Views\layout',
'action_email_2fa' => '\CodeIgniter\Shield\Views\email_2fa_show',
'action_email_2fa_verify' => '\CodeIgniter\Shield\Views\email_2fa_verify',
@@ -35,16 +61,25 @@ class Auth extends ShieldAuth
/**
* --------------------------------------------------------------------
* Redirect urLs
* Redirect URLs
* --------------------------------------------------------------------
* The default URL that a user will be redirected to after
* various auth actions. If you need more flexibility you can
* override the `getUrl()` method to apply any logic you may need.
* The default URL that a user will be redirected to after various auth
* actions. This can be either of the following:
*
* 1. An absolute URL. E.g. http://example.com OR https://example.com
* 2. A named route that can be accessed using `route_to()` or `url_to()`
* 3. A URI path within the application. e.g 'admin', 'login', 'expath'
*
* If you need more flexibility you can override the `getUrl()` method
* to apply any logic you may need.
*/
public array $redirects = [
'register' => '/',
'login' => '/',
'logout' => 'login',
'register' => '/',
'login' => '/',
'logout' => 'login',
'force_reset' => '/',
'permission_denied' => '/',
'group_denied' => '/',
];
/**
@@ -57,13 +92,13 @@ class Auth extends ShieldAuth
* You must register actions in the order of the actions to be performed.
*
* Available actions with Shield:
* - register: 'CodeIgniter\Shield\Authentication\Actions\EmailActivator'
* - login: 'CodeIgniter\Shield\Authentication\Actions\Email2FA'
* - register: \CodeIgniter\Shield\Authentication\Actions\EmailActivator::class
* - login: \CodeIgniter\Shield\Authentication\Actions\Email2FA::class
*
* @var array<string, class-string<ActionInterface>|null>
*/
public array $actions = [
'register' => null,
'register' => \CodeIgniter\Shield\Authentication\Actions\EmailActivator::class,
'login' => null,
];
@@ -81,29 +116,10 @@ class Auth extends ShieldAuth
public array $authenticators = [
'tokens' => AccessTokens::class,
'session' => Session::class,
'hmac' => HmacSha256::class,
// 'jwt' => JWT::class,
];
/**
* --------------------------------------------------------------------
* Name of Authenticator Header
* --------------------------------------------------------------------
* The name of Header that the Authorization token should be found.
* According to the specs, this should be `Authorization`, but rare
* circumstances might need a different header.
*/
public array $authenticatorHeader = [
'tokens' => 'Authorization',
];
/**
* --------------------------------------------------------------------
* Unused Token Lifetime
* --------------------------------------------------------------------
* Determines the amount of time, in seconds, that an unused
* access token can be used.
*/
public int $unusedTokenLifetime = YEAR;
/**
* --------------------------------------------------------------------
* Default Authenticator
@@ -121,12 +137,13 @@ class Auth extends ShieldAuth
* when using the 'chain' filter. Each Authenticator listed will be checked.
* If no match is found, then the next in the chain will be checked.
*
* @var string[]
* @phpstan-var list<string>
* @var list<string>
*/
public array $authenticationChain = [
'session',
'tokens',
'hmac',
// 'jwt',
];
/**
@@ -142,7 +159,10 @@ class Auth extends ShieldAuth
* Record Last Active Date
* --------------------------------------------------------------------
* If true, will always update the `last_active` datetime for the
* logged in user on every page request.
* logged-in user on every page request.
* This feature only works when session/tokens filter is active.
*
* @see https://codeigniter4.github.io/shield/quick_start_guide/using_session_auth/#protecting-pages for set filters.
*/
public bool $recordActiveDate = true;
@@ -188,6 +208,43 @@ class Auth extends ShieldAuth
'rememberLength' => 30 * DAY,
];
/**
* --------------------------------------------------------------------
* The validation rules for username
* --------------------------------------------------------------------
*
* Do not use string rules like `required|valid_email`.
*
* @var array<string, array<int, string>|string>
*/
public array $usernameValidationRules = [
'label' => 'Auth.username',
'rules' => [
'required',
'max_length[30]',
'min_length[3]',
'regex_match[/\A[a-zA-Z0-9\.]+\z/]',
],
];
/**
* --------------------------------------------------------------------
* The validation rules for email
* --------------------------------------------------------------------
*
* Do not use string rules like `required|valid_email`.
*
* @var array<string, array<int, string>|string>
*/
public array $emailValidationRules = [
'label' => 'Auth.email',
'rules' => [
'required',
'max_length[254]',
'valid_email',
],
];
/**
* --------------------------------------------------------------------
* Minimum Password Length
@@ -206,13 +263,13 @@ class Auth extends ShieldAuth
* You can add custom classes as long as they adhere to the
* CodeIgniter\Shield\Authentication\Passwords\ValidatorInterface.
*
* @var class-string<ValidatorInterface>[]
* @var list<class-string<ValidatorInterface>>
*/
public array $passwordValidators = [
'CodeIgniter\Shield\Authentication\Passwords\CompositionValidator',
'CodeIgniter\Shield\Authentication\Passwords\NothingPersonalValidator',
'CodeIgniter\Shield\Authentication\Passwords\DictionaryValidator',
//'CodeIgniter\Shield\Authentication\Passwords\PwnedValidator',
CompositionValidator::class,
NothingPersonalValidator::class,
DictionaryValidator::class,
// PwnedValidator::class,
];
/**
@@ -278,56 +335,87 @@ class Auth extends ShieldAuth
/**
* --------------------------------------------------------------------
* Encryption Algorithm to use
* Hashing Algorithm to use
* --------------------------------------------------------------------
* Valid values are
* - PASSWORD_DEFAULT (default)
* - PASSWORD_BCRYPT
* - PASSWORD_ARGON2I - As of PHP 7.2 only if compiled with support for it
* - PASSWORD_ARGON2ID - As of PHP 7.3 only if compiled with support for it
*
* If you choose to use any ARGON algorithm, then you might want to
* uncomment the "ARGON2i/D Algorithm" options to suit your needs
*/
public string $hashAlgorithm = PASSWORD_DEFAULT;
/**
* --------------------------------------------------------------------
* ARGON2i/D Algorithm options
* ARGON2I/ARGON2ID Algorithm options
* --------------------------------------------------------------------
* The ARGON2I method of encryption allows you to define the "memory_cost",
* The ARGON2I method of hashing allows you to define the "memory_cost",
* the "time_cost" and the number of "threads", whenever a password hash is
* created.
* This defaults to a value of 10 which is an acceptable number.
* However, depending on the security needs of your application
* and the power of your hardware, you might want to increase the
* cost. This makes the hashing process takes longer.
*/
public int $hashMemoryCost = 2048; // PASSWORD_ARGON2_DEFAULT_MEMORY_COST;
public int $hashMemoryCost = 65536; // PASSWORD_ARGON2_DEFAULT_MEMORY_COST;
public int $hashTimeCost = 4; // PASSWORD_ARGON2_DEFAULT_TIME_COST;
public int $hashThreads = 4; // PASSWORD_ARGON2_DEFAULT_THREADS;
public int $hashTimeCost = 4; // PASSWORD_ARGON2_DEFAULT_TIME_COST;
public int $hashThreads = 1; // PASSWORD_ARGON2_DEFAULT_THREADS;
/**
* --------------------------------------------------------------------
* Password Hashing Cost
* BCRYPT Algorithm options
* --------------------------------------------------------------------
* The BCRYPT method of encryption allows you to define the "cost"
* The BCRYPT method of hashing allows you to define the "cost"
* or number of iterations made, whenever a password hash is created.
* This defaults to a value of 10 which is an acceptable number.
* This defaults to a value of 12 which is an acceptable number.
* However, depending on the security needs of your application
* and the power of your hardware, you might want to increase the
* cost. This makes the hashing process takes longer.
*
* Valid range is between 4 - 31.
*/
public int $hashCost = 10;
public int $hashCost = 12;
/**
* ////////////////////////////////////////////////////////////////////
* OTHER SETTINGS
* ////////////////////////////////////////////////////////////////////
*/
/**
* --------------------------------------------------------------------
* Customize the DB group used for each model
* --------------------------------------------------------------------
*/
public ?string $DBGroup = 'verwaltung';
/**
* --------------------------------------------------------------------
* Customize Name of Shield Tables
* --------------------------------------------------------------------
* Only change if you want to rename the default Shield table names
*
* It may be necessary to change the names of the tables for
* security reasons, to prevent the conflict of table names,
* the internal policy of the companies or any other reason.
*
* - users Auth Users Table, the users info is stored.
* - auth_identities Auth Identities Table, Used for storage of passwords, access tokens, social login identities, etc.
* - auth_logins Auth Login Attempts, Table records login attempts.
* - auth_token_logins Auth Token Login Attempts Table, Records Bearer Token type login attempts.
* - auth_remember_tokens Auth Remember Tokens (remember-me) Table.
* - auth_groups_users Groups Users Table.
* - auth_permissions_users Users Permissions Table.
*
* @var array<string, string>
*/
public array $tables = [
'users' => 'users',
'identities' => 'auth_identities',
'logins' => 'auth_logins',
'token_logins' => 'auth_token_logins',
'remember_tokens' => 'auth_remember_tokens',
'groups_users' => 'auth_groups_users',
'permissions_users' => 'auth_permissions_users',
];
/**
* --------------------------------------------------------------------
* User Provider
@@ -340,7 +428,7 @@ class Auth extends ShieldAuth
*
* @var class-string<UserModel>
*/
public string $userProvider = 'CodeIgniter\Shield\Models\UserModel';
public string $userProvider = UserModel::class;
/**
* Returns the URL that a user should be redirected
@@ -348,7 +436,8 @@ class Auth extends ShieldAuth
*/
public function loginRedirect(): string
{
$url = setting('Auth.redirects')['login'];
$session = session();
$url = $session->getTempdata('beforeLoginUrl') ?? setting('Auth.redirects')['login'];
return $this->getUrl($url);
}
@@ -375,10 +464,65 @@ class Auth extends ShieldAuth
return $this->getUrl($url);
}
/**
* Returns the URL the user should be redirected to
* if force_reset identity is set to true.
*/
public function forcePasswordResetRedirect(): string
{
$url = setting('Auth.redirects')['force_reset'];
return $this->getUrl($url);
}
/**
* Returns the URL the user should be redirected to
* if permission denied.
*/
public function permissionDeniedRedirect(): string
{
$url = setting('Auth.redirects')['permission_denied'];
return $this->getUrl($url);
}
/**
* Returns the URL the user should be redirected to
* if group denied.
*/
public function groupDeniedRedirect(): string
{
$url = setting('Auth.redirects')['group_denied'];
return $this->getUrl($url);
}
/**
* Accepts a string which can be an absolute URL or
* a named route or just a URI path, and returns the
* full path.
*
* @param string $url an absolute URL or a named route or just URI path
*/
protected function getUrl(string $url): string
{
return strpos($url, 'http') === 0
? $url
: rtrim(site_url($url), '/ ');
// To accommodate all url patterns
$final_url = '';
switch (true) {
case strpos($url, 'http://') === 0 || strpos($url, 'https://') === 0: // URL begins with 'http' or 'https'. E.g. http://example.com
$final_url = $url;
break;
case route_to($url) !== false: // URL is a named-route
$final_url = rtrim(url_to($url), '/ ');
break;
default: // URL is a route (URI path)
$final_url = rtrim(site_url($url), '/ ');
break;
}
return $final_url;
}
}

View File

@@ -2,6 +2,15 @@
declare(strict_types=1);
/**
* This file is part of CodeIgniter Shield.
*
* (c) CodeIgniter Foundation <admin@codeigniter.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Config;
use CodeIgniter\Shield\Config\AuthGroups as ShieldAuthGroups;
@@ -20,10 +29,16 @@ class AuthGroups extends ShieldAuthGroups
* --------------------------------------------------------------------
* Groups
* --------------------------------------------------------------------
* The available authentication systems, listed
* with alias and class name. These can be referenced
* by alias in the auth helper:
* auth('api')->attempt($credentials);
* An associative array of the available groups in the system, where the keys
* are the group names and the values are arrays of the group info.
*
* Whatever value you assign as the key will be used to refer to the group
* when using functions such as:
* $user->addGroup('superadmin');
*
* @var array<string, array<string, string>>
*
* @see https://codeigniter4.github.io/shield/quick_start_guide/using_authorization/#change-available-groups for more info
*/
public array $groups = [
'superadmin' => [
@@ -34,17 +49,17 @@ class AuthGroups extends ShieldAuthGroups
'title' => 'Admin',
'description' => 'Day to day administrators of the site.',
],
'developer' => [
'title' => 'Developer',
'description' => 'Site programmers.',
'finanzen' => [
'title' => 'Finanzmanger User',
'description' => 'Buchhaltung.',
],
'user' => [
'title' => 'User',
'description' => 'General users of the site. Often customers.',
],
'beta' => [
'title' => 'Beta User',
'description' => 'Has access to beta-level features.',
'smarthome' => [
'title' => 'Smarthome User',
'description' => 'Kann Smarthome eingeschränkt benutzen.',
],
];
@@ -52,8 +67,7 @@ class AuthGroups extends ShieldAuthGroups
* --------------------------------------------------------------------
* Permissions
* --------------------------------------------------------------------
* The available permissions in the system. Each system is defined
* where the key is the
* The available permissions in the system.
*
* If a permission is not listed here it cannot be used.
*/
@@ -64,20 +78,28 @@ class AuthGroups extends ShieldAuthGroups
'users.create' => 'Can create new non-admin users',
'users.edit' => 'Can edit existing non-admin users',
'users.delete' => 'Can delete existing non-admin users',
'beta.access' => 'Can access beta-level features',
];
'finanzen.view' => 'Can view FinanzManager',
'finanzen.change' => 'Can use FinanzManager',
'smarthome.settings' => 'Can change settings in smarthome',
'smarthome.action' => 'Can switch lights in smarthome',
'smarthome.view' => 'Can view smarthome site',
];
/**
* --------------------------------------------------------------------
* Permissions Matrix
* --------------------------------------------------------------------
* Maps permissions to groups.
*
* This defines group-level permissions.
*/
public array $matrix = [
'superadmin' => [
'admin.*',
'users.*',
'beta.*',
'smarthome.*',
'finanzen.*',
],
'admin' => [
'admin.access',
@@ -86,16 +108,15 @@ class AuthGroups extends ShieldAuthGroups
'users.delete',
'beta.access',
],
'developer' => [
'admin.access',
'admin.settings',
'users.create',
'users.edit',
'beta.access',
'finanzen' => [
'finanzen.view',
'finanzen.change',
],
'user' => [],
'beta' => [
'beta.access',
'user' => [
'smarthome.view',
],
'smarthome' => [
'smarthome.action',
],
];
}

138
app/Config/AuthToken.php Normal file
View File

@@ -0,0 +1,138 @@
<?php
declare(strict_types=1);
/**
* This file is part of CodeIgniter Shield.
*
* (c) CodeIgniter Foundation <admin@codeigniter.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Config;
use CodeIgniter\Shield\Config\AuthToken as ShieldAuthToken;
/**
* Configuration for Token Auth and HMAC Auth
*/
class AuthToken extends ShieldAuthToken
{
/**
* --------------------------------------------------------------------
* Record Login Attempts for Token Auth and HMAC Auth
* --------------------------------------------------------------------
* Specify which login attempts are recorded in the database.
*
* Valid values are:
* - Auth::RECORD_LOGIN_ATTEMPT_NONE
* - Auth::RECORD_LOGIN_ATTEMPT_FAILURE
* - Auth::RECORD_LOGIN_ATTEMPT_ALL
*/
public int $recordLoginAttempt = Auth::RECORD_LOGIN_ATTEMPT_FAILURE;
/**
* --------------------------------------------------------------------
* Name of Authenticator Header
* --------------------------------------------------------------------
* The name of Header that the Authorization token should be found.
* According to the specs, this should be `Authorization`, but rare
* circumstances might need a different header.
*/
public array $authenticatorHeader = [
'tokens' => 'Authorization',
'hmac' => 'Authorization',
];
/**
* --------------------------------------------------------------------
* Unused Token Lifetime for Token Auth and HMAC Auth
* --------------------------------------------------------------------
* Determines the amount of time, in seconds, that an unused token can
* be used.
*/
public int $unusedTokenLifetime = YEAR;
/**
* --------------------------------------------------------------------
* Secret2 storage character limit
* --------------------------------------------------------------------
* Database size limit for the identities 'secret2' field.
*/
public int $secret2StorageLimit = 255;
/**
* --------------------------------------------------------------------
* HMAC secret key byte size
* --------------------------------------------------------------------
* Specify in integer the desired byte size of the
* HMAC SHA256 byte size
*/
public int $hmacSecretKeyByteSize = 32;
/**
* --------------------------------------------------------------------
* HMAC encryption Keys
* --------------------------------------------------------------------
* This sets the key to be used when encrypting a user's HMAC Secret Key.
*
* 'keys' is an array of keys which will facilitate key rotation. Valid
* keyTitles must include only [a-zA-Z0-9_] and should be kept to a
* max of 8 characters.
*
* Each keyTitle is an associative array containing the required 'key'
* value, and the optional 'driver' and 'digest' values. If the
* 'driver' and 'digest' values are not specified, the default 'driver'
* and 'digest' values will be used.
*
* Old keys will are used to decrypt existing Secret Keys. It is encouraged
* to run 'php spark shield:hmac reencrypt' to update existing Secret
* Key encryptions.
*
* @see https://codeigniter.com/user_guide/libraries/encryption.html
*
* @var array<string, array{key: string, driver?: string, digest?: string}>|string
*
* NOTE: The value becomes temporarily a string when setting value as JSON
* from environment variable.
*
* [key_name => ['key' => key_value]]
* or [key_name => ['key' => key_value, 'driver' => driver, 'digest' => digest]]
*/
public $hmacEncryptionKeys = [
'k1' => [
'key' => '',
],
];
/**
* --------------------------------------------------------------------
* HMAC Current Encryption Key Selector
* --------------------------------------------------------------------
* This specifies which of the encryption keys should be used.
*/
public string $hmacEncryptionCurrentKey = 'k1';
/**
* --------------------------------------------------------------------
* HMAC Encryption Key Driver
* --------------------------------------------------------------------
* This specifies which of the encryption drivers should be used.
*
* Available drivers:
* - OpenSSL
* - Sodium
*/
public string $hmacEncryptionDefaultDriver = 'OpenSSL';
/**
* --------------------------------------------------------------------
* HMAC Encryption Key Driver
* --------------------------------------------------------------------
* THis specifies the type of encryption to be used.
* e.g. 'SHA512' or 'SHA256'.
*/
public string $hmacEncryptionDefaultDigest = 'SHA512';
}

View File

@@ -13,7 +13,10 @@ use CodeIgniter\Config\AutoloadConfig;
* can find the files as needed.
*
* NOTE: If you use an identical key in $psr4 or $classmap, then
* the values in this file will overwrite the framework's values.
* the values in this file will overwrite the framework's values.
*
* NOTE: This class is required prior to Autoloader instantiation,
* and does not extend BaseConfig.
*/
class Autoload extends AutoloadConfig
{
@@ -25,24 +28,17 @@ class Autoload extends AutoloadConfig
* their location on the file system. These are used by the autoloader
* to locate files the first time they have been instantiated.
*
* The '/app' and '/system' directories are already mapped for you.
* you may change the name of the 'App' namespace if you wish,
* The 'Config' (APPPATH . 'Config') and 'CodeIgniter' (SYSTEMPATH) are
* already mapped for you.
*
* You may change the name of the 'App' namespace if you wish,
* but this should be done prior to creating any namespaced classes,
* else you will need to modify all of those classes for this to work.
*
* Prototype:
*```
* $psr4 = [
* 'CodeIgniter' => SYSTEMPATH,
* 'App' => APPPATH
* ];
*```
*
* @var array<string, string>
* @var array<string, list<string>|string>
*/
public $psr4 = [
APP_NAMESPACE => APPPATH, // For custom app namespace
'Config' => APPPATH . 'Config',
APP_NAMESPACE => APPPATH,
];
/**
@@ -56,11 +52,9 @@ class Autoload extends AutoloadConfig
* were being autoloaded through a namespace.
*
* Prototype:
*```
* $classmap = [
* 'MyClass' => '/path/to/class/file.php'
* ];
*```
*
* @var array<string, string>
*/
@@ -75,13 +69,24 @@ class Autoload extends AutoloadConfig
* or for loading functions.
*
* Prototype:
* ```
* $files = [
* '/path/to/my/file.php',
* ];
* ```
* $files = [
* '/path/to/my/file.php',
* ];
*
* @var array<int, string>
* @var list<string>
*/
public $files = [];
}
/**
* -------------------------------------------------------------------
* Helpers
* -------------------------------------------------------------------
* Prototype:
* $helpers = [
* 'form',
* ];
*
* @var list<string>
*/
public $helpers = ['auth', 'setting'];
}

View File

@@ -7,8 +7,10 @@
| In development, we want to show as many errors as possible to help
| make sure they don't make it to production. And save us hours of
| painful debugging.
|
| If you set 'display_errors' to '1', CI4's detailed error report will show.
*/
error_reporting(-1);
error_reporting(E_ALL);
ini_set('display_errors', '1');
/*

View File

@@ -6,9 +6,13 @@
|--------------------------------------------------------------------------
| Don't show ANY in production environments. Instead, let the system catch
| it and display a generic error message.
|
| If you set 'display_errors' to '1', CI4's detailed error report will show.
*/
error_reporting(E_ALL & ~E_DEPRECATED);
// If you want to suppress more types of errors.
// error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
ini_set('display_errors', '0');
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
/*
|--------------------------------------------------------------------------

View File

@@ -1,5 +1,11 @@
<?php
/*
* The environment testing is reserved for PHPUnit testing. It has special
* conditions built into the framework at various places to assist with that.
* You can’t use it for your development.
*/
/*
|--------------------------------------------------------------------------
| ERROR DISPLAY
@@ -8,7 +14,7 @@
| make sure they don't make it to production. And save us hours of
| painful debugging.
*/
error_reporting(-1);
error_reporting(E_ALL);
ini_set('display_errors', '1');
/*

View File

@@ -6,6 +6,22 @@ use CodeIgniter\Config\BaseConfig;
class CURLRequest extends BaseConfig
{
/**
* --------------------------------------------------------------------------
* CURLRequest Share Connection Options
* --------------------------------------------------------------------------
*
* Share connection options between requests.
*
* @var list<int>
*
* @see https://www.php.net/manual/en/curl.constants.php#constant.curl-lock-data-connect
*/
public array $shareConnectionOptions = [
CURL_LOCK_DATA_CONNECT,
CURL_LOCK_DATA_DNS,
];
/**
* --------------------------------------------------------------------------
* CURLRequest Share Options
@@ -15,8 +31,6 @@ class CURLRequest extends BaseConfig
*
* If true, all the options won't be reset between requests.
* It may cause an error request with unnecessary headers.
*
* @var bool
*/
public $shareOptions = true;
public bool $shareOptions = false;
}

View File

@@ -2,6 +2,8 @@
namespace Config;
use CodeIgniter\Cache\CacheInterface;
use CodeIgniter\Cache\Handlers\ApcuHandler;
use CodeIgniter\Cache\Handlers\DummyHandler;
use CodeIgniter\Cache\Handlers\FileHandler;
use CodeIgniter\Cache\Handlers\MemcachedHandler;
@@ -19,10 +21,8 @@ class Cache extends BaseConfig
*
* The name of the preferred handler that should be used. If for some reason
* it is not available, the $backupHandler will be used in its place.
*
* @var string
*/
public $handler = 'file';
public string $handler = 'file';
/**
* --------------------------------------------------------------------------
@@ -32,43 +32,8 @@ class Cache extends BaseConfig
* The name of the handler that will be used in case the first one is
* unreachable. Often, 'file' is used here since the filesystem is
* always available, though that's not always practical for the app.
*
* @var string
*/
public $backupHandler = 'dummy';
/**
* --------------------------------------------------------------------------
* Cache Directory Path
* --------------------------------------------------------------------------
*
* The path to where cache files should be stored, if using a file-based
* system.
*
* @var string
*
* @deprecated Use the driver-specific variant under $file
*/
public $storePath = WRITEPATH . 'cache/';
/**
* --------------------------------------------------------------------------
* Cache Include Query String
* --------------------------------------------------------------------------
*
* Whether to take the URL query string into consideration when generating
* output cache files. Valid options are:
*
* false = Disabled
* true = Enabled, take all query parameters into account.
* Please be aware that this may result in numerous cache
* files generated for the same page over and over again.
* array('q') = Enabled, but only take into account the specified list
* of query parameters.
*
* @var bool|string[]
*/
public $cacheQueryString = false;
public string $backupHandler = 'dummy';
/**
* --------------------------------------------------------------------------
@@ -77,10 +42,8 @@ class Cache extends BaseConfig
*
* This string is added to all cache item names to help avoid collisions
* if you run multiple applications with the same cache engine.
*
* @var string
*/
public $prefix = '';
public string $prefix = '';
/**
* --------------------------------------------------------------------------
@@ -92,10 +55,8 @@ class Cache extends BaseConfig
* WARNING: This is not used by framework handlers where 60 seconds is
* hard-coded, but may be useful to projects and modules. This will replace
* the hard-coded value in a future release.
*
* @var int
*/
public $ttl = 60;
public int $ttl = 60;
/**
* --------------------------------------------------------------------------
@@ -105,22 +66,22 @@ class Cache extends BaseConfig
* A string of reserved characters that will not be allowed in keys or tags.
* Strings that violate this restriction will cause handlers to throw.
* Default: {}()/\@:
* Note: The default set is required for PSR-6 compliance.
*
* @var string
* NOTE: The default set is required for PSR-6 compliance.
*/
public $reservedCharacters = '{}()/\@:';
public string $reservedCharacters = '{}()/\@:';
/**
* --------------------------------------------------------------------------
* File settings
* --------------------------------------------------------------------------
*
* Your file storage preferences can be specified below, if you are using
* the File driver.
*
* @var array<string, int|string|null>
* @var array{storePath?: string, mode?: int}
*/
public $file = [
public array $file = [
'storePath' => WRITEPATH . 'cache/',
'mode' => 0640,
];
@@ -129,14 +90,15 @@ class Cache extends BaseConfig
* -------------------------------------------------------------------------
* Memcached settings
* -------------------------------------------------------------------------
*
* Your Memcached servers can be specified below, if you are using
* the Memcached drivers.
*
* @see https://codeigniter.com/user_guide/libraries/caching.html#memcached
*
* @var array<string, boolean|int|string>
* @var array{host?: string, port?: int, weight?: int, raw?: bool}
*/
public $memcached = [
public array $memcached = [
'host' => '127.0.0.1',
'port' => 11211,
'weight' => 1,
@@ -147,17 +109,28 @@ class Cache extends BaseConfig
* -------------------------------------------------------------------------
* Redis settings
* -------------------------------------------------------------------------
*
* Your Redis server can be specified below, if you are using
* the Redis or Predis drivers.
*
* @var array<string, int|string|null>
* @var array{
* host?: string,
* password?: string|null,
* port?: int,
* timeout?: int,
* async?: bool,
* persistent?: bool,
* database?: int
* }
*/
public $redis = [
'host' => '127.0.0.1',
'password' => null,
'port' => 6379,
'timeout' => 0,
'database' => 0,
public array $redis = [
'host' => '127.0.0.1',
'password' => null,
'port' => 6379,
'timeout' => 0,
'async' => false, // specific to Predis and ignored by the native Redis extension
'persistent' => false,
'database' => 0,
];
/**
@@ -168,9 +141,10 @@ class Cache extends BaseConfig
* This is an array of cache engine alias' and class names. Only engines
* that are listed here are allowed to be used.
*
* @var array<string, string>
* @var array<string, class-string<CacheInterface>>
*/
public $validHandlers = [
public array $validHandlers = [
'apcu' => ApcuHandler::class,
'dummy' => DummyHandler::class,
'file' => FileHandler::class,
'memcached' => MemcachedHandler::class,
@@ -178,4 +152,47 @@ class Cache extends BaseConfig
'redis' => RedisHandler::class,
'wincache' => WincacheHandler::class,
];
/**
* --------------------------------------------------------------------------
* Web Page Caching: Cache Include Query String
* --------------------------------------------------------------------------
*
* Whether to take the URL query string into consideration when generating
* output cache files. Valid options are:
*
* false = Disabled
* true = Enabled, take all query parameters into account.
* Please be aware that this may result in numerous cache
* files generated for the same page over and over again.
* ['q'] = Enabled, but only take into account the specified list
* of query parameters.
*
* @var bool|list<string>
*/
public $cacheQueryString = false;
/**
* --------------------------------------------------------------------------
* Web Page Caching: Cache Status Codes
* --------------------------------------------------------------------------
*
* HTTP status codes that are allowed to be cached. Only responses with
* these status codes will be cached by the PageCache filter.
*
* Default: [] - Cache all status codes (backward compatible)
*
* Recommended: [200] - Only cache successful responses
*
* You can also use status codes like:
* [200, 404, 410] - Cache successful responses and specific error codes
* [200, 201, 202, 203, 204] - All 2xx successful responses
*
* WARNING: Using [] may cache temporary error pages (404, 500, etc).
* Consider restricting to [200] for production applications to avoid
* caching errors that should be temporary.
*
* @var list<int>
*/
public array $cacheStatusCodes = [];
}

View File

@@ -77,18 +77,3 @@ defined('EXIT_USER_INPUT') || define('EXIT_USER_INPUT', 7); // invalid u
defined('EXIT_DATABASE') || define('EXIT_DATABASE', 8); // database error
defined('EXIT__AUTO_MIN') || define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
defined('EXIT__AUTO_MAX') || define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code
/**
* @deprecated Use \CodeIgniter\Events\Events::PRIORITY_LOW instead.
*/
define('EVENT_PRIORITY_LOW', 200);
/**
* @deprecated Use \CodeIgniter\Events\Events::PRIORITY_NORMAL instead.
*/
define('EVENT_PRIORITY_NORMAL', 100);
/**
* @deprecated Use \CodeIgniter\Events\Events::PRIORITY_HIGH instead.
*/
define('EVENT_PRIORITY_HIGH', 10);

View File

@@ -15,64 +15,93 @@ use CodeIgniter\Config\BaseConfig;
*/
class ContentSecurityPolicy extends BaseConfig
{
//-------------------------------------------------------------------------
// -------------------------------------------------------------------------
// Broadbrush CSP management
//-------------------------------------------------------------------------
// -------------------------------------------------------------------------
/**
* Default CSP report context
*
* @var bool
*/
public $reportOnly = false;
public bool $reportOnly = false;
/**
* Specifies a URL where a browser will send reports
* when a content security policy is violated.
*
* @var string|null
*/
public $reportURI;
public ?string $reportURI = null;
/**
* Specifies a reporting endpoint to which violation reports ought to be sent.
*/
public ?string $reportTo = null;
/**
* Instructs user agents to rewrite URL schemes, changing
* HTTP to HTTPS. This directive is for websites with
* large numbers of old URLs that need to be rewritten.
*
* @var bool
*/
public $upgradeInsecureRequests = false;
public bool $upgradeInsecureRequests = false;
//-------------------------------------------------------------------------
// Sources allowed
// Note: once you set a policy to 'none', it cannot be further restricted
//-------------------------------------------------------------------------
// -------------------------------------------------------------------------
// CSP DIRECTIVES SETTINGS
// NOTE: once you set a policy to 'none', it cannot be further restricted
// -------------------------------------------------------------------------
/**
* Will default to self if not overridden
* Will default to `'self'` if not overridden
*
* @var string|string[]|null
* @var list<string>|string|null
*/
public $defaultSrc;
/**
* Lists allowed scripts' URLs.
*
* @var string|string[]
* @var list<string>|string
*/
public $scriptSrc = 'self';
/**
* Specifies valid sources for JavaScript <script> elements.
*
* @var list<string>|string
*/
public array|string $scriptSrcElem = 'self';
/**
* Specifies valid sources for JavaScript inline event
* handlers and JavaScript URLs.
*
* @var list<string>|string
*/
public array|string $scriptSrcAttr = 'self';
/**
* Lists allowed stylesheets' URLs.
*
* @var string|string[]
* @var list<string>|string
*/
public $styleSrc = 'self';
/**
* Specifies valid sources for stylesheets <link> elements.
*
* @var list<string>|string
*/
public array|string $styleSrcElem = 'self';
/**
* Specifies valid sources for stylesheets inline
* style attributes and `<style>` elements.
*
* @var list<string>|string
*/
public array|string $styleSrcAttr = 'self';
/**
* Defines the origins from which images can be loaded.
*
* @var string|string[]
* @var list<string>|string
*/
public $imageSrc = 'self';
@@ -81,14 +110,14 @@ class ContentSecurityPolicy extends BaseConfig
*
* Will default to self if not overridden
*
* @var string|string[]|null
* @var list<string>|string|null
*/
public $baseURI;
/**
* Lists the URLs for workers and embedded frame contents
*
* @var string|string[]
* @var list<string>|string
*/
public $childSrc = 'self';
@@ -96,21 +125,21 @@ class ContentSecurityPolicy extends BaseConfig
* Limits the origins that you can connect to (via XHR,
* WebSockets, and EventSource).
*
* @var string|string[]
* @var list<string>|string
*/
public $connectSrc = 'self';
/**
* Specifies the origins that can serve web fonts.
*
* @var string|string[]
* @var list<string>|string
*/
public $fontSrc;
/**
* Lists valid endpoints for submission from `<form>` tags.
*
* @var string|string[]
* @var list<string>|string
*/
public $formAction = 'self';
@@ -120,7 +149,7 @@ class ContentSecurityPolicy extends BaseConfig
* and `<applet>` tags. This directive can't be used in
* `<meta>` tags and applies only to non-HTML resources.
*
* @var string|string[]|null
* @var list<string>|string|null
*/
public $frameAncestors;
@@ -128,61 +157,60 @@ class ContentSecurityPolicy extends BaseConfig
* The frame-src directive restricts the URLs which may
* be loaded into nested browsing contexts.
*
* @var array|string|null
* @var list<string>|string|null
*/
public $frameSrc;
/**
* Restricts the origins allowed to deliver video and audio.
*
* @var string|string[]|null
* @var list<string>|string|null
*/
public $mediaSrc;
/**
* Allows control over Flash and other plugins.
*
* @var string|string[]
* @var list<string>|string
*/
public $objectSrc = 'self';
/**
* @var string|string[]|null
* @var list<string>|string|null
*/
public $manifestSrc;
/**
* @var list<string>|string
*/
public array|string $workerSrc = [];
/**
* Limits the kinds of plugins a page may invoke.
*
* @var string|string[]|null
* @var list<string>|string|null
*/
public $pluginTypes;
/**
* List of actions allowed.
*
* @var string|string[]|null
* @var list<string>|string|null
*/
public $sandbox;
/**
* Nonce tag for style
*
* @var string
* Nonce placeholder for style tags.
*/
public $styleNonceTag = '{csp-style-nonce}';
public string $styleNonceTag = '{csp-style-nonce}';
/**
* Nonce tag for script
*
* @var string
* Nonce placeholder for script tags.
*/
public $scriptNonceTag = '{csp-script-nonce}';
public string $scriptNonceTag = '{csp-script-nonce}';
/**
* Replace nonce tag automatically
*
* @var bool
* Replace nonce tag automatically?
*/
public $autoNonce = true;
public bool $autoNonce = true;
}

View File

@@ -13,10 +13,8 @@ class Cookie extends BaseConfig
* --------------------------------------------------------------------------
*
* Set a cookie name prefix if you need to avoid collisions.
*
* @var string
*/
public $prefix = '';
public string $prefix = '';
/**
* --------------------------------------------------------------------------
@@ -37,10 +35,8 @@ class Cookie extends BaseConfig
* --------------------------------------------------------------------------
*
* Typically will be a forward slash.
*
* @var string
*/
public $path = '/';
public string $path = '/';
/**
* --------------------------------------------------------------------------
@@ -48,10 +44,8 @@ class Cookie extends BaseConfig
* --------------------------------------------------------------------------
*
* Set to `.your-domain.com` for site-wide cookies.
*
* @var string
*/
public $domain = '';
public string $domain = '';
/**
* --------------------------------------------------------------------------
@@ -59,10 +53,8 @@ class Cookie extends BaseConfig
* --------------------------------------------------------------------------
*
* Cookie will only be set if a secure HTTPS connection exists.
*
* @var bool
*/
public $secure = false;
public bool $secure = false;
/**
* --------------------------------------------------------------------------
@@ -70,10 +62,8 @@ class Cookie extends BaseConfig
* --------------------------------------------------------------------------
*
* Cookie will only be accessible via HTTP(S) (no JavaScript).
*
* @var bool
*/
public $httponly = true;
public bool $httponly = true;
/**
* --------------------------------------------------------------------------
@@ -95,9 +85,9 @@ class Cookie extends BaseConfig
* (empty string) means default SameSite attribute set by browsers (`Lax`)
* will be set on cookies. If set to `None`, `$secure` must also be set.
*
* @var string
* @var ''|'Lax'|'None'|'Strict'
*/
public $samesite = 'Lax';
public string $samesite = 'Lax';
/**
* --------------------------------------------------------------------------
@@ -110,10 +100,8 @@ class Cookie extends BaseConfig
* If this is set to `true`, cookie names should be compliant of RFC 2616's
* list of allowed characters.
*
* @var bool
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#attributes
* @see https://tools.ietf.org/html/rfc2616#section-2.2
*/
public $raw = false;
public bool $raw = false;
}

105
app/Config/Cors.php Normal file
View File

@@ -0,0 +1,105 @@
<?php
namespace Config;
use CodeIgniter\Config\BaseConfig;
/**
* Cross-Origin Resource Sharing (CORS) Configuration
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
*/
class Cors extends BaseConfig
{
/**
* The default CORS configuration.
*
* @var array{
* allowedOrigins: list<string>,
* allowedOriginsPatterns: list<string>,
* supportsCredentials: bool,
* allowedHeaders: list<string>,
* exposedHeaders: list<string>,
* allowedMethods: list<string>,
* maxAge: int,
* }
*/
public array $default = [
/**
* Origins for the `Access-Control-Allow-Origin` header.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin
*
* E.g.:
* - ['http://localhost:8080']
* - ['https://www.example.com']
*/
'allowedOrigins' => [],
/**
* Origin regex patterns for the `Access-Control-Allow-Origin` header.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin
*
* NOTE: A pattern specified here is part of a regular expression. It will
* be actually `#\A<pattern>\z#`.
*
* E.g.:
* - ['https://\w+\.example\.com']
*/
'allowedOriginsPatterns' => [],
/**
* Weather to send the `Access-Control-Allow-Credentials` header.
*
* The Access-Control-Allow-Credentials response header tells browsers whether
* the server allows cross-origin HTTP requests to include credentials.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials
*/
'supportsCredentials' => false,
/**
* Set headers to allow.
*
* The Access-Control-Allow-Headers response header is used in response to
* a preflight request which includes the Access-Control-Request-Headers to
* indicate which HTTP headers can be used during the actual request.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers
*/
'allowedHeaders' => [],
/**
* Set headers to expose.
*
* The Access-Control-Expose-Headers response header allows a server to
* indicate which response headers should be made available to scripts running
* in the browser, in response to a cross-origin request.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Expose-Headers
*/
'exposedHeaders' => [],
/**
* Set methods to allow.
*
* The Access-Control-Allow-Methods response header specifies one or more
* methods allowed when accessing a resource in response to a preflight
* request.
*
* E.g.:
* - ['GET', 'POST', 'PUT', 'DELETE']
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods
*/
'allowedMethods' => [],
/**
* Set how many seconds the results of a preflight request can be cached.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Max-Age
*/
'maxAge' => 7200,
];
}

View File

@@ -10,50 +10,172 @@ use CodeIgniter\Database\Config;
class Database extends Config
{
/**
* The directory that holds the Migrations
* and Seeds directories.
*
* @var string
* The directory that holds the Migrations and Seeds directories.
*/
public $filesPath = APPPATH . 'Database' . DIRECTORY_SEPARATOR;
public string $filesPath = APPPATH . 'Database' . DIRECTORY_SEPARATOR;
/**
* Lets you choose which connection group to
* use if no other is specified.
*
* @var string
* Lets you choose which connection group to use if no other is specified.
*/
public $defaultGroup = 'default';
public string $defaultGroup = 'default';
/**
* The default database connection.
*
* @var array
* @var array<string, mixed>
*/
public $default = [
'DSN' => 'host=192.168.16.14;dbname=mawim;user=finanzen;password=/mA!FZ22Wi',
// 'hostname' => 'localhost',
'hostname' => '192.168.16.13',
'database' => 'mawim',
'username' => 'finanzen',
'password' => '/mW!FZ26DB',
'schema' => 'finanzen',
'port' => 5432,
'charset' => 'utf8',
'DBDriver' => 'Postgre',
'schema' => 'finanzen,verwaltung',
// 'DBPrefix' => '',
// 'pConnect' => false,
'DBDebug' => (ENVIRONMENT !== 'production'),
// 'charset' => 'utf8',
// 'DBCollat' => 'utf8_general_ci',
// 'swapPre' => '',
// 'encrypt' => false,
// 'compress' => false,
// 'strictOn' => false,
// 'failover' => [],
'DBDebug' => false,
'swapPre' => '',
'failover' => [],
'dateFormat' => [
'date' => 'Y-m-d',
'datetime' => 'Y-m-d H:i:s',
'time' => 'H:i:s',
],
];
public $verwaltung = [
'hostname' => 'localhost',
'database' => 'mawim',
'username' => 'security',
'password' => '/mA!Admin26',
'schema' => 'finanzen,verwaltung',
'port' => 5432,
'charset' => 'utf8',
'DBDriver' => 'Postgre',
'DBDebug' => false,
'swapPre' => '',
'failover' => [],
'dateFormat' => [
'date' => 'Y-m-d',
'datetime' => 'Y-m-d H:i:s',
'time' => 'H:i:s',
],
];
// /**
// * Sample database connection for SQLite3.
// *
// * @var array<string, mixed>
// */
// public array $default = [
// 'database' => 'database.db',
// 'DBDriver' => 'SQLite3',
// 'DBPrefix' => '',
// 'DBDebug' => true,
// 'swapPre' => '',
// 'failover' => [],
// 'foreignKeys' => true,
// 'busyTimeout' => 1000,
// 'synchronous' => null,
// 'dateFormat' => [
// 'date' => 'Y-m-d',
// 'datetime' => 'Y-m-d H:i:s',
// 'time' => 'H:i:s',
// ],
// ];
// /**
// * Sample database connection for Postgre.
// *
// * @var array<string, mixed>
// */
// public array $default = [
// 'DSN' => '',
// 'hostname' => 'localhost',
// 'username' => 'root',
// 'password' => 'root',
// 'database' => 'ci4',
// 'schema' => 'public',
// 'DBDriver' => 'Postgre',
// 'DBPrefix' => '',
// 'pConnect' => false,
// 'DBDebug' => true,
// 'charset' => 'utf8',
// 'swapPre' => '',
// 'failover' => [],
// 'port' => 5432,
// 'dateFormat' => [
// 'date' => 'Y-m-d',
// 'datetime' => 'Y-m-d H:i:s',
// 'time' => 'H:i:s',
// ],
// ];
// /**
// * Sample database connection for SQLSRV.
// *
// * @var array<string, mixed>
// */
// public array $default = [
// 'DSN' => '',
// 'hostname' => 'localhost',
// 'username' => 'root',
// 'password' => 'root',
// 'database' => 'ci4',
// 'schema' => 'dbo',
// 'DBDriver' => 'SQLSRV',
// 'DBPrefix' => '',
// 'pConnect' => false,
// 'DBDebug' => true,
// 'charset' => 'utf8',
// 'swapPre' => '',
// 'encrypt' => false,
// 'failover' => [],
// 'port' => 1433,
// 'dateFormat' => [
// 'date' => 'Y-m-d',
// 'datetime' => 'Y-m-d H:i:s',
// 'time' => 'H:i:s',
// ],
// ];
// /**
// * Sample database connection for OCI8.
// *
// * You may need the following environment variables:
// * NLS_LANG = 'AMERICAN_AMERICA.UTF8'
// * NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'
// * NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS'
// * NLS_TIMESTAMP_TZ_FORMAT = 'YYYY-MM-DD HH24:MI:SS'
// *
// * @var array<string, mixed>
// */
// public array $default = [
// 'DSN' => 'localhost:1521/FREEPDB1',
// 'username' => 'root',
// 'password' => 'root',
// 'DBDriver' => 'OCI8',
// 'DBPrefix' => '',
// 'pConnect' => false,
// 'DBDebug' => true,
// 'charset' => 'AL32UTF8',
// 'swapPre' => '',
// 'failover' => [],
// 'dateFormat' => [
// 'date' => 'Y-m-d',
// 'datetime' => 'Y-m-d H:i:s',
// 'time' => 'H:i:s',
// ],
// ];
/**
* This database connection is used when
* running PHPUnit database tests.
* This database connection is used when running PHPUnit database tests.
*
* @var array
* @var array<string, mixed>
*/
public $tests = [
public array $tests = [
'DSN' => '',
'hostname' => '127.0.0.1',
'username' => '',
@@ -62,16 +184,23 @@ class Database extends Config
'DBDriver' => 'SQLite3',
'DBPrefix' => 'db_', // Needed to ensure we're working correctly with prefixes live. DO NOT REMOVE FOR CI DEVS
'pConnect' => false,
'DBDebug' => (ENVIRONMENT !== 'production'),
'DBDebug' => true,
'charset' => 'utf8',
'DBCollat' => 'utf8_general_ci',
'DBCollat' => '',
'swapPre' => '',
'encrypt' => false,
'compress' => false,
'strictOn' => false,
'strictOn' => true,
'failover' => [],
'port' => 3306,
'foreignKeys' => true,
'busyTimeout' => 1000,
'synchronous' => null,
'dateFormat' => [
'date' => 'Y-m-d',
'datetime' => 'Y-m-d H:i:s',
'time' => 'H:i:s',
],
];
public function __construct()

View File

@@ -9,7 +9,7 @@ class DocTypes
*
* @var array<string, string>
*/
public $list = [
public array $list = [
'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',
'xhtml1-strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
'xhtml1-trans' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
@@ -30,4 +30,14 @@ class DocTypes
'xhtml-rdfa-1' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">',
'xhtml-rdfa-2' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd">',
];
/**
* Whether to remove the solidus (`/`) character for void HTML elements (e.g. `<input>`)
* for HTML5 compatibility.
*
* Set to:
* `true` - to be HTML5 compatible
* `false` - to be XHTML compatible
*/
public bool $html5 = true;
}

View File

@@ -6,165 +6,123 @@ use CodeIgniter\Config\BaseConfig;
class Email extends BaseConfig
{
/**
* @var string
*/
public $fromEmail;
public string $fromEmail = "webmaster@mawim.at";
/**
* @var string
*/
public $fromName;
public string $fromName = "Webmaster Smarthome";
/**
* @var string
*/
public $recipients;
public string $recipients = '';
/**
* The "user agent"
*
* @var string
*/
public $userAgent = 'CodeIgniter';
public string $userAgent = 'CodeIgniter';
/**
* The mail sending protocol: mail, sendmail, smtp
*
* @var string
*/
public $protocol = 'mail';
public string $protocol = 'sendmail';
/**
* The server path to Sendmail.
*
* @var string
*/
public $mailPath = '/usr/sbin/sendmail';
public string $mailPath = '/usr/sbin/sendmail';
/**
* SMTP Server Address
*
* @var string
* SMTP Server Hostname
*/
public $SMTPHost;
public string $SMTPHost = 'web110.dogado.de';
/**
* Which SMTP authentication method to use: login, plain
*/
public string $SMTPAuthMethod = 'login';
/**
* SMTP Username
*
* @var string
*/
public $SMTPUser;
public string $SMTPUser = "markus@mawim.at";
/**
* SMTP Password
*
* @var string
*/
public $SMTPPass;
public string $SMTPPass ="3c2efe";
/**
* SMTP Port
*
* @var int
*/
public $SMTPPort = 25;
public int $SMTPPort = 465;
/**
* SMTP Timeout (in seconds)
*
* @var int
*/
public $SMTPTimeout = 5;
public int $SMTPTimeout = 5;
/**
* Enable persistent SMTP connections
*
* @var bool
*/
public $SMTPKeepAlive = false;
public bool $SMTPKeepAlive = false;
/**
* SMTP Encryption. Either tls or ssl
* SMTP Encryption.
*
* @var string
* @var string '', 'tls' or 'ssl'. 'tls' will issue a STARTTLS command
* to the server. 'ssl' means implicit SSL. Connection on port
* 465 should set this to ''.
*/
public $SMTPCrypto = 'tls';
public string $SMTPCrypto = 'ssl';
/**
* Enable word-wrap
*
* @var bool
*/
public $wordWrap = true;
public bool $wordWrap = true;
/**
* Character count to wrap at
*
* @var int
*/
public $wrapChars = 76;
public int $wrapChars = 76;
/**
* Type of mail, either 'text' or 'html'
*
* @var string
*/
public $mailType = 'text';
public string $mailType = 'text';
/**
* Character set (utf-8, iso-8859-1, etc.)
*
* @var string
*/
public $charset = 'UTF-8';
public string $charset = 'UTF-8';
/**
* Whether to validate the email address
*
* @var bool
*/
public $validate = false;
public bool $validate = false;
/**
* Email Priority. 1 = highest. 5 = lowest. 3 = normal
*
* @var int
*/
public $priority = 3;
public int $priority = 3;
/**
* Newline character. (Use “\r\n” to comply with RFC 822)
*
* @var string
*/
public $CRLF = "\r\n";
public string $CRLF = "\r\n";
/**
* Newline character. (Use “\r\n” to comply with RFC 822)
*
* @var string
*/
public $newline = "\r\n";
public string $newline = "\r\n";
/**
* Enable BCC Batch Mode.
*
* @var bool
*/
public $BCCBatchMode = false;
public bool $BCCBatchMode = false;
/**
* Number of emails in each BCC batch
*
* @var int
*/
public $BCCBatchSize = 200;
public int $BCCBatchSize = 200;
/**
* Enable notify message from server
*
* @var bool
*/
public $DSN = false;
public bool $DSN = false;
}

View File

@@ -20,10 +20,25 @@ class Encryption extends BaseConfig
* If you use the Encryption class you must set an encryption key (seed).
* You need to ensure it is long enough for the cipher and mode you plan to use.
* See the user guide for more info.
*
* @var string
*/
public $key = '';
public string $key = '';
/**
* --------------------------------------------------------------------------
* Previous Encryption Keys
* --------------------------------------------------------------------------
*
* When rotating encryption keys, add old keys here to maintain ability
* to decrypt data encrypted with previous keys. Encryption always uses
* the current $key. Decryption tries current key first, then falls back
* to previous keys if decryption fails.
*
* In .env file, use comma-separated string:
* encryption.previousKeys = hex2bin:9be8c64fcea509867...,hex2bin:3f5a1d8e9c2b7a4f6...
*
* @var list<string>|string
*/
public array|string $previousKeys = '';
/**
* --------------------------------------------------------------------------
@@ -35,10 +50,8 @@ class Encryption extends BaseConfig
* Available drivers:
* - OpenSSL
* - Sodium
*
* @var string
*/
public $driver = 'OpenSSL';
public string $driver = 'OpenSSL';
/**
* --------------------------------------------------------------------------
@@ -49,10 +62,8 @@ class Encryption extends BaseConfig
* before it is encrypted. This value should be greater than zero.
*
* See the user guide for more information on padding.
*
* @var int
*/
public $blockSize = 16;
public int $blockSize = 16;
/**
* --------------------------------------------------------------------------
@@ -60,8 +71,39 @@ class Encryption extends BaseConfig
* --------------------------------------------------------------------------
*
* HMAC digest to use, e.g. 'SHA512' or 'SHA256'. Default value is 'SHA512'.
*
* @var string
*/
public $digest = 'SHA512';
public string $digest = 'SHA512';
/**
* Whether the cipher-text should be raw. If set to false, then it will be base64 encoded.
* This setting is only used by OpenSSLHandler.
*
* Set to false for CI3 Encryption compatibility.
*/
public bool $rawData = true;
/**
* Encryption key info.
* This setting is only used by OpenSSLHandler.
*
* Set to 'encryption' for CI3 Encryption compatibility.
*/
public string $encryptKeyInfo = '';
/**
* Authentication key info.
* This setting is only used by OpenSSLHandler.
*
* Set to 'authentication' for CI3 Encryption compatibility.
*/
public string $authKeyInfo = '';
/**
* Cipher to use.
* This setting is only used by OpenSSLHandler.
*
* Set to 'AES-128-CBC' to decrypt encrypted data that encrypted
* by CI3 Encryption default configuration.
*/
public string $cipher = 'AES-256-CTR';
}

View File

@@ -4,6 +4,7 @@ namespace Config;
use CodeIgniter\Events\Events;
use CodeIgniter\Exceptions\FrameworkException;
use CodeIgniter\HotReloader\HotReloader;
/*
* --------------------------------------------------------------------
@@ -22,9 +23,11 @@ use CodeIgniter\Exceptions\FrameworkException;
* Events::on('create', [$myInstance, 'myMethod']);
*/
Events::on('pre_system', static function () {
Events::on('pre_system', static function (): void {
if (ENVIRONMENT !== 'testing') {
if (ini_get('zlib.output_compression')) {
$value = ini_get('zlib.output_compression');
if (filter_var($value, FILTER_VALIDATE_BOOLEAN) || (int) $value > 0) {
throw FrameworkException::forEnabledZlibOutputCompression();
}
@@ -43,6 +46,12 @@ Events::on('pre_system', static function () {
*/
if (CI_DEBUG && ! is_cli()) {
Events::on('DBQuery', 'CodeIgniter\Debug\Toolbar\Collectors\Database::collect');
Services::toolbar()->respond();
service('toolbar')->respond();
// Hot Reload route - for framework use on the hot reloader.
if (ENVIRONMENT === 'development') {
service('routes')->get('__hot-reload', static function (): void {
(new HotReloader())->run();
});
}
}
});

View File

@@ -3,6 +3,10 @@
namespace Config;
use CodeIgniter\Config\BaseConfig;
use CodeIgniter\Debug\ExceptionHandler;
use CodeIgniter\Debug\ExceptionHandlerInterface;
use Psr\Log\LogLevel;
use Throwable;
/**
* Setup how the exception handler works.
@@ -17,10 +21,8 @@ class Exceptions extends BaseConfig
* through Services::Log.
*
* Default: true
*
* @var bool
*/
public $log = true;
public bool $log = true;
/**
* --------------------------------------------------------------------------
@@ -29,9 +31,9 @@ class Exceptions extends BaseConfig
* Any status codes here will NOT be logged if logging is turned on.
* By default, only 404 (Page Not Found) exceptions are ignored.
*
* @var array
* @var list<int>
*/
public $ignoreCodes = [404];
public array $ignoreCodes = [404];
/**
* --------------------------------------------------------------------------
@@ -41,10 +43,8 @@ class Exceptions extends BaseConfig
* directories that hold the views used to generate errors.
*
* Default: APPPATH.'Views/errors'
*
* @var string
*/
public $errorViewPath = APPPATH . 'Views/errors';
public string $errorViewPath = APPPATH . 'Views/errors';
/**
* --------------------------------------------------------------------------
@@ -54,7 +54,53 @@ class Exceptions extends BaseConfig
* In order to specify 2 levels, use "/" to separate.
* ex. ['server', 'setup/password', 'secret_token']
*
* @var array
* @var list<string>
*/
public $sensitiveDataInTrace = [];
public array $sensitiveDataInTrace = [];
/**
* --------------------------------------------------------------------------
* WHETHER TO THROW AN EXCEPTION ON DEPRECATED ERRORS
* --------------------------------------------------------------------------
* If set to `true`, DEPRECATED errors are only logged and no exceptions are
* thrown. This option also works for user deprecations.
*/
public bool $logDeprecations = true;
/**
* --------------------------------------------------------------------------
* LOG LEVEL THRESHOLD FOR DEPRECATIONS
* --------------------------------------------------------------------------
* If `$logDeprecations` is set to `true`, this sets the log level
* to which the deprecation will be logged. This should be one of the log
* levels recognized by PSR-3.
*
* The related `Config\Logger::$threshold` should be adjusted, if needed,
* to capture logging the deprecations.
*/
public string $deprecationLogLevel = LogLevel::WARNING;
/*
* DEFINE THE HANDLERS USED
* --------------------------------------------------------------------------
* Given the HTTP status code, returns exception handler that
* should be used to deal with this error. By default, it will run CodeIgniter's
* default handler and display the error information in the expected format
* for CLI, HTTP, or AJAX requests, as determined by is_cli() and the expected
* response format.
*
* Custom handlers can be returned if you want to handle one or more specific
* error codes yourself like:
*
* if (in_array($statusCode, [400, 404, 500])) {
* return new \App\Libraries\MyExceptionHandler();
* }
* if ($exception instanceOf PageNotFoundException) {
* return new \App\Libraries\MyExceptionHandler();
* }
*/
public function handler(int $statusCode, Throwable $exception): ExceptionHandlerInterface
{
return new ExceptionHandler($this);
}
}

View File

@@ -10,23 +10,28 @@ use CodeIgniter\Config\BaseConfig;
class Feature extends BaseConfig
{
/**
* Enable multiple filters for a route or not.
*
* If you enable this:
* - CodeIgniter\CodeIgniter::handleRequest() uses:
* - CodeIgniter\Filters\Filters::enableFilters(), instead of enableFilter()
* - CodeIgniter\CodeIgniter::tryToRouteIt() uses:
* - CodeIgniter\Router\Router::getFilters(), instead of getFilter()
* - CodeIgniter\Router\Router::handle() uses:
* - property $filtersInfo, instead of $filterInfo
* - CodeIgniter\Router\RouteCollection::getFiltersForRoute(), instead of getFilterForRoute()
*
* @var bool
* Use improved new auto routing instead of the legacy version.
*/
public $multipleFilters = false;
public bool $autoRoutesImproved = true;
/**
* Use improved new auto routing instead of the default legacy version.
* Use filter execution order in 4.4 or before.
*/
public bool $autoRoutesImproved = false;
public bool $oldFilterOrder = false;
/**
* The behavior of `limit(0)` in Query Builder.
*
* If true, `limit(0)` returns all records. (the behavior of 4.4.x or before in version 4.x.)
* If false, `limit(0)` returns no records. (the behavior of 3.1.9 or later in version 3.x.)
*/
public bool $limitZeroAsAll = true;
/**
* Use strict location negotiation.
*
* By default, the locale is selected based on a loose comparison of the language code (ISO 639-1)
* Enabling strict comparison will also consider the region code (ISO 3166-1 alpha-2).
*/
public bool $strictLocaleNegotiation = false;
}

View File

@@ -2,43 +2,83 @@
namespace Config;
use CodeIgniter\Config\BaseConfig;
use CodeIgniter\Config\Filters as BaseFilters;
use CodeIgniter\Filters\Cors;
use CodeIgniter\Filters\CSRF;
use CodeIgniter\Filters\DebugToolbar;
use CodeIgniter\Filters\ForceHTTPS;
use CodeIgniter\Filters\Honeypot;
use CodeIgniter\Filters\InvalidChars;
use CodeIgniter\Filters\PageCache;
use CodeIgniter\Filters\PerformanceMetrics;
use CodeIgniter\Filters\SecureHeaders;
class Filters extends BaseConfig
class Filters extends BaseFilters
{
/**
* Configures aliases for Filter classes to
* make reading things nicer and simpler.
*
* @var array
* @var array<string, class-string|list<class-string>>
*
* [filter_name => classname]
* or [filter_name => [classname1, classname2, ...]]
*/
public $aliases = [
public array $aliases = [
'csrf' => CSRF::class,
'toolbar' => DebugToolbar::class,
'honeypot' => Honeypot::class,
'invalidchars' => InvalidChars::class,
'secureheaders' => SecureHeaders::class,
'cors' => Cors::class,
'forcehttps' => ForceHTTPS::class,
'pagecache' => PageCache::class,
'performance' => PerformanceMetrics::class,
];
/**
* List of special required filters.
*
* The filters listed here are special. They are applied before and after
* other kinds of filters, and always applied even if a route does not exist.
*
* Filters set by default provide framework functionality. If removed,
* those functions will no longer work.
*
* @see https://codeigniter.com/user_guide/incoming/filters.html#provided-filters
*
* @var array{before: list<string>, after: list<string>}
*/
public array $required = [
'before' => [
'forcehttps', // Force Global Secure Requests
'pagecache', // Web Page Caching
],
'after' => [
'pagecache', // Web Page Caching
'performance', // Performance Metrics
'toolbar', // Debug Toolbar
],
];
/**
* List of filter aliases that are always
* applied before and after every request.
*
* @var array
* @var array{
* before: array<string, array{except: list<string>|string}>|list<string>,
* after: array<string, array{except: list<string>|string}>|list<string>
* }
*/
public $globals = [
public array $globals = [
'before' => [
// 'honeypot',
// 'csrf',
// 'invalidchars',
'session' => ['except' => ['login*', 'register', 'auth/a/*', 'logout']],
'permission' =>['isAuthorized'=>[]],
],
'after' => [
'toolbar',
// 'honeypot',
// 'secureheaders',
],
@@ -49,15 +89,15 @@ class Filters extends BaseConfig
* particular HTTP method (GET, POST, etc.).
*
* Example:
* 'post' => ['foo', 'bar']
* 'POST' => ['foo', 'bar']
*
* If you use this, you should disable auto-routing because auto-routing
* permits any HTTP method to access a controller. Accessing the controller
* with a method you don’t expect could bypass the filter.
* with a method you don't expect could bypass the filter.
*
* @var array
* @var array<string, list<string>>
*/
public $methods = [];
public array $methods = [];
/**
* List of filter aliases that should run on any
@@ -66,7 +106,9 @@ class Filters extends BaseConfig
* Example:
* 'isLoggedIn' => ['before' => ['account/*', 'profiles/*']]
*
* @var array
* @var array<string, array<string, list<string>>>
*/
public $filters = [];
public array $filters = [
'isLoggedIn' => ['before' => ['show-passwords']]
];
}

View File

@@ -4,6 +4,9 @@ namespace Config;
use CodeIgniter\Config\ForeignCharacters as BaseForeignCharacters;
/**
* @immutable
*/
class ForeignCharacters extends BaseForeignCharacters
{
}

View File

@@ -3,7 +3,6 @@
namespace Config;
use CodeIgniter\Config\BaseConfig;
use CodeIgniter\Format\FormatterInterface;
use CodeIgniter\Format\JSONFormatter;
use CodeIgniter\Format\XMLFormatter;
@@ -22,9 +21,9 @@ class Format extends BaseConfig
* These formats are only checked when the data passed to the respond()
* method is an array.
*
* @var string[]
* @var list<string>
*/
public $supportedResponseFormats = [
public array $supportedResponseFormats = [
'application/json',
'application/xml', // machine-readable XML
'text/xml', // human-readable XML
@@ -41,7 +40,7 @@ class Format extends BaseConfig
*
* @var array<string, string>
*/
public $formatters = [
public array $formatters = [
'application/json' => JSONFormatter::class,
'application/xml' => XMLFormatter::class,
'text/xml' => XMLFormatter::class,
@@ -57,21 +56,18 @@ class Format extends BaseConfig
*
* @var array<string, int>
*/
public $formatterOptions = [
public array $formatterOptions = [
'application/json' => JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES,
'application/xml' => 0,
'text/xml' => 0,
];
/**
* A Factory method to return the appropriate formatter for the given mime type.
* --------------------------------------------------------------------------
* Maximum depth for JSON encoding.
* --------------------------------------------------------------------------
*
* @return FormatterInterface
*
* @deprecated This is an alias of `\CodeIgniter\Format\Format::getFormatter`. Use that instead.
* This value determines how deep the JSON encoder will traverse nested structures.
*/
public function getFormatter(string $mime)
{
return Services::format()->getFormatter($mime);
}
public int $jsonEncodeDepth = 512;
}

View File

@@ -23,9 +23,13 @@ class Generators extends BaseConfig
*
* YOU HAVE BEEN WARNED!
*
* @var array<string, string>
* @var array<string, array<string, string>|string>
*/
public $views = [
public array $views = [
'make:cell' => [
'class' => 'CodeIgniter\Commands\Generators\Views\cell.tpl.php',
'view' => 'CodeIgniter\Commands\Generators\Views\cell_view.tpl.php',
],
'make:command' => 'CodeIgniter\Commands\Generators\Views\command.tpl.php',
'make:config' => 'CodeIgniter\Commands\Generators\Views\config.tpl.php',
'make:controller' => 'CodeIgniter\Commands\Generators\Views\controller.tpl.php',

View File

@@ -8,36 +8,35 @@ class Honeypot extends BaseConfig
{
/**
* Makes Honeypot visible or not to human
*
* @var bool
*/
public $hidden = true;
public bool $hidden = true;
/**
* Honeypot Label Content
*
* @var string
*/
public $label = 'Fill This Field';
public string $label = 'Fill This Field';
/**
* Honeypot Field Name
*
* @var string
*/
public $name = 'honeypot';
public string $name = 'honeypot';
/**
* Honeypot HTML Template
*
* @var string
*/
public $template = '<label>{label}</label><input type="text" name="{name}" value=""/>';
public string $template = '<label>{label}</label><input type="text" name="{name}" value="">';
/**
* Honeypot container
*
* @var string
* If you enabled CSP, you can remove `style="display:none"`.
*/
public $container = '<div style="display:none">{template}</div>';
public string $container = '<div style="display:none">{template}</div>';
/**
* The id attribute for Honeypot container tag
*
* Used when CSP is enabled.
*/
public string $containerId = 'hpc';
}

40
app/Config/Hostnames.php Normal file
View File

@@ -0,0 +1,40 @@
<?php
namespace Config;
class Hostnames
{
// List of known two-part TLDs for subdomain extraction
public const TWO_PART_TLDS = [
'co.uk', 'org.uk', 'gov.uk', 'ac.uk', 'sch.uk', 'ltd.uk', 'plc.uk',
'com.au', 'net.au', 'org.au', 'edu.au', 'gov.au', 'asn.au', 'id.au',
'co.jp', 'ac.jp', 'go.jp', 'or.jp', 'ne.jp', 'gr.jp',
'co.nz', 'org.nz', 'govt.nz', 'ac.nz', 'net.nz', 'geek.nz', 'maori.nz', 'school.nz',
'co.in', 'net.in', 'org.in', 'ind.in', 'ac.in', 'gov.in', 'res.in',
'com.cn', 'net.cn', 'org.cn', 'gov.cn', 'edu.cn',
'com.sg', 'net.sg', 'org.sg', 'gov.sg', 'edu.sg', 'per.sg',
'co.za', 'org.za', 'gov.za', 'ac.za', 'net.za',
'co.kr', 'or.kr', 'go.kr', 'ac.kr', 'ne.kr', 'pe.kr',
'co.th', 'or.th', 'go.th', 'ac.th', 'net.th', 'in.th',
'com.my', 'net.my', 'org.my', 'edu.my', 'gov.my', 'mil.my', 'name.my',
'com.mx', 'org.mx', 'net.mx', 'edu.mx', 'gob.mx',
'com.br', 'net.br', 'org.br', 'gov.br', 'edu.br', 'art.br', 'eng.br',
'co.il', 'org.il', 'ac.il', 'gov.il', 'net.il', 'muni.il',
'co.id', 'or.id', 'ac.id', 'go.id', 'net.id', 'web.id', 'my.id',
'com.hk', 'edu.hk', 'gov.hk', 'idv.hk', 'net.hk', 'org.hk',
'com.tw', 'net.tw', 'org.tw', 'edu.tw', 'gov.tw', 'idv.tw',
'com.sa', 'net.sa', 'org.sa', 'gov.sa', 'edu.sa', 'sch.sa', 'med.sa',
'co.ae', 'net.ae', 'org.ae', 'gov.ae', 'ac.ae', 'sch.ae',
'com.tr', 'net.tr', 'org.tr', 'gov.tr', 'edu.tr', 'av.tr', 'gen.tr',
'co.ke', 'or.ke', 'go.ke', 'ac.ke', 'sc.ke', 'me.ke', 'mobi.ke', 'info.ke',
'com.ng', 'org.ng', 'gov.ng', 'edu.ng', 'net.ng', 'sch.ng', 'name.ng',
'com.pk', 'net.pk', 'org.pk', 'gov.pk', 'edu.pk', 'fam.pk',
'com.eg', 'edu.eg', 'gov.eg', 'org.eg', 'net.eg',
'com.cy', 'net.cy', 'org.cy', 'gov.cy', 'ac.cy',
'com.lk', 'org.lk', 'edu.lk', 'gov.lk', 'net.lk', 'int.lk',
'com.bd', 'net.bd', 'org.bd', 'ac.bd', 'gov.bd', 'mil.bd',
'com.ar', 'net.ar', 'org.ar', 'gov.ar', 'edu.ar', 'mil.ar',
'gob.cl', 'com.pl', 'net.pl', 'org.pl', 'gov.pl', 'edu.pl',
'co.ir', 'ac.ir', 'org.ir', 'id.ir', 'gov.ir', 'sch.ir', 'net.ir',
];
}

View File

@@ -10,25 +10,23 @@ class Images extends BaseConfig
{
/**
* Default handler used if no other handler is specified.
*
* @var string
*/
public $defaultHandler = 'gd';
public string $defaultHandler = 'gd';
/**
* The path to the image library.
* Required for ImageMagick, GraphicsMagick, or NetPBM.
*
* @var string
* @deprecated 4.7.0 No longer used.
*/
public $libraryPath = '/usr/local/bin/convert';
public string $libraryPath = '/usr/local/bin/convert';
/**
* The available handler classes.
*
* @var array<string, string>
*/
public $handlers = [
public array $handlers = [
'gd' => GDHandler::class,
'imagick' => ImageMagickHandler::class,
];

View File

@@ -2,8 +2,9 @@
namespace Config;
use CodeIgniter\Config\BaseConfig;
use Kint\Renderer\Renderer;
use Kint\Parser\ConstructablePluginInterface;
use Kint\Renderer\Rich\TabPluginInterface;
use Kint\Renderer\Rich\ValuePluginInterface;
/**
* --------------------------------------------------------------------------
@@ -15,7 +16,7 @@ use Kint\Renderer\Renderer;
*
* @see https://kint-php.github.io/kint/ for details on these settings.
*/
class Kint extends BaseConfig
class Kint
{
/*
|--------------------------------------------------------------------------
@@ -23,20 +24,31 @@ class Kint extends BaseConfig
|--------------------------------------------------------------------------
*/
/**
* @var list<class-string<ConstructablePluginInterface>|ConstructablePluginInterface>|null
*/
public $plugins;
public $maxDepth = 6;
public $displayCalledFrom = true;
public $expanded = false;
public int $maxDepth = 6;
public bool $displayCalledFrom = true;
public bool $expanded = false;
/*
|--------------------------------------------------------------------------
| RichRenderer Settings
|--------------------------------------------------------------------------
*/
public $richTheme = 'aante-light.css';
public $richFolder = false;
public $richSort = Renderer::SORT_FULL;
public string $richTheme = 'aante-light.css';
public bool $richFolder = false;
/**
* @var array<string, class-string<ValuePluginInterface>>|null
*/
public $richObjectPlugins;
/**
* @var array<string, class-string<TabPluginInterface>>|null
*/
public $richTabPlugins;
/*
@@ -44,8 +56,8 @@ class Kint extends BaseConfig
| CLI Settings
|--------------------------------------------------------------------------
*/
public $cliColors = true;
public $cliForceUTF8 = false;
public $cliDetectWidth = true;
public $cliMinWidth = 40;
public bool $cliColors = true;
public bool $cliForceUTF8 = false;
public bool $cliDetectWidth = true;
public int $cliMinWidth = 40;
}

View File

@@ -2,8 +2,9 @@
namespace Config;
use CodeIgniter\Log\Handlers\FileHandler;
use CodeIgniter\Config\BaseConfig;
use CodeIgniter\Log\Handlers\FileHandler;
use CodeIgniter\Log\Handlers\HandlerInterface;
class Logger extends BaseConfig
{
@@ -36,9 +37,9 @@ class Logger extends BaseConfig
* For a live site you'll usually enable Critical or higher (3) to be logged otherwise
* your log files will fill up very fast.
*
* @var array|int
* @var int|list<int>
*/
public $threshold = 4;
public $threshold = (ENVIRONMENT === 'production') ? 4 : 9;
/**
* --------------------------------------------------------------------------
@@ -47,10 +48,8 @@ class Logger extends BaseConfig
*
* Each item that is logged has an associated date. You can use PHP date
* codes to set your own date formatting
*
* @var string
*/
public $dateFormat = 'Y-m-d H:i:s';
public string $dateFormat = 'Y-m-d H:i:s';
/**
* --------------------------------------------------------------------------
@@ -60,7 +59,7 @@ class Logger extends BaseConfig
* The logging system supports multiple actions to be taken when something
* is logged. This is done by allowing for multiple Handlers, special classes
* designed to write the log to their chosen destinations, whether that is
* a file on the server, a cloud-based service, or even taking actions such
* a file on the getServer, a cloud-based service, or even taking actions such
* as emailing the dev team.
*
* Each handler is defined by the class name used for that handler, and it
@@ -75,17 +74,15 @@ class Logger extends BaseConfig
* Handlers are executed in the order defined in this array, starting with
* the handler on top and continuing down.
*
* @var array
* @var array<class-string<HandlerInterface>, array<string, int|list<string>|string>>
*/
public $handlers = [
public array $handlers = [
/*
* --------------------------------------------------------------------
* File Handler
* --------------------------------------------------------------------
*/
FileHandler::class => [
// The log levels that this handler will handle.
'handles' => [
'critical',
@@ -103,7 +100,7 @@ class Logger extends BaseConfig
* An extension of 'php' allows for protecting the log files via basic
* scripting, when they are to be stored under a publicly accessible directory.
*
* Note: Leaving it blank will default to 'log'.
* NOTE: Leaving it blank will default to 'log'.
*/
'fileExtension' => '',
@@ -141,14 +138,14 @@ class Logger extends BaseConfig
* Uncomment this block to use it.
*/
// 'CodeIgniter\Log\Handlers\ErrorlogHandler' => [
// /* The log levels this handler can handle. */
// 'handles' => ['critical', 'alert', 'emergency', 'debug', 'error', 'info', 'notice', 'warning'],
// /* The log levels this handler can handle. */
// 'handles' => ['critical', 'alert', 'emergency', 'debug', 'error', 'info', 'notice', 'warning'],
//
// /*
// * The message type where the error should go. Can be 0 or 4, or use the
// * class constants: `ErrorlogHandler::TYPE_OS` (0) or `ErrorlogHandler::TYPE_SAPI` (4)
// */
// 'messageType' => 0,
// /*
// * The message type where the error should go. Can be 0 or 4, or use the
// * class constants: `ErrorlogHandler::TYPE_OS` (0) or `ErrorlogHandler::TYPE_SAPI` (4)
// */
// 'messageType' => 0,
// ],
];
}

View File

@@ -15,10 +15,8 @@ class Migrations extends BaseConfig
*
* You should enable migrations whenever you intend to do a schema migration
* and disable it back when you're done.
*
* @var bool
*/
public $enabled = true;
public bool $enabled = true;
/**
* --------------------------------------------------------------------------
@@ -27,13 +25,9 @@ class Migrations extends BaseConfig
*
* This is the name of the table that will store the current migrations state.
* When migrations runs it will store in a database table which migration
* level the system is at. It then compares the migration level in this
* table to the $config['migration_version'] if they are not the same it
* will migrate up. This must be set.
*
* @var string
* files have already been run.
*/
public $table = 'migrations';
public string $table = 'migrations';
/**
* --------------------------------------------------------------------------
@@ -42,14 +36,30 @@ class Migrations extends BaseConfig
*
* This is the format that will be used when creating new migrations
* using the CLI command:
* > php spark migrate:create
* > php spark make:migration
*
* Typical formats:
* NOTE: if you set an unsupported format, migration runner will not find
* your migration files.
*
* Supported formats:
* - YmdHis_
* - Y-m-d-His_
* - Y_m_d_His_
*
* @var string
*/
public $timestampFormat = 'Y-m-d-His_';
public string $timestampFormat = 'Y-m-d-His_';
/**
* --------------------------------------------------------------------------
* Enable/Disable Migration Lock
* --------------------------------------------------------------------------
*
* Locking is disabled by default.
*
* When enabled, it will prevent multiple migration processes
* from running at the same time by using a lock mechanism.
*
* This is useful in production environments to avoid conflicts
* or race conditions during concurrent deployments.
*/
public bool $lock = false;
}

View File

@@ -3,8 +3,6 @@
namespace Config;
/**
* Mimes
*
* This file contains an array of mime types. It is used by the
* Upload class to help identify allowed file types.
*
@@ -21,9 +19,9 @@ class Mimes
/**
* Map of extensions to mime types.
*
* @var array
* @var array<string, list<string>|string>
*/
public static $mimes = [
public static array $mimes = [
'hqx' => [
'application/mac-binhex40',
'application/mac-binhex',
@@ -55,6 +53,8 @@ class Mimes
'lzh' => 'application/octet-stream',
'exe' => [
'application/octet-stream',
'application/vnd.microsoft.portable-executable',
'application/x-dosexec',
'application/x-msdownload',
],
'class' => 'application/octet-stream',
@@ -478,6 +478,8 @@ class Mimes
'application/sla',
'application/vnd.ms-pki.stl',
'application/x-navistyle',
'model/stl',
'application/octet-stream',
],
];

View File

@@ -4,6 +4,12 @@ namespace Config;
use CodeIgniter\Modules\Modules as BaseModules;
/**
* Modules Configuration.
*
* NOTE: This class is required prior to Autoloader instantiation,
* and does not extend BaseConfig.
*/
class Modules extends BaseModules
{
/**
@@ -31,6 +37,29 @@ class Modules extends BaseModules
*/
public $discoverInComposer = true;
/**
* The Composer package list for Auto-Discovery
* This setting is optional.
*
* E.g.:
* [
* 'only' => [
* // List up all packages to auto-discover
* 'codeigniter4/shield',
* ],
* ]
* or
* [
* 'exclude' => [
* // List up packages to exclude.
* 'pestphp/pest',
* ],
* ]
*
* @var array{only?: list<string>, exclude?: list<string>}
*/
public $composerPackages = [];
/**
* --------------------------------------------------------------------------
* Auto-Discovery Rules
@@ -41,7 +70,7 @@ class Modules extends BaseModules
*
* If it is not listed, only the base application elements will be used.
*
* @var string[]
* @var list<string>
*/
public $aliases = [
'events',

32
app/Config/Optimize.php Normal file
View File

@@ -0,0 +1,32 @@
<?php
namespace Config;
/**
* Optimization Configuration.
*
* NOTE: This class does not extend BaseConfig for performance reasons.
* So you cannot replace the property values with Environment Variables.
*
* WARNING: Do not use these options when running the app in the Worker Mode.
*/
class Optimize
{
/**
* --------------------------------------------------------------------------
* Config Caching
* --------------------------------------------------------------------------
*
* @see https://codeigniter.com/user_guide/concepts/factories.html#config-caching
*/
public bool $configCacheEnabled = false;
/**
* --------------------------------------------------------------------------
* Config Caching
* --------------------------------------------------------------------------
*
* @see https://codeigniter.com/user_guide/concepts/autoloader.html#file-locator-caching
*/
public bool $locatorCacheEnabled = false;
}

View File

@@ -20,7 +20,7 @@ class Pager extends BaseConfig
*
* @var array<string, string>
*/
public $templates = [
public array $templates = [
'default_full' => 'CodeIgniter\Pager\Views\default_full',
'default_simple' => 'CodeIgniter\Pager\Views\default_simple',
'default_head' => 'CodeIgniter\Pager\Views\default_head',
@@ -32,8 +32,6 @@ class Pager extends BaseConfig
* --------------------------------------------------------------------------
*
* The default number of results shown in a single page.
*
* @var int
*/
public $perPage = 20;
public int $perPage = 20;
}

View File

@@ -12,6 +12,9 @@ namespace Config;
* share a system folder between multiple applications, and more.
*
* All paths are relative to the project's root folder.
*
* NOTE: This class is required prior to Autoloader instantiation,
* and does not extend BaseConfig.
*/
class Paths
{
@@ -22,10 +25,8 @@ class Paths
*
* This must contain the name of your "system" folder. Include
* the path if the folder is not in the same directory as this file.
*
* @var string
*/
public $systemDirectory = __DIR__ . '/../../../vendor/codeigniter4/framework/system';
public string $systemDirectory = __DIR__ . '/../../../vendor/codeigniter4/framework/system';
/**
* ---------------------------------------------------------------
@@ -38,10 +39,8 @@ class Paths
* you do, use a full server path.
*
* @see http://codeigniter.com/user_guide/general/managing_apps.html
*
* @var string
*/
public $appDirectory = __DIR__ . '/..';
public string $appDirectory = __DIR__ . '/..';
/**
* ---------------------------------------------------------------
@@ -53,10 +52,8 @@ class Paths
* need write permission to a single place that can be tucked away
* for maximum security, keeping it out of the app and/or
* system directories.
*
* @var string
*/
public $writableDirectory = __DIR__ . '/../../writable';
public string $writableDirectory = __DIR__ . '/../../writable';
/**
* ---------------------------------------------------------------
@@ -64,10 +61,8 @@ class Paths
* ---------------------------------------------------------------
*
* This variable must contain the name of your "tests" directory.
*
* @var string
*/
public $testsDirectory = __DIR__ . '/../../tests';
public string $testsDirectory = __DIR__ . '/../../tests';
/**
* ---------------------------------------------------------------
@@ -78,8 +73,18 @@ class Paths
* contains the view files used by your application. By
* default this is in `app/Views`. This value
* is used when no value is provided to `Services::renderer()`.
*
* @var string
*/
public $viewDirectory = __DIR__ . '/../Views';
public string $viewDirectory = __DIR__ . '/../Views';
/**
* ---------------------------------------------------------------
* ENVIRONMENT DIRECTORY NAME
* ---------------------------------------------------------------
*
* This variable must contain the name of the directory where
* the .env file is located.
* Please consider security implications when changing this
* value - the directory should not be publicly accessible.
*/
public string $envDirectory = __DIR__ . '/../../';
}

View File

@@ -19,7 +19,7 @@ class Publisher extends BasePublisher
* result in a PublisherException. Files that do no fit the
* pattern will cause copy/merge to fail.
*
* @var array<string,string>
* @var array<string, string>
*/
public $restrictions = [
ROOTPATH => '*',

View File

@@ -1,75 +1,42 @@
<?php
namespace Config;
use CodeIgniter\Router\RouteCollection;
// Create a new instance of our RouteCollection class.
$routes = Services::routes();
// Load the system's routing file first, so that the app and ENVIRONMENT
// can override as needed.
if (is_file(SYSTEMPATH . 'Config/Routes.php')) {
require SYSTEMPATH . 'Config/Routes.php';
}
/*
* --------------------------------------------------------------------
* Router Setup
* --------------------------------------------------------------------
*/
$routes->setDefaultNamespace('App\Controllers');
$routes->setDefaultController('Home');
$routes->setDefaultMethod('index');
$routes->setTranslateURIDashes(false);
$routes->set404Override();
// The Auto Routing (Legacy) is very dangerous. It is easy to create vulnerable apps
// where controller filters or CSRF protection are bypassed.
// If you don't want to define all routes, please use the Auto Routing (Improved).
// Set `$autoRoutesImproved` to true in `app/Config/Feature.php` and set the following to true.
$routes->setAutoRoute(false);
/*
* --------------------------------------------------------------------
* Route Definitions
* --------------------------------------------------------------------
*/
/** @var RouteCollection $routes */
// We get a performance increase by specifying the default
// route since we don't have to scan directories.
$routes->get('/', 'Home::overview');
$routes->get('Ajax/(:segment)', 'Ajax::$1');
$routes->post('Ajax/(:segment)', 'Ajax::$1');
$routes->get('newBill', 'Home::newBill');
$routes->get('newTransfer', 'Home::newTransfer');
$routes->get('newScheduled', 'Home::newScheduled/0');
$routes->get('newScheduledTransfer', 'Home::newScheduled/1');
//ajax requests for Tableview
$routes->get('viewInvoice/(:any)', 'FormHandler::viewInvoice/$1');
$routes->post('edit', 'FormHandler::editForm');
$routes->get('newScheduled', 'Scheduled::new/0');
$routes->get('newScheduledTransfer', 'Scheduled::new/1');
$routes->get('editScheduled/(:num)', 'Scheduled::edit/$1');
$routes->get('getScheduledData', 'Scheduled::getTabData');
$routes->post('deleteScheduled', 'Scheduled::delete');
$routes->get('syncScheduled', 'Scheduled::sync');
$routes->get('viewScheduled', 'Scheduled::viewScheduled');
$routes->post('newBill', 'Home::attemptNewBilling');
$routes->post('editAccount', 'Home::attemptEditAccount');
$routes->get('editBill/(:num)', 'Home::editBill/$1');
$routes->get('editScheduled/(:num)', 'Home::editScheduled/$1');
$routes->get('syncScheduled', 'Home::syncScheduled');
$routes->get('getOverviewData', 'Bills::getOverviewData');
$routes->get('getAccountsBalance', 'Bills::getAccountsBalance');
$routes->get('getToDosData', 'Bills::getToDosData');
$routes->post('getActivitiesData', 'Bills::getActivitiesData');
$routes->get('newBill', 'Bills::edit/0');
$routes->get('newTransfer', 'Bills::edit/0/1');
$routes->get('editBill/(:num)', 'Bills::edit/$1');
$routes->get('viewActivities', 'Bills::viewActivities');
$routes->post('deleteBill', 'Bills::delete');
$routes->get('viewAccounts', 'Home::viewAccountsTree');
$routes->get('viewActivities', 'Home::viewAccountActivities');
$routes->get('viewScheduled', 'Home::viewScheduled');
$routes->post('editAccount', 'Accounts::attemptEditAccount');
$routes->match(['GET', 'POST'],'viewAccounts', 'Accounts::index');
$routes->get('viewChart', 'Charts::getData/0');
$routes->get('viewChart/(:num)', 'Charts::getData/$1');
service('auth')->routes($routes);
/*
* --------------------------------------------------------------------
* Additional Routing
* --------------------------------------------------------------------
*
* There will often be times that you need additional routing and you
* need it to be able to override any defaults in this file. Environment
* based routes is one such time. require() additional route files here
* to make that happen.
*
* You will have access to the $routes object within that file without
* needing to reload it.
*/
if (is_file(APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php')) {
require APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php';
}

149
app/Config/Routing.php Normal file
View File

@@ -0,0 +1,149 @@
<?php
/**
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <admin@codeigniter.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Config;
use CodeIgniter\Config\Routing as BaseRouting;
/**
* Routing configuration
*/
class Routing extends BaseRouting
{
/**
* For Defined Routes.
* An array of files that contain route definitions.
* Route files are read in order, with the first match
* found taking precedence.
*
* Default: APPPATH . 'Config/Routes.php'
*
* @var list<string>
*/
public array $routeFiles = [
APPPATH . 'Config/Routes.php',
];
/**
* For Defined Routes and Auto Routing.
* The default namespace to use for Controllers when no other
* namespace has been specified.
*
* Default: 'App\Controllers'
*/
public string $defaultNamespace = 'App\Controllers';
/**
* For Auto Routing.
* The default controller to use when no other controller has been
* specified.
*
* Default: 'Home'
*/
public string $defaultController = 'Home';
/**
* For Defined Routes and Auto Routing.
* The default method to call on the controller when no other
* method has been set in the route.
*
* Default: 'index'
*/
public string $defaultMethod = 'index';
/**
* For Auto Routing.
* Whether to translate dashes in URIs for controller/method to underscores.
* Primarily useful when using the auto-routing.
*
* Default: false
*/
public bool $translateURIDashes = false;
/**
* Sets the class/method that should be called if routing doesn't
* find a match. It can be the controller/method name like: Users::index
*
* This setting is passed to the Router class and handled there.
*
* If you want to use a closure, you will have to set it in the
* routes file by calling:
*
* $routes->set404Override(function() {
* // Do something here
* });
*
* Example:
* public $override404 = 'App\Errors::show404';
*/
public ?string $override404 = null;
/**
* If TRUE, the system will attempt to match the URI against
* Controllers by matching each segment against folders/files
* in APPPATH/Controllers, when a match wasn't found against
* defined routes.
*
* If FALSE, will stop searching and do NO automatic routing.
*/
public bool $autoRoute = false;
/**
* If TRUE, the system will look for attributes on controller
* class and methods that can run before and after the
* controller/method.
*
* If FALSE, will ignore any attributes.
*/
public bool $useControllerAttributes = true;
/**
* For Defined Routes.
* If TRUE, will enable the use of the 'prioritize' option
* when defining routes.
*
* Default: false
*/
public bool $prioritize = false;
/**
* For Defined Routes.
* If TRUE, matched multiple URI segments will be passed as one parameter.
*
* Default: false
*/
public bool $multipleSegmentsOneParam = true;
/**
* For Auto Routing (Improved).
* Map of URI segments and namespaces.
*
* The key is the first URI segment. The value is the controller namespace.
* E.g.,
* [
* 'blog' => 'Acme\Blog\Controllers',
* ]
*
* @var array<string, string>
*/
public array $moduleRoutes = [];
/**
* For Auto Routing (Improved).
* Whether to translate dashes in URIs for controller/method to CamelCase.
* E.g., blog-controller -> BlogController
*
* If you enable this, $translateURIDashes is ignored.
*
* Default: false
*/
public bool $translateUriToCamelCase = true;
}

View File

@@ -15,7 +15,7 @@ class Security extends BaseConfig
*
* @var string 'cookie' or 'session'
*/
public $csrfProtection = 'session';
public string $csrfProtection = 'session';
/**
* --------------------------------------------------------------------------
@@ -23,10 +23,8 @@ class Security extends BaseConfig
* --------------------------------------------------------------------------
*
* Randomize the CSRF Token for added security.
*
* @var bool
*/
public $tokenRandomize = false;
public bool $tokenRandomize = false;
/**
* --------------------------------------------------------------------------
@@ -34,10 +32,8 @@ class Security extends BaseConfig
* --------------------------------------------------------------------------
*
* Token name for Cross Site Request Forgery protection.
*
* @var string
*/
public $tokenName = 'csrf_test_name';
public string $tokenName = 'csrf_test_name';
/**
* --------------------------------------------------------------------------
@@ -45,10 +41,8 @@ class Security extends BaseConfig
* --------------------------------------------------------------------------
*
* Header name for Cross Site Request Forgery protection.
*
* @var string
*/
public $headerName = 'X-CSRF-TOKEN';
public string $headerName = 'X-CSRF-TOKEN';
/**
* --------------------------------------------------------------------------
@@ -56,10 +50,8 @@ class Security extends BaseConfig
* --------------------------------------------------------------------------
*
* Cookie name for Cross Site Request Forgery protection.
*
* @var string
*/
public $cookieName = 'csrf_cookie_name';
public string $cookieName = 'csrf_cookie_name';
/**
* --------------------------------------------------------------------------
@@ -69,10 +61,8 @@ class Security extends BaseConfig
* Expiration time for Cross Site Request Forgery protection cookie.
*
* Defaults to two hours (in seconds).
*
* @var int
*/
public $expires = 7200;
public int $expires = 7200;
/**
* --------------------------------------------------------------------------
@@ -80,10 +70,8 @@ class Security extends BaseConfig
* --------------------------------------------------------------------------
*
* Regenerate CSRF Token on every submission.
*
* @var bool
*/
public $regenerate = true;
public bool $regenerate = true;
/**
* --------------------------------------------------------------------------
@@ -92,26 +80,7 @@ class Security extends BaseConfig
*
* Redirect to previous page with error on failure.
*
* @var bool
* @see https://codeigniter4.github.io/userguide/libraries/security.html#redirection-on-failure
*/
public $redirect = true;
/**
* --------------------------------------------------------------------------
* CSRF SameSite
* --------------------------------------------------------------------------
*
* Setting for CSRF SameSite cookie token.
*
* Allowed values are: None - Lax - Strict - ''.
*
* Defaults to `Lax` as recommended in this link:
*
* @see https://portswigger.net/web-security/csrf/samesite-cookies
*
* @var string
*
* @deprecated `Config\Cookie` $samesite property is used.
*/
public $samesite = 'Lax';
public bool $redirect = (ENVIRONMENT === 'production');
}

128
app/Config/Session.php Normal file
View File

@@ -0,0 +1,128 @@
<?php
namespace Config;
use CodeIgniter\Config\BaseConfig;
use CodeIgniter\Session\Handlers\BaseHandler;
use CodeIgniter\Session\Handlers\FileHandler;
class Session extends BaseConfig
{
/**
* --------------------------------------------------------------------------
* Session Driver
* --------------------------------------------------------------------------
*
* The session storage driver to use:
* - `CodeIgniter\Session\Handlers\ArrayHandler` (for testing)
* - `CodeIgniter\Session\Handlers\FileHandler`
* - `CodeIgniter\Session\Handlers\DatabaseHandler`
* - `CodeIgniter\Session\Handlers\MemcachedHandler`
* - `CodeIgniter\Session\Handlers\RedisHandler`
*
* @var class-string<BaseHandler>
*/
public string $driver = FileHandler::class;
/**
* --------------------------------------------------------------------------
* Session Cookie Name
* --------------------------------------------------------------------------
*
* The session cookie name, must contain only [0-9a-z_-] characters
*/
public string $cookieName = 'ci_session';
/**
* --------------------------------------------------------------------------
* Session Expiration
* --------------------------------------------------------------------------
*
* The number of SECONDS you want the session to last.
* Setting to 0 (zero) means expire when the browser is closed.
*/
public int $expiration = 7200;
/**
* --------------------------------------------------------------------------
* Session Save Path
* --------------------------------------------------------------------------
*
* The location to save sessions to and is driver dependent.
*
* For the 'files' driver, it's a path to a writable directory.
* WARNING: Only absolute paths are supported!
*
* For the 'database' driver, it's a table name.
* Please read up the manual for the format with other session drivers.
*
* IMPORTANT: You are REQUIRED to set a valid save path!
*/
public string $savePath = WRITEPATH . 'session';
/**
* --------------------------------------------------------------------------
* Session Match IP
* --------------------------------------------------------------------------
*
* Whether to match the user's IP address when reading the session data.
*
* WARNING: If you're using the database driver, don't forget to update
* your session table's PRIMARY KEY when changing this setting.
*/
public bool $matchIP = false;
/**
* --------------------------------------------------------------------------
* Session Time to Update
* --------------------------------------------------------------------------
*
* How many seconds between CI regenerating the session ID.
*/
public int $timeToUpdate = 300;
/**
* --------------------------------------------------------------------------
* Session Regenerate Destroy
* --------------------------------------------------------------------------
*
* Whether to destroy session data associated with the old session ID
* when auto-regenerating the session ID. When set to FALSE, the data
* will be later deleted by the garbage collector.
*/
public bool $regenerateDestroy = false;
/**
* --------------------------------------------------------------------------
* Session Database Group
* --------------------------------------------------------------------------
*
* DB Group for the database session.
*/
public ?string $DBGroup = null;
/**
* --------------------------------------------------------------------------
* Lock Retry Interval (microseconds)
* --------------------------------------------------------------------------
*
* This is used for RedisHandler.
*
* Time (microseconds) to wait if lock cannot be acquired.
* The default is 100,000 microseconds (= 0.1 seconds).
*/
public int $lockRetryInterval = 100_000;
/**
* --------------------------------------------------------------------------
* Lock Max Retries
* --------------------------------------------------------------------------
*
* This is used for RedisHandler.
*
* Maximum number of lock acquisition attempts.
* The default is 300 times. That is lock timeout is about 30 (0.1 * 300)
* seconds.
*/
public int $lockMaxRetries = 300;
}

View File

@@ -31,9 +31,9 @@ class Toolbar extends BaseConfig
* List of toolbar collectors that will be called when Debug Toolbar
* fires up and collects data from.
*
* @var string[]
* @var list<class-string>
*/
public $collectors = [
public array $collectors = [
Timers::class,
Database::class,
Logs::class,
@@ -49,12 +49,10 @@ class Toolbar extends BaseConfig
* Collect Var Data
* --------------------------------------------------------------------------
*
* If set to false var data from the views will not be colleted. Usefull to
* If set to false var data from the views will not be collected. Useful to
* avoid high memory usage when there are lots of data passed to the view.
*
* @var bool
*/
public $collectVarData = true;
public bool $collectVarData = true;
/**
* --------------------------------------------------------------------------
@@ -64,10 +62,8 @@ class Toolbar extends BaseConfig
* `$maxHistory` sets a limit on the number of past requests that are stored,
* helping to conserve file space used to store them. You can set it to
* 0 (zero) to not have any history stored, or -1 for unlimited history.
*
* @var int
*/
public $maxHistory = 20;
public int $maxHistory = 20;
/**
* --------------------------------------------------------------------------
@@ -76,10 +72,8 @@ class Toolbar extends BaseConfig
*
* The full path to the the views that are used by the toolbar.
* This MUST have a trailing slash.
*
* @var string
*/
public $viewsPath = SYSTEMPATH . 'Debug/Toolbar/Views/';
public string $viewsPath = SYSTEMPATH . 'Debug/Toolbar/Views/';
/**
* --------------------------------------------------------------------------
@@ -92,8 +86,62 @@ class Toolbar extends BaseConfig
* with hundreds of queries.
*
* `$maxQueries` defines the maximum amount of queries that will be stored.
*
* @var int
*/
public $maxQueries = 100;
public int $maxQueries = 100;
/**
* --------------------------------------------------------------------------
* Watched Directories
* --------------------------------------------------------------------------
*
* Contains an array of directories that will be watched for changes and
* used to determine if the hot-reload feature should reload the page or not.
* We restrict the values to keep performance as high as possible.
*
* NOTE: The ROOTPATH will be prepended to all values.
*
* @var list<string>
*/
public array $watchedDirectories = [
'app',
];
/**
* --------------------------------------------------------------------------
* Watched File Extensions
* --------------------------------------------------------------------------
*
* Contains an array of file extensions that will be watched for changes and
* used to determine if the hot-reload feature should reload the page or not.
*
* @var list<string>
*/
public array $watchedExtensions = [
'php', 'css', 'js', 'html', 'svg', 'json', 'env',
];
/**
* --------------------------------------------------------------------------
* Ignored HTTP Headers
* --------------------------------------------------------------------------
*
* CodeIgniter Debug Toolbar normally injects HTML and JavaScript into every
* HTML response. This is correct for full page loads, but it breaks requests
* that expect only a clean HTML fragment.
*
* Libraries like HTMX, Unpoly, and Hotwire (Turbo) update parts of the page or
* manage navigation on the client side. Injecting the Debug Toolbar into their
* responses can cause invalid HTML, duplicated scripts, or JavaScript errors
* (such as infinite loops or "Maximum call stack size exceeded").
*
* Any request containing one of the following headers is treated as a
* client-managed or partial request, and the Debug Toolbar injection is skipped.
*
* @var array<string, string|null>
*/
public array $disableOnHeaders = [
'X-Requested-With' => 'xmlhttprequest', // AJAX requests
'HX-Request' => 'true', // HTMX requests
'X-Up-Version' => null, // Unpoly partial requests
];
}

View File

@@ -23,7 +23,7 @@ class UserAgents extends BaseConfig
*
* @var array<string, string>
*/
public $platforms = [
public array $platforms = [
'windows nt 10.0' => 'Windows 10',
'windows nt 6.3' => 'Windows 8.1',
'windows nt 6.2' => 'Windows 8',
@@ -78,7 +78,7 @@ class UserAgents extends BaseConfig
*
* @var array<string, string>
*/
public $browsers = [
public array $browsers = [
'OPR' => 'Opera',
'Flock' => 'Flock',
'Edge' => 'Spartan',
@@ -119,7 +119,7 @@ class UserAgents extends BaseConfig
*
* @var array<string, string>
*/
public $mobiles = [
public array $mobiles = [
// legacy array, old values commented out
'mobileexplorer' => 'Mobile Explorer',
// 'openwave' => 'Open Wave',
@@ -228,11 +228,15 @@ class UserAgents extends BaseConfig
*
* @var array<string, string>
*/
public $robots = [
public array $robots = [
'googlebot' => 'Googlebot',
'google-pagerenderer' => 'Google Page Renderer',
'google-read-aloud' => 'Google Read Aloud',
'google-safety' => 'Google Safety Bot',
'msnbot' => 'MSNBot',
'baiduspider' => 'Baiduspider',
'bingbot' => 'Bing',
'bingpreview' => 'BingPreview',
'slurp' => 'Inktomi Slurp',
'yahoo' => 'Yahoo',
'ask jeeves' => 'Ask Jeeves',
@@ -248,5 +252,11 @@ class UserAgents extends BaseConfig
'ia_archiver' => 'Alexa Crawler',
'MJ12bot' => 'Majestic-12',
'Uptimebot' => 'Uptimebot',
'duckduckbot' => 'DuckDuckBot',
'sogou' => 'Sogou Spider',
'exabot' => 'Exabot',
'bot' => 'Generic Bot',
'crawler' => 'Generic Crawler',
'spider' => 'Generic Spider',
];
}

View File

@@ -3,24 +3,24 @@
namespace Config;
use CodeIgniter\Config\BaseConfig;
use CodeIgniter\Validation\CreditCardRules;
use CodeIgniter\Validation\FileRules;
use CodeIgniter\Validation\FormatRules;
use CodeIgniter\Validation\Rules;
use CodeIgniter\Validation\StrictRules\CreditCardRules;
use CodeIgniter\Validation\StrictRules\FileRules;
use CodeIgniter\Validation\StrictRules\FormatRules;
use CodeIgniter\Validation\StrictRules\Rules;
class Validation extends BaseConfig
{
//--------------------------------------------------------------------
// --------------------------------------------------------------------
// Setup
//--------------------------------------------------------------------
// --------------------------------------------------------------------
/**
* Stores the classes that contain the
* rules that are available.
*
* @var string[]
* @var list<string>
*/
public $ruleSets = [
public array $ruleSets = [
Rules::class,
FormatRules::class,
FileRules::class,
@@ -33,12 +33,12 @@ class Validation extends BaseConfig
*
* @var array<string, string>
*/
public $templates = [
public array $templates = [
'list' => 'CodeIgniter\Validation\Views\list',
'single' => 'CodeIgniter\Validation\Views\single',
];
//--------------------------------------------------------------------
// --------------------------------------------------------------------
// Rules
//--------------------------------------------------------------------
// --------------------------------------------------------------------
}

View File

@@ -30,7 +30,7 @@ class View extends BaseView
* { title|esc(js) }
* { created_on|date(Y-m-d)|esc(attr) }
*
* @var array
* @var array<string, (callable(mixed): mixed)&string>
*/
public $filters = [];
@@ -39,7 +39,7 @@ class View extends BaseView
* by the core Parser by creating aliases that will be replaced with
* any callable. Can be single or tag pair.
*
* @var array
* @var array<string, (callable(mixed...): mixed)|((callable(mixed...): mixed)&string)|list<(callable(mixed...): mixed)&string>>
*/
public $plugins = [];
@@ -50,7 +50,24 @@ class View extends BaseView
*
* All classes must implement CodeIgniter\View\ViewDecoratorInterface
*
* @var class-string<ViewDecoratorInterface>[]
* @var list<class-string<ViewDecoratorInterface>>
*/
public array $decorators = [];
/**
* Subdirectory within app/Views for namespaced view overrides.
*
* Namespaced views will be searched in:
*
* app/Views/{$appOverridesFolder}/{Namespace}/{view_path}.{php|html...}
*
* This allows application-level overrides for package or module views
* without modifying vendor source files.
*
* Examples:
* 'overrides' -> app/Views/overrides/Example/Blog/post/card.php
* 'vendor' -> app/Views/vendor/Example/Blog/post/card.php
* '' -> app/Views/Example/Blog/post/card.php (direct mapping)
*/
public string $appOverridesFolder = 'overrides';
}

62
app/Config/WorkerMode.php Normal file
View File

@@ -0,0 +1,62 @@
<?php
namespace Config;
/**
* This configuration controls how CodeIgniter behaves when running
* in worker mode (with FrankenPHP).
*/
class WorkerMode
{
/**
* Persistent Services
*
* List of service names that should persist across requests.
* These services will NOT be reset between requests.
*
* Services not in this list will be reset for each request to prevent
* state leakage.
*
* Recommended persistent services:
* - `autoloader`: PSR-4 autoloading configuration
* - `locator`: File locator
* - `exceptions`: Exception handler
* - `commands`: CLI commands registry
* - `codeigniter`: Main application instance
* - `superglobals`: Superglobals wrapper
* - `routes`: Router configuration
* - `cache`: Cache instance
*
* @var list<string>
*/
public array $persistentServices = [
'autoloader',
'locator',
'exceptions',
'commands',
'codeigniter',
'superglobals',
'routes',
'cache',
];
/**
* Reset Event Listeners
*
* List of event names whose listeners should be removed between requests.
* Use this if you register event listeners inside other event callbacks
* (rather than at the top level of Config/Events.php), which would cause
* them to accumulate across requests in worker mode.
*
* @var list<string>
*/
public array $resetEventListeners = [];
/**
* Force Garbage Collection
*
* Whether to force garbage collection after each request.
* Helps prevent memory leaks at a small performance cost.
*/
public bool $forceGarbageCollection = true;
}

View File

@@ -0,0 +1,44 @@
<?php namespace App\Controllers;
use CodeIgniter\Session\Session;
use App\Models\mAccounts;
use Config\App;
class Accounts extends BaseController {
private \App\Models\mAccounts $accounts;
public function __construct() {
$this->accounts = new mAccounts;
}
public function index(){
if ($this->request->is('post')) {
return $this->editAccount();
}
else
return $this->viewAccountsTree();
}
private function viewAccountsTree($data = array()){
helper('form');
$data = array_merge($data,$this->accounts->getTreeData());
$data['ddlist'] = $this->accounts->getDropDownList( 'all', false,true );
return view('accountstree',$data);
}
private function editAccount(){
$rules = [
'description' => 'required',
];
if (! $this->validate($rules)) {
return $this->viewAccountsTree(['errors'=>$this->validator->getErrors()]);
}
$saveDB = array();
if ($this->accounts->saveAccount($this->request->getPost()))
$saveDB = ['mode'=>'alert-success','message'=>'Erfolgreich gespeichert'];
else
$saveDB = ['mode'=>'alert-danger','message'=>'Speichern fehlgeschlagen'];
return $this->viewAccountsTree(['saveDB'=>$saveDB]);
}
};

View File

@@ -1,71 +0,0 @@
<?php
namespace App\Controllers;
use App\Models\mBills;
use CodeIgniter\Session\Session;
class Ajax extends BaseController
{
protected $session;
public function __construct()
{
$this->session = service('session');
}
public function getTabelData(){
if (!$this->request->isAJAX()) return;
$billing = model('App\Models\mBills');
$start = $this->request->getPost('datum_start')??session('datum_start');
$ende = $this->request->getPost('datum_ende')??session('datum_ende');
$src = intval($this->request->getPost('source')) ?? 0;
$_SESSION['datum_start'] = $start;
$_SESSION['datum_ende'] = $ende;
$_SESSION['source'] = $src;
$result = $billing->getEntriesDet($start,$ende,$src);
return json_encode($result);
}
public function getAccountsBalance(){
if (!$this->request->isAJAX()) return;
$billing = model('App\Models\mBills');
return json_encode($billing->getAccountsBalance());
}
public function getScheduledData(){
if (!$this->request->isAJAX()) return;
$scheduled = model('App\Models\mScheduled');
return json_encode($scheduled->getEntries());
}
public function getToDosData(){
if (!$this->request->isAJAX()) return;
$billing = model('App\Models\mBills');
return json_encode($billing->getToDos());
}
public function getOverviewData(){
if (!$this->request->isAJAX()) return;
$billing = model('App\Models\mBills');
$result = $billing->getEntries();
return json_encode($result);
}
public function deleteBill(){
if (!$this->request->isAJAX()) return;
$bills = model('App\Models\mBills');
$bills->deleteEntry($this->request->getPost('id'));
return json_encode(["result"=>"done"]);
}
public function deleteScheduled(){
if (!$this->request->isAJAX()) return;
$scheduled = model('App\Models\mScheduled');
$scheduled->delete($this->request->getPost('id'));
return json_encode(["result"=>"done"]);
}
}
?>

View File

@@ -3,52 +3,43 @@
namespace App\Controllers;
use CodeIgniter\Controller;
use CodeIgniter\HTTP\CLIRequest;
use CodeIgniter\HTTP\IncomingRequest;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
/**
* Class BaseController
*
* BaseController provides a convenient place for loading components
* and performing functions that are needed by all your controllers.
* Extend this class in any new controllers:
* class Home extends BaseController
*
* For security be sure to declare any new methods as protected or private.
* Extend this class in any new controllers:
* ```
* class Home extends BaseController
* ```
*
* For security, be sure to declare any new methods as protected or private.
*/
abstract class BaseController extends Controller
{
/**
* Instance of the main Request object.
*
* @var CLIRequest|IncomingRequest
* Be sure to declare properties for any property fetch you initialized.
* The creation of dynamic property is deprecated in PHP 8.2.
*/
protected $request;
// protected $session;
/**
* An array of helpers to be loaded automatically upon
* class instantiation. These helpers will be available
* to all other controllers that extend BaseController.
*
* @var array
*/
protected $helpers = [];
/**
* Constructor.
* @return void
*/
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
$this->helpers = array_merge($this->helpers, ['setting']);
// Load here all helpers you want to be available in your controllers that extend BaseController.
// Caution: Do not put the this below the parent::initController() call below.
// $this->helpers = ['form', 'url'];
// Do Not Edit This Line
// Caution: Do not edit this line.
parent::initController($request, $response, $logger);
// Preload any models, libraries, etc, here.
// E.g.: $this->session = \Config\Services::session();
// $this->session = service('session');
}
}

90
app/Controllers/Bills.php Normal file
View File

@@ -0,0 +1,90 @@
<?php namespace App\Controllers;
use App\Models\mAccounts;
use function PHPUnit\Framework\logicalXor;
use App\Models\mBills;
use CodeIgniter\API\ResponseTrait;
include_once (dirname(__FILE__) . "/FormHandler.php");
class Bills extends FormHandler {
use ResponseTrait;
public function __construct() {
}
public function edit(int $id, bool $transfer=false){
if ($id == 0){ // erstellen eines leeren Formular
log_message('debug','Bills::edit: new bill');
$eBooking = new \App\Entities\eBooking();
$eBooking->transfer = $transfer;
$eBooking->scheduled = false;
$data = $eBooking->getNew();
} else {
$billModel = model(mBills::class);
$bill = $billModel->find($id); /* @var \App\Entity\eBooking $bill */
$bill->datum = date( "Y-m-d", strtotime( $bill->datum ));
$data = $bill->fillDetails();
log_message('debug','Bills::edit:ID:'.$id.'; Data: '.json_encode($bill->toArray()));
}
return $this->viewBill($data);
}
public function viewActivities(){
$accounts = model('App\Models\mAccounts'); /* @var \App\Models\mAccounts $accounts */
$data = array();
$data['source'] = 0;
$data['start'] = session('datum_start') ?? date("Y-m-d", strtotime( "- 2 weeks", strtotime( "now" ) ));
$data['ende'] = session('datum_ende') ?? date("Y-m-d", strtotime( "now" ) );
$data['source'] = session('source') ?? 0;
$data['sourcelist'] = $accounts->getDropDownList( 'all', true );
return view('activities', $data);
}
public function getOverviewData(){
if (!$this->request->isAJAX()) return;
$billing = model('App\Models\mBills');
$result = $billing->getEntries(10);
return json_encode($result);
}
public function getActivitiesData(){
if (!$this->request->isAJAX()) return;
$billing = model('App\Models\mBills');
$start = $this->request->getPost('datum_start')??session('datum_start');
$ende = $this->request->getPost('datum_ende')??session('datum_ende');
$src = intval($this->request->getPost('source'));
$_SESSION['datum_start'] = $start;
$_SESSION['datum_ende'] = $ende;
$_SESSION['source'] = $src;
$result = $billing->getEntriesDet($start,$ende,$src);
return json_encode($result);
}
public function delete(){
if ($this->request->is('post')) {
if (!ctype_digit($this->request->getPost("id"))) return $this->failForbidden("Ungültige ID");
log_message('debug',"delete id: ".$this->request->getPost("id"));
$billModel = model(mBills::class);
$result = $billModel->deleteEntry(intval($this->request->getPost("id")));
if ($result !== true)
return $this->fail("Database error ".$result);
else
return $this->respondDeleted(['url'=>session('redirect_url') ?? site_url('/'),'ID'=>$this->request->getPost("id")]);
}
return $this->failUnauthorized("Schäm Dich");
}
public function getToDosData(){
if (!$this->request->isAJAX()) return;
$billing = model('App\Models\mBills');
return json_encode($billing->getToDos());
}
public function getAccountsBalance(){
if (!$this->request->isAJAX()) return;
$billing = model('App\Models\mBills');
return json_encode($billing->getAccountsBalance());
}
}

149
app/Controllers/Charts.php Normal file
View File

@@ -0,0 +1,149 @@
<?php namespace App\Controllers;
use CodeIgniter\Session\Session;
use DateInterval;
use Config\App;
class Charts extends BaseController {
private $db;
public function __construct() {
$this->db = \Config\Database::connect();
}
public function getData(int $id){
if ($id == 0)
return $this->getAllData();
else
return $this->getDetailData($id);
}
private function getDetailData(int $id){
$accounts = model('App\Models\mAccounts'); /* @var \App\Models\mAccounts $accounts */
$bills = model('App\Models\mBills'); /* @var \App\Models\mBills $bills */
$billDet = model('App\Models\mBillDetails'); /* @var \App\Models\mBills $billDet */
$accTable = $accounts->getTable();
$billTable = $bills->getTable();
$billDetTable = $billDet->getTable();
$jetzt = date('Y-m-01');
$query = <<<EOD
SELECT
SUM(subamount)*(-1) AS Amount,
description,account_id as id
FROM
$billDetTable, $billTable,$accTable
WHERE
datum >= '$jetzt'
AND (datum < '$jetzt'::date + interval '1 month')
AND $billTable.id = bill_id
AND account_id = $accTable.id
AND (account_id IN (
WITH RECURSIVE subordinates AS (
SELECT
id,
parent_id,
description
FROM
$accTable
WHERE
id = $id
UNION
SELECT
e.id,
e.parent_id,
e.description
FROM
$accTable e
INNER JOIN subordinates s ON s.id = e.parent_id)
SELECT
id
FROM
subordinates
))
GROUP BY description, account_id
EOD;
$data = array();
$werte = array();
$ids = array();
$labels = array();
$result = $this->db->query($query);
foreach ($result->getResult() as $row) {
$werte[] = $row->amount;
$ids[] = $row->id;
$labels[] = $row->description;
}
$data['data'] = json_encode($werte);
$data['labels'] = json_encode($labels);
$data['ids'] = json_encode($ids);
$data['title'] = "Kategorieübersicht > ".$jetzt;
return view("charts/monthly", $data);
}
private function getAllData(){
$accounts = model('App\Models\mAccounts'); /* @var \App\Models\mAccounts $accounts */
$bills = model('App\Models\mBills'); /* @var \App\Models\mBills $bills */
$billDet = model('App\Models\mBillDetails'); /* @var \App\Models\mBills $billDet */
$accTable = $accounts->getTable();
$billTable = $bills->getTable();
$billDetTable = $billDet->getTable();
$jetzt = date('Y-m-01');
$query = <<<EOD
SELECT * FROM (
SELECT id, description,sum(amount)as summe FROM (SELECT id,description from $accTable WHERE parent_id=0 AND account=false AND deleted_at is null) as w,
LATERAL
(SELECT ABS(SUM(subamount)) as amount
FROM $billDetTable, $billTable
WHERE datum >= '$jetzt'
AND $billTable.deleted_at is null
AND $billDetTable.deleted_at is null
AND $billTable.id = $billDetTable.bill_id
AND (account_id IN
(
WITH RECURSIVE subordinates AS (
SELECT
id,
parent_id,
description
FROM
$accTable
WHERE
id = w.id
UNION
SELECT
e.id,
e.parent_id,
e.description
FROM
$accTable e
INNER JOIN subordinates s ON s.id = e.parent_id)
SELECT
id
FROM
subordinates
))
) AS x GROUP BY description, id) as i WHERE summe is not null;
EOD;
$data = array();
$result = $this->db->query($query);
log_message('debug','Charts::getAllData: '.$this->db->getLastQuery());
foreach ($result->getResult() as $row) {
$werte[] = $row->summe;
$ids[] = $row->id;
$labels[] = $row->description;
}
$data['data'] = json_encode($werte);
$data['labels'] = json_encode($labels);
$data['ids'] = json_encode($ids);
$data['title'] = "Monatsübersicht > ".$jetzt;
return view("charts/monthly", $data);
// SELECT description,amount FROM (SELECT id,description from finanzen.budget_accounts WHERE parent_id=0 AND type='output' AND LKZ is null) as w,
// LATERAL
// (SELECT subamount as amount
// FROM finanzen.budget_billdetails, finanzen.budget_bills
// WHERE datum >= DATE_TRUNC('month',current_date)
// AND budget_bills.id = bill_id
// AND (account_id IN
// (SELECT id from finanzen.budget_accounts WHERE (id = w.id OR parent_id = w.id))
// )
// ) AS x
}
}

View File

@@ -0,0 +1,195 @@
<?php namespace App\Controllers;
use App\Models\mAccounts;
use function PHPUnit\Framework\logicalXor;
use App\Models\mBills;
class FormHandler extends BaseController {
public function editForm(){
if ($this->request->is('post')) {
log_message('debug','Bills::edit: post data: '.json_encode($this->request->getPost()));
return $this->checkBillForm();
}
else
return $this->viewBill($data);
}
/**
* Prüft ob Kategorie vorhanden wenn ein Betrag eingegeben wurde, ohne Betrag und ohne Kategorie wird die Zeile ignoriert bzw. gelöscht
*/
public function _ruleBookingLineAcc($value, array $data, ?string &$error, string $field){
log_message('debug',"Bills::_ruleBookingLineAcc Typ von übergegeben Wert".gettype($value));
$index = explode('.', $field)[1];
if ($value > 0) return true;
if ($index == 0)
$error = "Kategorie fehlt";
else if ((is_numeric($data['input'][$index]) && (round($data['input'][$index],2) > 0.0)) || (is_numeric($data['output'][$index]) && (round($data['output'][$index]) > 0.0)))
$error = "Kategorie in Zeile " . $index . " fehlt";
return empty($error);
}
/**
* Prüft ob Teilbetrag vorhanden wenn eine Kategorie ausgewählt wurde, ohne Betrag und ohne Kategorie wird die Zeile ignoriert bzw. gelöscht
* auch wird geprüft dass nur Input oder Output einen Wert enthält, soll im Javascript gemacht werden wenn ordentlich läuft
*/
public function _ruleBookingLineAmount(string $value, array $data, ?string &$error, string $field){
log_message('debug',"Bills::_ruleBookingLineAmount Typ von übergegeben Wert ".gettype($value));
$index = explode('.', $field)[1];
if ((is_numeric($data['input'][$index]) && (round($data['input'][$index],2) > 0.0)) xor
(is_numeric($data['output'][$index]) && (round($data['output'][$index],2) > 0.0)))
return true;
if ((is_numeric($data['input'][$index]) && (round($data['input'][$index],2) > 0.0)) && (is_numeric($data['output'][$index]) && (round($data['output'][$index],2) > 0.0)))
$error = "Systemfehler: Nur Input oder Output darf einen Wert haben";
else if (($index == 0) && (count($data['input'])==1))
$error = "Betrag fehlt";
else if (is_numeric($data['account_id'][$index]) && ($data['account_id'][$index] > 0))
$error = "Betrag in Zeile " . $index+1 . " fehlt";
return empty($error);
}
/**
* rechnet nach ob der Virtuelle Gesamtbetrag (berechnet javascript) stimmt
*/
public function _ruleCalcAmount(string $value, array $data, ?string &$error, string $field){
$subamounts = 0.0;
foreach ($data['input'] as $i => $inp){
$subamounts = $subamounts + round(floatval($inp),2) - round(floatval($data['output'][$i]),2);
}
if (round($value,2) == round($subamounts,2))
return true;
else
$error = "Systemfehler: Amount Client ". floatval($value) . " ungleich Server Amount ". floatval($subamounts) ." Kalkulation; Diff = ".floatval($value)-floatval($subamounts);
return empty($error);
}
public function _ruleCalcTotal(string $value, array $data, ?string &$error, string $field){
log_message('debug',"Bills::_ruleCalcTotal In: ".$data['total_in']."; Out: ".$data['total_out']);
if ((is_numeric($data['total_in']) && (round($data['total_in'],2) > 0.0)) && (is_numeric($data['total_out']) && (round($data['total_out'],2) > 0.0))) {
$error = "Systemfehler: Gesamtbetrag darf nur Input oder Output sein";
// } else if ((!is_numeric($data['total_in'])) && (!is_numeric($data['total_out']))) {
// $error = "Systemfehler: Gesamtbetrag muss angegeben sein";
} else {
$total = round(floatval($data['total_in'])-floatval($data['total_out']),2);
if (($total !== round(floatval($data['amount']),2)) && (round(floatval($data['openamount']),2) == 0.0))
$error = "Systemfehler: Gesamtbetrag entspricht nicht Teilbeträgen";
}
log_message('debug',"Bills::_ruleCalcTotal Ergebnis ".$error);
return empty($error);
}
public function checkBillForm(){
$rules = [
'id'=>['required','is_natural'],
'source_id' => ['label'=>'Konto','rules'=>['required','greater_than[0]'],'errors'=>['greater_than'=>'Konto fehlt']],
'datum' => 'required',
'scheduled' => 'required',
'transfer' => 'required',
'sid.*' => ['label'=>'BuchungszeileID','rules'=>['required','is_natural']],
'receiver' => ['label'=>'Empfänger','rules'=>['required','max_length[120]'],'errors'=>['required'=>'Empfänger fehlt']],
'account_id.*' => [[$this,'_ruleBookingLineAcc']],
'input.*' => [[$this,'_ruleBookingLineAmount']],
'comment.*' => ['label'=>'Kommentar','rules'=>['max_length[150]']],
'output.*' => ['permit_empty','numeric'],
'amount' => ['required', 'numeric', [$this,'_ruleCalcAmount']],
'billfile' => ['max_size[billfile,10000]','mime_in[billfile,application/pdf,image/jpg,image/jpeg]'],
'removeBillFile' => ['max_length[50]'],
'validate' => ['required'],
'scheduledNum' =>['required_with[scheduled]','permit_empty','numeric'],
'scheduledType' =>['required_with[scheduled]','permit_empty','in_list[week,month,year]']
];
if ( 1 < count($this->request->getPost('sid')) ) {
$rules['openamount'] = ['rules'=>['numeric','equals[0.00]'], 'errors'=>['equals'=>'Restbetrag muss 0 sein']];
$rules['total_in'] = [[$this,'_ruleCalcTotal']];
$rules['total_out'] = ['required_without[total_in]','permit_empty','numeric'];
}
$data = $this->request->getPost();// filter getPost by array_keys($rules) but indexed rules not working
log_message('debug','Bills::checkBillForm: Form Data: '.json_encode($data));
if (! $this->validateData($data, $rules)){
log_message('debug','Bills::checkBillForm: validation failed: '.json_encode($data));
log_message('debug','Bills::checkBillForm: validation failed: '.json_encode($this->validator->getErrors()));
$eBooking = new \App\Entities\eBooking($data);
return $this->viewBill($eBooking, $this->validator->getErrors());
// return redirect()->back()->withInput()->with('errors', $validation->getErrors());
}
else{
log_message('debug','Bills::checkBillForm: validation success: '.json_encode($this->validator->getValidated()));
$eBooking = new \App\Entities\eBooking($this->validator->getValidated());
if ($data['scheduled'] == "0"){
$file = $this->request->getFile('billfile');
if ($file) {
if (! $file->isValid() && ($file->getError() != UPLOAD_ERR_NO_FILE)) {
throw new \RuntimeException($file->getErrorString() . '(' . $file->getError() . ')');
}
$eBooking->setInvoice($file);
}
}
$result = $eBooking->saveIt();
if (true !== $result) // show error of database
$this->viewBill($eBooking, $result);
$redirectURL = session('redirect_url') ?? site_url('/');
unset($_SESSION['redirect_url']);
return redirect()->to($redirectURL);
}
}
public function viewBill(\App\Entities\eBooking $fdata, $errors = NULL){
helper('form');
log_message('debug','Bills::viewBill: fdata: '.json_encode($fdata->toArray()));
$data['booking'] = $fdata->getFormData();
$data['validation'] = $errors;
return view('newBill', $data);
}
public function viewInvoice(string $filename) {
$filePath= WRITEPATH . '/uploads/'.auth()->user()->preFixDB;
$file = new \CodeIgniter\Files\File($filePath."/".$filename);
log_message('debug',$file->getMimeType());
if ($file->getMimeType() == 'application/pdf')
$this->viewPdf($filename);
else{
$imginfo = getimagesize($filePath."/".$filename);
header("Content-type: {$imginfo['mime']}");
readfile($filePath."/".$filename);
exit;
}
// return view('viewBillImg', ['filename'=>'writable/uploads/'.$filename]);
}
private function viewPdf(string $filename) {
// $view = \Config\Services::renderer();
log_message('debug',$filename);
$filePath= WRITEPATH . '/uploads/'.auth()->user()->preFixDB;
header("Cache-Control: maxage=1");
header("Pragma: public");
header('Content-type:application/pdf');
header('Content-disposition: inline; filename="'.$filename.'"');
header('content-Transfer-Encoding:binary');
header('Content-Length:' .filesize($filePath."/".$filename));
if (($pdf =file_get_contents($filePath."/".$filename)) === false)
print $filePath."/".$filename;
else
print $pdf;
exit;
}
}

View File

@@ -1,287 +1,28 @@
<?php
namespace App\Controllers;
use App\Models\mBills;
use App\Models\mAccounts;
use App\Models\mBills;
use CodeIgniter\Session\Session;
use CodeIgniter\Files\File;
use CodeIgniter\I18n\Time;
class Home extends BaseController
{
private $accounts;
class Home extends BaseController {
/**
* @var Session
*/
protected $session;
public function __construct()
{
public function __construct() {
$this->session = service('session');
$this->accounts = model('App\Models\mAccounts');
}
public function overview()
{
public function overview() {
$accounts = model('App\Models\mAccounts'); /* @var \App\Models\mAccounts $accounts */
$bills = model('App\Models\mBills'); /* @var \App\Models\mBills $bills */
$billDet = model('App\Models\mBillDetails'); /* @var \App\Models\mBills $billDet */
$scheduled = model('App\Models\mScheduled'); /* @var \App\Models\mScheduled $scheduled */
return view('table');
}
private function checkDDPList(&$arr, $ele){
if (!array_key_exists($ele, $arr)){
$arr[$ele] = $this->accounts->getDropDownEntry($ele);
}
}
private function checkDDSList($arr, $par, $ele){
if (!array_key_exists($par, $arr)){
$ret = array();
if ($ele > 0)
$ret[$ele] = $this->accounts->getDropDownEntry($ele);
else
$ret[0] = '-----';
return $ret;
}
else{
return $arr[$par];
}
}
private function loadFormDefaults(){
$data['id'] = 0;
$data['source'] = 0;
$data['datum'] ='';
$data['renummer'] = false;
$data['multi'] = false;
$data['transfer'] = false;
$data['receiver'] = '';
$data['total_in'] = '';
$data['total_out'] = '';
$data['validate'] = false;
$data['scheduled'] = false;
$data['scheduledNum'] = 0;
$data['scheduledType'] = 0;
for ($i=0;$i<10;$i++){
$data['sid'][$i] = 0;
$data['category_parent'][$i] = 0;
$data['category'][$i] = 0;
$data['input'][$i] = '';
$data['output'][$i] = '';
$data['comment'][$i] = '';
}
return $data;
}
/**
* Legt eine neue Terminbuchung an
* @param bool $transfer ob Terminbuchung vom Typ Transfer ist
* @return char gibt die View zurück
**/
public function newScheduled($transfer = 0){
$data = $this->loadFormDefaults();
$data['transfer'] = (bool)$transfer;
return $this->newBill($data,NULL,true);
}
public function newTransfer(){
$data = $this->loadFormDefaults();
$data['transfer'] = true;
return $this->newBill($data,NULL);
}
public function newBill($data = NULL, $errors = NULL,$scheduled = false){
helper('form');
$data = $data ?? $this->loadFormDefaults();
$data['isScheduled'] = $scheduled;
$data['validation'] = $errors;
$srclist = $this->accounts->getDropDownList( 'Acc', TRUE );
$this->checkDDPList($srclist,$data['source']);
$data['sourcelist'] = $srclist;
$data['scheduled'] = array('NumList' => array('1'=>'1','2'=>'2','3'=>'3','4'=>'4','5'=>'5','6'=>'6'),
'TypeList' => array('week'=>'Woche(n)','month'=>'Monat(e)','year'=>'Jahr(e)'),
'style' => 'class="form-select"');
if ($data['transfer'])
$categories = $this->accounts->getDropDownLists( 'Acc', TRUE );
else
$categories = $this->accounts->getDropDownLists( 'InOut', TRUE );
// $data['catparentlist'] = $categories['parent'];
// if (!array_key_exists('catparent', $data))
// $data['catparent'] = $this->accounts->getParent($data['cat']);
// $this->checkDDPList($data['catparentlist'],$data['catparent']);
// $data['catlist'] = $this->checkDDSList((array)$categories['subs'],$data['catparent'],$data['cat']);
$data['subsparent'] = array();
$data['subscategory'] = array();
for ($i=0;$i<10;$i++){
$data['subsparent'][$i] = $categories['parent'];
$data['category_parent'][$i] = $data['category_parent'][$i] ?? 0;
$this->checkDDPList($data['subsparent'][$i],$data['category_parent'][$i]);
$data['subscategory'][$i] = $this->checkDDSList((array)$categories['subs'],$data['category_parent'][$i],$data['category'][$i]??0);
}
$data['subsdata'] = json_encode($categories['subs']);
return view('newBill', $data);
}
private function customValidation(&$errors){
$result = true;
// if ( "on" == $this->request->getPost('multi') )
// {
for ($i=0;$i<10;$i++){
$inp = $this->request->getPost("input[$i]");
$outp = $this->request->getPost("output[$i]");
$cat = $this->request->getPost("category[$i]");
if ((is_numeric($inp) && $inp > 0.0) || (is_numeric($outp) && $outp > 0.0)){
if ($cat == 0){
$result &= false;
$errors['Kategorie']="Kategorie [$i] fehlt oder ungültig";
}
}
if ($cat > 0){
$errors['log2'] = "cat recognized";
if (!((is_numeric($inp) && ($inp > 0.0)) || (is_numeric($outp) && ($outp > 0.0)))){
$errors['Betrag']="Betrag [$i] fehlt oder ungültig";
$result &= false;
}
}
}
// }
// else{
// if ((is_numeric($this->request->getPost('total_in')) && $this->request->getPost('total_in') > 0.0) || (is_numeric($this->request->getPost('total_out')) && $this->request->getPost('total_out') > 0.0)){
// return true;
// }
// else
// $errors['Betrag']="Betrag fehlt oder ungültig";
// }
return $result;
}
public function attemptNewBilling()
{
$rules = [
'source' => 'required|greater_than[0]',
'datum' => 'required',
'category.0' => 'required|greater_than[0]'
// 'totalamount'=>'required|numeric'
];
$errors = [ // Errors
'source' => ['required' => 'Konto fehlt','greater_than' => 'Konto fehlt'],
'datum' => ['required' => 'Datum fehlt']];
// 'totalamount' => ['required' => 'Betrag fehlt','numeric' => 'Betrag muss eine Zahl sein']];
if ( 'on' == $this->request->getPost('multi') )
{
$rules['openamount'] = 'equals[0]';
$errors['openamount'] = ['equals' => 'Betrag muss 0 sein'];
}
$fehler= array();
$valid = $this->customValidation($fehler);
if ((! $this->validate($rules,$errors)) || (!$valid)){
return $this->newBill($this->request->getPost(), array_merge($this->validator->getErrors(),$fehler),$this->request->getPost('scheduled'));
// return redirect()->back()->withInput()->with('errors', $validation->getErrors());
}
else{
if ($this->request->getPost('scheduled') =="0"){
$bills = model('App\Models\mBills');
$bills->saveBill($this->request->getPost());
$redirectURL = session('redirect_url') ?? site_url('/');
unset($_SESSION['redirect_url']);
return redirect()->to($redirectURL);
}
else{
$scheduled = model('App\Models\mScheduled');
$scheduled->saveBill($this->request->getPost());
}
$this->response->redirect(site_url('/'));
}
}
public function editBill($id){
$bills = model('App\Models\mBills');
$data = $this->loadFormDefaults();
$result = $bills->getEntry($id, $data, $this->accounts);
return $this->newBill($result);
}
public function editScheduled($id){
$scheduled = model('App\Models\mScheduled');
$entry = $scheduled->getEntry($id);
// $bill = array_merge($this->loadFormDefaults(),(array)json_decode($entry['data']));
// $bill['datum'] = $entry['next_date'];
return $this->newBill($entry,NULL,true);
}
public function deleteScheduled($id){
$scheduled = model('App\Models\mScheduled');
$entry = $scheduled->getEntry($id);
// $bill = array_merge($this->loadFormDefaults(),(array)json_decode($entry['data']));
// $bill['datum'] = $entry['next_date'];
return $this->newBill($entry,NULL,true);
}
public function syncScheduled(){
$scheduled = model('App\Models\mScheduled');
$schedules = $scheduled->findAll();
foreach ( $schedules as $schedule )
{
$cur_date = $schedule['next_date'];
while ( strtotime( $cur_date ) <= strtotime( "now" ) )
{
echo "$cur_date - ";
$bill = array_merge($this->loadFormDefaults(),(array)json_decode($schedule['data']));
//echo "Hugo:".$schedule['id'];
$bill['id']=0; // to generate a new booking
$bill['datum'] = $cur_date;
$bill['type'] = $bill['transfer']?'transfer':'multiple';
echo $bill['receiver'];
$bills = model('App\Models\mBills');
$bills->saveBill($bill);
$cur_date = $scheduled->calcNextDate( $cur_date, $bill['scheduledNum'], $bill['scheduledType']);
echo " - $cur_date <br/>";
//log_message('debug','BudgetScheduled:process data: '.logArray($booking->getData()));
$scheduled->update($schedule['id'], ['next_date'=>$cur_date ]);
}
}
//$this->showTableBookings();
}
public function viewAccountsTree(){
helper('form');
$data = $this->accounts->getTreeData();
$data['ddlist'] = $this->accounts->getDropDownList( 'all', false,true );
return view('accountstree',$data);
}
public function attemptEditAccount(){
$rules = [
'description' => 'required',
'type' => 'required',
];
if (! $this->validate($rules))
{
return redirect()->back()->withInput()->with('errors', $this->validator->getErrors());
}
$this->accounts->saveAccount($this->request->getPost());
// $this->accounts = model('App\Models\mAccounts', false);
return $this->viewAccountsTree();
}
public function viewAccountActivities(){
helper('form');
$data = array();
$data['source'] = 0;
$data['start'] = session('datum_start') ?? date("d.m.Y", strtotime( "- 2 weeks", strtotime( "now" ) ));
$data['ende'] = session('datum_ende') ?? date("d.m.Y", strtotime( "now" ) );
$data['source'] = session('source') ?? 0;
$data['sourcelist'] = $this->accounts->getDropDownList( 'all', TRUE );
return view('activities', $data);
}
public function viewScheduled(){
helper('form');
return view('scheduled');
}
}

View File

@@ -0,0 +1,83 @@
<?php
namespace App\Controllers;
use App\Models\mScheduled;
use CodeIgniter\Session\Session;
use CodeIgniter\API\ResponseTrait;
include_once (dirname(__FILE__) . "/FormHandler.php");
class Scheduled extends FormHandler {
use ResponseTrait;
/**
* @var Session
*/
protected $session;
public function __construct() {
$this->session = service('session');
}
public function new(bool $transfer=false){
//log_message('debug','Bills::new');
$eBooking = new \App\Entities\eBooking();
$eBooking->transfer = $transfer;
$eBooking->scheduled = true;
$eBooking = $eBooking->getNew();
return $this->viewBill($eBooking);
}
public function edit(int $id){
$scheduled = model('App\Models\mScheduled');
$entry = $scheduled->getEntry($id);
$eBooking = new \App\Entities\eBooking($entry);
return $this->viewBill($eBooking);
}
public function sync(){
if (!$this->request->isAJAX()) return;
$scheduled = model('App\Models\mScheduled');
$schedules = $scheduled->findAll();
$lines = "";
foreach ( $schedules as $schedule ) {
$cur_date = $schedule['next_date'];
while ( strtotime( $cur_date ) <= strtotime( "now" ) ) {
$data = (array)json_decode($schedule['data']);
$data['id'] = 0; // to generate a new booking (overwrite id of scheduled DB)
$data['scheduled'] = false;
$eBooking = new \App\Entities\eBooking($data);
$eBooking->datum = $cur_date;
$lines .= " $cur_date - $eBooking->receiver <br/>";
$eBooking->saveIt();
$cur_date = $scheduled->calcNextDate( $cur_date, $data['scheduledNum'], $data['scheduledType']);
}
$scheduled->update($schedule['id'], ['next_date'=>$cur_date ]);
}
return $lines;
}
public function viewScheduled(){
helper('form');
return view('scheduled');
}
public function delete(){
if ($this->request->is('post')) {
log_message('debug',"delete id: ".$this->request->getPost("id"));
if (!ctype_digit($this->request->getPost("id"))) return $this->failForbidden("Ungültige ID");
$schmodel = model(mScheduled::class);
$result = $schmodel->delete(intval($this->request->getPost("id")));
if ($result !== true)
return $this->fail("Database error ".$result);
else
return $this->respondDeleted(['url'=>session('redirect_url') ?? site_url('/'),'ID'=>$this->request->getPost("id")]);
}
return $this->failUnauthorized("Schäm Dich");
}
public function getTabData(){
if (!$this->request->isAJAX()) return;
$scheduled = model('App\Models\mScheduled');
return json_encode($scheduled->getEntries());
}
}

194
app/Entities/eBooking.php Normal file
View File

@@ -0,0 +1,194 @@
<?php
namespace App\Entities;
use App\Models\mBills;
use App\Models\mBillDetails;
use App\Models\mScheduled;
use CodeIgniter\Entity\Entity;
use CodeIgniter\I18n\Time;
class eBooking extends Entity{
protected $file = null; /* @var \CodeIgniter\HTTP\Files\UploadedFile|null $file */
protected $attributes =[
'id' => 0,
'datum' => '',
'source_id' => 0,
'receiver' => '',
'amount' => null,
'validate' => false,
'transfer' => false,
'scheduled' => false,
'details' => [],
'deleted_at' => null,
'rechnung' => null,
'scheduledNum' => null,
'scheduledType' => null
];
public function fillDetails(){
$billD = model(mBillDetails::class);
$accounts = model('App\Models\mAccounts'); /* @var \App\Models\mAccounts $accounts */
$this->attributes['details'] = $billD->where('bill_id',$this->attributes['id'])->findAll();
$this->attributes['scheduled'] = false;
$this->attributes['transfer'] = ((count($this->attributes['details']) == 1) && $accounts->isAccount($this->attributes['details'][0]->account_id));
return $this;
}
public function setInvoice(\CodeIgniter\HTTP\Files\UploadedFile $file){
$this->file = $file;
}
public function getNew(){
$this->attributes['datum'] = date('Y-m-d');
$this->attributes['details'][] = new \App\Entities\eBookingLine();
log_message('debug','eBooking::getNew: '.json_encode($this->attributes));
return $this;
}
public function getFormData(){
$billDet = new \App\Entities\eBookingLine();
$data = $this->toArray();
$data['template'] = $billDet->toArray();
log_message('debug','eBooking::getFormData:template '.json_encode($data['template']));
$accounts = model('App\Models\mAccounts'); /* @var \App\Models\mAccounts $accounts */
$data['category'] = $accounts->getDropDownLists($this->attributes['transfer']?'Acc':'InOut');
$data['sourcelist'] = $accounts->getDropDownList( type:'Acc', defaultKey:$data['source_id'] );
// log_message('debug','eBooking::getFormData: '.json_encode($data));
//$billDet->createDropDownLists($data);
if (is_null($this->attributes['amount'])){
$data['total_in'] = '';
$data['total_out'] = '';
}
else {
$data['total_in'] = ($this->attributes['amount'] >= 0.0)? abs($this->attributes['amount']):'';
$data['total_out'] = ($this->attributes['amount'] < 0.0)? abs($this->attributes['amount']):'';
}
if ($this->attributes['scheduled']??false){
// $data['scheduledNum'] = 0;
// $data['scheduledType'] = 0;
$data['schedule_lists'] = array('NumList' => array('1'=>'1','2'=>'2','3'=>'3','4'=>'4','5'=>'5','6'=>'6'),
'TypeList' => array('week'=>'Woche(n)','month'=>'Monat(e)','year'=>'Jahr(e)'));
}
if (count($this->attributes['details'])>0){
foreach ($this->attributes['details'] as $i => $line){
$line->createFormData($data,$i);
}
}else{
foreach ($this->attributes['sid'] as $i => $line){
$billDet->createDropDownLists($data,$i);
}
}
log_message('debug','eBooking::getFormData: '.json_encode($data));
return $data;
}
// public function convertFromPost(array $data){
// $this->fill($data);
// foreach ($data['sid'] as $i => $value){
// $sub = array('id' => $value,
// 'bill_id' => $data['id'],
// 'comment' => $data['comment'][$i],
// 'account_id' => $data['account_id'][$i],
// 'subamount' => floatval($data['input'][$i])-floatval($data['output'][$i]),
// 'deleted_at' => null);
// $details[] = new \App\Entities\eBookingLine($sub);
// }
// }
private function calcAmount(){
$amount = floatval($data['total_in'])-floatval($data['total_out']);
$subamounts = 0.0;
foreach ($this->attributes['input'] as $i => $value){
$subamounts = $subamounts + floatval($value) - floatval($this->attributes['output'][$i]);
}
}
private function saveScheduled() {
$scheduledModel = model(mScheduled::class);
$data = $this->toArray();
for ($i=(count($data['account_id'])-1); $i>0; $i--){
if ($data['account_id'][$i] == "0") {
unset($data['account_id'][$i]);
unset($data['sid'][$i]);
unset($data['input'][$i]);
unset($data['output'][$i]);
unset($data['comment'][$i]);
continue;
}
}
return $scheduledModel->saveIt($data);
}
//switch scheduled or bill
public function saveIt() {
if ($this->attributes['scheduled'] != 0) return $this->saveScheduled();
$billModel = model(mBills::class);
if ($this->attributes['id'] == 0) {
$billId = $billModel->insert($this, true);
log_message('debug','SaveIt with insert result: '.json_encode($billId));
if ($billId === false)
return $billModel->errors();
else{
$this->attributes['id'] = $billId;
}
//$billId = $$billModel->getInsertID();
} else {
if ($this->attributes['removeBillFile']??false){
$this->attributes['rechnung'] = null;
unlink(WRITEPATH . 'uploads/'.auth()->user()->preFixDB.'/'.$this->attributes['removeBillFile']);
}
if ($billModel->update($this->attributes['id'],$this) === false)
return $billModel->errors();
}
$billDetailsModel = model(mBillDetails::class);
$details = new \App\Entities\eBookingLine;
foreach ($this->attributes['sid'] as $i => $value){
if ($this->attributes['account_id'][$i] == 0) { // leere Zeile ignorieren bzw wenn id (also bereits in DB) dann löschen
if ($value == 0) {
continue;
} else {
$billDetailsModel->delete($value);
continue;
}
}
$sub = array('sid' => ($value == 0)? NULL: $value,
'bill_id' => $this->attributes['id'],
'comment' => $this->attributes['comment'][$i],
'account_id' => $this->attributes['account_id'][$i],
'subamount' => floatval($this->attributes['input'][$i])-floatval($this->attributes['output'][$i]),
'deleted_at' => null);
$details->fill($sub);
$billDetailsModel->save($details);
}
if ($this->file) {
if (! $this->file->isValid() && ($this->file->getError() != UPLOAD_ERR_NO_FILE)) {
throw new \RuntimeException($this->file->getErrorString() . '(' . $this->file->getError() . ')');
} else if ($this->file->isValid()) {
helper('url');
$date = Time::parse($this->attributes['datum']);
$name = url_title($date->toLocalizedString('yyyyMMdd')." ".$this->attributes['receiver']." ".$this->attributes['id']);
$this->file->move(WRITEPATH . 'uploads/'.auth()->user()->preFixDB,$name.".".$this->file->guessExtension());
log_message('debug', $this->file->getName());
$this->attributes['rechnung'] = $this->file->getName();
if ($billModel->update($this->attributes['id'],$this) === false)
return $billModel->errors();
}
}
// $details = model('App\Models\mBillDetails');
// return $details->getDetails([$this->id]);
return true;
}
}

View File

@@ -0,0 +1,69 @@
<?php
namespace App\Entities;
use CodeIgniter\Entity\Entity;
use App\Models\mAccounts;
class eBookingLine extends Entity{
protected $attributes =[
'id' => 0,
'bill_id' => 0,
'comment' => '',
'account_id' => 0,
'subamount' => null,
'deleted_at' => null,
];
protected $datamap = [
// property_name => db_column_name
'sid' => 'id',
];
private function checkCreateParentDefault(array &$list, int $parentId) : void {
if ($parentId == 0) return;
if (!array_key_exists($parentId, $list)){
log_message('debug',"Parent not exists: $parentId in List: ".json_encode(array_keys($list)));
$list[$parentId] = $this->accounts->getDropDownEntry($parentId);
}
}
private function checkCreateSubDefault(array &$list, int $accountId) : void {
if (!array_key_exists($accountId, $list)){
if ($accountId > 0)
$list[$accountId] = $this->accounts->getDropDownEntry($accountId);
else
$list[0] = '-----';
}
}
public function createFormData(array &$data, int $i){
if (!array_key_exists('sid', $data)) $data['sid'] = [];
if (!array_key_exists('comment', $data)) $data['comment'] = [];
if (!array_key_exists('account_id', $data)) $data['account_id'] = [];
if (!array_key_exists('deleted_at', $data)) $data['deleted_at'] = [];
if (!array_key_exists('input', $data)) $data['input'] = [];
if (!array_key_exists('output', $data)) $data['output'] = [];
$data['sid'][$i] = $this->attributes['id'];
$data['comment'][$i] = $this->attributes['comment'];
$data['account_id'][$i] = $this->attributes['account_id'];
$data['deleted_at'][$i] = $this->attributes['deleted_at'];
$data['input'][$i] = (!is_null($this->attributes['subamount']) && $this->attributes['subamount'] > 0.0) ? $this->attributes['subamount'] :'';
$data['output'][$i] = (!is_null($this->attributes['subamount']) && $this->attributes['subamount'] <= 0.0) ? abs($this->attributes['subamount']) :'';
$this->createDropDownLists($data,$i);
}
public function createDropDownLists(array &$data, int $i){
$accounts = model('App\Models\mAccounts'); /* @var \App\Models\mAccounts $accounts */
$lists = $data['category'] ?? [];
if (!array_key_exists('parent_id', $data)) $data['parent_id'] = [];
if (!array_key_exists('cat_parent', $data)) $data['cat_parent'] = [];
if (!array_key_exists('cat_sub', $data)) $data['cat_sub'] = [];
$data['parent_id'][$i] = $accounts->getParent($data['account_id'][$i]);
$data['cat_parent'][$i] = $lists['parent'];
$this->checkCreateParentDefault($data['cat_parent'][$i],$data['parent_id'][$i]);
$data['cat_sub'][$i] = $lists['subs']->{$data['parent_id'][$i]} ?? [];
$this->checkCreateSubDefault($data['cat_sub'][$i],$data['account_id'][$i]);
}
}

View File

@@ -0,0 +1,78 @@
<?php
declare(strict_types=1);
/**
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <admin@codeigniter.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
// Validation language settings
return [
// Core Messages
'noRuleSets' => 'No rule sets specified in Validation configuration.',
'ruleNotFound' => '"{0}" is not a valid rule.',
'groupNotFound' => '"{0}" is not a validation rules group.',
'groupNotArray' => '"{0}" rule group must be an array.',
'invalidTemplate' => '"{0}" is not a valid Validation template.',
// Rule Messages
'alpha' => 'The {field} field may only contain alphabetical characters.',
'alpha_dash' => 'The {field} field may only contain alphanumeric, underscore, and dash characters.',
'alpha_numeric' => 'The {field} field may only contain alphanumeric characters.',
'alpha_numeric_punct' => 'The {field} field may contain only alphanumeric characters, spaces, and ~ ! # $ % & * - _ + = | : . characters.',
'alpha_numeric_space' => 'The {field} field may only contain alphanumeric and space characters.',
'alpha_space' => 'The {field} field may only contain alphabetical characters and spaces.',
'decimal' => 'The {field} field must contain a decimal number.',
'differs' => 'The {field} field must differ from the {param} field.',
'equals' => 'Das Feld {field} muss exakt sein: {param}.',
'exact_length' => 'The {field} field must be exactly {param} characters in length.',
'field_exists' => 'The {field} field must exist.',
'greater_than' => 'The {field} field must contain a number greater than {param}.',
'greater_than_equal_to' => 'The {field} field must contain a number greater than or equal to {param}.',
'hex' => 'The {field} field may only contain hexadecimal characters.',
'in_list' => 'The {field} field must be one of: {param}.',
'integer' => 'The {field} field must contain an integer.',
'is_natural' => 'The {field} field must only contain digits.',
'is_natural_no_zero' => 'The {field} field must only contain digits and must be greater than zero.',
'is_not_unique' => 'The {field} field must contain a previously existing value in the database.',
'is_unique' => 'The {field} field must contain a unique value.',
'less_than' => 'The {field} field must contain a number less than {param}.',
'less_than_equal_to' => 'The {field} field must contain a number less than or equal to {param}.',
'matches' => 'The {field} field does not match the {param} field.',
'max_length' => '{field} darf nicht länger als {param} Zeichen sein.',
'min_length' => 'The {field} field must be at least {param} characters in length.',
'not_equals' => 'The {field} field cannot be: {param}.',
'not_in_list' => 'The {field} field must not be one of: {param}.',
'numeric' => 'Das Feld {field} darf nur Zahlen enthalten.',
'regex_match' => 'The {field} field is not in the correct format.',
'required' => 'Das Feld {field} ist erforderlich.',
'required_with' => 'The {field} field is required when {param} is present.',
'required_without' => 'Das Feld {field} muss ausgefüllt werden, wenn {param} nicht vorhanden ist.',
'string' => 'The {field} field must be a valid string.',
'timezone' => 'The {field} field must be a valid timezone.',
'valid_base64' => 'The {field} field must be a valid base64 string.',
'valid_email' => 'The {field} field must contain a valid email address.',
'valid_emails' => 'The {field} field must contain all valid email addresses.',
'valid_ip' => 'The {field} field must contain a valid IP.',
'valid_url' => 'The {field} field must contain a valid URL.',
'valid_url_strict' => 'The {field} field must contain a valid URL.',
'valid_date' => 'The {field} field must contain a valid date.',
'valid_json' => 'The {field} field must contain a valid json.',
// Credit Cards
'valid_cc_number' => '{field} does not appear to be a valid credit card number.',
// Files
'uploaded' => '{field} is not a valid uploaded file.',
'max_size' => '{field} is too large of a file.',
'is_image' => '{field} is not a valid, uploaded image file.',
'mime_in' => '{field} does not have a valid mime type.',
'ext_in' => '{field} does not have a valid file extension.',
'max_dims' => '{field} is either not an image, or it is too wide or tall.',
'min_dims' => '{field} is either not an image, or it is not wide or tall enough.',
];

View File

@@ -0,0 +1,49 @@
<?php
declare(strict_types=1);
namespace App\Models\Cast;
//namespace CodeIgniter\DataCaster\Cast;
use CodeIgniter\Database\BaseConnection;
use CodeIgniter\Exceptions\InvalidArgumentException;
use CodeIgniter\DataCaster\Cast\BaseCast;
use CodeIgniter\I18n\Time;
// The class must inherit the CodeIgniter\DataCaster\Cast\BaseCast class
class CastMyDate extends BaseCast
{
public static function get( mixed $value, array $params = [], ?object $helper = null,): string {
if (! is_string($value)) {
self::invalidTypeValueError($value);
}
if (! $helper instanceof BaseConnection) {
$message = 'The parameter $helper must be BaseConnection.';
throw new InvalidArgumentException($message);
}
$format = $helper->dateFormat['date'];
return Time::createFromFormat($format, $value)->toLocalizedString($params[0] ?? 'yyyy-MM-dd');
}
public static function set( mixed $value, array $params = [], ?object $helper = null,): string {
if ( is_string($value)) {
$value = Time::createFromFormat("Y-m-d", $value);
}
if (! $value instanceof Time) {
self::invalidTypeValueError($value);
}
if (! $helper instanceof BaseConnection) {
$message = 'The parameter $helper must be BaseConnection.';
throw new InvalidArgumentException($message);
}
$format = $helper->dateFormat['date'];
return $value->format($format);
}
}

View File

@@ -3,41 +3,65 @@
use CodeIgniter\Model;
class mAccounts extends Model {
protected $table = 'budget_accounts';
private $defaultTableName='_budget_accounts';
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
protected $returnType = 'object';
protected $useSoftDeletes = false;
protected $useSoftDeletes = true;
protected $deletedField ="deleted_at";
protected $allowedFields = ['parent_id','type','bookable','description','lkz'];
protected $allowedFields = ['parent_id','bookable','description','account','monitor','deleted_at'];
protected $useTimestamps = false;
private $mAccountList = array();
private ?array $mAccountList = null;
protected function initialize()
{
$result = $this->findAll();
foreach ($result as $value) {
$this->mAccountList[$value->id] = $value;
protected array $casts = [
'bookable' => 'boolean',
'monitor' => 'boolean',
'account' => 'boolean',
];
protected function initialize() {
log_message('debug','mAccounts initialize');
$this->table = auth()->user()->preFixDB.$this->defaultTableName;
$this->checkOrCreateTable();
}
/**
* Sicherstellen dass mAccountList gefüllt ist
*/
private function populateAccountList(): void {
if ($this->mAccountList === null) {
log_message('debug','mAccounts populateAccountList New');
$result = $this->withDeleted()->findAll();
// log_message('debug','mAccounts DB-Result '.json_encode($result));
$this->mAccountList = [];
foreach ($result as $value) {
$this->mAccountList[$value->id] = $value;
}
//log_message('debug','mAccounts intern List '.json_encode($this->mAccountList));
}
}
/**
* Erstellt DropDownListe aus gegeben array
* @param array liste der daten
* @param bool wenn true wird auch ein 0-Eintrag erstellt
* @param array $data liste der daten
* @param bool $withnull wenn true wird auch ein 0-Eintrag erstellt
* @param int $key index für null eintrag
* @return mixed
*/
private function createDropDownList($data,$withnull = true,$key=0)
{
private function createDropDownList(array $data, bool $withnull = true, int $key=0) {
$liste = array();
if ($withnull)
$liste[$key] = '-----';
foreach ( $data as $row )
{
if ($withnull){
if ($key > 0)
$liste[$key] = '-----';
// else
// $liste[""] = '-----';
}
foreach ( $data as $row ) {
$liste[$row->id] = $row->description;
}
asort( $liste );
@@ -46,114 +70,114 @@ class mAccounts extends Model {
/**
* holt Text vom gegebenen Element
* @param int id des gewünschten Elements
* @param int $id ID des gewünschten Elements
* @return string Full Name of Entry
*/
public function getDropDownEntry($id){
public function getDropDownEntry(int $id) {
$this->populateAccountList();
$element = $this->mAccountList[$id];
$description = $element->description;
$id = $element->parent_id;
while ( $id > 0 )
{
while ( $id > 0 ) {
$description = $this->mAccountList[$id]->description .'-'.$description;
$id = $this->mAccountList[$id]->parent_id;
}
return $description;;
return $description;
}
private function filterIt(string $type = 'all', bool $bookableOnly = true, bool $withDeleted = false, ?int $defaultKey = null){
return unserialize(serialize(array_filter($this->mAccountList, function($var) use($type, $bookableOnly, $withDeleted, $defaultKey) {
if ($defaultKey !== null && $var->id == $defaultKey)
return true;
if (!($withDeleted) && $var->deleted_at)
return false;
if ($bookableOnly && !$var->bookable)
return false;
if ($type == 'Acc' && !$var->account)
return false;
elseif ($type == 'InOut' && $var->account)
return false;
return true;
})));
}
/**
* liefert DropDown Liste mit gegeben Suchparametern
* @param string Kontotyp "InOut,In,Out,Acc"
* @param bool ob bookable gesetzt sein muss
* @return bool ob lkz Flag gesetzt sein darf
* @param string $type Kontotyp "InOut,Acc,all"
* @param bool $bookableOnly ob bookable gesetzt sein muss
* @param bool $withDeleted ob gelöschte auch
* @return array fertige DropDownListe
*/
public function getDropDownList($type, $bookable = true, $lkz = false )
{
if ($bookable == true)
$this->where('bookable',true);
if ($lkz == false) $this->where('lkz',NULL);
if ( $type == 'InOut' ) $this->where('type !=','account');
elseif ( $type == 'Acc' ) $this->where('type','account');
elseif ( $type == 'In' ) $this->where('type','input');
elseif ( $type == 'Out' ) $this->where('type','output');
$this->orderBy('description');
$result = $this->findAll();
$parent = array();
foreach ( $result as &$element )
{
public function getDropDownList(string $type, bool $bookableOnly = true, bool $withDeleted = false, ?int $defaultKey = null) : array {
$this->populateAccountList();
$result = $this->filterIt($type,$bookableOnly,$withDeleted,$defaultKey);
foreach ( $result as &$element ) {
$id = $element->parent_id;
while ( $id > 0 )
{
while ( $id > 0 ) {
$element->description = $this->mAccountList[$id]->description .'-'.$element->description;
if ($this->mAccountList[$id]->parent_id == 0){
$parent[] = (object)['id' => $element->id,'description' => $element->description ];
}
$id = $this->mAccountList[$id]->parent_id;
}
}
return $this->createDropDownList($result);
}
/**
public function getCurDDLists(string $type, bool $bookableOnly = true, bool $withDeleted = false, ?int $defaultKey = null ) : array {
$this->populateAccountList();
$list = $this->filterIt($type,$bookableOnly,$withDeleted, $defaultKey);
$parent = $this->getParent($defaultKey);
}
/**
* liefert 2 DropDown Listen mit gegeben Suchparametern
* parent für Vorselektion, subs für Untereinträge
* @param string Kontotyp "InOut,In,Out,Acc"
* @param bool ob bookable gesetzt sein muss
* @return bool ob lkz Flag gesetzt sein darf
* @param string $type Kontotyp "InOut,In,Out,Acc"
* @param bool $bookableOnly ob bookable gesetzt sein muss
* @param bool $withDeleted ob lkz Flag gesetzt sein darf
* @return array fertige DropDownListen mit parent und subs
*/
public function getDropDownLists($type, $bookable = true, $lkz = false )
{
if ($bookable == true) $this->where('bookable',true);
if ($lkz == false) $this->where('lkz',null);
if ( $type == 'InOut' ) $this->where('type !=','account');
elseif ( $type == 'Acc' ) $this->where('type','account');
elseif ( $type == 'In' ) $this->where('type','output');
elseif ( $type == 'Out' ) $this->where('type','input');
$this->orderBy('description');
$result = $this->findAll();
public function getDropDownLists(string $type, bool $bookableOnly = true, bool $withDeleted = false, ?int $defaultKey = null ) : array {
$this->populateAccountList();
$list = $this->filterIt($type,$bookableOnly,$withDeleted, $defaultKey);
$parent = array();
$listen = array();
foreach ( $result as &$element )
{
foreach ( $list as &$element ) {
$id = $element->parent_id;
while ( $id > 0 )
{
if ($this->mAccountList[$id]->lkz == 1) continue 2;
while ( $id > 0 ) {
if ($this->mAccountList[$id]->deleted_at) continue 2;
if ($this->mAccountList[$id]->parent_id == 0){
if (!array_key_exists($id, $parent))
$parent[$id] = (object)['id' => $id,'description' => $this->mAccountList[$id]->description ];
$listen[$id][$element->id] = (object)['id' => $element->id,'description' => $element->description ];
}
else{
} else{
$element->description = $this->mAccountList[$id]->description .'-'.$element->description;
}
$id = $this->mAccountList[$id]->parent_id;
}
}
$subs = array();
$subs[0] = $this->createDropDownList(array());
$subs[0] = ["0"=>"----"];
foreach ( $listen as $key => $element ){
$subs[$key] = $this->createDropDownList($element,($this->mAccountList[$key]->bookable=="t"), $key);
$subs[$key] = $this->createDropDownList($element,($this->mAccountList[$key]->bookable), $key);
}
return array('parent'=> $this->createDropDownList($parent),'subs'=>(object)$subs);
}
/**
* liefert parent id für category
* @param int account id
* @param int $sid account id
* @return int parent id
*/
public function getParent($sid){
public function getParent(int $sid): int{
if ($sid == 0) return 0;
$result = $sid;
$id = $this->mAccountList[$sid]->parent_id;
while ( $id > 0 )
{
$result = $id;
$id = $this->mAccountList[$id]->parent_id;
$this->populateAccountList();
while ( $this->mAccountList[$sid]->parent_id > 0 ) {
$sid = $this->mAccountList[$sid]->parent_id;
}
return $result;
return $sid;
}
@@ -163,45 +187,71 @@ class mAccounts extends Model {
*/
public function getTreeData(){
helper('array');
$parents = array();
$subs = array();
foreach ( $this->mAccountList as $element )
{
if ($element->parent_id == 0)
$parents[$element->id] = $element;
}
foreach ( $this->mAccountList as $element )
{
// if ($element->parent_id > 0)
// echo "".$parents[$element->parent_id]->id;
$this->populateAccountList();
$parents = array_filter($this->mAccountList, function($var) {
return ($var->parent_id == 0);
});
foreach ( $this->mAccountList as $element ) {
if (($element->parent_id > 0) && array_key_exists($element->parent_id , $parents))
$parents[$element->parent_id]->subs[$element->id] = $element;
}
array_sort_by_multiple_keys($parents, ['description' => SORT_ASC]);
return ['parents'=>$parents,'subs'=>$subs, 'all'=>$this->mAccountList];
return ['parents'=>$parents, 'all'=>$this->mAccountList];
}
/**
/**
* erstellt oder updatet den gegeben Account
* @var array formulardaten
*/
public function saveAccount($data){
public function saveAccount(array $data) : bool{
$this->set('parent_id',$data['parent']);
$this->set('type', $data['type']);
$this->set('bookable', array_key_exists('bookable', $data) ? true : false);
$this->set('bookable', array_key_exists('bookable', $data));
$this->set('monitor', array_key_exists('monitor', $data));
$this->set('account', array_key_exists('account', $data));
$this->set('description', $data['description']);
$this->set('lkz', (array_key_exists('lkz', $data) ? 1 : null));
$this->set('deleted_at', (array_key_exists('deleted_at', $data) ? 'LOCALTIMESTAMP' : null),(array_key_exists('deleted_at', $data)? false: true));
if ($data['id'] == 0)
$this->insert();
$result = $this->insert();
else
$this->update($data['id']);
$this->initialize();
$result = $this->update($data['id']);
log_message('debug',$this->db->getLastQuery());
return $result;
}
public function checkType($id, $type){
return ($this->mAccountList[$id]->type == $type);
/**
* prüft ob gegebene Kategorie ein Konot ist
*
* @param int $id
* @return bool
*/
public function isAccount(int $id){
$this->populateAccountList();
return ($this->mAccountList[$id]->account);
}
public function checkOrCreateTable(){
log_message('debug',"Check or Create Account Table");
if ($this->db->tableExists($this->table)) return;
$forge = \Config\Database::forge();
$fields = array(
'id' => array( 'type' => 'serial'),
'parent_id' => array( 'type' => 'integer','default'=>'0'),
'bookable' => array( 'type' => 'boolean' ),
'description' => array( 'type' => 'character varying','constraint' => '80'),
'monitor' => array( 'type' => 'boolean','default'=>'false' ),
'account' => array( 'type' => 'boolean','default'=>'false' ),
'deleted_at'=> array( 'type' => 'timestamp without time zone','null'=>true),
);
$forge->addField( $fields );
$forge->addPrimaryKey('id');
// $this->db->query("CREATE TABLE $this->table (LIKE $this->defaultTableName INCLUDING DEFAULTS INCLUDING CONSTRAINTS) PARTITION BY RANGE (datum);");
$forge->createTable($this->table,true);
// CREATE TABLE temperatures_y2025q1 PARTITION OF temperatures
// FOR VALUES FROM ('2025-01-01') TO ('2025-04-01');
}
};
?>

View File

@@ -3,31 +3,60 @@
use CodeIgniter\Model;
class mBillDetails extends Model {
protected $table = 'budget_billdetails';
private $defaultTableName='_budget_billdetails';
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
protected $returnType = 'object';
protected $useSoftDeletes = false;
protected $returnType = \App\Entities\eBookingLine::class;
protected $useSoftDeletes = true;
protected $deletedField ="deleted_at";
protected $allowedFields = ['bill_id','comment','account_id','subamount','lkz'];
protected $allowedFields = ['bill_id','comment','account_id','subamount','deleted_at'];
protected $useTimestamps = false;
// public function getEntries($id){
// $this->select('mw_budget_bookingdetails.*,mw_budget_categories.description');
// $this->join('mw_budget_categories', 'mw_budget_categories.id = mw_budget_bookingdetails.account_id', 'left');
// $result = $this->orderBy('id','asc')->where('bill_id',$id)->findAll();
// foreach ($result as $key => $value) {
// // $value->datum = date( "d.m.Y", strtotime( $value->datum ));
// // $value->amount = number_format( $value->amount , 2, ',', '.' );
// }
// return $result;
// }
protected array $casts = [
'subamount' => 'float',
'account_id' => 'int',
'bill_id' => 'int',
];
public function getDetails($ids){
protected $validationRules = [
'bill_id' => 'required|numeric',
'account_id' => 'required|numeric',
];
protected $validationMessages = [
'bill_id' => [
'required' => 'Die Buchungsnummer muss angegeben sein.',
'numeric' => 'Die Buchungsnummer muss eine Zahl sein.',
],
'account_id' => [
'required' => 'Die Kategorie muss angegeben sein.',
'numeric' => 'Die Kategorie muss eine Zahl sein.',
],
];
protected function initialize() {
log_message('debug','mBillDetails initialize');
$this->table = auth()->user()->preFixDB.$this->defaultTableName;
$this->checkOrCreateTable();
}
public function getEntries(int $id){
$accounts = model('App\Models\mAccounts'); /* @var \App\Models\mAccounts $accounts */
$this->select($this->table.'.*,'.$accounts->getTable().'.description');
$this->join($accounts->getTable(), $accounts->getTable().'.id = '.$this->table.'.account_id', 'left');
$result = $this->orderBy('id','asc')->where('bill_id',$id)->findAll();
return $result;
}
/**
* liefert für gegebene Buchung Details
* @param array<int> $ids id der Buchung
*/
public function getDetails(array $ids): array {
$quelle = model('App\Models\mAccounts');
$rows = $this->whereIn('bill_id', $ids)->findAll();
$result = array();
@@ -37,9 +66,18 @@ class mBillDetails extends Model {
}
return $result;
}
public function getEntriesForForm($billId, &$result, $accounts){
$this->select('budget_billdetails.*,budget_accounts.description');
$this->join('budget_accounts', 'budget_accounts.id = budget_billdetails.account_id', 'left');
/**
* liefert für gegebene Buchung Details im Formularformat
* @param int $billId id der Buchung
* @param mixed $result Datenstruktur für Formular mit defaults
* @param \App\Models\mAccounts $accounts modelClass für Konten
*
*/
public function getEntriesForForm(int $billId, &$result){
$accounts = model('App\Models\mAccounts');
$this->select($this->table.'.*,'.$accounts->getTable().'.description');
$this->join($accounts->getTable(), $accounts->getTable().'.id = '.$this->table.'.account_id', 'left');
$data = $this->orderBy('id','asc')->where('bill_id',$billId)->findAll();
$amount = 0.0;
foreach ($data as $key => $row){
@@ -58,12 +96,12 @@ class mBillDetails extends Model {
$result['total_in']= ($amount >= 0.0)?number_format( abs( $amount ), 2, ',', '' ):'';
$result['total_out']= ($amount < 0.0)?number_format( abs( $amount ), 2, ',', '' ):'';
}
else if ($accounts->checkType($result['category'][0],'account'))
else if ($accounts->isAccount($result['category'][0]))
$result['transfer'] = true;
return $result;
}
public function saveEntries($data, $billId){
public function saveEntries(array $data, int $billId){
for ($i=0;$i<10;$i++){
if ($data['category'][$i] > 0){
$this->set('subamount', floatval($data['input'][$i])-floatval($data['output'][$i])); //floatval($data['total_in'])-floatval($data['total_out']));
@@ -82,5 +120,28 @@ class mBillDetails extends Model {
}
}
}
public function checkOrCreateTable(){
log_message('debug',"Check or Create BillDetails Table");
if ($this->db->tableExists($this->table)) return;
log_message('debug',"Create BillDetails Table ".$this->table);
$accounts = model('App\Models\mAccounts'); /* @var \App\Models\mAccounts $accounts */
$bills = model('App\Models\mBills'); /* @var \App\Models\mBills $bills */
$forge = \Config\Database::forge();
$fields = array(
'id' => array( 'type' => 'serial'),
'bill_id' => array( 'type' => 'integer'),
'account_id' => array( 'type' => 'integer' ),
'subamount' => array( 'type' => 'numeric','constraint' => '9,2' ),
'comment' => array( 'type' => 'character varying','constraint' => '150'),
'deleted_at'=> array( 'type' => 'timestamp without time zone','null'=>true),
);
$forge->addField( $fields );
$forge->addPrimaryKey('id');
$forge->addForeignKey('bill_id', $bills->getTable(), 'id','NO ACTION','NO ACTION','bill_id_fk');
$forge->addForeignKey('account_id', $accounts->getTable(), 'id','NO ACTION','NO ACTION','account_id_fk');
$forge->createTable($this->table,true);
log_message('debug','Create BillDetails Table '.$this->db->lastQuery);
}
};
?>

View File

@@ -1,28 +1,58 @@
<?php namespace App\Models;
use App\Models\Cast\CastMyDate;
use CodeIgniter\Model;
use App\Models\Mbookingdetails;
use App\Models\Mcategories;
class mBills extends Model {
protected $table = 'budget_bills';
private $defaultTableName='_budget_bills';
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
protected $returnType = 'object';
protected $useSoftDeletes = false;
protected $returnType = \App\Entities\eBooking::class;
protected $allowedFields = ['renummer','datum','receiver','source_id','amount','type','comment','validate','lkz'];
protected $useSoftDeletes = true;
protected $deletedField ="deleted_at";
//TODO timestamps aktivieren
// protected $createdField = 'created_at';
// protected $updatedField = 'updated_at';
// protected $deletedField = 'deleted_at';
protected $allowedFields = ['datum','receiver','source_id','amount','validate','deleted_at','rechnung'];
protected $useTimestamps = false;
// Bind the type to the handler
protected array $castHandlers = [
'myDate' => CastMyDate::class,
];
//protected $afterFind = ['checkTransfer'];
protected array $casts = [
'id' => 'int',
'amount' => 'float',
'datum' => 'myDate[dd.MM.yyyy]',
'validate' => 'boolean',
'source_id' => 'int',
];
protected function initialize() {
log_message('debug','mBills initialize');
$this->table = auth()->user()->preFixDB.$this->defaultTableName;
$this->checkOrCreateTable();
}
public function getTable() : string {
return $this->table;
}
// protected function checkTransfer(array $data){
// $data['data']['transfer'] = ((count($this->attributes['details']) == 1) && $accounts->isAccount($this->attributes['details'][0]->account_id));
// }
/**
* liefert Buchungen für Aktivitätenliste
* liefert Buchungen für Aktivitätenliste für alte datentabelle
* @return mixed Datensätze für Tabelle
*/
public function getEntriesDet($start, $ende, $source){
public function getEntriesDet(string $start, string $ende, int $source){
$details = model('App\Models\mBillDetails');
$quelle = model('App\Models\mAccounts');
$this->where('datum >=', date( 'Y-m-d', strtotime($start)));
@@ -46,7 +76,7 @@ class mBills extends Model {
}
}
$result = $this->orderBy('datum','desc')->where('lkz',null)->findAll();
$result = $this->orderBy('datum','desc')->findAll(); //->where('lkz',null)
if (0 == sizeof($result)){
return $result;
}
@@ -59,7 +89,6 @@ class mBills extends Model {
foreach ($result as $value) {
$value->details = $ergebnis[$value->id]??null;
$value->datum = date( "d.m.Y", strtotime( $value->datum ));
$value->source = $quelle->getDropDownEntry($value->source_id);
// $value->amount = number_format( $value->amount , 2, ',', '.' );
}
@@ -67,152 +96,97 @@ class mBills extends Model {
}
/**
* liefert Buchungen für Aktivitätenliste
* @return mixed Datensätze für Tabelle
*/
public function getActivities(string $start, string $ende, int $source){
$quelle = model('App\Models\mAccounts');
$this->where('datum >=', date( 'Y-m-d', strtotime($start)));
$this->where('datum <=', date( 'Y-m-d', strtotime($ende)));
if ($source > 0) {
$this->where('source_id', $source );
}
$result = $this->orderBy('datum','desc')->findAll();
if (0 == sizeof($result)) return $result;
foreach ($result as $value) {
$value->source = $quelle->getDropDownEntry($value->source_id);
}
return $result;
}
/**
* liefert Buchungen für Übersichtstabelle
* @return mixed Datensätze für Tabelle
*/
function getEntries(){
$details = model('App\Models\mBillDetails');
$quelle = model('App\Models\mAccounts');
$result = $this->orderBy('datum','desc')->where('validate',false)->where('lkz',null)->findAll(10);
$keys=array();
foreach ($result as $value) {
$keys[] = intval($value->id);
}
//$ergebnis = $details->whereIn('bill_id', $keys)->asArray()->findAll();
$ergebnis = $details->getDetails($keys);
// print_r($ergebnis);
foreach ($result as $value) {
$value->details = $ergebnis[$value->id]??null;//$details->getEntries($value->id);
$value->datum = date( "d.m.Y", strtotime( $value->datum ));
$value->quelle = $quelle->getDropDownEntry($value->source_id);
// $value->amount = number_format( $value->amount , 2, ',', '.' );
}
public function getEntries(int $zeilen = 10){
$result = $this->orderBy('datum','desc')->where('validate',false)->findAll($zeilen); //->where('lkz',null)
if (0 == sizeof($result)) return $result;
return $result;
}
/**
* liefert gegebene Buchung inkl. Details im Formularformat
* @param int id der Buchung
* @return mixed Datenstruktur für Formular
*/
function getEntry($id, &$result, $accounts){
$details = model('App\Models\mBillDetails');
$quelle = model('App\Models\mAccounts');
$data = $this->orderBy('datum','desc')->find($id);
$result['datum'] = date( "d.m.Y", strtotime($data->datum));
$result['receiver'] = $data->receiver;
$result['source'] = $data->source_id;
$result['validate'] = $data->validate;
$result['id'] = $id;
$result = array_merge($result, $details->getEntriesForForm($id, $result, $accounts));
$result['transfer'] = $result['transfer'] || ($data->type == 'transfer');
return $result;
}
function getToDos(){
$details = model('App\Models\mBillDetails');
$quelle = model('App\Models\mAccounts');
$result = $this->orderBy('datum','desc')->where('validate',true)->where('lkz',null)->findAll();
$keys=array();
foreach ($result as $value) {
$keys[] = intval($value->id);
}
$ergebnis = $details->getDetails($keys);
foreach ($result as $value) {
$value->details = $ergebnis[$value->id]??null;
//$value->details = $details->getEntries($value->id);
$value->datum = date( "d.m.Y", strtotime( $value->datum ));
$value->quelle = $quelle->getDropDownEntry($value->source_id);;
// $value->amount = number_format( $value->amount , 2, ',', '.' );
}
return $result;
}
function getAccountsBalance(){
// $this->select('SUM(amount) as amount, source_id as idd, budget_accounts.description',FALSE);
// $this->groupby('source_id')->asArray();
// $this->join('budget_accounts', 'budget_accounts.id = budget_bills.source_id', 'left');
// $this->where('budget_accounts.type','account');
// $this->where('budget_accounts.lkz',null);
// $this->where('budget_bills.validate',false);
// $result1 = $this->where('budget_bills.lkz',null)->findAll();
// $assoc1 = array();
// foreach ($result1 as $value) {
// $assoc1[$value['idd']] = $value;
// }
// $details = model('App\Models\mBillDetails');
// $details->select('SUM((-1)*subamount) as amount, account_id as idd, budget_accounts.description',FALSE);
// $details->groupby('account_id')->asArray();
// $details->join('budget_accounts', 'budget_accounts.id = budget_billdetails.account_id', 'left');
// $details->join('budget_bills', 'budget_bills.id = budget_billdetails.bill_id', 'left');
// $details->where('budget_accounts.type','account');
// $details->where('budget_bills.validate',false);
// $details->where('budget_accounts.lkz',NULL);
// $result3 = $details->where('budget_billdetails.lkz',NULL)->findAll();
// $assoc3 = array();
// foreach ($result3 as $value) {
// $assoc3[$value['idd']] = $value;
// }
// $sums = array();
// foreach (array_keys($assoc1 + $assoc3) as $key) {
// $obj = new \stdClass;
// $obj->amount = (isset($assoc1[$key]) ? floatval($assoc1[$key]['amount']) : 0) + (isset($assoc3[$key]) ? floatval($assoc3[$key]['amount']) : 0);
// $obj->description = isset($assoc1[$key]) ? $assoc1[$key]['description'] : $assoc3[$key]['description'];
// $sums[] = $obj;
// }
$sums = $this->db->query("SELECT * FROM get_account_balance4()");
//$this->from("get_account_balance4()")->findAll();
// $this->groupby('source_id')->asArray();
return $sums->getResult();
}
public function saveBill($data){
$details = model('App\Models\mBillDetails');
$accounts = model('App\Models\mAccounts');
$this->set('datum', date( "Y-m-d", strtotime($data['datum'] ) ));
$this->set('source_id', $data['source']);
$total = floatval($data['total_in'])-floatval($data['total_out']);
if ( !isset($data['multi']) )
$total = floatval($data['input'][0])-floatval($data['output'][0]);
$this->set('amount', $total);
$this->set('validate', $data['validate']??false);
if ($data['transfer']==1){
$this->set('receiver', $accounts->getDropDownEntry($data['category'][0]));
$this->set('type', 'transfer');
}
else{
$this->set('receiver', $data['receiver']);
$this->set('type', 'multiple');
}
//$tabdata['type']
if ( 0 == $data['id'] ){
$this->insert();
$billId = $this->getInsertID();
//insert
}
else{
$billId = $data['id'];
$this->update($data['id']);
}
$details->saveEntries($data, $billId);
}
public function getToDos(){
$result = $this->orderBy('datum','desc')->where('validate',true)->findAll();
return $result;
}
public function getAccountsBalance(){
$sums = $this->db->query("SELECT * FROM finanzen.getbalances('".auth()->user()->preFixDB."'::text,ARRAY[]::integer[])"); // mit datensyntax ARRAY[210,216]
// log_message('debug', $this->db->getLastQuery());
// log_message('debug', print_r($sums->getResultArray(), true));
return $sums->getResultArray();
}
public function storeBillFile(int $billId, string $filename){
$this->update($billId, [ 'rechnung' => $filename ]);
}
public function deleteBillFile(int $billId){
$this->set('rechnung', 'NULL',false);
$this->update($billId);
}
/**
* löscht gegebene Buchung inkl. Details
* @param int id der Buchung
* @return mixed Datenstruktur für Formular
*/
function deleteEntry($id){
public function deleteEntry(int $id) : bool {
$result = true;
$details = model('App\Models\mBillDetails');
if ($id > 0){
$details->where('bill_id',$id)->delete();
$this->delete($id);
$result = $details->where('bill_id',$id)->delete();
if ($result === true)
$result = $this->delete($id);
}
return $result;
}
public function checkOrCreateTable(){
log_message('debug',"Check or Create Bill Table");
if ($this->db->tableExists('finanzen.'.$this->table)) return;
log_message('debug','Create Bills Table '.$this->db->lastQuery);
log_message('debug',"Create Bills Table ".$this->table);
$accounts = model('App\Models\mAccounts'); /* @var \App\Models\mAccounts $accounts */
$forge = \Config\Database::forge();
$fields = array(
'id' => array( 'type' => 'serial'),
'datum' => array( 'type' => 'date'),
'receiver' => array( 'type' => 'character varying','constraint' => '120'),
'source_id' => array( 'type' => 'integer' ),
'amount' => array( 'type' => 'numeric','constraint' => '9,2' ),
'validate' => array( 'type' => 'boolean' ),
'rechnung' => array( 'type' => 'character varying','constraint' => '50','null'=>true),
'deleted_at'=> array( 'type' => 'timestamp without time zone','null'=>true),
);
$forge->addField( $fields );
$forge->addPrimaryKey('id');
$forge->addForeignKey('source_id', $accounts->getTable(), 'id','NO ACTION','NO ACTION','source_id_fk');
// $this->db->query("CREATE TABLE $this->table (LIKE $this->defaultTableName INCLUDING DEFAULTS INCLUDING CONSTRAINTS) PARTITION BY RANGE (datum);");
$forge->createTable($this->table,true,['PARTITION BY RANGE'=>'(datum)']);
log_message('debug','Create Bills Table '.$this->db->lastQuery);
// CREATE TABLE temperatures_y2025q1 PARTITION OF temperatures
// FOR VALUES FROM ('2025-01-01') TO ('2025-04-01');
}
};
?>

View File

@@ -3,17 +3,26 @@
use CodeIgniter\Model;
class mScheduled extends Model {
protected $table = 'budget_scheduled';
protected $primaryKey = 'id';
private $defaultTableName='_budget_scheduled';
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
protected $returnType = 'array';
protected $useSoftDeletes = false;
protected $useSoftDeletes = true;
protected $deletedField ="deleted_at";
protected $allowedFields = ['creat_date','next_date','data'];
protected $useTimestamps = false;
protected $skipValidation = false;
public function calcNextDate($date, $num, $type)
protected function initialize() {
$this->table = auth()->user()->preFixDB.$this->defaultTableName;
$this->checkOrCreateTable();
}
public function calcNextDate(string $date, string $num, string $type)
{
$start = strtotime( $date );
$period = $num .' '. $type;
@@ -24,68 +33,78 @@ class mScheduled extends Model {
return date( "Y-m-d", $future );
}
public function getEntry($id){
$accounts = model('App\Models\mAccounts');
public function getEntry(int $id){
$data = $this->asObject()->find($id);
$result = (array)json_decode($data->data);
$result['id'] = $id;
$result['datum'] = date( "d.m.Y", strtotime($data->next_date));
for ($i=0;$i<10;$i++){
$result['category_parent'][$i]= $accounts->getParent($result['category'][$i]);
}
$result['datum'] = $data->next_date; //date( "d.m.Y", strtotime($data->next_date));
return $result;
}
public function getEntries(){
$quelle = model('App\Models\mAccounts');
$result = $this->asObject()->findAll();
log_message('error', 'Get Entries Schedules: {msg}', ['msg'=>(string)$this->db->getLastQuery()]);
foreach ($result as $value) {
$details = json_decode($value->data);
for ($i=0;$i<10;$i++){
if ((floatval($details->input[$i]) == 0.0) && (floatval($details->output[$i]) == 0.0))
foreach ($details->input as $key => $line){
if ((floatval($line) == 0.0) && (floatval($details->output[$key]) == 0.0))
continue;
$value->details[] = ['comment'=>$details->comment[$i], 'description'=>$quelle->getDropDownEntry($details->category[$i]), 'subamount'=>(floatval($details->input[$i])-floatval($details->output[$i]))];
// $account_id = (!isset($details->account_id))?$details->category:$details->account_id;
$value->details[] = ['comment'=>$details->comment[$key], 'description'=>$quelle->getDropDownEntry($details->account_id[$key]), 'subamount'=>(floatval($details->input[$key])-floatval($details->output[$key]))];
}
//$value->details = null;
$value->datum = date( "d.m.Y", strtotime( $value->next_date ));
$value->source = $quelle->getDropDownEntry($details->source);
$source_id = (!isset($details->source_id))?$details->source:$details->source_id;
$value->source = $quelle->getDropDownEntry($source_id);
$value->receiver = $details->receiver;
$value->amount = floatval($details->total_in)-floatval($details->total_out);
// $value->amount = number_format( $value->amount , 2, ',', '.' );
// if (!isset($details->amount)){
// $value->amount = floatval($details->total_in)-floatval($details->total_out);
// $value->amount = number_format( floatval($value->amount) , 2, ',', '.' );
// }
// else
$value->amount = $details->amount; //number_format( floatval($details->amount) , 2, ',', '.' );
}
return $result;
}
public function saveBill($data){
public function saveIt(array $data){
$accounts = model('App\Models\mAccounts');
$data['validate'] = true;
$data['scheduled'] = true;
$data['renummer'] = isset($data['renummer']);
if ($data['transfer']==1){
$data['receiver'] = $accounts->getDropDownEntry($data['category'][0]);
$data['transfer'] = true;
}
else{
$data['multi'] = isset($data['multiple']);
$data['transfer'] = false;
}
unset($data['openamount']);
unset($data['category_parent']);
$data['datum'] = date( "Y-m-d", strtotime($data['datum'] ) );
unset($data['total_in']);
unset($data['total_out']);
// $data['datum'] = date( "Y-m-d", strtotime($data['datum'] ) );
$this->set('next_date', $data['datum']);
$data['total_in'] = 0;
$data['total_out'] = 0;
for ($i=0;$i<10;$i++){
if ($data['category'][$i] > 0){
$data['total_in'] += floatval($data['input'][$i]);
$data['total_out'] += floatval($data['output'][$i]);
}
}
$this->set('data',json_encode($data));
log_message("debug","save Scheduled".json_encode($data));
if ( 0 == $data['id']) $this->insert();
else $this->update($data['id']);
}
public function checkOrCreateTable(){
log_message('debug',"Check or Create Scheduled Table");
if ($this->db->tableExists($this->table)) return;
log_message('debug','Create Scheduled Table '.$this->db->lastQuery);
log_message('debug',"Create Scheduled Table ".$this->table);
$forge = \Config\Database::forge();
$fields = array(
'id' => array( 'type' => 'serial'),
'creat_date' => array( 'type' => 'date','default'=>new \CodeIgniter\Database\RawSql('CURRENT_TIMESTAMP')),
'next_date' => array( 'type' => 'date'),
'data' => array( 'type' => 'text'),
'deleted_at'=> array( 'type' => 'timestamp without time zone','null'=>true),
);
$forge->addField( $fields );
$forge->addPrimaryKey('id');
$forge->createTable($this->table,true);
log_message('debug','Create Scheduled Table '.$this->db->lastQuery);
}
}

View File

@@ -2,13 +2,13 @@
<div class="card text-bg-dark">
<div class="card-content">
<div class="card-body">
<form class="form form-vertical" id="editaccount" method="post" action="<?= base_url() ?>/editAccount">
<form class="form form-vertical" id="editaccount" method="post" action="<?= base_url() ?>/viewAccounts">
<input type="hidden" value="<?= $id??0 ?>" name="id" id="id">
<?php if (! empty($validation)) : ?>
<?php if (! empty($errors)) : ?>
<div class='alert alert-danger mt-2'>
<div class="errors" role="alert">
<ul>
<?php foreach ($validation as $error) : ?>
<?php foreach ($errors as $error) : ?>
<li><?= esc($error) ?></li>
<?php endforeach ?>
</ul>
@@ -26,33 +26,36 @@
<div class="col-12">
<div class="form-group">
<label for="parent">Überkonto:</label>
<?= form_dropdown('parent', $ddlist, $parent??0,'id="parent" class="form-select"'); ?>
<select name="parent" class="form-select" required id="parent" >
<option value="0">----</option>
<?php foreach ($ddlist as $key => $value): ?>
<option value="<?= $key ?>" <?= ($key == ($parent??0))?'selected':'' ?>><?= $value ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="col-12">
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" id="typeAccount" value="account" name="type" <?= set_radio('type', 'account') ?>>
<label class="form-check-label" for="inlineCheckbox1">Konto</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" id="typeInput" value="input" name="type" <?= set_radio('type', 'input') ?> >
<label class="form-check-label" for="inlineCheckbox2">Einnahmen</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" id="typeOutput" value="output" name="type" <?= set_radio('type', 'output', true) ?> >
<label class="form-check-label" for="inlineCheckbox3">Ausgaben</label>
<div class="form-check form-switch">
<label class="form-check-label" for="account">Typ Konto</label>
<input class="form-check-input" type="checkbox" id="account" name="account" <?= set_checkbox('account', 'on', $account??false) ?> >
</div>
</div>
<div class="col-12">
<div class="form-check form-switch">
<label class="form-check-label" for="bookable">Buchbarkeit</label>
<input class="form-check-input" type="checkbox" id="bookable" value="bookable" name="bookable" <?= set_checkbox('bookable', 'on', (($bookable??"f")=="t")?true:false) ?> >
<input class="form-check-input" type="checkbox" id="bookable" value="bookable" name="bookable" <?= set_checkbox('bookable', 'on', $bookable??false) ?> >
</div>
</div>
<div class="col-12">
<div class="form-check form-switch">
<label class="form-check-label" for="lkz">lkz</label>
<input class="form-check-input" type="checkbox" id="lkz" value="1" name="lkz" <?= set_checkbox('lkz', '1', $lkz??false) ?>>
<label class="form-check-label" for="monitor">Monitor</label>
<input class="form-check-input" type="checkbox" id="monitor" name="monitor" <?= set_checkbox('monitor', 'on', $monitor??false) ?> >
</div>
</div>
<div class="col-12">
<div class="form-check form-switch">
<label class="form-check-label" for="deleted_at">Gelöscht</label>
<input class="form-check-input" type="checkbox" id="deleted_at" value="1" name="deleted_at" <?= set_checkbox('deleted_at', '1', $deleted_at??false) ?>>
</div>
</div>
<div class="col-12">

View File

@@ -3,31 +3,49 @@
<?= $this->section('css'); ?>
<link rel="stylesheet" href="/css/mawim.css">
<link rel="stylesheet" href="/assets/jquery-ui-1.13.2.custom/jquery-ui.css">
<?= $this->endSection(); ?>
<?= $this->section('menu'); ?>
<?= $this->include('sidebar') ?>
<?= $this->endSection(); ?>
<?= $this->section('content'); ?>
<?php if (!function_exists('printBool')) {
function printBool(bool $var){
return ($var)?"true":"false";
}
}
?>
<?php function printsub($id, $all){
<?php if (!function_exists('printsub')) { function printsub(int $id, $all){
$liste = '';
$ret='';
foreach($all as $ele){
$class ="";
$vis ="d-none";
if ($ele->parent_id == $id){
if ($ele->lkz) $class = "text-bg-danger";
else if ($ele->bookable == "f") $class = "text-bg-warning";
$toolt ="bookable: $ele->bookable; lkz: $ele->lkz; Id: $ele->id; PID:$ele->parent_id";
$liste .= "<li><span data-bs-toggle='tooltip' data-bs-html=true title='$toolt'";
if ($ele->deleted_at) {
$class = "text-bg-danger";
$vis="d-none";
}
else {
$vis="";
if (!$ele->bookable)
$class = "text-bg-warning";
}
$toolt = ($ele->bookable)?"":"not ";
$toolt .= "bookable; ";
$toolt .= ($ele->deleted_at)?"gelöscht; ":"";
$toolt .="Id: $ele->id; PID:$ele->parent_id";
$liste .= "<li class=\"$vis\"><i class=\"fa-solid\"></i> <span data-bs-toggle='tooltip' data-bs-html=true title='$toolt'";
$liste .= "data-id=\"$ele->id\"";
$liste .= "data-pid=\"$ele->parent_id\"";
$liste .= "data-bookable=\"$ele->bookable\"";
$liste .= "data-lkz=\"$ele->lkz\"";
$liste .= "data-type=\"$ele->type\"";
$liste .= "data-bookable=\"".printBool($ele->bookable)."\"";
$liste .= "data-account=\"".printBool($ele->account)."\"";
$liste .= "data-monitor=\"".printBool($ele->monitor)."\"";
$liste .= "data-deleted=\"$ele->deleted_at\"";
$liste .= "data-description=\"$ele->description\"";
$liste .= "class='$class'>$ele->description</span></li>";
$liste .= "class='$class'>$ele->description</span>";
$liste .= printsub($ele->id, $all);
$liste .= "</li>";
}
}
if ($liste !=''){
@@ -36,33 +54,53 @@
$ret .= "</ul>";
}
return $ret;
} ?>
}} ?>
<div class="page-heading">
<h3> Kategorien bearbeiten</h3>
<?php if ($saveDB??false) : ?>
<div class='alert <?= $saveDB["mode"] ?> mt-2'>
<?= $saveDB["message"] ?>
</div>
<?php endif; ?>
</div>
<div class="row">
<div class="col-md-3 col-12" id="tree">
<div class="card text-bg-dark">
<div class="card-content">
<div class="card-body">
<div><a class="btn btn-info multi" onclick="newCat();" role="button">Neue Kategorie</a></div>
<div class="d-flex justify-content-between">
<div class="col-sm-12 col-md-6">
<a class="btn btn-info multi" onclick="newCat();" role="button"> + Neue Kategorie</a>
</div>
<div class="col-sm-12 col-md-6 form-check form-check-reverse form-switch justify-content-end">
<input class="form-check-input" type="checkbox" id="viewdeleted" value="1" name="viewdeleted">
<label class="form-check-label" for="viewdeleted">Gelöschte</label>
</div>
</div>
<div class="tree">
<ul>
<?php foreach($parents as $parent): ?>
<?php $class='';
if ($parent->lkz) $class = "text-bg-danger";
else if ($parent->bookable == "f") $class = "text-bg-warning"; ?>
<li> <span data-bs-toggle='tooltip'
<?php $class=''; $vis ="d-none";
if ($parent->deleted_at) {
$class = "text-bg-danger";
$vis = "d-none";
} else {
$vis = "";
if (!$parent->bookable) $class = "text-bg-warning";
}?>
<li class="<?=$vis?>"><i class="fa-solid"></i> <span data-bs-toggle='tooltip'
data-bs-html=true
data-id="<?=$parent->id?>"
data-pid="0"
data-bookable="<?=$parent->bookable?>"
data-lkz=" <?= $parent->lkz?>"
data-type="<?= $parent->type?>"
data-bookable=<?=printBool($parent->bookable)?>
data-monitor=<?=printBool($parent->monitor)?>
data-account=<?=printBool($parent->account)?>
data-deleted="<?= $parent->deleted_at?>"
data-description="<?= $parent->description?>";
title="bookable: <?=$parent->bookable?>; lkz: <?= $parent->lkz?>; Id: <?=$parent->id?>;" class="<?=$class?>"><?=$parent->description?></span>
title="<?=($parent->bookable)?"":"not "?>bookable; <?= ($parent->deleted_at)?"gelöscht; ":""?>Id: <?=$parent->id?>;"
class="<?=$class?>"><?=$parent->description?></span>
<?= printsub($parent->id, $all); ?>
<li>
<?php endforeach; ?>
</ul>
</div>
@@ -70,13 +108,11 @@
</div>
</div>
</div>
<div class="col-md-3 col-12 d-none" id="editor">
<div class="col-md-3 col-12 <?= (empty($errors))?"d-none" :"" ?>" id="editor">
<?= $this->include('accountsform') ?>
</div>
</section>
<?= $this->endSection(); ?>
<?= $this->section('scripts'); ?>
<script src="/assets/jquery-ui-1.13.2.custom/jquery-ui.js"></script>
<script></script>
<script src="/js/accounts.js"></script>
<?= $this->endSection(); ?>

View File

@@ -1,7 +1,6 @@
<?= $this->extend('layout'); ?>
<?= $this->section('css'); ?>
<link rel="stylesheet" href="/assets/jquery-ui-1.13.2.custom/jquery-ui.css">
<link rel="stylesheet" href="/css/mawim.css">
<?= $this->endSection(); ?>
<?= $this->section('menu'); ?>
@@ -13,71 +12,40 @@
<div class="row">
<div class="col-xxl-8 col-12">
<div class="text-white-50"><h2>Verlauf</h2></div>
<form class="form row row-cols align-items-bottom" id="getData" method="post" action="<?= base_url() ?>/Ajax/getTabelData">
<form class="form row row-cols align-items-bottom" id="getData" method="post" action="/getActivitiesData">
<div class="row">
<div class="col-lg-3 col-12">
<input type="text" class="form-control" id="datepickers" data-date-format="mm.dd.yyyy" name="datum_start" placeholder="Datum Start" value="<?= $datum_start??$start ?>"/>
<input type="date" class="form-control" name="datum_start" placeholder="Datum Start" value="<?= $datum_start??$start ?>"/>
</div>
<div class="col-lg-3 col-12">
<input type="text" class="form-control" id="datepickere" data-date-format="mm.dd.yyyy" name="datum_ende" placeholder="Datum Ende" value="<?= $datum_ende??$ende ?>"/>
<input type="date" class="form-control" name="datum_ende" placeholder="Datum Ende" value="<?= $datum_ende??$ende ?>"/>
</div>
<div class="col-lg-3 col-12">
<div class="form-group">
<?= form_dropdown('source', $sourcelist, $source,'id="source" class="form-select"'); ?>
<select name="source" class="form-select">
<option value="0">----</option>
<?php foreach ($sourcelist as $key => $value): ?>
<option value="<?= $key ?>" <?= ($key == $source)?'selected':'' ?>><?= $value ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="col-lg-3 col-12">
<a class="btn btn-primary" onclick="datatable.ajax.reload();" role="button">Aktualisieren</a>
<a class="btn btn-primary" onclick="loadActivityData();" role="button">Aktualisieren</a>
</div>
</div>
</form>
<table class="table table-sm table-striped" id="bookings" cellspacing="0"></table>
<table id="activities" cellspacing="0"></table>
</div>
<div class="col-xxl-4 col-12 d-none d-xxl-block">
<div class="text-white-50"><h2>Aktuelle Kontostände</h2></div>
<table class="table table-striped table-sm" id="accounts" cellspacing="0"></table>
<table id="accounts" cellspacing="0"></table>
</div>
</div>
</div>
<?= $this->endSection(); ?>
<?= $this->section('scripts'); ?>
<script src="/assets/jquery-ui-1.13.2.custom/jquery-ui.js"></script>
<script>
$.datepicker.regional['de'] = {clearText: 'löschen', clearStatus: 'aktuelles Datum löschen',
closeText: 'schließen', closeStatus: 'ohne Änderungen schließen',
prevText: '<zurück', prevStatus: 'letzten Monat zeigen',
nextText: 'Vor>', nextStatus: 'nächsten Monat zeigen',
currentText: 'heute', currentStatus: '',
monthNames: ['Januar','Februar','März','April','Mai','Juni',
'Juli','August','September','Oktober','November','Dezember'],
monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun',
'Jul','Aug','Sep','Okt','Nov','Dez'],
monthStatus: 'anderen Monat anzeigen', yearStatus: 'anderes Jahr anzeigen',
weekHeader: 'Wo', weekStatus: 'Woche des Monats',
dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
dayStatus: 'Setze DD als ersten Wochentag', dateStatus: 'Wähle D, M d',
dateFormat: 'dd.mm.yy', firstDay: 1,
initStatus: 'Wähle ein Datum', isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['de']);
$('#datepickers').datepicker(
{
format: "dd.mm.yyyy",
language: 'de-DE',
weekStart: 1,
autoclose: true,
todayHighlight: false});
$('#datepickere').datepicker(
{
format: "dd.mm.yyyy",
language: 'de-DE',
weekStart: 1,
autoclose: true,
todayHighlight: false});
</script>
<script src="/js/tables.js"></script>
<script src="/js/tab_accounts.js"></script>
<script src="/js/activities.js"></script>
<script src="/js/tab_activities.js"></script>
<?= $this->endSection(); ?>

View File

@@ -0,0 +1,64 @@
<?= $this->extend('layouts/smarthome'); ?>
<?= $this->section('menu'); ?>
<?= $this->include('menu/dashboard_menu') ?>
<?= $this->endSection(); ?>
<?= $this->section('content'); ?>
<div class="container">
<div class="row">
<div class="col-sm-6 offset-sm-3">
<div class="card bg-secondary">
<div class="card-body bg-dark text-white-50">
<h5 class="card-header">Hallo <?= auth()->user()->username ?>, Passwort ändern</h5>
<?php if (session('error') !== null) : ?>
<div class="alert alert-danger" role="alert"><?= session('error') ?></div>
<?php elseif (session('errors') !== null) : ?>
<div class="alert alert-danger" role="alert">
<?php if (is_array(session('errors'))) : ?>
<?php foreach (session('errors') as $error) : ?>
<?= $error ?>
<br>
<?php endforeach ?>
<?php else : ?>
<?= session('errors') ?>
<?php endif ?>
</div>
<?php endif ?>
<?php if (session('message') !== null) : ?>
<div class="alert alert-success" role="alert"><?= session('message') ?></div>
<?php endif ?>
<form action="changePassword" method="post">
<?= csrf_field() ?>
<!-- Email -->
<div class="mb-2">
<input type="email" class="form-control bg-transparent text-light " name="email" inputmode="email" autocomplete="email" placeholder="<?= lang('Auth.email') ?>" value="<?= old('email',$email) ?>" required />
</div>
<!-- old Password -->
<?php if (session('magicLogin') === null) : ?>
<div class="mb-2">
<input type="password" class="form-control bg-transparent text-light " name="oldpassword" inputmode="text" autocomplete="current-password" placeholder="neues Passwort" required />
</div>
<?php endif ?>
<!-- Password -->
<div class="mb-2">
<input type="password" class="form-control bg-transparent text-light " name="password" inputmode="text" autocomplete="new-password" placeholder="neues Passwort" required />
</div>
<!-- Password (Again) -->
<div class="mb-5">
<input type="password" class="form-control bg-transparent text-light " name="password_confirm" inputmode="text" autocomplete="new-password" placeholder="<?= lang('Auth.passwordConfirm') ?>" required />
</div>
<div class="d-grid col-12 col-md-8 mx-auto m-3">
<button type="submit" class="btn btn-primary btn-block">Ändern</button>
</div>
</form>
</div>
</div>
</div>
<?= $this->endSection(); ?>

View File

@@ -0,0 +1,27 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<head>
<meta name="x-apple-disable-message-reformatting">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="format-detection" content="telephone=no, date=no, address=no, email=no">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Einladung zur Registrierung bei Smarthome</title>
</head>
<body>
Hi,
um Smarthome Dashboard zu benutzen, musst du dich registrieren.
Benutze hierfür den Link:
<table role="presentation" border="0" cellpadding="0" cellspacing="0" style="border-radius: 6px; border-collapse: separate !important;">
<tbody>
<tr>
<td style="line-height: 24px; font-size: 16px; border-radius: 6px; margin: 0;" align="center" bgcolor="#0d6efd">
<a href="<?= url_to('register') ?>" style="color: #ffffff; font-size: 16px; font-family: Helvetica, Arial, sans-serif; text-decoration: none; border-radius: 6px; line-height: 20px; display: inline-block; font-weight: normal; white-space: nowrap; background-color: #0d6efd; padding: 8px 12px; border: 1px solid #0d6efd;"><?= lang('Auth.register') ?></a>
</td>
</tr>
</tbody>
</table>
<p><?= lang('Auth.emailDate') ?> <?= esc($date) ?></p>
</body>
</html>

View File

@@ -0,0 +1,24 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<head>
<meta name="x-apple-disable-message-reformatting">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="format-detection" content="telephone=no, date=no, address=no, email=no">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Neue Registrierung bei der Verwaltung der Wörgler Flughunden ist erfolgt</title>
</head>
<body>
<table role="presentation" border="0" cellpadding="0" cellspacing="0" style="border-radius: 6px; border-collapse: separate !important;">
Der Benutzer <b><?= $username?></b> mit der Emailadresse <b><?=$email?></b> hat sich neu registriert.<br>
Die Gruppenzugehörigkeit gehört eingestellt.
<tbody>
<tr>
<td style="line-height: 24px; font-size: 16px; border-radius: 6px; margin: 0;" align="center" bgcolor="#0d6efd">
<a href="<?=base_url().$link ?>" style="color: #ffffff; font-size: 16px; font-family: Helvetica, Arial, sans-serif; text-decoration: none; border-radius: 6px; line-height: 20px; display: inline-block; font-weight: normal; white-space: nowrap; background-color: #0d6efd; padding: 8px 12px; border: 1px solid #0d6efd;">Check</a>
</td>
</tr>
</tbody>
</table>
</body>
</html>

73
app/Views/auth/login.php Normal file
View File

@@ -0,0 +1,73 @@
<?= $this->extend('layout'); ?>
<?= $this->section('menu'); ?>
<?= $this->include('sidebar') ?>
<?= $this->endSection(); ?>
<?= $this->section('content'); ?>
<div class="container">
<div class="row">
<div class="col-sm-6 offset-sm-3">
<div class="card bg-secondary">
<div class="card-header bg-dark text-white-50">
<h5 class="card-title"> <?= lang('Auth.login') ?></h5>
</div>
<div class="card-body bg-dark text-white-50">
<?php if (session('error') !== null) : ?>
<div class="alert alert-danger" role="alert"><?= session('error') ?></div>
<?php elseif (session('errors') !== null) : ?>
<div class="alert alert-danger" role="alert">
<?php if (is_array(session('errors'))) : ?>
<?php foreach (session('errors') as $error) : ?>
<?= $error ?>
<br>
<?php endforeach ?>
<?php else : ?>
<?= session('errors') ?>
<?php endif ?>
</div>
<?php endif ?>
<?php if (session('message') !== null) : ?>
<div class="alert alert-success" role="alert"><?= session('message') ?></div>
<?php endif ?>
<form action="<?= url_to('login') ?>" method="post">
<?= csrf_field() ?>
<!-- Email -->
<div class="mb-2">
<input type="email" class="form-control bg-transparent text-light " name="email" inputmode="email" autocomplete="email" placeholder="<?= lang('Auth.email') ?>" value="<?= old('email') ?>" required />
</div>
<!-- Password -->
<div class="mb-2">
<input type="password" class="form-control bg-transparent text-light " name="password" inputmode="text" autocomplete="current-password" placeholder="<?= lang('Auth.password') ?>" required />
</div>
<!-- Remember me -->
<?php if (setting('Auth.sessionConfig')['allowRemembering']): ?>
<div class="form-check">
<label class="form-check-label">
<input type="checkbox" name="remember" class="form-check-input bg-transparent text-light" <?php if (old('remember')): ?> checked<?php endif ?>>
<?= lang('Auth.rememberMe') ?>
</label>
</div>
<?php endif; ?>
<div class="d-grid col-12 col-md-8 mx-auto m-3">
<button type="submit" class="btn btn-primary btn-block"><?= lang('Auth.login') ?></button>
</div>
<?php if (setting('Auth.allowMagicLinkLogins')) : ?>
<p class="text-center"><?= lang('Auth.forgotPassword') ?> <a href="<?= url_to('magic-link') ?>"><?= lang('Auth.useMagicLink') ?></a></p>
<?php endif ?>
</form>
</div>
</div>
</div>
<?= $this->endSection(); ?>

View File

@@ -0,0 +1,66 @@
<?= $this->extend('layout'); ?>
<?= $this->section('menu'); ?>
<?= $this->include('sidebar') ?>
<?= $this->endSection(); ?>
<?= $this->section('content'); ?>
<div class="container">
<div class="card col-12 col-md-5 shadow-sm">
<div class="card-header">
<h5 class="card-title"> <?= lang('Auth.register') ?></h5>
</div>
<div class="card-body">
<?php if (session('error') !== null) : ?>
<div class="alert alert-danger" role="alert"><?= session('error') ?></div>
<?php elseif (session('errors') !== null) : ?>
<div class="alert alert-danger" role="alert">
<?php if (is_array(session('errors'))) : ?>
<?php foreach (session('errors') as $error) : ?>
<?= $error ?>
<br>
<?php endforeach ?>
<?php else : ?>
<?= session('errors') ?>
<?php endif ?>
</div>
<?php endif ?>
<form action="<?= url_to('register') ?>" method="post">
<?= csrf_field() ?>
<!-- Email -->
<div class="form-floating mb-2">
<input type="email" class="form-control" id="floatingEmailInput" name="email" inputmode="email" autocomplete="email" placeholder="<?= lang('Auth.email') ?>" value="<?= old('email') ?>" required>
<label for="floatingEmailInput"><?= lang('Auth.email') ?></label>
</div>
<!-- Username -->
<div class="form-floating mb-4">
<input type="text" class="form-control" id="floatingUsernameInput" name="username" inputmode="text" autocomplete="username" placeholder="<?= lang('Auth.username') ?>" value="<?= old('username') ?>" required>
<label for="floatingUsernameInput"><?= lang('Auth.username') ?></label>
</div>
<!-- Password -->
<div class="form-floating mb-2">
<input type="password" class="form-control" id="floatingPasswordInput" name="password" inputmode="text" autocomplete="new-password" placeholder="<?= lang('Auth.password') ?>" required>
<label for="floatingPasswordInput"><?= lang('Auth.password') ?></label>
</div>
<!-- Password (Again) -->
<div class="form-floating mb-5">
<input type="password" class="form-control" id="floatingPasswordConfirmInput" name="password_confirm" inputmode="text" autocomplete="new-password" placeholder="<?= lang('Auth.passwordConfirm') ?>" required>
<label for="floatingPasswordConfirmInput"><?= lang('Auth.passwordConfirm') ?></label>
</div>
<div class="d-grid col-12 col-md-8 mx-auto m-3">
<button type="submit" class="btn btn-primary btn-block"><?= lang('Auth.register') ?></button>
</div>
<p class="text-center"><?= lang('Auth.haveAccount') ?> <a href="<?= url_to('login') ?>"><?= lang('Auth.login') ?></a></p>
</form>
</div>
</div>
</div>
<?= $this->endSection() ?>

View File

@@ -0,0 +1,92 @@
<?= $this->extend('layouts/smarthome'); ?>
<?= $this->section('css'); ?>
<link href="/assets/DataTables/datatables.css" rel="stylesheet"/>
<?= $this->endSection(); ?>
<?= $this->section('menu'); ?>
<?= $this->include('menu/dashboard_menu') ?>
<?= $this->endSection(); ?>
<?= $this->section('content'); ?>
<div class="modal fade" id="modalInviteUser" tabindex="-1" aria-labelledby="Invite User Dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="modalTitle">Benutzer Registrierungslink schicken</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form id="inviteuser" method="post" action="/inviteUser">
<div class="form-floating mb-2">
<input type="email" name="email" id="email" onchange="add(this);" inputmode="email" autocomplete="email" class="form-control" placeholder="Email" value="<?= set_value('email', $email??'') ?>">
<label for="email">Email</label>
</div>
<div class="d-grid col-12 col-md-8 mx-auto m-3">
<button type="submit" class="btn btn-primary btn-block">sende Email</button>
</div>
</form>
</div>
<div class="modal-footer d-none">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Send Email</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="modalChangeUser" tabindex="-1" aria-labelledby="Change User Dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="modalTitle">Benutzer ändern</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form id="edituser" method="post" action="/editUser">
<input type="hidden" value=0 name="id" class="changed" id="fuserid">
<div class="form-group row my-2">
<label for="username" class="col-sm-3 col-form-label">Name</label>
<div class="col-sm-9">
<input type="text" name="username" id="username" onchange="add(this);" class="form-control" placeholder="Name" value="<?= set_value('username', $username??'') ?>">
</div>
</div>
<div class="form-group row my-2">
<label for="email" class="col-sm-3 col-form-label">Email</label>
<div class="col-sm-9">
<input type="email" name="email" id="email" onchange="add(this);" class="form-control" placeholder="Email" value="<?= set_value('email', $email??'') ?>">
</div>
</div>
<div class="form-group row my-2 mb-3">
<label for="group" class="form-label">Auswahl Gruppen</label>
<?php foreach ($allowedGroups as $val => $item) : ?>
<div class="form-switch">
<input class="form-check-input" type="checkbox" onchange="add(this);" role="switch" value="<?=$val?>" name="group[]" id="group<?= $val; ?>">
<label for="group[<?= $val; ?>]" class="form-check-label"><?= $item ?></label>
</div>
<?php endforeach; ?>
</div>
<button type="submit" name="cmnd" value="change" id="modalsave" data-bs-toggle="modal" data-bs-target="#myModal" class="btn btn-primary">Submit</button>
<button type="submit" name="cmnd" value="resetPWD" id="modal_reset" data-bs-toggle="modal" data-bs-target="#myModal" class="btn btn-warning">Passwort Reset</button>
<button type="submit" name="cmnd" value="banUser" id="modal_ban" data-bs-toggle="modal" data-bs-target="#myModal" class="btn btn-danger">Zugang Sperren</button>
</form>
</div>
<div class="modal-footer d-none">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="submit" id="modal_save" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
<div class="container-lg ms-0">
<table class="table table-striped table-sm display no-wrap" id="usersTable" width="100%" cellspacing="0"
data-paging="false"
data-scrollX="false"
data-info="false"
data-responsive="{details: false}"
data-order='[[ 2, "desc" ]]''
data-ajax='{"url":"/viewUsers","dataSrc":""}'>
</table>
</div>
<?= $this->endSection(); ?>
<?= $this->section('scripts'); ?>
<script src="/js/userstab.js"></script>
<script src="/assets/DataTables/datatables.js"></script>
<?= $this->endSection(); ?>

View File

@@ -0,0 +1,56 @@
<?php
if (!$template) {
$parentList = $booking['cat_parent'][$i];
$subList = $booking['cat_sub'][$i];
$account_id = $booking['account_id'][$i];
$parent_id = $booking['parent_id'][$i];
$comment = $booking['comment'][$i];
$input = $booking['input'][$i];
$output = $booking['output'][$i];
$sid = $booking['sid'][$i];
} else {
$i = 0;
$account_id = 0;
$parent_id = 0;
$parentList = $booking['category']['parent'];
$subList = $booking['category']['subs']->{$parent_id};
$comment = '';
$input = '';
$output = '';
$sid = 0;
}
?>
<div <?=(($template)?'id="template"':'')?> class="row <?=(($template)?'d-none':'')?>">
<input type="hidden" value="<?= $sid ?>" name="sid[]">
<div class="col-lg-3 col-6 col-md-6 <?=(($i>0)?'multi':'')?> order-sm-2 px-0">
<select name="parent_id[]" class="form-select parent" <?=(($i==0 && !$template)?'required':'')?>>
<option value="">----</option>
<?php foreach ($parentList as $key => $value): ?>
<option value="<?= $key ?>" <?= ($key == $parent_id)?'selected':'' ?>><?= $value ?></option>
<?php endforeach; ?>
</select>
</div>
<div class="col-lg-3 col-6 col-md-6 <?=(($i>0)?'multi':'')?> order-sm-2 px-0" <?=(($i==0 && !$template)?'required':'')?>>
<select name="account_id[]" class="form-select sub">
<?php foreach ($subList as $key => $value): ?>
<option value="<?= $key ?>" <?= ($key == $account_id && $account_id>0)?'selected':'' ?>><?= $value ?></option>
<?php endforeach; ?>
</select>
</div>
<div class="w-100 d-md-none"></div>
<div class="col-lg-2 col-6 <?=(($i>0)?'multi':'')?> <?= ($booking['transfer']?' d-none':'') ?> px-0 order-sm-2">
<input type="text" name="input[]" class="form-control dt-subamount input" placeholder="Einnahme" value="<?= $input ?>"
pattern="[0-9\*\(\)\-\+\/,.]*"
oninput="if (!this.checkValidity()) this.value = this.value.slice(0, -1)">
</div>
<div class="<?= ($booking['transfer']?'col-lg-4 col-12':'col-lg-2 col-6') ?> <?=(($i>0)?'multi':'')?> px-0 order-sm-2">
<input type="text" name="output[]" placeholder="Ausgabe" value="<?= $output ?>"
pattern="[0-9\*\(\)\-\+\/,.]*"
oninput="if (!this.checkValidity()) this.value = this.value.slice(0, -1)" class="form-control dt-subamount output text-danger" >
</div>
<div class="col-lg-2 col-12 col-md-12 <?=(($i>0)?'multi':'')?> order-sm-1 px-0 mb-3 mb-md-0">
<input type="text" name="comment[]" class="form-control" placeholder="Kommentar" value="<?= $comment ?>">
</div>
</div>

View File

@@ -0,0 +1,19 @@
<div class="col-12 scheduled <?=($booking['scheduled']?'':'d-none')?>">
<div class="form-group">
<label for="scheduledNum">Scheduled:</label>
<div class="input-group">
<select name="scheduledNum" id="scheduledNum" class="form-select" required>
<option value="">----</option>
<?php foreach ($booking['schedule_lists']['NumList'] as $key => $value): ?>
<option value="<?= $key ?>" <?= ($key == $booking['scheduledNum'])?'selected':'' ?>><?= $value ?></option>
<?php endforeach; ?>
</select>
<select name="scheduledType" id="scheduledType" class="form-select" required>
<option value="">----</option>
<?php foreach ($booking['schedule_lists']['TypeList'] as $key => $value): ?>
<option value="<?= $key ?>" <?= ($key == $booking['scheduledType'])?'selected':'' ?>><?= $value ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
</div>

View File

@@ -0,0 +1,68 @@
<?= $this->extend('layout'); ?>
<?= $this->section('menu'); ?>
<?= $this->include('sidebar') ?>
<?= $this->endSection(); ?>
<?= $this->section('css'); ?>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<?= $this->endSection(); ?>
<?= $this->section('content'); ?>
<div class="page-content col-xxl-4 col-12">
<div class="row" id="chart">
<canvas id="myAreaChart"></canvas>
</div>
</div>
<?= $this->endSection(); ?>
<?= $this->section('scripts'); ?>
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.5/dist/chart.umd.min.js"></script>
<script src="https://smarthome.mawim.at/assets/luxon.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chartjs-adapter-luxon/1.3.0/chartjs-adapter-luxon.umd.js" integrity="sha512-IUw+YyQA3lci8gHiGIbkEA5pHnSy9LJeujqIDBHQMhxTk019nRXvDrKi2WcEr5nf5+RNffKMqSagdI0tzXvBiA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
<script>
const data = {
labels: <?=$labels?>,
datasets: [
{
label: '€',
data: <?=$data?>,
id:<?=$ids?>,
hoverOffset: 8
}
]
};
const configDonut = {
type: 'doughnut',
data: data,
options: {
responsive: true,
plugins: {
legend: {
position: 'left',
},
title: {
display: true,
text: '<?=$title?>',
font: { size: 20 }
}
},
onClick: (e) => {
let ele = document.getElementById("myChartModal");
const canvasPosition = Chart.helpers.getRelativePosition(e, window.myLineChart);
// Substitute the appropriate scale IDs
const data = window.myLineChart.getActiveElements(e);
document.getElementById("modalChartBody").innerHTML = `<a href="/viewChart/${window.myLineChart.data.datasets[0].id[data[0].index]}">Zeige Details von ${window.myLineChart.data.labels[data[0].index]}</a>`;
bootstrap.Modal.getOrCreateInstance(ele).show();
const name = window.myLineChart.data.labels[data[0].index];
//const dataY = chart.scales.y.getValueForPixel(canvasPosition.y);
// alert(`http://mqtt.mawim.at/viewChart/${window.myLineChart.data.datasets[0].id[data[0].index]}`);
}
},
};
(async function () {
Chart.defaults.font.size = 16;
window.myLineChart = new Chart(document.getElementById('myAreaChart'), configDonut);
})();
</script>
<?= $this->endSection(); ?>

View File

@@ -3,17 +3,26 @@
use CodeIgniter\CLI\CLI;
// The main Exception
CLI::newLine();
CLI::write('[' . get_class($exception) . ']', 'light_gray', 'red');
CLI::newLine();
CLI::write('[' . $exception::class . ']', 'light_gray', 'red');
CLI::write($message);
CLI::newLine();
CLI::write('at ' . CLI::color(clean_path($exception->getFile()) . ':' . $exception->getLine(), 'green'));
CLI::newLine();
$last = $exception;
while ($prevException = $last->getPrevious()) {
$last = $prevException;
CLI::write(' Caused by:');
CLI::write(' [' . $prevException::class . ']', 'red');
CLI::write(' ' . $prevException->getMessage());
CLI::write(' at ' . CLI::color(clean_path($prevException->getFile()) . ':' . $prevException->getLine(), 'green'));
CLI::newLine();
}
// The backtrace
if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE) {
$backtraces = $exception->getTrace();
$backtraces = $last->getTrace();
if ($backtraces) {
CLI::write('Backtrace:', 'green');
@@ -41,20 +50,11 @@ if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE) {
$function .= $padClass . $error['function'];
}
$args = implode(', ', array_map(static function ($value) {
switch (true) {
case is_object($value):
return 'Object(' . get_class($value) . ')';
case is_array($value):
return count($value) ? '[...]' : '[]';
case $value === null:
return 'null'; // return the lowercased version
default:
return var_export($value, true);
}
$args = implode(', ', array_map(static fn ($value): string => match (true) {
is_object($value) => 'Object(' . $value::class . ')',
is_array($value) => $value !== [] ? '[...]' : '[]',
$value === null => 'null', // return the lowercased version
default => var_export($value, true),
}, array_values($error['args'] ?? [])));
$function .= '(' . $args . ')';

View File

@@ -3,7 +3,7 @@
--main-text-color: #555;
--dark-text-color: #222;
--light-text-color: #c7c7c7;
--brand-primary-color: #E06E3F;
--brand-primary-color: #DC4814;
--light-bg-color: #ededee;
--dark-bg-color: #404040;
}
@@ -19,7 +19,6 @@ body {
}
h1 {
font-weight: lighter;
letter-spacing: 0.8;
font-size: 3rem;
color: var(--dark-text-color);
margin: 0;
@@ -42,9 +41,10 @@ p.lead {
.header {
background: var(--light-bg-color);
color: var(--dark-text-color);
margin-top: 2.17rem;
}
.header .container {
padding: 1rem 1.75rem 1.75rem 1.75rem;
padding: 1rem;
}
.header h1 {
font-size: 2.5rem;
@@ -65,14 +65,14 @@ p.lead {
display: inline;
}
.footer {
background: var(--dark-bg-color);
color: var(--light-text-color);
}
.footer .container {
border-top: 1px solid #e7e7e7;
margin-top: 1rem;
.environment {
background: var(--brand-primary-color);
color: var(--main-bg-color);
text-align: center;
padding: calc(4px + 0.2083vw);
width: 100%;
top: 0;
position: fixed;
}
.source {
@@ -112,7 +112,7 @@ p.lead {
}
.tabs a:link,
.tabs a:visited {
padding: 0rem 1rem;
padding: 0 1rem;
line-height: 2.7;
text-decoration: none;
color: var(--dark-text-color);
@@ -152,9 +152,6 @@ p.lead {
border-radius: 5px;
color: #31708f;
}
ul, ol {
line-height: 1.8;
}
table {
width: 100%;

View File

@@ -0,0 +1,84 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title><?= lang('Errors.badRequest') ?></title>
<style>
div.logo {
height: 200px;
width: 155px;
display: inline-block;
opacity: 0.08;
position: absolute;
top: 2rem;
left: 50%;
margin-left: -73px;
}
body {
height: 100%;
background: #fafafa;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #777;
font-weight: 300;
}
h1 {
font-weight: lighter;
letter-spacing: normal;
font-size: 3rem;
margin-top: 0;
margin-bottom: 0;
color: #222;
}
.wrap {
max-width: 1024px;
margin: 5rem auto;
padding: 2rem;
background: #fff;
text-align: center;
border: 1px solid #efefef;
border-radius: 0.5rem;
position: relative;
}
pre {
white-space: normal;
margin-top: 1.5rem;
}
code {
background: #fafafa;
border: 1px solid #efefef;
padding: 0.5rem 1rem;
border-radius: 5px;
display: block;
}
p {
margin-top: 1.5rem;
}
.footer {
margin-top: 2rem;
border-top: 1px solid #efefef;
padding: 1em 2em 0 2em;
font-size: 85%;
color: #999;
}
a:active,
a:link,
a:visited {
color: #dd4814;
}
</style>
</head>
<body>
<div class="wrap">
<h1>400</h1>
<p>
<?php if (ENVIRONMENT !== 'production') : ?>
<?= nl2br(esc($message)) ?>
<?php else : ?>
<?= lang('Errors.sorryBadRequest') ?>
<?php endif; ?>
</p>
</div>
</body>
</html>

View File

@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>404 Page Not Found</title>
<title><?= lang('Errors.pageNotFound') ?></title>
<style>
div.logo {
@@ -70,14 +70,14 @@
</head>
<body>
<div class="wrap">
<h1>404 - File Not Found</h1>
<h1>404</h1>
<p>
<?php if (ENVIRONMENT !== 'production') : ?>
<?= nl2br(esc($message)) ?>
<?php else : ?>
Sorry! Cannot seem to find the page you were looking for.
<?php endif ?>
<?= lang('Errors.sorryCannotFind') ?>
<?php endif; ?>
</p>
</div>
</body>

View File

@@ -1,4 +1,9 @@
<?php $error_id = uniqid('error', true); ?>
<?php
use CodeIgniter\HTTP\Header;
use CodeIgniter\CodeIgniter;
$errorId = uniqid('error', true);
?>
<!doctype html>
<html>
<head>
@@ -6,11 +11,11 @@
<meta name="robots" content="noindex">
<title><?= esc($title) ?></title>
<style type="text/css">
<style>
<?= preg_replace('#[\r\n\t ]+#', ' ', file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'debug.css')) ?>
</style>
<script type="text/javascript">
<script>
<?= file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'debug.js') ?>
</script>
</head>
@@ -18,6 +23,12 @@
<!-- Header -->
<div class="header">
<div class="environment">
Displayed at <?= esc(date('H:i:s')) ?> &mdash;
PHP: <?= esc(PHP_VERSION) ?> &mdash;
CodeIgniter: <?= esc(CodeIgniter::CI_VERSION) ?> --
Environment: <?= ENVIRONMENT ?>
</div>
<div class="container">
<h1><?= esc($title), esc($exception->getCode() ? ' #' . $exception->getCode() : '') ?></h1>
<p>
@@ -39,6 +50,30 @@
<?php endif; ?>
</div>
<div class="container">
<?php
$last = $exception;
while ($prevException = $last->getPrevious()) {
$last = $prevException;
?>
<pre>
Caused by:
<?= esc($prevException::class), esc($prevException->getCode() ? ' #' . $prevException->getCode() : '') ?>
<?= nl2br(esc($prevException->getMessage())) ?>
<a href="https://www.duckduckgo.com/?q=<?= urlencode($prevException::class . ' ' . preg_replace('#\'.*\'|".*"#Us', '', $prevException->getMessage())) ?>"
rel="noreferrer" target="_blank">search &rarr;</a>
<?= esc(clean_path($prevException->getFile()) . ':' . $prevException->getLine()) ?>
</pre>
<?php
}
?>
</div>
<?php if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE) : ?>
<div class="container">
<ul class="tabs" id="tabs">
@@ -61,7 +96,7 @@
<li>
<p>
<!-- Trace info -->
<?php if (isset($row['file']) && is_file($row['file'])) :?>
<?php if (isset($row['file']) && is_file($row['file'])) : ?>
<?php
if (isset($row['function']) && in_array($row['function'], ['include', 'include_once', 'require', 'require_once'], true)) {
echo esc($row['function'] . ' ' . clean_path($row['file']));
@@ -77,16 +112,16 @@
<?php if (isset($row['class'])) : ?>
&nbsp;&nbsp;&mdash;&nbsp;&nbsp;<?= esc($row['class'] . $row['type'] . $row['function']) ?>
<?php if (! empty($row['args'])) : ?>
<?php $args_id = $error_id . 'args' . $index ?>
( <a href="#" onclick="return toggle('<?= esc($args_id, 'attr') ?>');">arguments</a> )
<div class="args" id="<?= esc($args_id, 'attr') ?>">
<?php $argsId = $errorId . 'args' . $index ?>
( <a href="#" onclick="return toggle('<?= esc($argsId, 'attr') ?>');">arguments</a> )
<div class="args" id="<?= esc($argsId, 'attr') ?>">
<table cellspacing="0">
<?php
$params = null;
// Reflection by name is not available for closure function
if (substr($row['function'], -1) !== '}') {
$mirror = isset($row['class']) ? new \ReflectionMethod($row['class'], $row['function']) : new \ReflectionFunction($row['function']);
if (! str_ends_with($row['function'], '}')) {
$mirror = isset($row['class']) ? new ReflectionMethod($row['class'], $row['function']) : new ReflectionFunction($row['function']);
$params = $mirror->getParameters();
}
@@ -189,7 +224,7 @@
<!-- Request -->
<div class="content" id="request">
<?php $request = \Config\Services::request(); ?>
<?php $request = service('request'); ?>
<table>
<tbody>
@@ -199,7 +234,7 @@
</tr>
<tr>
<td>HTTP Method</td>
<td><?= esc(strtoupper($request->getMethod())) ?></td>
<td><?= esc($request->getMethod()) ?></td>
</tr>
<tr>
<td>IP Address</td>
@@ -270,60 +305,11 @@
<?php endif; ?>
<?php $headers = $request->getHeaders(); ?>
<?php $headers = $request->headers(); ?>
<?php if (! empty($headers)) : ?>
<h3>Headers</h3>
<table>
<thead>
<tr>
<th>Header</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<?php foreach ($headers as $value) : ?>
<?php
if (empty($value)) {
continue;
}
if (! is_array($value)) {
$value = [$value];
} ?>
<?php foreach ($value as $h) : ?>
<tr>
<td><?= esc($h->getName(), 'html') ?></td>
<td><?= esc($h->getValueLine(), 'html') ?></td>
</tr>
<?php endforeach; ?>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>
<!-- Response -->
<?php
$response = \Config\Services::response();
$response->setStatusCode(http_response_code());
?>
<div class="content" id="response">
<table>
<tr>
<td style="width: 15em">Response Status</td>
<td><?= esc($response->getStatusCode() . ' - ' . $response->getReasonPhrase()) ?></td>
</tr>
</table>
<?php $headers = $response->getHeaders(); ?>
<?php if (! empty($headers)) : ?>
<?php natsort($headers) ?>
<h3>Headers</h3>
<table>
<thead>
<tr>
@@ -335,7 +321,64 @@
<?php foreach ($headers as $name => $value) : ?>
<tr>
<td><?= esc($name, 'html') ?></td>
<td><?= esc($response->getHeaderLine($name), 'html') ?></td>
<td>
<?php
if ($value instanceof Header) {
echo esc($value->getValueLine(), 'html');
} else {
foreach ($value as $i => $header) {
echo ' ('. $i+1 . ') ' . esc($header->getValueLine(), 'html');
}
}
?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>
<!-- Response -->
<?php
$response = service('response');
$response->setStatusCode(http_response_code());
?>
<div class="content" id="response">
<table>
<tr>
<td style="width: 15em">Response Status</td>
<td><?= esc($response->getStatusCode() . ' - ' . $response->getReasonPhrase()) ?></td>
</tr>
</table>
<?php $headers = $response->headers(); ?>
<?php if (! empty($headers)) : ?>
<h3>Headers</h3>
<table>
<thead>
<tr>
<th>Header</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<?php foreach ($headers as $name => $value) : ?>
<tr>
<td><?= esc($name, 'html') ?></td>
<td>
<?php
if ($value instanceof Header) {
echo esc($response->getHeaderLine($name), 'html');
} else {
foreach ($value as $i => $header) {
echo ' ('. $i+1 . ') ' . esc($header->getValueLine(), 'html');
}
}
?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
@@ -380,18 +423,7 @@
</div> <!-- /tab-content -->
</div> <!-- /container -->
<div class="footer">
<div class="container">
<p>
Displayed at <?= esc(date('H:i:sa')) ?> &mdash;
PHP: <?= esc(PHP_VERSION) ?> &mdash;
CodeIgniter: <?= esc(\CodeIgniter\CodeIgniter::CI_VERSION) ?>
</p>
</div>
</div>
<?php endif; ?>
</body>
</html>

View File

@@ -4,9 +4,9 @@
<meta charset="UTF-8">
<meta name="robots" content="noindex">
<title>Whoops!</title>
<title><?= lang('Errors.whoops') ?></title>
<style type="text/css">
<style>
<?= preg_replace('#[\r\n\t ]+#', ' ', file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'debug.css')) ?>
</style>
</head>
@@ -14,9 +14,9 @@
<div class="container text-center">
<h1 class="headline">Whoops!</h1>
<h1 class="headline"><?= lang('Errors.whoops') ?></h1>
<p class="lead">We seem to have hit a snag. Please try again later...</p>
<p class="lead"><?= lang('Errors.weHitASnag') ?></p>
</div>

View File

@@ -8,18 +8,14 @@
<meta name="description" content="Adminpage for Finanzen" />
<meta name="author" content="Wimpissinger Markus" />
<?= $this->renderSection('css_first') ?>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;600;700;800&display=swap" rel="stylesheet">
<link href="/assets/bootstrap-5.3.0-alpha1-dist/css/bootstrap.min.css" rel="stylesheet" />
<link href="/assets/fontawesome6.4.0/css/fontawesome.css" rel="stylesheet">
<link href="/assets/fontawesome6.4.0/css/solid.css" rel="stylesheet">
<link href="/assets/fontawesome6.4.0/css/brands.css" rel="stylesheet">
<link href="/assets/fontawesome6.4.0/css/regular.css" rel="stylesheet">
<!-- <link rel="stylesheet" href="/assets/vendors/perfect-scrollbar/perfect-scrollbar.css"> -->
<link href="/assets/bootstrap/css/bootstrap.css" rel="stylesheet" />
<link href="/assets/font-awesome/css/fontawesome.css" rel="stylesheet">
<link href="/assets/font-awesome/css/solid.css" rel="stylesheet">
<link href="/assets/font-awesome/css/brands.css" rel="stylesheet">
<link href="/assets/font-awesome/css/regular.css" rel="stylesheet">
<link rel="stylesheet" href="/assets/css/app.css">
<link href="/assets/DataTables/datatables.min.css" rel="stylesheet"/>
<!-- <script src="https://cdn.jsdelivr.net/npm/simple-datatables@latest" type="text/javascript"></script> -->
<?= $this->renderSection('css') ?>
<!-- <link rel="shortcut icon" href="/assets/images/favicon.svg" type="image/x-icon"> -->
</head>
<body>
@@ -34,31 +30,83 @@
</a>
</header>
<?= $this->renderSection('content') ?>
<div class="modal" id="mymodal" tabindex="-1">
<div class="modal fade" id="mymodal" tabindex="-1">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header d-none">
<h1 class="modal-title fs-5" id="modalTitle">Modal Title</h1>
</div>
<div class="modal-body">
<h5 class="modal-title"></h5>
<p>Wirklich löschen?</p>
<p>Modal body</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Abbruch</button>
<button type="button" id="modal_ok" class="btn btn-primary">Löschen</button>
<div class ="mx-auto">
<button type="button" id="modal_ok" data-bs-dismiss="modal" class="btn btn-primary">Ok</button>
</div>
</div>
</div>
</div>
</div>
<div class="modal" id="mymodalDelete" tabindex="-1">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title fs-5" id="modalDelTitle">Wirklich löschen?</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body d-none">
<p class="modal-text">Wirklich löschen?</p>
</div>
<div class="modal-footer">
<div class ="mx-auto">
<button type="button" id="modal_delete" class="btn btn-primary" data-bs-target="#mymodal" data-bs-toggle="modal">Löschen</button>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="mySnycModal" tabindex="-1" aria-labelledby="Snc Result Window" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="modalTitle">Modal title</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>Please Wait.</p>
</div>
<div class="modal-footer d-none">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="myChartModal" tabindex="-1" aria-labelledby="Chart Link Window" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="modalTitle">Modal title</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div id="modalChartBody" class="modal-body">
<p>Please Wait.</p>
</div>
<div class="modal-footer d-none">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- <script src="/assets/vendors/perfect-scrollbar/perfect-scrollbar.min.js"></script>
<script src="/assets/js/bootstrap.bundle.min.js"></script> -->
<script src="/assets/jquery-3.6.4.min.js" type="text/javascript"></script>
<script src="/assets/bootstrap-5.3.0-alpha1-dist/js/bootstrap.bundle.js" type="text/javascript"></script>
<script defer src="/assets/fontawesome6.4.0/js/solid.js"></script>
<script defer src="/assets/fontawesome6.4.0/js/brands.js"></script>
<script defer src="/assets/fontawesome6.4.0/js/regular.js"></script>
<script src="/assets/DataTables/datatables.min.js"></script>
<script src="/assets/js/main.js"></script>
<!-- <script src="/assets/vendors/perfect-scrollbar/perfect-scrollbar.min.js"></script> -->
<script src="/assets/bootstrap/js/bootstrap.bundle.js" type="text/javascript"></script>
<script src="/assets/fiduswriter/simple-datatables.js" type="text/javascript"></script>
<!-- <script defer src="/assets/fontawesome/js/solid.js"></script>
<script defer src="/assets/fontawesome/js/brands.js"></script>
<script defer src="/assets/fontawesome/js/regular.js"></script> -->
<script src="/js/menue.js"></script>
<script src="/assets/js/main.js"></script>
<?= $this->renderSection('scripts') ?>
</body>

View File

@@ -2,7 +2,6 @@
<?= $this->section('css'); ?>
<link rel="stylesheet" href="/css/mawim.css">
<link rel="stylesheet" href="/assets/jquery-ui-1.13.2.custom/jquery-ui.css">
<?= $this->endSection(); ?>
<?= $this->section('menu'); ?>
<?= $this->include('sidebar') ?>
@@ -15,7 +14,12 @@
<div class="col-md-8 col-12">
<div class="card">
<div class="card-header pb-0">
<h4 class="card-title">Neue Rechnung</h4>
<?php if ($booking['id']) : ?>
<h4 class="card-title"><?= ($booking['transfer']?'Transfer '.$booking['id'].' bearbeiten':($booking['scheduled']?'Terminbuchung '.$booking['id'].' bearbeiten':'Rechnung '.$booking['id'].' bearbeiten'))?></h4>
<?php else: ?>
<h4 class="card-title"><?= ($booking['transfer']?'Neuer Transfer':($booking['scheduled']?'Neue Terminbuchung':'Neue Rechnung'))?></h4>
<?php endif; ?>
<?php if (! empty($validation)) : ?>
<div class='alert alert-danger mt-2'>
<div class="errors" role="alert">
@@ -30,18 +34,25 @@
</div>
<div class="card-content">
<div class="card-body">
<form class="form form-vertical" id="newbill" method="post" action="<?= base_url() ?>/newBill">
<input type="hidden" value="<?= $id ?>" name="id">
<input type="hidden" value="<?= $transfer?'1':'0' ?>" name="transfer">
<?= view("bill_bookingline",['booking'=>$booking, 'template'=>true]); ?>
<form id="newbill" action="/edit" class="form form-vertical needs-validation" method="post" enctype="multipart/form-data" onsubmit="checkForm(event,this)" novalidate>
<!-- <form class="form form-vertical" id="newbill" method="post" enctype="multipart/form-data" onsubmit="logData(event)" action="<?= base_url() ?>newBill"> -->
<input type="hidden" value="<?= $booking['id'] ?>" name="id">
<input type="hidden" value="<?= $booking['amount']??0.0 ?>" name="amount">
<input type="hidden" value="<?= $booking['transfer']?'1':'0' ?>" name="transfer">
<input type="hidden" value="<?= ($booking['scheduled']??false)?'1':'0' ?>" name="scheduled">
<div class="form-body">
<div class="row">
<div class="col-12 <?= ($transfer?' d-none':'') ?>">
<div class="form-check form-switch">
<label class="form-check-label" for="multi">Multi Rechnung</label>
<input class="form-check-input" type="checkbox" id="multi" value="on" name="multi" <?= set_checkbox('multi', 'on', $multi??false) ?>>
</div>
<div class="col-12 <?= ($booking['transfer']?' d-none':(($booking['scheduled']??false)?' d-none':'')) ?>">
<label for="billfile">Rechnung:</label>
<input type="file" id="billfile" name="billfile" class="form-control <?= (!isset($booking['rechnung']))?'':'d-none' ?>" capture="environment" accept="image/*, application/pdf">
<?php if (isset($booking['rechnung'])): ?>
<a href="/viewInvoice/<?= $booking['rechnung'] ?>" id="billfileRef" target="_blank"> <?= $booking['rechnung'] ?></a>
<a class="" onclick="removeBillFile(this);"><i class="fa fa-trash"></i></a>
<?php endif; ?>
</div>
<div class="col-12 <?= ($transfer?' d-none':'') ?>">
<div class="col-12 <?= ($booking['transfer']?' d-none':'d-none') ?>">
<div class='form-check'>
<div class="checkbox">
<label for="renummer">Re-Nr.</label>
@@ -50,74 +61,65 @@
</div>
</div>
<div class="col-12">
<label for="datepicker">Datum</label>
<input type="text" class="form-control" id="datepicker" data-date-format="mm.dd.yyyy" name="datum" value="<?= $datum ?>"/>
<label for="datum">Datum</label>
<input type="date" class="form-control" id="datum" name="datum" value="<?= $booking['datum'] ?>" onclick="openBox(this);"/>
</div>
</div>
<div class="col-12 <?= ($transfer?' d-none':'') ?>">
<div class="col-12 <?= ($booking['transfer']?' d-none':'') ?>">
<div class="form-group">
<label for="receiver">Empfänger</label>
<input type="text" class="form-control" id="receiver" name="receiver" value="<?= $receiver ?>">
<input type="text" class="form-control" id="receiver" name="receiver" <?=(($booking['transfer'])?'':'required')?> value="<?= $booking['receiver'] ?>">
</div>
</div>
<div class="col-12">
<div class="form-group">
<label for="source">Konto:</label>
<?= form_dropdown('source', $sourcelist, $source,'id="source" class="form-select"'); ?>
<label for="sourceID">Konto:</label>
<select name="source_id" class="form-select" required id="sourceID" >
<option value="">----</option>
<?php foreach ($booking['sourcelist'] as $key => $value): ?>
<option value="<?= $key ?>" <?= ($key == $booking['source_id'])?'selected':'' ?>><?= $value ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="col-12 multi">
<div class="input-group">
<input type="text" class="form-control dt-amount" id="total_in" name="total_in" placeholder="Einnahme" maxlength=120 value="<?= $total_in ?>">
<input type="text" class="form-control dt-amount text-danger" id="total_out" name="total_out" placeholder="Ausgabe" maxlength=120 value="<?= $total_out ?>">
</div>
</div>
<div class="col-12 scheduled <?=($isScheduled?'':'d-none')?>">
<div class="form-group">
<label for="scheduledNum">Scheduled:</label>
<div class="input-group">
<input type="hidden" value="<?= $isScheduled?'1':'0' ?>" name="scheduled">
<?= form_dropdown("scheduledNum", $scheduled['NumList'], $scheduledNum,$scheduled['style']); ?>
<?= form_dropdown("scheduledType",$scheduled['TypeList'], $scheduledType,$scheduled['style']); ?>
</div>
<div class="input-group has-validation">
<input type="text" id="total_in" name="total_in" value="<?= $booking['total_in'] ?>"
class="form-control dt-amount input"
pattern="[0-9\*\(\)\-\+\/,.]*"
oninput="if (!this.checkValidity()) this.value = this.value.slice(0, -1)"
placeholder="Einnahme" maxlength=120 ">
<input type="text" id="total_out" name="total_out" value="<?= $booking['total_out'] ?>"
class="form-control dt-amount output text-danger"
pattern="[0-9\*\(\)\-\+\/,.]*"
oninput="if (!this.checkValidity()) this.value = this.value.slice(0, -1)"
placeholder="Ausgabe" maxlength=120>
</div>
</div>
<?php if ($booking['scheduled']??false)
echo view("bill_scheduled",['booking'=>$booking]);
?>
<div class="col-12 d-none multi">
<div class="form-group">
<label for="openamount">Offener Betrag:</label>
<input type="text" class="form-control dt-amount" readonly="readonly" id="openamount" name="openamount">
<div class="invalid-feedback"></div>
</div>
</div>
<div class="col-12" id="linecont">
<?php for ($i=0;$i<10;$i++): ?>
<div class="row <?= (($i<3 || $input[$i]>0 || $output[$i]>0)?'':' d-none')?>">
<input type="hidden" value="<?= $sid[$i] ?>" name="sid[<?=$i?>]">
<div class="col-lg-3 col-6 col-md-6 <?=(($i>0)?'multi':'')?> order-sm-2 px-0">
<?= form_dropdown("category_parent[$i]", $subsparent[$i], $category_parent[$i], 'class="form-select parent"'); ?>
</div>
<div class="col-lg-3 col-6 col-md-6 <?=(($i>0)?'multi':'')?> order-sm-2 px-0 sub">
<?= form_dropdown("category[$i]", $subscategory[$i], $category[$i], 'class="form-select"'); ?>
</div>
<div class="w-100 d-md-none"></div>
<div class="col-lg-2 col-6 <?=(($i>0)?'multi':'')?> <?= ($transfer?' d-none':'') ?> px-0 order-sm-2">
<input type="text" name="input[<?=$i?>]" class="form-control dt-subamount" placeholder="Einnahme" value="<?= $input[$i] ?>">
</div>
<div class="<?= ($transfer?'col-lg-4 col-12':'col-lg-2 col-6') ?> <?=(($i>0)?'multi':'')?> px-0 order-sm-2">
<input type="text" name="output[<?=$i?>]" class="form-control dt-subamount text-danger" placeholder="Ausgabe" value="<?= $output[$i] ?>">
</div>
<div class="col-lg-2 col-12 col-md-12 <?=(($i>0)?'multi':'')?> order-sm-1 px-0 mb-3 mb-md-0">
<input type="text" name="comment[<?=$i?>]" class="form-control" placeholder="Kommentar" value="<?= $comment[$i] ?>">
</div>
</div>
<?php endfor; ?>
<?php $i = 0; foreach ($booking['sid'] as $_sid) :
echo view("bill_bookingline",['booking'=>$booking, 'i'=>$i,'template'=>false]);
?>
<?php $i++; endforeach; ?>
</div>
<div class="col-12 d-flex" role="group">
<a class="btn btn-info multi" onclick="addLine();" role="button">+ Zeile</a>
<input type="checkbox" id="validate" name="validate" value="1" class='btn-check' autocomplete="off" <?= set_checkbox('validate', '1', (($validate??"f")=="t")?true:false) ?>>
<a id="multiadd" class="btn btn-info <?= ($booking['transfer']?' d-none':'') ?>" onclick="addLine();" role="button">+ Zeile</a>
<input type="checkbox" id="validate" name="validate" value="1" class='btn-check' autocomplete="off" <?= set_checkbox('validate', '1', ($booking['validate'])?true:false) ?>>
<label class="btn btn-outline-danger" for="validate">Entwurf</label>
<?php if ($booking['id']) : ?>
<a class="btn btn-danger" data-bs-toggle="modal" data-bs-table="<?= ($booking['scheduled']??false)?'scheduled':'bill'?>" data-bs-id="<?= $booking['id'] ?>" data-bs-target="#mymodalDelete"><i class="fa fa-trash"></i></a>
<?php endif; ?>
<button type="submit" class="btn btn-primary">Submit</button>
<a class="btn btn-secondary" onclick="history.back();" role="button">Zurück</a>
</div>
</div>
</div>
@@ -130,36 +132,10 @@
<?= $this->endSection(); ?>
<?= $this->section('scripts'); ?>
<script>
subsdata = <?= $subsdata; ?>;
function openBox(e) {
e.showPicker();
}
subsdata = <?= json_encode($booking['category']['subs']) ?>;
</script>
<script src="/assets/jquery-ui-1.13.2.custom/jquery-ui.js"></script>
<script src="/js/billing.js"></script>
<script>
$.datepicker.regional['de'] = {clearText: 'löschen', clearStatus: 'aktuelles Datum löschen',
closeText: 'schließen', closeStatus: 'ohne Änderungen schließen',
prevText: '<zurück', prevStatus: 'letzten Monat zeigen',
nextText: 'Vor>', nextStatus: 'nächsten Monat zeigen',
currentText: 'heute', currentStatus: '',
monthNames: ['Januar','Februar','März','April','Mai','Juni',
'Juli','August','September','Oktober','November','Dezember'],
monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun',
'Jul','Aug','Sep','Okt','Nov','Dez'],
monthStatus: 'anderen Monat anzeigen', yearStatus: 'anderes Jahr anzeigen',
weekHeader: 'Wo', weekStatus: 'Woche des Monats',
dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
dayStatus: 'Setze DD als ersten Wochentag', dateStatus: 'Wähle D, M d',
dateFormat: 'dd.mm.yy', firstDay: 1,
initStatus: 'Wähle ein Datum', isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['de']);
$('#datepicker').datepicker(
{
format: "dd.mm.yyyy",
language: 'de-DE',
weekStart: 1,
autoclose: true,
todayHighlight: false});
</script>
<?= $this->endSection(); ?>

View File

@@ -1,31 +1,29 @@
<?= $this->extend('layout'); ?>
<?= $this->section('css'); ?>
<link rel="stylesheet" href="/assets/jquery-ui-1.13.2.custom/jquery-ui.css">
<link rel="stylesheet" href="/css/mawim.css">
<?= $this->endSection(); ?>
<?= $this->section('menu'); ?>
<?= $this->include('sidebar') ?>
<?= $this->endSection(); ?>
<?= $this->section('content'); ?>
<?php session()->set('redirect_url',base_url(route_to('/show-passwords'))); ?>
<?php session()->set('redirect_url',base_url('viewScheduled')); ?>
<div class="page-content">
<div class="row">
<div class="col-xxl-8 col-12">
<div class="text-white-50"><h2>Terminbuchungen</h2></div>
<table class="table table-striped table-sm" id="scheduled" cellspacing="0"></table>
<table id="scheduled" cellspacing="0"></table>
</div>
<div class="col-xxl-4 col-12 d-none d-xxl-block">
<div class="text-white-50"><h2>Aktuelle Kontostände</h2></div>
<table class="table table-striped table-sm" id="accounts" cellspacing="0"></table>
<table id="accounts" cellspacing="0"></table>
</div>
</div>
</div>
<?= $this->endSection(); ?>
<?= $this->section('scripts'); ?>
<script src="/assets/jquery-ui-1.13.2.custom/jquery-ui.js"></script>
<script src="/js/tables.js"></script>
<script src="/js/tab_accounts.js"></script>
<script src="/js/scheduled.js"></script>
<script src="/js/tab_scheduled.js"></script>
<?= $this->endSection(); ?>

View File

@@ -2,7 +2,7 @@
<div class="sidebar-header">
<div class="d-flex justify-content-between">
<div class="logo">
<a href="index.php">Mein Geld</a>
<a href="/">Mein Geld</a>
</div>
<div class="toggler">
<a href="#" class="sidebar-hide d-xl-none d-block"><i class="fa-solid fa-xmark"></i></a>
@@ -30,13 +30,13 @@
</a>
</li>
<li class="sidebar-item active">
<a href="/syncScheduled" class='sidebar-link'>
<a class="sidebar-link" data-bs-toggle="modal" role="button" data-bs-target="#mySnycModal" onclick="syncScheduled(this)">
<i class="fa-solid fa-pen-to-square"></i>
<span>Sync Automatische</span>
</a>
</a>
</li>
<li class="sidebar-item active">
<a href="viewAccounts" class='sidebar-link'>
<a href="/viewAccounts" class='sidebar-link'>
<i class="fa-solid fa-pen-to-square"></i>
<span>Kategorien</span>
</a>
@@ -54,13 +54,17 @@
</a>
</li>
<li class="sidebar-item active">
<a href="http://mqtt.mawim.at:3000/d/6nnjNisVz/monatsuebersicht?orgId=1&from=1682671795200&to=1682693395200" class='sidebar-link' target="_blank">
<a href="/viewChart" class='sidebar-link'>
<i class="fa-solid fa-tachometer-alt"></i>
<span>Monatschart</span>
</a>
</li>
</ul>
<div class="ps-5">
<div class="small">Logged in as:</div>
<?= (auth()->user()?auth()->user()->username:"Gast")?>
</div>
</div>
<button class="sidebar-toggler btn x"><i data-feather="x"></i></button>
</div>

View File

@@ -1,4 +1,4 @@
<?= $this->extend('layout'); ?>
<?= $this->extend('layout'); ?>
<?= $this->section('css'); ?>
<link rel="stylesheet" href="/css/mawim.css">
@@ -15,21 +15,21 @@
<div class="col-xl-4 col-md-8 col-sm-12">
<div class="text-white-50"><h2>Aktuelle Buchungen</h2></div>
<div class="">
<table class="table table-striped table-sm" id="bookings" cellspacing="0">
<table id="bookings" cellspacing="0">
</table>
</div>
</div>
<div class="col-xl-4 col-md-8 col-sm-12">
<div class="text-white-50"><h2>Aktuelle Kontostände</h2></div>
<div class="">
<table class="table table-striped table-sm" id="accounts" cellspacing="0">
<table id="accounts" cellspacing="0">
</table>
</div>
</div>
<div class="col-xl-4 col-md-8 col-sm-12">
<div class="text-white-50"><h2>Überfällige</h2></div>
<div class="">
<table class="table table-striped table-sm" id="todos" cellspacing="0">
<table id="todos" cellspacing="0">
</table>
</div>
</div>
@@ -40,6 +40,7 @@
<?= $this->section('scripts'); ?>
<script src="/js/tables.js"></script>
<script src="/js/tab_accounts.js"></script>
<script src="/js/tabs_overview.js"></script>
<script src="/js/tab_todos.js"></script>
<script src="/js/tab_overview.js"></script>
<?= $this->endSection(); ?>

View File

@@ -0,0 +1 @@
<img src="<?=$filename?>" alt="Rechnung <?=$filename?>">

86
env
View File

@@ -20,19 +20,11 @@
# APP
#--------------------------------------------------------------------
#app.disableShield = false
# app.baseURL = ''
# If you have trouble with `.`, you could also use `_`.
# app_baseURL = ''
# app.forceGlobalSecureRequests = false
# app.sessionDriver = 'CodeIgniter\Session\Handlers\FileHandler'
# app.sessionCookieName = 'ci_session'
# app.sessionExpiration = 7200
# app.sessionSavePath = null
# app.sessionMatchIP = false
# app.sessionTimeToUpdate = 300
# app.sessionRegenerateDestroy = false
# app.CSPEnabled = false
#--------------------------------------------------------------------
@@ -47,94 +39,32 @@
# database.default.DBPrefix =
# database.default.port = 3306
# If you use MySQLi as tests, first update the values of Config\Database::$tests.
# database.tests.hostname = localhost
# database.tests.database = ci4
# database.tests.database = ci4_test
# database.tests.username = root
# database.tests.password = root
# database.tests.DBDriver = MySQLi
# database.tests.DBPrefix =
# database.tests.charset = utf8mb4
# database.tests.DBCollat = utf8mb4_general_ci
# database.tests.port = 3306
#--------------------------------------------------------------------
# CONTENT SECURITY POLICY
#--------------------------------------------------------------------
# contentsecuritypolicy.reportOnly = false
# contentsecuritypolicy.defaultSrc = 'none'
# contentsecuritypolicy.scriptSrc = 'self'
# contentsecuritypolicy.styleSrc = 'self'
# contentsecuritypolicy.imageSrc = 'self'
# contentsecuritypolicy.baseURI = null
# contentsecuritypolicy.childSrc = null
# contentsecuritypolicy.connectSrc = 'self'
# contentsecuritypolicy.fontSrc = null
# contentsecuritypolicy.formAction = null
# contentsecuritypolicy.frameAncestors = null
# contentsecuritypolicy.frameSrc = null
# contentsecuritypolicy.mediaSrc = null
# contentsecuritypolicy.objectSrc = null
# contentsecuritypolicy.pluginTypes = null
# contentsecuritypolicy.reportURI = null
# contentsecuritypolicy.sandbox = false
# contentsecuritypolicy.upgradeInsecureRequests = false
# contentsecuritypolicy.styleNonceTag = '{csp-style-nonce}'
# contentsecuritypolicy.scriptNonceTag = '{csp-script-nonce}'
# contentsecuritypolicy.autoNonce = true
#--------------------------------------------------------------------
# COOKIE
#--------------------------------------------------------------------
# cookie.prefix = ''
# cookie.expires = 0
# cookie.path = '/'
# cookie.domain = ''
# cookie.secure = false
# cookie.httponly = false
# cookie.samesite = 'Lax'
# cookie.raw = false
#--------------------------------------------------------------------
# ENCRYPTION
#--------------------------------------------------------------------
# encryption.key =
# encryption.driver = OpenSSL
# encryption.blockSize = 16
# encryption.digest = SHA512
#--------------------------------------------------------------------
# HONEYPOT
# SESSION
#--------------------------------------------------------------------
# honeypot.hidden = 'true'
# honeypot.label = 'Fill This Field'
# honeypot.name = 'honeypot'
# honeypot.template = '<label>{label}</label><input type="text" name="{name}" value=""/>'
# honeypot.container = '<div style="display:none">{template}</div>'
#--------------------------------------------------------------------
# SECURITY
#--------------------------------------------------------------------
# security.csrfProtection = 'cookie'
# security.tokenRandomize = false
# security.tokenName = 'csrf_token_name'
# security.headerName = 'X-CSRF-TOKEN'
# security.cookieName = 'csrf_cookie_name'
# security.expires = 7200
# security.regenerate = true
# security.redirect = true
# security.samesite = 'Lax'
# session.driver = 'CodeIgniter\Session\Handlers\FileHandler'
# session.savePath = null
#--------------------------------------------------------------------
# LOGGER
#--------------------------------------------------------------------
# logger.threshold = 4
#--------------------------------------------------------------------
# CURLRequest
#--------------------------------------------------------------------
# curlrequest.shareOptions = true

View File

@@ -1,57 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="vendor/codeigniter4/framework/system/Test/bootstrap.php"
backupGlobals="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage includeUncoveredFiles="true" processUncoveredFiles="true">
<include>
<directory suffix=".php">./app</directory>
</include>
<exclude>
<directory suffix=".php">./app/Views</directory>
<file>./app/Config/Routes.php</file>
</exclude>
<report>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="build/logs/html"/>
<php outputFile="build/logs/coverage.serialized"/>
<text outputFile="php://stdout" showUncoveredFiles="false"/>
</report>
</coverage>
<testsuites>
<testsuite name="App">
<directory>./tests</directory>
</testsuite>
</testsuites>
<logging>
<testdoxHtml outputFile="build/logs/testdox.html"/>
<testdoxText outputFile="build/logs/testdox.txt"/>
<junit outputFile="build/logs/logfile.xml"/>
</logging>
<php>
<server name="app.baseURL" value="http://example.com/"/>
<!-- Directory containing phpunit.xml -->
<const name="HOMEPATH" value="./"/>
<!-- Directory containing the Paths config file -->
<const name="CONFIGPATH" value="./app/Config/"/>
<!-- Directory containing the front controller (index.php) -->
<const name="PUBLICPATH" value="./public/"/>
<!-- Database configuration -->
<!-- Uncomment to provide your own database for testing
<env name="database.tests.hostname" value="localhost"/>
<env name="database.tests.database" value="tests"/>
<env name="database.tests.username" value="tests_user"/>
<env name="database.tests.password" value=""/>
<env name="database.tests.DBDriver" value="MySQLi"/>
<env name="database.tests.DBPrefix" value="tests_"/>
-->
</php>
</phpunit>

View File

@@ -9,6 +9,9 @@
* the LICENSE file that was distributed with this source code.
*/
use CodeIgniter\Boot;
use Config\Paths;
/*
*---------------------------------------------------------------
* Sample file for Preloading
@@ -16,7 +19,8 @@
* See https://www.php.net/manual/en/opcache.preloading.php
*
* How to Use:
* 1. Set preload::$paths.
* 0. Copy this file to your project root folder.
* 1. Set the $paths property of the preload class below.
* 2. Set opcache.preload in php.ini.
* php.ini:
* opcache.preload=/path/to/preload.php
@@ -28,19 +32,6 @@ require __DIR__ . '/app/Config/Paths.php';
// Path to the front controller
define('FCPATH', __DIR__ . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR);
/**
* See https://www.php.net/manual/en/function.str-contains.php#126277
*/
if (! function_exists('str_contains')) {
/**
* Polyfill of str_contains()
*/
function str_contains(string $haystack, string $needle): bool
{
return empty($needle) || strpos($haystack, $needle) !== false;
}
}
class preload
{
/**
@@ -48,23 +39,28 @@ class preload
*/
private array $paths = [
[
'include' => __DIR__ . '/vendor/codeigniter4/framework/system',
'include' => __DIR__ . '/vendor/codeigniter4/framework/system', // Change this path if using manual installation
'exclude' => [
// Not needed if you don't use them.
'/system/Database/OCI8/',
'/system/Database/Postgre/',
'/system/Database/SQLite3/',
'/system/Database/SQLSRV/',
// Not needed.
// Not needed for web apps.
'/system/Database/Seeder.php',
'/system/Test/',
'/system/Language/',
'/system/CLI/',
'/system/Commands/',
'/system/Publisher/',
'/system/ComposerScripts.php',
// Not Class/Function files.
'/system/Config/Routes.php',
'/system/Language/',
'/system/bootstrap.php',
'/system/util_bootstrap.php',
'/system/rewrite.php',
'/Views/',
// Errors occur.
'/system/Config/Routes.php',
'/system/ThirdParty/',
],
],
@@ -75,16 +71,18 @@ class preload
$this->loadAutoloader();
}
private function loadAutoloader()
private function loadAutoloader(): void
{
$paths = new Config\Paths();
require rtrim($paths->systemDirectory, '\\/ ') . DIRECTORY_SEPARATOR . 'bootstrap.php';
$paths = new Paths();
require rtrim($paths->systemDirectory, '\\/ ') . DIRECTORY_SEPARATOR . 'Boot.php';
Boot::preload($paths);
}
/**
* Load PHP files.
*/
public function load()
public function load(): void
{
foreach ($this->paths as $path) {
$directory = new RecursiveDirectoryIterator($path['include']);
@@ -92,7 +90,7 @@ class preload
$phpFiles = new RegexIterator(
$fullTree,
'/.+((?<!Test)+\.php$)/i',
RecursiveRegexIterator::GET_MATCH
RecursiveRegexIterator::GET_MATCH,
);
foreach ($phpFiles as $key => $file) {
@@ -103,7 +101,9 @@ class preload
}
require_once $file[0];
echo 'Loaded: ' . $file[0] . "\n";
// Uncomment only for debugging (to inspect which files are included).
// Never use this in production - preload scripts must not generate output.
// echo 'Loaded: ' . $file[0] . "\n";
}
}
}

View File

@@ -1,5 +1,5 @@
# Disable directory browsing
Options All -Indexes
Options -Indexes
# ----------------------------------------------------------------------
# Rewrite engine
@@ -45,5 +45,5 @@ Options All -Indexes
</IfModule>
# Disable server signature start
ServerSignature Off
ServerSignature Off
# Disable server signature end

View File

@@ -1,416 +0,0 @@
@charset "UTF-8";
:root {
--dt-row-selected: 0, 136, 204;
--dt-row-selected-text: 255, 255, 255;
--dt-row-selected-link: 9, 10, 11;
}
table.dataTable td.dt-control {
text-align: center;
cursor: pointer;
}
table.dataTable td.dt-control:before {
height: 1em;
width: 1em;
margin-top: -9px;
display: inline-block;
color: white;
border: 0.15em solid white;
border-radius: 1em;
box-shadow: 0 0 0.2em #444;
box-sizing: content-box;
text-align: center;
text-indent: 0 !important;
font-family: "Courier New", Courier, monospace;
line-height: 1em;
content: "+";
background-color: #31b131;
}
table.dataTable tr.dt-hasChild td.dt-control:before {
content: "-";
background-color: #d33333;
}
table.dataTable thead > tr > th.sorting, table.dataTable thead > tr > th.sorting_asc, table.dataTable thead > tr > th.sorting_desc, table.dataTable thead > tr > th.sorting_asc_disabled, table.dataTable thead > tr > th.sorting_desc_disabled,
table.dataTable thead > tr > td.sorting,
table.dataTable thead > tr > td.sorting_asc,
table.dataTable thead > tr > td.sorting_desc,
table.dataTable thead > tr > td.sorting_asc_disabled,
table.dataTable thead > tr > td.sorting_desc_disabled {
cursor: pointer;
position: relative;
padding-right: 26px;
}
table.dataTable thead > tr > th.sorting:before, table.dataTable thead > tr > th.sorting:after, table.dataTable thead > tr > th.sorting_asc:before, table.dataTable thead > tr > th.sorting_asc:after, table.dataTable thead > tr > th.sorting_desc:before, table.dataTable thead > tr > th.sorting_desc:after, table.dataTable thead > tr > th.sorting_asc_disabled:before, table.dataTable thead > tr > th.sorting_asc_disabled:after, table.dataTable thead > tr > th.sorting_desc_disabled:before, table.dataTable thead > tr > th.sorting_desc_disabled:after,
table.dataTable thead > tr > td.sorting:before,
table.dataTable thead > tr > td.sorting:after,
table.dataTable thead > tr > td.sorting_asc:before,
table.dataTable thead > tr > td.sorting_asc:after,
table.dataTable thead > tr > td.sorting_desc:before,
table.dataTable thead > tr > td.sorting_desc:after,
table.dataTable thead > tr > td.sorting_asc_disabled:before,
table.dataTable thead > tr > td.sorting_asc_disabled:after,
table.dataTable thead > tr > td.sorting_desc_disabled:before,
table.dataTable thead > tr > td.sorting_desc_disabled:after {
position: absolute;
display: block;
opacity: 0.125;
right: 10px;
line-height: 9px;
font-size: 0.8em;
}
table.dataTable thead > tr > th.sorting:before, table.dataTable thead > tr > th.sorting_asc:before, table.dataTable thead > tr > th.sorting_desc:before, table.dataTable thead > tr > th.sorting_asc_disabled:before, table.dataTable thead > tr > th.sorting_desc_disabled:before,
table.dataTable thead > tr > td.sorting:before,
table.dataTable thead > tr > td.sorting_asc:before,
table.dataTable thead > tr > td.sorting_desc:before,
table.dataTable thead > tr > td.sorting_asc_disabled:before,
table.dataTable thead > tr > td.sorting_desc_disabled:before {
bottom: 50%;
content: "▲";
content: "▲"/"";
}
table.dataTable thead > tr > th.sorting:after, table.dataTable thead > tr > th.sorting_asc:after, table.dataTable thead > tr > th.sorting_desc:after, table.dataTable thead > tr > th.sorting_asc_disabled:after, table.dataTable thead > tr > th.sorting_desc_disabled:after,
table.dataTable thead > tr > td.sorting:after,
table.dataTable thead > tr > td.sorting_asc:after,
table.dataTable thead > tr > td.sorting_desc:after,
table.dataTable thead > tr > td.sorting_asc_disabled:after,
table.dataTable thead > tr > td.sorting_desc_disabled:after {
top: 50%;
content: "▼";
content: "▼"/"";
}
table.dataTable thead > tr > th.sorting_asc:before, table.dataTable thead > tr > th.sorting_desc:after,
table.dataTable thead > tr > td.sorting_asc:before,
table.dataTable thead > tr > td.sorting_desc:after {
opacity: 0.6;
}
table.dataTable thead > tr > th.sorting_desc_disabled:after, table.dataTable thead > tr > th.sorting_asc_disabled:before,
table.dataTable thead > tr > td.sorting_desc_disabled:after,
table.dataTable thead > tr > td.sorting_asc_disabled:before {
display: none;
}
table.dataTable thead > tr > th:active,
table.dataTable thead > tr > td:active {
outline: none;
}
div.dataTables_scrollBody > table.dataTable > thead > tr > th:before, div.dataTables_scrollBody > table.dataTable > thead > tr > th:after,
div.dataTables_scrollBody > table.dataTable > thead > tr > td:before,
div.dataTables_scrollBody > table.dataTable > thead > tr > td:after {
display: none;
}
div.dataTables_processing {
position: absolute;
top: 50%;
left: 50%;
width: 200px;
margin-left: -100px;
margin-top: -26px;
text-align: center;
padding: 2px;
}
div.dataTables_processing > div:last-child {
position: relative;
width: 80px;
height: 15px;
margin: 1em auto;
}
div.dataTables_processing > div:last-child > div {
position: absolute;
top: 0;
width: 13px;
height: 13px;
border-radius: 50%;
background: rgb(0, 136, 204);
background: rgb(var(--dt-row-selected));
animation-timing-function: cubic-bezier(0, 1, 1, 0);
}
div.dataTables_processing > div:last-child > div:nth-child(1) {
left: 8px;
animation: datatables-loader-1 0.6s infinite;
}
div.dataTables_processing > div:last-child > div:nth-child(2) {
left: 8px;
animation: datatables-loader-2 0.6s infinite;
}
div.dataTables_processing > div:last-child > div:nth-child(3) {
left: 32px;
animation: datatables-loader-2 0.6s infinite;
}
div.dataTables_processing > div:last-child > div:nth-child(4) {
left: 56px;
animation: datatables-loader-3 0.6s infinite;
}
@keyframes datatables-loader-1 {
0% {
transform: scale(0);
}
100% {
transform: scale(1);
}
}
@keyframes datatables-loader-3 {
0% {
transform: scale(1);
}
100% {
transform: scale(0);
}
}
@keyframes datatables-loader-2 {
0% {
transform: translate(0, 0);
}
100% {
transform: translate(24px, 0);
}
}
table.dataTable.nowrap th, table.dataTable.nowrap td {
white-space: nowrap;
}
table.dataTable th.dt-left,
table.dataTable td.dt-left {
text-align: left;
}
table.dataTable th.dt-center,
table.dataTable td.dt-center,
table.dataTable td.dataTables_empty {
text-align: center;
}
table.dataTable th.dt-right,
table.dataTable td.dt-right {
text-align: right;
}
table.dataTable th.dt-justify,
table.dataTable td.dt-justify {
text-align: justify;
}
table.dataTable th.dt-nowrap,
table.dataTable td.dt-nowrap {
white-space: nowrap;
}
table.dataTable thead th,
table.dataTable thead td,
table.dataTable tfoot th,
table.dataTable tfoot td {
text-align: left;
}
table.dataTable thead th.dt-head-left,
table.dataTable thead td.dt-head-left,
table.dataTable tfoot th.dt-head-left,
table.dataTable tfoot td.dt-head-left {
text-align: left;
}
table.dataTable thead th.dt-head-center,
table.dataTable thead td.dt-head-center,
table.dataTable tfoot th.dt-head-center,
table.dataTable tfoot td.dt-head-center {
text-align: center;
}
table.dataTable thead th.dt-head-right,
table.dataTable thead td.dt-head-right,
table.dataTable tfoot th.dt-head-right,
table.dataTable tfoot td.dt-head-right {
text-align: right;
}
table.dataTable thead th.dt-head-justify,
table.dataTable thead td.dt-head-justify,
table.dataTable tfoot th.dt-head-justify,
table.dataTable tfoot td.dt-head-justify {
text-align: justify;
}
table.dataTable thead th.dt-head-nowrap,
table.dataTable thead td.dt-head-nowrap,
table.dataTable tfoot th.dt-head-nowrap,
table.dataTable tfoot td.dt-head-nowrap {
white-space: nowrap;
}
table.dataTable tbody th.dt-body-left,
table.dataTable tbody td.dt-body-left {
text-align: left;
}
table.dataTable tbody th.dt-body-center,
table.dataTable tbody td.dt-body-center {
text-align: center;
}
table.dataTable tbody th.dt-body-right,
table.dataTable tbody td.dt-body-right {
text-align: right;
}
table.dataTable tbody th.dt-body-justify,
table.dataTable tbody td.dt-body-justify {
text-align: justify;
}
table.dataTable tbody th.dt-body-nowrap,
table.dataTable tbody td.dt-body-nowrap {
white-space: nowrap;
}
table.dataTable {
clear: both;
margin-top: 6px !important;
margin-bottom: 6px !important;
max-width: none !important;
border-collapse: separate !important;
}
table.dataTable td,
table.dataTable th {
-webkit-box-sizing: content-box;
box-sizing: content-box;
}
table.dataTable td.dataTables_empty,
table.dataTable th.dataTables_empty {
text-align: center;
}
table.dataTable.nowrap th,
table.dataTable.nowrap td {
white-space: nowrap;
}
table.dataTable.table-striped > tbody > tr:nth-of-type(2n+1) {
background-color: transparent;
}
table.dataTable > tbody > tr {
background-color: transparent;
}
table.dataTable > tbody > tr.selected > * {
box-shadow: inset 0 0 0 9999px rgb(0, 136, 204);
box-shadow: inset 0 0 0 9999px rgb(var(--dt-row-selected));
color: rgb(255, 255, 255);
color: rgb(var(--dt-row-selected-text));
}
table.dataTable > tbody > tr.selected a {
color: rgb(9, 10, 11);
color: rgb(var(--dt-row-selected-link));
}
table.dataTable.table-striped > tbody > tr.odd > * {
box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.023);
}
table.dataTable.table-striped > tbody > tr.odd.selected > * {
box-shadow: inset 0 0 0 9999px rgba(0, 136, 204, 0.923);
box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-selected), 0.923);
}
table.dataTable.table-hover > tbody > tr:hover > * {
box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.075);
}
table.dataTable.table-hover > tbody > tr.selected:hover > * {
box-shadow: inset 0 0 0 9999px rgba(0, 136, 204, 0.975);
box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-selected), 0.975);
}
div.dataTables_wrapper div.dataTables_length label {
font-weight: normal;
text-align: left;
white-space: nowrap;
}
div.dataTables_wrapper div.dataTables_length select {
width: 75px;
display: inline-block;
}
div.dataTables_wrapper div.dataTables_filter {
text-align: right;
}
div.dataTables_wrapper div.dataTables_filter label {
font-weight: normal;
white-space: nowrap;
text-align: left;
}
div.dataTables_wrapper div.dataTables_filter input {
margin-left: 0.5em;
display: inline-block;
width: auto;
}
div.dataTables_wrapper div.dataTables_info {
padding-top: 8px;
white-space: nowrap;
}
div.dataTables_wrapper div.dataTables_paginate {
margin: 0;
white-space: nowrap;
text-align: right;
}
div.dataTables_wrapper div.dataTables_paginate ul.pagination {
margin: 2px 0;
white-space: nowrap;
}
div.dataTables_wrapper div.dataTables_processing {
position: absolute;
top: 50%;
left: 50%;
width: 200px;
margin-left: -100px;
margin-top: -26px;
text-align: center;
padding: 1em 0;
}
div.dataTables_scrollHead table.dataTable {
margin-bottom: 0 !important;
}
div.dataTables_scrollBody > table {
border-top: none;
margin-top: 0 !important;
margin-bottom: 0 !important;
}
div.dataTables_scrollBody > table > thead .sorting:after,
div.dataTables_scrollBody > table > thead .sorting_asc:after,
div.dataTables_scrollBody > table > thead .sorting_desc:after {
display: none;
}
div.dataTables_scrollBody > table > tbody > tr:first-child > th,
div.dataTables_scrollBody > table > tbody > tr:first-child > td {
border-top: none;
}
div.dataTables_scrollFoot > .dataTables_scrollFootInner {
box-sizing: content-box;
}
div.dataTables_scrollFoot > .dataTables_scrollFootInner > table {
margin-top: 0 !important;
border-top: none;
}
@media screen and (max-width: 767px) {
div.dataTables_wrapper div.dataTables_length,
div.dataTables_wrapper div.dataTables_filter,
div.dataTables_wrapper div.dataTables_info,
div.dataTables_wrapper div.dataTables_paginate {
text-align: center;
}
}
table.dataTable.table-condensed > thead > tr > th {
padding-right: 20px;
}
table.table-bordered.dataTable {
border-right-width: 0;
}
table.table-bordered.dataTable th,
table.table-bordered.dataTable td {
border-left-width: 0;
}
table.table-bordered.dataTable th:last-child, table.table-bordered.dataTable th:last-child,
table.table-bordered.dataTable td:last-child,
table.table-bordered.dataTable td:last-child {
border-right-width: 1px;
}
table.table-bordered.dataTable tbody th,
table.table-bordered.dataTable tbody td {
border-bottom-width: 0;
}
div.dataTables_scrollHead table.table-bordered {
border-bottom-width: 0;
}
div.table-responsive > div.dataTables_wrapper > div.row {
margin: 0;
}
div.table-responsive > div.dataTables_wrapper > div.row > div[class^=col-]:first-child {
padding-left: 0;
}
div.table-responsive > div.dataTables_wrapper > div.row > div[class^=col-]:last-child {
padding-right: 0;
}

File diff suppressed because one or more lines are too long

View File

@@ -1,423 +0,0 @@
@charset "UTF-8";
:root {
--dt-row-selected: 2, 117, 216;
--dt-row-selected-text: 255, 255, 255;
--dt-row-selected-link: 9, 10, 11;
}
table.dataTable td.dt-control {
text-align: center;
cursor: pointer;
}
table.dataTable td.dt-control:before {
height: 1em;
width: 1em;
margin-top: -9px;
display: inline-block;
color: white;
border: 0.15em solid white;
border-radius: 1em;
box-shadow: 0 0 0.2em #444;
box-sizing: content-box;
text-align: center;
text-indent: 0 !important;
font-family: "Courier New", Courier, monospace;
line-height: 1em;
content: "+";
background-color: #31b131;
}
table.dataTable tr.dt-hasChild td.dt-control:before {
content: "-";
background-color: #d33333;
}
table.dataTable thead > tr > th.sorting, table.dataTable thead > tr > th.sorting_asc, table.dataTable thead > tr > th.sorting_desc, table.dataTable thead > tr > th.sorting_asc_disabled, table.dataTable thead > tr > th.sorting_desc_disabled,
table.dataTable thead > tr > td.sorting,
table.dataTable thead > tr > td.sorting_asc,
table.dataTable thead > tr > td.sorting_desc,
table.dataTable thead > tr > td.sorting_asc_disabled,
table.dataTable thead > tr > td.sorting_desc_disabled {
cursor: pointer;
position: relative;
padding-right: 26px;
}
table.dataTable thead > tr > th.sorting:before, table.dataTable thead > tr > th.sorting:after, table.dataTable thead > tr > th.sorting_asc:before, table.dataTable thead > tr > th.sorting_asc:after, table.dataTable thead > tr > th.sorting_desc:before, table.dataTable thead > tr > th.sorting_desc:after, table.dataTable thead > tr > th.sorting_asc_disabled:before, table.dataTable thead > tr > th.sorting_asc_disabled:after, table.dataTable thead > tr > th.sorting_desc_disabled:before, table.dataTable thead > tr > th.sorting_desc_disabled:after,
table.dataTable thead > tr > td.sorting:before,
table.dataTable thead > tr > td.sorting:after,
table.dataTable thead > tr > td.sorting_asc:before,
table.dataTable thead > tr > td.sorting_asc:after,
table.dataTable thead > tr > td.sorting_desc:before,
table.dataTable thead > tr > td.sorting_desc:after,
table.dataTable thead > tr > td.sorting_asc_disabled:before,
table.dataTable thead > tr > td.sorting_asc_disabled:after,
table.dataTable thead > tr > td.sorting_desc_disabled:before,
table.dataTable thead > tr > td.sorting_desc_disabled:after {
position: absolute;
display: block;
opacity: 0.125;
right: 10px;
line-height: 9px;
font-size: 0.8em;
}
table.dataTable thead > tr > th.sorting:before, table.dataTable thead > tr > th.sorting_asc:before, table.dataTable thead > tr > th.sorting_desc:before, table.dataTable thead > tr > th.sorting_asc_disabled:before, table.dataTable thead > tr > th.sorting_desc_disabled:before,
table.dataTable thead > tr > td.sorting:before,
table.dataTable thead > tr > td.sorting_asc:before,
table.dataTable thead > tr > td.sorting_desc:before,
table.dataTable thead > tr > td.sorting_asc_disabled:before,
table.dataTable thead > tr > td.sorting_desc_disabled:before {
bottom: 50%;
content: "▲";
content: "▲"/"";
}
table.dataTable thead > tr > th.sorting:after, table.dataTable thead > tr > th.sorting_asc:after, table.dataTable thead > tr > th.sorting_desc:after, table.dataTable thead > tr > th.sorting_asc_disabled:after, table.dataTable thead > tr > th.sorting_desc_disabled:after,
table.dataTable thead > tr > td.sorting:after,
table.dataTable thead > tr > td.sorting_asc:after,
table.dataTable thead > tr > td.sorting_desc:after,
table.dataTable thead > tr > td.sorting_asc_disabled:after,
table.dataTable thead > tr > td.sorting_desc_disabled:after {
top: 50%;
content: "▼";
content: "▼"/"";
}
table.dataTable thead > tr > th.sorting_asc:before, table.dataTable thead > tr > th.sorting_desc:after,
table.dataTable thead > tr > td.sorting_asc:before,
table.dataTable thead > tr > td.sorting_desc:after {
opacity: 0.6;
}
table.dataTable thead > tr > th.sorting_desc_disabled:after, table.dataTable thead > tr > th.sorting_asc_disabled:before,
table.dataTable thead > tr > td.sorting_desc_disabled:after,
table.dataTable thead > tr > td.sorting_asc_disabled:before {
display: none;
}
table.dataTable thead > tr > th:active,
table.dataTable thead > tr > td:active {
outline: none;
}
div.dataTables_scrollBody > table.dataTable > thead > tr > th:before, div.dataTables_scrollBody > table.dataTable > thead > tr > th:after,
div.dataTables_scrollBody > table.dataTable > thead > tr > td:before,
div.dataTables_scrollBody > table.dataTable > thead > tr > td:after {
display: none;
}
div.dataTables_processing {
position: absolute;
top: 50%;
left: 50%;
width: 200px;
margin-left: -100px;
margin-top: -26px;
text-align: center;
padding: 2px;
}
div.dataTables_processing > div:last-child {
position: relative;
width: 80px;
height: 15px;
margin: 1em auto;
}
div.dataTables_processing > div:last-child > div {
position: absolute;
top: 0;
width: 13px;
height: 13px;
border-radius: 50%;
background: rgb(2, 117, 216);
background: rgb(var(--dt-row-selected));
animation-timing-function: cubic-bezier(0, 1, 1, 0);
}
div.dataTables_processing > div:last-child > div:nth-child(1) {
left: 8px;
animation: datatables-loader-1 0.6s infinite;
}
div.dataTables_processing > div:last-child > div:nth-child(2) {
left: 8px;
animation: datatables-loader-2 0.6s infinite;
}
div.dataTables_processing > div:last-child > div:nth-child(3) {
left: 32px;
animation: datatables-loader-2 0.6s infinite;
}
div.dataTables_processing > div:last-child > div:nth-child(4) {
left: 56px;
animation: datatables-loader-3 0.6s infinite;
}
@keyframes datatables-loader-1 {
0% {
transform: scale(0);
}
100% {
transform: scale(1);
}
}
@keyframes datatables-loader-3 {
0% {
transform: scale(1);
}
100% {
transform: scale(0);
}
}
@keyframes datatables-loader-2 {
0% {
transform: translate(0, 0);
}
100% {
transform: translate(24px, 0);
}
}
table.dataTable.nowrap th, table.dataTable.nowrap td {
white-space: nowrap;
}
table.dataTable th.dt-left,
table.dataTable td.dt-left {
text-align: left;
}
table.dataTable th.dt-center,
table.dataTable td.dt-center,
table.dataTable td.dataTables_empty {
text-align: center;
}
table.dataTable th.dt-right,
table.dataTable td.dt-right {
text-align: right;
}
table.dataTable th.dt-justify,
table.dataTable td.dt-justify {
text-align: justify;
}
table.dataTable th.dt-nowrap,
table.dataTable td.dt-nowrap {
white-space: nowrap;
}
table.dataTable thead th,
table.dataTable thead td,
table.dataTable tfoot th,
table.dataTable tfoot td {
text-align: left;
}
table.dataTable thead th.dt-head-left,
table.dataTable thead td.dt-head-left,
table.dataTable tfoot th.dt-head-left,
table.dataTable tfoot td.dt-head-left {
text-align: left;
}
table.dataTable thead th.dt-head-center,
table.dataTable thead td.dt-head-center,
table.dataTable tfoot th.dt-head-center,
table.dataTable tfoot td.dt-head-center {
text-align: center;
}
table.dataTable thead th.dt-head-right,
table.dataTable thead td.dt-head-right,
table.dataTable tfoot th.dt-head-right,
table.dataTable tfoot td.dt-head-right {
text-align: right;
}
table.dataTable thead th.dt-head-justify,
table.dataTable thead td.dt-head-justify,
table.dataTable tfoot th.dt-head-justify,
table.dataTable tfoot td.dt-head-justify {
text-align: justify;
}
table.dataTable thead th.dt-head-nowrap,
table.dataTable thead td.dt-head-nowrap,
table.dataTable tfoot th.dt-head-nowrap,
table.dataTable tfoot td.dt-head-nowrap {
white-space: nowrap;
}
table.dataTable tbody th.dt-body-left,
table.dataTable tbody td.dt-body-left {
text-align: left;
}
table.dataTable tbody th.dt-body-center,
table.dataTable tbody td.dt-body-center {
text-align: center;
}
table.dataTable tbody th.dt-body-right,
table.dataTable tbody td.dt-body-right {
text-align: right;
}
table.dataTable tbody th.dt-body-justify,
table.dataTable tbody td.dt-body-justify {
text-align: justify;
}
table.dataTable tbody th.dt-body-nowrap,
table.dataTable tbody td.dt-body-nowrap {
white-space: nowrap;
}
table.dataTable {
clear: both;
margin-top: 6px !important;
margin-bottom: 6px !important;
max-width: none !important;
border-collapse: separate !important;
border-spacing: 0;
}
table.dataTable td,
table.dataTable th {
-webkit-box-sizing: content-box;
box-sizing: content-box;
}
table.dataTable td.dataTables_empty,
table.dataTable th.dataTables_empty {
text-align: center;
}
table.dataTable.nowrap th,
table.dataTable.nowrap td {
white-space: nowrap;
}
table.dataTable.table-striped > tbody > tr:nth-of-type(2n+1) {
background-color: transparent;
}
table.dataTable > tbody > tr {
background-color: transparent;
}
table.dataTable > tbody > tr.selected > * {
box-shadow: inset 0 0 0 9999px rgb(2, 117, 216);
box-shadow: inset 0 0 0 9999px rgb(var(--dt-row-selected));
color: rgb(255, 255, 255);
color: rgb(var(--dt-row-selected-text));
}
table.dataTable > tbody > tr.selected a {
color: rgb(9, 10, 11);
color: rgb(var(--dt-row-selected-link));
}
table.dataTable.table-striped > tbody > tr.odd > * {
box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.05);
}
table.dataTable.table-striped > tbody > tr.odd.selected > * {
box-shadow: inset 0 0 0 9999px rgba(2, 117, 216, 0.95);
box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-selected), 0.95);
}
table.dataTable.table-hover > tbody > tr:hover > * {
box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.075);
}
table.dataTable.table-hover > tbody > tr.selected:hover > * {
box-shadow: inset 0 0 0 9999px rgba(2, 117, 216, 0.975);
box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-selected), 0.975);
}
div.dataTables_wrapper div.dataTables_length label {
font-weight: normal;
text-align: left;
white-space: nowrap;
}
div.dataTables_wrapper div.dataTables_length select {
width: auto;
display: inline-block;
}
div.dataTables_wrapper div.dataTables_filter {
text-align: right;
}
div.dataTables_wrapper div.dataTables_filter label {
font-weight: normal;
white-space: nowrap;
text-align: left;
}
div.dataTables_wrapper div.dataTables_filter input {
margin-left: 0.5em;
display: inline-block;
width: auto;
}
div.dataTables_wrapper div.dataTables_info {
padding-top: 0.85em;
}
div.dataTables_wrapper div.dataTables_paginate {
margin: 0;
white-space: nowrap;
text-align: right;
}
div.dataTables_wrapper div.dataTables_paginate ul.pagination {
margin: 2px 0;
white-space: nowrap;
justify-content: flex-end;
}
div.dataTables_wrapper div.dataTables_processing {
position: absolute;
top: 50%;
left: 50%;
width: 200px;
margin-left: -100px;
margin-top: -26px;
text-align: center;
padding: 1em 0;
}
div.dataTables_scrollHead table.dataTable {
margin-bottom: 0 !important;
}
div.dataTables_scrollBody > table {
border-top: none;
margin-top: 0 !important;
margin-bottom: 0 !important;
}
div.dataTables_scrollBody > table > thead .sorting:before,
div.dataTables_scrollBody > table > thead .sorting_asc:before,
div.dataTables_scrollBody > table > thead .sorting_desc:before,
div.dataTables_scrollBody > table > thead .sorting:after,
div.dataTables_scrollBody > table > thead .sorting_asc:after,
div.dataTables_scrollBody > table > thead .sorting_desc:after {
display: none;
}
div.dataTables_scrollBody > table > tbody tr:first-child th,
div.dataTables_scrollBody > table > tbody tr:first-child td {
border-top: none;
}
div.dataTables_scrollFoot > .dataTables_scrollFootInner {
box-sizing: content-box;
}
div.dataTables_scrollFoot > .dataTables_scrollFootInner > table {
margin-top: 0 !important;
border-top: none;
}
@media screen and (max-width: 767px) {
div.dataTables_wrapper div.dataTables_length,
div.dataTables_wrapper div.dataTables_filter,
div.dataTables_wrapper div.dataTables_info,
div.dataTables_wrapper div.dataTables_paginate {
text-align: center;
}
div.dataTables_wrapper div.dataTables_paginate ul.pagination {
justify-content: center !important;
}
}
table.dataTable.table-sm > thead > tr > th:not(.sorting_disabled) {
padding-right: 20px;
}
table.table-bordered.dataTable {
border-right-width: 0;
}
table.table-bordered.dataTable th,
table.table-bordered.dataTable td {
border-left-width: 0;
}
table.table-bordered.dataTable th:last-child, table.table-bordered.dataTable th:last-child,
table.table-bordered.dataTable td:last-child,
table.table-bordered.dataTable td:last-child {
border-right-width: 1px;
}
table.table-bordered.dataTable tbody th,
table.table-bordered.dataTable tbody td {
border-bottom-width: 0;
}
div.dataTables_scrollHead table.table-bordered {
border-bottom-width: 0;
}
div.table-responsive > div.dataTables_wrapper > div.row {
margin: 0;
}
div.table-responsive > div.dataTables_wrapper > div.row > div[class^=col-]:first-child {
padding-left: 0;
}
div.table-responsive > div.dataTables_wrapper > div.row > div[class^=col-]:last-child {
padding-right: 0;
}

File diff suppressed because one or more lines are too long

View File

@@ -1,430 +0,0 @@
@charset "UTF-8";
:root {
--dt-row-selected: 13, 110, 253;
--dt-row-selected-text: 255, 255, 255;
--dt-row-selected-link: 9, 10, 11;
}
table.dataTable td.dt-control {
text-align: center;
cursor: pointer;
}
table.dataTable td.dt-control:before {
height: 1em;
width: 1em;
margin-top: -9px;
display: inline-block;
color: white;
border: 0.15em solid white;
border-radius: 1em;
box-shadow: 0 0 0.2em #444;
box-sizing: content-box;
text-align: center;
text-indent: 0 !important;
font-family: "Courier New", Courier, monospace;
line-height: 1em;
content: "+";
background-color: #31b131;
}
table.dataTable tr.dt-hasChild td.dt-control:before {
content: "-";
background-color: #d33333;
}
table.dataTable thead > tr > th.sorting, table.dataTable thead > tr > th.sorting_asc, table.dataTable thead > tr > th.sorting_desc, table.dataTable thead > tr > th.sorting_asc_disabled, table.dataTable thead > tr > th.sorting_desc_disabled,
table.dataTable thead > tr > td.sorting,
table.dataTable thead > tr > td.sorting_asc,
table.dataTable thead > tr > td.sorting_desc,
table.dataTable thead > tr > td.sorting_asc_disabled,
table.dataTable thead > tr > td.sorting_desc_disabled {
cursor: pointer;
position: relative;
padding-right: 26px;
}
table.dataTable thead > tr > th.sorting:before, table.dataTable thead > tr > th.sorting:after, table.dataTable thead > tr > th.sorting_asc:before, table.dataTable thead > tr > th.sorting_asc:after, table.dataTable thead > tr > th.sorting_desc:before, table.dataTable thead > tr > th.sorting_desc:after, table.dataTable thead > tr > th.sorting_asc_disabled:before, table.dataTable thead > tr > th.sorting_asc_disabled:after, table.dataTable thead > tr > th.sorting_desc_disabled:before, table.dataTable thead > tr > th.sorting_desc_disabled:after,
table.dataTable thead > tr > td.sorting:before,
table.dataTable thead > tr > td.sorting:after,
table.dataTable thead > tr > td.sorting_asc:before,
table.dataTable thead > tr > td.sorting_asc:after,
table.dataTable thead > tr > td.sorting_desc:before,
table.dataTable thead > tr > td.sorting_desc:after,
table.dataTable thead > tr > td.sorting_asc_disabled:before,
table.dataTable thead > tr > td.sorting_asc_disabled:after,
table.dataTable thead > tr > td.sorting_desc_disabled:before,
table.dataTable thead > tr > td.sorting_desc_disabled:after {
position: absolute;
display: block;
opacity: 0.125;
right: 10px;
line-height: 9px;
font-size: 0.8em;
}
table.dataTable thead > tr > th.sorting:before, table.dataTable thead > tr > th.sorting_asc:before, table.dataTable thead > tr > th.sorting_desc:before, table.dataTable thead > tr > th.sorting_asc_disabled:before, table.dataTable thead > tr > th.sorting_desc_disabled:before,
table.dataTable thead > tr > td.sorting:before,
table.dataTable thead > tr > td.sorting_asc:before,
table.dataTable thead > tr > td.sorting_desc:before,
table.dataTable thead > tr > td.sorting_asc_disabled:before,
table.dataTable thead > tr > td.sorting_desc_disabled:before {
bottom: 50%;
content: "▲";
content: "▲"/"";
}
table.dataTable thead > tr > th.sorting:after, table.dataTable thead > tr > th.sorting_asc:after, table.dataTable thead > tr > th.sorting_desc:after, table.dataTable thead > tr > th.sorting_asc_disabled:after, table.dataTable thead > tr > th.sorting_desc_disabled:after,
table.dataTable thead > tr > td.sorting:after,
table.dataTable thead > tr > td.sorting_asc:after,
table.dataTable thead > tr > td.sorting_desc:after,
table.dataTable thead > tr > td.sorting_asc_disabled:after,
table.dataTable thead > tr > td.sorting_desc_disabled:after {
top: 50%;
content: "▼";
content: "▼"/"";
}
table.dataTable thead > tr > th.sorting_asc:before, table.dataTable thead > tr > th.sorting_desc:after,
table.dataTable thead > tr > td.sorting_asc:before,
table.dataTable thead > tr > td.sorting_desc:after {
opacity: 0.6;
}
table.dataTable thead > tr > th.sorting_desc_disabled:after, table.dataTable thead > tr > th.sorting_asc_disabled:before,
table.dataTable thead > tr > td.sorting_desc_disabled:after,
table.dataTable thead > tr > td.sorting_asc_disabled:before {
display: none;
}
table.dataTable thead > tr > th:active,
table.dataTable thead > tr > td:active {
outline: none;
}
div.dataTables_scrollBody > table.dataTable > thead > tr > th:before, div.dataTables_scrollBody > table.dataTable > thead > tr > th:after,
div.dataTables_scrollBody > table.dataTable > thead > tr > td:before,
div.dataTables_scrollBody > table.dataTable > thead > tr > td:after {
display: none;
}
div.dataTables_processing {
position: absolute;
top: 50%;
left: 50%;
width: 200px;
margin-left: -100px;
margin-top: -26px;
text-align: center;
padding: 2px;
}
div.dataTables_processing > div:last-child {
position: relative;
width: 80px;
height: 15px;
margin: 1em auto;
}
div.dataTables_processing > div:last-child > div {
position: absolute;
top: 0;
width: 13px;
height: 13px;
border-radius: 50%;
background: rgb(13, 110, 253);
background: rgb(var(--dt-row-selected));
animation-timing-function: cubic-bezier(0, 1, 1, 0);
}
div.dataTables_processing > div:last-child > div:nth-child(1) {
left: 8px;
animation: datatables-loader-1 0.6s infinite;
}
div.dataTables_processing > div:last-child > div:nth-child(2) {
left: 8px;
animation: datatables-loader-2 0.6s infinite;
}
div.dataTables_processing > div:last-child > div:nth-child(3) {
left: 32px;
animation: datatables-loader-2 0.6s infinite;
}
div.dataTables_processing > div:last-child > div:nth-child(4) {
left: 56px;
animation: datatables-loader-3 0.6s infinite;
}
@keyframes datatables-loader-1 {
0% {
transform: scale(0);
}
100% {
transform: scale(1);
}
}
@keyframes datatables-loader-3 {
0% {
transform: scale(1);
}
100% {
transform: scale(0);
}
}
@keyframes datatables-loader-2 {
0% {
transform: translate(0, 0);
}
100% {
transform: translate(24px, 0);
}
}
table.dataTable.nowrap th, table.dataTable.nowrap td {
white-space: nowrap;
}
table.dataTable th.dt-left,
table.dataTable td.dt-left {
text-align: left;
}
table.dataTable th.dt-center,
table.dataTable td.dt-center,
table.dataTable td.dataTables_empty {
text-align: center;
}
table.dataTable th.dt-right,
table.dataTable td.dt-right {
text-align: right;
}
table.dataTable th.dt-justify,
table.dataTable td.dt-justify {
text-align: justify;
}
table.dataTable th.dt-nowrap,
table.dataTable td.dt-nowrap {
white-space: nowrap;
}
table.dataTable thead th,
table.dataTable thead td,
table.dataTable tfoot th,
table.dataTable tfoot td {
text-align: left;
}
table.dataTable thead th.dt-head-left,
table.dataTable thead td.dt-head-left,
table.dataTable tfoot th.dt-head-left,
table.dataTable tfoot td.dt-head-left {
text-align: left;
}
table.dataTable thead th.dt-head-center,
table.dataTable thead td.dt-head-center,
table.dataTable tfoot th.dt-head-center,
table.dataTable tfoot td.dt-head-center {
text-align: center;
}
table.dataTable thead th.dt-head-right,
table.dataTable thead td.dt-head-right,
table.dataTable tfoot th.dt-head-right,
table.dataTable tfoot td.dt-head-right {
text-align: right;
}
table.dataTable thead th.dt-head-justify,
table.dataTable thead td.dt-head-justify,
table.dataTable tfoot th.dt-head-justify,
table.dataTable tfoot td.dt-head-justify {
text-align: justify;
}
table.dataTable thead th.dt-head-nowrap,
table.dataTable thead td.dt-head-nowrap,
table.dataTable tfoot th.dt-head-nowrap,
table.dataTable tfoot td.dt-head-nowrap {
white-space: nowrap;
}
table.dataTable tbody th.dt-body-left,
table.dataTable tbody td.dt-body-left {
text-align: left;
}
table.dataTable tbody th.dt-body-center,
table.dataTable tbody td.dt-body-center {
text-align: center;
}
table.dataTable tbody th.dt-body-right,
table.dataTable tbody td.dt-body-right {
text-align: right;
}
table.dataTable tbody th.dt-body-justify,
table.dataTable tbody td.dt-body-justify {
text-align: justify;
}
table.dataTable tbody th.dt-body-nowrap,
table.dataTable tbody td.dt-body-nowrap {
white-space: nowrap;
}
/*! Bootstrap 5 integration for DataTables
*
* ©2020 SpryMedia Ltd, all rights reserved.
* License: MIT datatables.net/license/mit
*/
table.dataTable {
clear: both;
margin-top: 6px !important;
margin-bottom: 6px !important;
max-width: none !important;
border-collapse: separate !important;
border-spacing: 0;
}
table.dataTable td,
table.dataTable th {
-webkit-box-sizing: content-box;
box-sizing: content-box;
}
table.dataTable td.dataTables_empty,
table.dataTable th.dataTables_empty {
text-align: center;
}
table.dataTable.nowrap th,
table.dataTable.nowrap td {
white-space: nowrap;
}
table.dataTable.table-striped > tbody > tr:nth-of-type(2n+1) > * {
box-shadow: none;
}
table.dataTable > tbody > tr {
background-color: transparent;
}
table.dataTable > tbody > tr.selected > * {
box-shadow: inset 0 0 0 9999px rgb(13, 110, 253);
box-shadow: inset 0 0 0 9999px rgb(var(--dt-row-selected));
color: rgb(255, 255, 255);
color: rgb(var(--dt-row-selected-text));
}
table.dataTable > tbody > tr.selected a {
color: rgb(9, 10, 11);
color: rgb(var(--dt-row-selected-link));
}
table.dataTable.table-striped > tbody > tr.odd > * {
box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.05);
}
table.dataTable.table-striped > tbody > tr.odd.selected > * {
box-shadow: inset 0 0 0 9999px rgba(13, 110, 253, 0.95);
box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-selected), 0.95);
}
table.dataTable.table-hover > tbody > tr:hover > * {
box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.075);
}
table.dataTable.table-hover > tbody > tr.selected:hover > * {
box-shadow: inset 0 0 0 9999px rgba(13, 110, 253, 0.975);
box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-selected), 0.975);
}
div.dataTables_wrapper div.dataTables_length label {
font-weight: normal;
text-align: left;
white-space: nowrap;
}
div.dataTables_wrapper div.dataTables_length select {
width: auto;
display: inline-block;
}
div.dataTables_wrapper div.dataTables_filter {
text-align: right;
}
div.dataTables_wrapper div.dataTables_filter label {
font-weight: normal;
white-space: nowrap;
text-align: left;
}
div.dataTables_wrapper div.dataTables_filter input {
margin-left: 0.5em;
display: inline-block;
width: auto;
}
div.dataTables_wrapper div.dataTables_info {
padding-top: 0.85em;
}
div.dataTables_wrapper div.dataTables_paginate {
margin: 0;
white-space: nowrap;
text-align: right;
}
div.dataTables_wrapper div.dataTables_paginate ul.pagination {
margin: 2px 0;
white-space: nowrap;
justify-content: flex-end;
}
div.dataTables_wrapper div.dt-row {
position: relative;
}
div.dataTables_scrollHead table.dataTable {
margin-bottom: 0 !important;
}
div.dataTables_scrollBody > table {
border-top: none;
margin-top: 0 !important;
margin-bottom: 0 !important;
}
div.dataTables_scrollBody > table > thead .sorting:before,
div.dataTables_scrollBody > table > thead .sorting_asc:before,
div.dataTables_scrollBody > table > thead .sorting_desc:before,
div.dataTables_scrollBody > table > thead .sorting:after,
div.dataTables_scrollBody > table > thead .sorting_asc:after,
div.dataTables_scrollBody > table > thead .sorting_desc:after {
display: none;
}
div.dataTables_scrollBody > table > tbody tr:first-child th,
div.dataTables_scrollBody > table > tbody tr:first-child td {
border-top: none;
}
div.dataTables_scrollFoot > .dataTables_scrollFootInner {
box-sizing: content-box;
}
div.dataTables_scrollFoot > .dataTables_scrollFootInner > table {
margin-top: 0 !important;
border-top: none;
}
@media screen and (max-width: 767px) {
div.dataTables_wrapper div.dataTables_length,
div.dataTables_wrapper div.dataTables_filter,
div.dataTables_wrapper div.dataTables_info,
div.dataTables_wrapper div.dataTables_paginate {
text-align: center;
}
div.dataTables_wrapper div.dataTables_paginate ul.pagination {
justify-content: center !important;
}
}
table.dataTable.table-sm > thead > tr > th:not(.sorting_disabled) {
padding-right: 20px;
}
table.table-bordered.dataTable {
border-right-width: 0;
}
table.table-bordered.dataTable thead tr:first-child th,
table.table-bordered.dataTable thead tr:first-child td {
border-top-width: 1px;
}
table.table-bordered.dataTable th,
table.table-bordered.dataTable td {
border-left-width: 0;
}
table.table-bordered.dataTable th:first-child, table.table-bordered.dataTable th:first-child,
table.table-bordered.dataTable td:first-child,
table.table-bordered.dataTable td:first-child {
border-left-width: 1px;
}
table.table-bordered.dataTable th:last-child, table.table-bordered.dataTable th:last-child,
table.table-bordered.dataTable td:last-child,
table.table-bordered.dataTable td:last-child {
border-right-width: 1px;
}
table.table-bordered.dataTable th,
table.table-bordered.dataTable td {
border-bottom-width: 1px;
}
div.dataTables_scrollHead table.table-bordered {
border-bottom-width: 0;
}
div.table-responsive > div.dataTables_wrapper > div.row {
margin: 0;
}
div.table-responsive > div.dataTables_wrapper > div.row > div[class^=col-]:first-child {
padding-left: 0;
}
div.table-responsive > div.dataTables_wrapper > div.row > div[class^=col-]:last-child {
padding-right: 0;
}

File diff suppressed because one or more lines are too long

View File

@@ -1,379 +0,0 @@
@charset "UTF-8";
:root {
--dt-row-selected: 0, 209, 178;
--dt-row-selected-text: 255, 255, 255;
--dt-row-selected-link: 9, 10, 11;
}
table.dataTable td.dt-control {
text-align: center;
cursor: pointer;
}
table.dataTable td.dt-control:before {
height: 1em;
width: 1em;
margin-top: -9px;
display: inline-block;
color: white;
border: 0.15em solid white;
border-radius: 1em;
box-shadow: 0 0 0.2em #444;
box-sizing: content-box;
text-align: center;
text-indent: 0 !important;
font-family: "Courier New", Courier, monospace;
line-height: 1em;
content: "+";
background-color: #31b131;
}
table.dataTable tr.dt-hasChild td.dt-control:before {
content: "-";
background-color: #d33333;
}
table.dataTable thead > tr > th.sorting, table.dataTable thead > tr > th.sorting_asc, table.dataTable thead > tr > th.sorting_desc, table.dataTable thead > tr > th.sorting_asc_disabled, table.dataTable thead > tr > th.sorting_desc_disabled,
table.dataTable thead > tr > td.sorting,
table.dataTable thead > tr > td.sorting_asc,
table.dataTable thead > tr > td.sorting_desc,
table.dataTable thead > tr > td.sorting_asc_disabled,
table.dataTable thead > tr > td.sorting_desc_disabled {
cursor: pointer;
position: relative;
padding-right: 26px;
}
table.dataTable thead > tr > th.sorting:before, table.dataTable thead > tr > th.sorting:after, table.dataTable thead > tr > th.sorting_asc:before, table.dataTable thead > tr > th.sorting_asc:after, table.dataTable thead > tr > th.sorting_desc:before, table.dataTable thead > tr > th.sorting_desc:after, table.dataTable thead > tr > th.sorting_asc_disabled:before, table.dataTable thead > tr > th.sorting_asc_disabled:after, table.dataTable thead > tr > th.sorting_desc_disabled:before, table.dataTable thead > tr > th.sorting_desc_disabled:after,
table.dataTable thead > tr > td.sorting:before,
table.dataTable thead > tr > td.sorting:after,
table.dataTable thead > tr > td.sorting_asc:before,
table.dataTable thead > tr > td.sorting_asc:after,
table.dataTable thead > tr > td.sorting_desc:before,
table.dataTable thead > tr > td.sorting_desc:after,
table.dataTable thead > tr > td.sorting_asc_disabled:before,
table.dataTable thead > tr > td.sorting_asc_disabled:after,
table.dataTable thead > tr > td.sorting_desc_disabled:before,
table.dataTable thead > tr > td.sorting_desc_disabled:after {
position: absolute;
display: block;
opacity: 0.125;
right: 10px;
line-height: 9px;
font-size: 0.8em;
}
table.dataTable thead > tr > th.sorting:before, table.dataTable thead > tr > th.sorting_asc:before, table.dataTable thead > tr > th.sorting_desc:before, table.dataTable thead > tr > th.sorting_asc_disabled:before, table.dataTable thead > tr > th.sorting_desc_disabled:before,
table.dataTable thead > tr > td.sorting:before,
table.dataTable thead > tr > td.sorting_asc:before,
table.dataTable thead > tr > td.sorting_desc:before,
table.dataTable thead > tr > td.sorting_asc_disabled:before,
table.dataTable thead > tr > td.sorting_desc_disabled:before {
bottom: 50%;
content: "▲";
content: "▲"/"";
}
table.dataTable thead > tr > th.sorting:after, table.dataTable thead > tr > th.sorting_asc:after, table.dataTable thead > tr > th.sorting_desc:after, table.dataTable thead > tr > th.sorting_asc_disabled:after, table.dataTable thead > tr > th.sorting_desc_disabled:after,
table.dataTable thead > tr > td.sorting:after,
table.dataTable thead > tr > td.sorting_asc:after,
table.dataTable thead > tr > td.sorting_desc:after,
table.dataTable thead > tr > td.sorting_asc_disabled:after,
table.dataTable thead > tr > td.sorting_desc_disabled:after {
top: 50%;
content: "▼";
content: "▼"/"";
}
table.dataTable thead > tr > th.sorting_asc:before, table.dataTable thead > tr > th.sorting_desc:after,
table.dataTable thead > tr > td.sorting_asc:before,
table.dataTable thead > tr > td.sorting_desc:after {
opacity: 0.6;
}
table.dataTable thead > tr > th.sorting_desc_disabled:after, table.dataTable thead > tr > th.sorting_asc_disabled:before,
table.dataTable thead > tr > td.sorting_desc_disabled:after,
table.dataTable thead > tr > td.sorting_asc_disabled:before {
display: none;
}
table.dataTable thead > tr > th:active,
table.dataTable thead > tr > td:active {
outline: none;
}
div.dataTables_scrollBody > table.dataTable > thead > tr > th:before, div.dataTables_scrollBody > table.dataTable > thead > tr > th:after,
div.dataTables_scrollBody > table.dataTable > thead > tr > td:before,
div.dataTables_scrollBody > table.dataTable > thead > tr > td:after {
display: none;
}
div.dataTables_processing {
position: absolute;
top: 50%;
left: 50%;
width: 200px;
margin-left: -100px;
margin-top: -26px;
text-align: center;
padding: 2px;
}
div.dataTables_processing > div:last-child {
position: relative;
width: 80px;
height: 15px;
margin: 1em auto;
}
div.dataTables_processing > div:last-child > div {
position: absolute;
top: 0;
width: 13px;
height: 13px;
border-radius: 50%;
background: rgb(0, 209, 178);
background: rgb(var(--dt-row-selected));
animation-timing-function: cubic-bezier(0, 1, 1, 0);
}
div.dataTables_processing > div:last-child > div:nth-child(1) {
left: 8px;
animation: datatables-loader-1 0.6s infinite;
}
div.dataTables_processing > div:last-child > div:nth-child(2) {
left: 8px;
animation: datatables-loader-2 0.6s infinite;
}
div.dataTables_processing > div:last-child > div:nth-child(3) {
left: 32px;
animation: datatables-loader-2 0.6s infinite;
}
div.dataTables_processing > div:last-child > div:nth-child(4) {
left: 56px;
animation: datatables-loader-3 0.6s infinite;
}
@keyframes datatables-loader-1 {
0% {
transform: scale(0);
}
100% {
transform: scale(1);
}
}
@keyframes datatables-loader-3 {
0% {
transform: scale(1);
}
100% {
transform: scale(0);
}
}
@keyframes datatables-loader-2 {
0% {
transform: translate(0, 0);
}
100% {
transform: translate(24px, 0);
}
}
table.dataTable.nowrap th, table.dataTable.nowrap td {
white-space: nowrap;
}
table.dataTable th.dt-left,
table.dataTable td.dt-left {
text-align: left;
}
table.dataTable th.dt-center,
table.dataTable td.dt-center,
table.dataTable td.dataTables_empty {
text-align: center;
}
table.dataTable th.dt-right,
table.dataTable td.dt-right {
text-align: right;
}
table.dataTable th.dt-justify,
table.dataTable td.dt-justify {
text-align: justify;
}
table.dataTable th.dt-nowrap,
table.dataTable td.dt-nowrap {
white-space: nowrap;
}
table.dataTable thead th,
table.dataTable thead td,
table.dataTable tfoot th,
table.dataTable tfoot td {
text-align: left;
}
table.dataTable thead th.dt-head-left,
table.dataTable thead td.dt-head-left,
table.dataTable tfoot th.dt-head-left,
table.dataTable tfoot td.dt-head-left {
text-align: left;
}
table.dataTable thead th.dt-head-center,
table.dataTable thead td.dt-head-center,
table.dataTable tfoot th.dt-head-center,
table.dataTable tfoot td.dt-head-center {
text-align: center;
}
table.dataTable thead th.dt-head-right,
table.dataTable thead td.dt-head-right,
table.dataTable tfoot th.dt-head-right,
table.dataTable tfoot td.dt-head-right {
text-align: right;
}
table.dataTable thead th.dt-head-justify,
table.dataTable thead td.dt-head-justify,
table.dataTable tfoot th.dt-head-justify,
table.dataTable tfoot td.dt-head-justify {
text-align: justify;
}
table.dataTable thead th.dt-head-nowrap,
table.dataTable thead td.dt-head-nowrap,
table.dataTable tfoot th.dt-head-nowrap,
table.dataTable tfoot td.dt-head-nowrap {
white-space: nowrap;
}
table.dataTable tbody th.dt-body-left,
table.dataTable tbody td.dt-body-left {
text-align: left;
}
table.dataTable tbody th.dt-body-center,
table.dataTable tbody td.dt-body-center {
text-align: center;
}
table.dataTable tbody th.dt-body-right,
table.dataTable tbody td.dt-body-right {
text-align: right;
}
table.dataTable tbody th.dt-body-justify,
table.dataTable tbody td.dt-body-justify {
text-align: justify;
}
table.dataTable tbody th.dt-body-nowrap,
table.dataTable tbody td.dt-body-nowrap {
white-space: nowrap;
}
/*! DataTables Bulma integration
* ©2020 SpryMedia Ltd - datatables.net/license
*/
table.dataTable {
clear: both;
margin-top: 6px !important;
margin-bottom: 6px !important;
max-width: none !important;
border-collapse: separate !important;
border-spacing: 0;
}
table.dataTable td,
table.dataTable th {
-webkit-box-sizing: content-box;
box-sizing: content-box;
}
table.dataTable td.dataTables_empty,
table.dataTable th.dataTables_empty {
text-align: center;
}
table.dataTable.nowrap th,
table.dataTable.nowrap td {
white-space: nowrap;
}
table.dataTable.table.is-striped > tbody > tr:nth-child(2n) {
background-color: transparent;
}
table.dataTable > tbody > tr {
background-color: transparent;
}
table.dataTable > tbody > tr.selected > * {
box-shadow: inset 0 0 0 9999px rgb(0, 209, 178);
box-shadow: inset 0 0 0 9999px rgb(var(--dt-row-selected));
color: rgb(255, 255, 255);
color: rgb(var(--dt-row-selected-text));
}
table.dataTable > tbody > tr.selected a {
color: rgb(9, 10, 11);
color: rgb(var(--dt-row-selected-link));
}
table.dataTable.is-striped > tbody > tr.odd > * {
box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.019);
}
table.dataTable.is-striped > tbody > tr.odd.selected > * {
box-shadow: inset 0 0 0 9999px rgba(0, 209, 178, 0.919);
box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-selected), 0.919);
}
table.dataTable.is-hoverable > tbody > tr:hover > * {
box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.39);
}
table.dataTable.is-hoverable > tbody > tr.selected:hover > * {
box-shadow: inset 0 0 0 9999px #00d1b2;
box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-selected), 1.29);
}
div.dataTables_wrapper div.dataTables_length label {
font-weight: normal;
text-align: left;
white-space: nowrap;
}
div.dataTables_wrapper div.dataTables_length div {
vertical-align: middle;
}
div.dataTables_wrapper div.dataTables_length select {
width: auto;
display: inline-block;
vertical-align: middle;
}
div.dataTables_wrapper div.dataTables_filter {
text-align: right;
}
div.dataTables_wrapper div.dataTables_filter label {
font-weight: normal;
white-space: nowrap;
text-align: left;
}
div.dataTables_wrapper div.dataTables_filter input {
margin-left: 0.5em;
width: auto;
vertical-align: middle;
}
div.dataTables_wrapper div.dataTables_info {
padding-top: 0.5em;
}
div.dataTables_wrapper div.dataTables_paginate ul {
justify-content: flex-end;
list-style: none;
margin: 0;
}
div.dataTables_wrapper div.dataTables_processing {
position: absolute;
top: 50%;
left: 50%;
width: 200px;
margin-left: -100px;
margin-top: -26px;
text-align: center;
padding: 1em 0;
}
div.dataTables_scrollHead table.dataTable {
margin-bottom: 0 !important;
}
div.dataTables_scrollBody table {
border-top: none;
margin-top: 0 !important;
margin-bottom: 0 !important;
}
div.dataTables_scrollBody table thead .sorting:before,
div.dataTables_scrollBody table thead .sorting_asc:before,
div.dataTables_scrollBody table thead .sorting_desc:before,
div.dataTables_scrollBody table thead .sorting:after,
div.dataTables_scrollBody table thead .sorting_asc:after,
div.dataTables_scrollBody table thead .sorting_desc:after {
display: none;
}
div.dataTables_scrollBody table tbody tr:first-child th,
div.dataTables_scrollBody table tbody tr:first-child td {
border-top: none;
}
div.dataTables_scrollFoot > .dataTables_scrollFootInner {
box-sizing: content-box;
}
div.dataTables_scrollFoot > .dataTables_scrollFootInner > table {
margin-top: 0 !important;
border-top: none;
}

Some files were not shown because too many files have changed in this diff Show More