Initial commit
This commit is contained in:
21
.editorconfig
Normal file
21
.editorconfig
Normal file
@@ -0,0 +1,21 @@
|
||||
; This file is for unifying the coding style for different editors and IDEs.
|
||||
; More information at http://editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.bat]
|
||||
end_of_line = crlf
|
||||
|
||||
[*.yml]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.twig]
|
||||
insert_final_newline = false
|
||||
46
.gitattributes
vendored
Normal file
46
.gitattributes
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
# Define the line ending behavior of the different file extensions
|
||||
# Set default behaviour, in case users don't have core.autocrlf set.
|
||||
* text=auto
|
||||
* text eol=lf
|
||||
|
||||
# Explicitly declare text files we want to always be normalized and converted
|
||||
# to native line endings on checkout.
|
||||
*.php text
|
||||
*.default text
|
||||
*.ctp text
|
||||
*.sql text
|
||||
*.md text
|
||||
*.po text
|
||||
*.js text
|
||||
*.css text
|
||||
*.ini text
|
||||
*.properties text
|
||||
*.txt text
|
||||
*.xml text
|
||||
*.svg text
|
||||
*.yml text
|
||||
.htaccess text
|
||||
|
||||
# Declare files that will always have CRLF line endings on checkout.
|
||||
*.bat eol=crlf
|
||||
|
||||
# Declare files that will always have LF line endings on checkout.
|
||||
*.pem eol=lf
|
||||
|
||||
# Denote all files that are truly binary and should not be modified.
|
||||
*.png binary
|
||||
*.jpg binary
|
||||
*.gif binary
|
||||
*.ico binary
|
||||
*.mo binary
|
||||
*.pdf binary
|
||||
*.phar binary
|
||||
*.woff binary
|
||||
*.woff2 binary
|
||||
*.ttf binary
|
||||
*.otf binary
|
||||
*.eot binary
|
||||
*.gz binary
|
||||
*.bz2 binary
|
||||
*.7z binary
|
||||
*.zip binary
|
||||
23
.github/ISSUE_TEMPLATE.md
vendored
Normal file
23
.github/ISSUE_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
This is a (multiple allowed):
|
||||
|
||||
* [x] bug
|
||||
* [ ] enhancement
|
||||
* [ ] feature-discussion (RFC)
|
||||
|
||||
* CakePHP Application Skeleton Version: EXACT RELEASE VERSION OR COMMIT HASH, HERE.
|
||||
* Platform and Target: YOUR WEB-SERVER, DATABASE AND OTHER RELEVANT INFO AND HOW THE REQUEST IS BEING MADE, HERE.
|
||||
|
||||
### What you did
|
||||
EXPLAIN WHAT YOU DID, PREFERABLY WITH CODE EXAMPLES, HERE.
|
||||
|
||||
### What happened
|
||||
EXPLAIN WHAT IS ACTUALLY HAPPENING, HERE.
|
||||
|
||||
### What you expected to happen
|
||||
EXPLAIN WHAT IS TO BE EXPECTED, HERE.
|
||||
|
||||
P.S. Remember, an issue is not the place to ask questions. You can use [Stack Overflow](https://stackoverflow.com/questions/tagged/cakephp)
|
||||
for that or join the #cakephp channel on irc.freenode.net, where we will be more
|
||||
than happy to help answer your questions.
|
||||
|
||||
Before you open an issue, please check if a similar issue already exists or has been closed before.
|
||||
10
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
10
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
**PLEASE NOTE:**
|
||||
|
||||
This is only a issue tracker for issues related to the CakePHP Application Skeleton.
|
||||
For CakePHP Framework issues please use this [issue tracker](https://github.com/cakephp/cakephp/issues).
|
||||
|
||||
Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.
|
||||
|
||||
The best way to propose a feature is to open an issue first and discuss your ideas there before implementing them.
|
||||
|
||||
Always follow the [contribution guidelines](https://github.com/cakephp/cakephp/blob/master/.github/CONTRIBUTING.md) guidelines when submitting a pull request. In particular, make sure existing tests still pass, and add tests for all new behavior. When fixing a bug, you may want to add a test to verify the fix.
|
||||
40
.gitignore
vendored
Normal file
40
.gitignore
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
# CakePHP specific files #
|
||||
##########################
|
||||
config/app.php
|
||||
config/.env
|
||||
logs/*
|
||||
tmp/*
|
||||
vendor/*
|
||||
|
||||
# OS generated files #
|
||||
######################
|
||||
.DS_Store
|
||||
.DS_Store?
|
||||
._*
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
Icon?
|
||||
ehthumbs.db
|
||||
Thumbs.db
|
||||
|
||||
# Tool specific files #
|
||||
#######################
|
||||
# vim
|
||||
*~
|
||||
*.swp
|
||||
*.swo
|
||||
# sublime text & textmate
|
||||
*.sublime-*
|
||||
*.stTheme.cache
|
||||
*.tmlanguage.cache
|
||||
*.tmPreferences.cache
|
||||
# Eclipse
|
||||
.settings/*
|
||||
# JetBrains, aka PHPStorm, IntelliJ IDEA
|
||||
.idea/*
|
||||
# NetBeans
|
||||
nbproject/*
|
||||
# Visual Studio Code
|
||||
.vscode
|
||||
# Sass preprocessor
|
||||
.sass-cache/
|
||||
12
.htaccess
Normal file
12
.htaccess
Normal file
@@ -0,0 +1,12 @@
|
||||
# Uncomment the following to prevent the httpoxy vulnerability
|
||||
# See: https://httpoxy.org/
|
||||
#<IfModule mod_headers.c>
|
||||
# RequestHeader unset Proxy
|
||||
#</IfModule>
|
||||
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine on
|
||||
RewriteRule ^(\.well-known/.*)$ $1 [L]
|
||||
RewriteRule ^$ webroot/ [L]
|
||||
RewriteRule (.*) webroot/$1 [L]
|
||||
</IfModule>
|
||||
30
.travis.yml
Normal file
30
.travis.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
language: php
|
||||
|
||||
dist: trusty
|
||||
|
||||
sudo: false
|
||||
|
||||
php:
|
||||
- 5.6
|
||||
- 7.0
|
||||
- 7.1
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
|
||||
include:
|
||||
- php: 7.0
|
||||
env: PHPCS=1
|
||||
|
||||
before_script:
|
||||
- if [[ $PHPCS = 1 ]]; then composer require cakephp/cakephp-codesniffer:~2.1; fi
|
||||
- if [[ $PHPCS != 1 ]]; then composer install; fi
|
||||
- if [[ $PHPCS != 1 ]]; then composer require phpunit/phpunit:"^5.7|^6.0"; fi
|
||||
- if [[ $PHPCS != 1 ]]; then composer run-script post-install-cmd --no-interaction; fi
|
||||
|
||||
script:
|
||||
- if [[ $PHPCS != 1 ]]; then vendor/bin/phpunit; fi
|
||||
- if [[ $PHPCS = 1 ]]; then vendor/bin/phpcs -p --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests ./config ./webroot; fi
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
51
README.md
Normal file
51
README.md
Normal file
@@ -0,0 +1,51 @@
|
||||
# CakePHP Application Skeleton
|
||||
|
||||
[](https://travis-ci.org/cakephp/app)
|
||||
[](https://packagist.org/packages/cakephp/app)
|
||||
|
||||
A skeleton for creating applications with [CakePHP](https://cakephp.org) 3.x.
|
||||
|
||||
The framework source code can be found here: [cakephp/cakephp](https://github.com/cakephp/cakephp).
|
||||
|
||||
## Installation
|
||||
|
||||
1. Download [Composer](https://getcomposer.org/doc/00-intro.md) or update `composer self-update`.
|
||||
2. Run `php composer.phar create-project --prefer-dist cakephp/app [app_name]`.
|
||||
|
||||
If Composer is installed globally, run
|
||||
|
||||
```bash
|
||||
composer create-project --prefer-dist cakephp/app
|
||||
```
|
||||
|
||||
In case you want to use a custom app dir name (e.g. `/myapp/`):
|
||||
|
||||
```bash
|
||||
composer create-project --prefer-dist cakephp/app myapp
|
||||
```
|
||||
|
||||
You can now either use your machine's webserver to view the default home page, or start
|
||||
up the built-in webserver with:
|
||||
|
||||
```bash
|
||||
bin/cake server -p 8765
|
||||
```
|
||||
|
||||
Then visit `http://localhost:8765` to see the welcome page.
|
||||
|
||||
## Update
|
||||
|
||||
Since this skeleton is a starting point for your application and various files
|
||||
would have been modified as per your needs, there isn't a way to provide
|
||||
automated upgrades, so you have to do any updates manually.
|
||||
|
||||
## Configuration
|
||||
|
||||
Read and edit `config/app.php` and setup the `'Datasources'` and any other
|
||||
configuration relevant for your application.
|
||||
|
||||
## Layout
|
||||
|
||||
The app skeleton uses a subset of [Foundation](http://foundation.zurb.com/) (v5) CSS
|
||||
framework by default. You can, however, replace it with any other library or
|
||||
custom styles.
|
||||
46
bin/cake
Normal file
46
bin/cake
Normal file
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env sh
|
||||
################################################################################
|
||||
#
|
||||
# Cake is a shell script for invoking CakePHP shell commands
|
||||
#
|
||||
# CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
# Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
#
|
||||
# Licensed under The MIT License
|
||||
# For full copyright and license information, please see the LICENSE.txt
|
||||
# Redistributions of files must retain the above copyright notice.
|
||||
#
|
||||
# @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
# @link https://cakephp.org CakePHP(tm) Project
|
||||
# @since 1.2.0
|
||||
# @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
#
|
||||
################################################################################
|
||||
|
||||
# Canonicalize by following every symlink of the given name recursively
|
||||
canonicalize() {
|
||||
NAME="$1"
|
||||
if [ -f "$NAME" ]
|
||||
then
|
||||
DIR=$(dirname -- "$NAME")
|
||||
NAME=$(cd -P "$DIR" > /dev/null && pwd -P)/$(basename -- "$NAME")
|
||||
fi
|
||||
while [ -h "$NAME" ]; do
|
||||
DIR=$(dirname -- "$NAME")
|
||||
SYM=$(readlink "$NAME")
|
||||
NAME=$(cd "$DIR" > /dev/null && cd $(dirname -- "$SYM") > /dev/null && pwd)/$(basename -- "$SYM")
|
||||
done
|
||||
echo "$NAME"
|
||||
}
|
||||
|
||||
CONSOLE=$(dirname -- "$(canonicalize "$0")")
|
||||
APP=$(dirname "$CONSOLE")
|
||||
|
||||
if [ $(basename $0) != 'cake' ]
|
||||
then
|
||||
exec php "$CONSOLE"/cake.php $(basename $0) "$@"
|
||||
else
|
||||
exec php "$CONSOLE"/cake.php "$@"
|
||||
fi
|
||||
|
||||
exit
|
||||
27
bin/cake.bat
Normal file
27
bin/cake.bat
Normal file
@@ -0,0 +1,27 @@
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::
|
||||
:: Cake is a Windows batch script for invoking CakePHP shell commands
|
||||
::
|
||||
:: CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
:: Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
::
|
||||
:: Licensed under The MIT License
|
||||
:: Redistributions of files must retain the above copyright notice.
|
||||
::
|
||||
:: @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
:: @link https://cakephp.org CakePHP(tm) Project
|
||||
:: @since 2.0.0
|
||||
:: @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
@echo off
|
||||
|
||||
SET app=%0
|
||||
SET lib=%~dp0
|
||||
|
||||
php "%lib%cake.php" %*
|
||||
|
||||
echo.
|
||||
|
||||
exit /B %ERRORLEVEL%
|
||||
12
bin/cake.php
Normal file
12
bin/cake.php
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/php -q
|
||||
<?php
|
||||
// Check platform requirements
|
||||
require dirname(__DIR__) . '/config/requirements.php';
|
||||
require dirname(__DIR__) . '/vendor/autoload.php';
|
||||
|
||||
use App\Application;
|
||||
use Cake\Console\CommandRunner;
|
||||
|
||||
// Build the runner with an application and root executable name.
|
||||
$runner = new CommandRunner(new Application(dirname(__DIR__) . '/config'), 'cake');
|
||||
exit($runner->run($argv));
|
||||
9381
budget.sql
Normal file
9381
budget.sql
Normal file
File diff suppressed because it is too large
Load Diff
55
composer.json
Normal file
55
composer.json
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"name": "cakephp/app",
|
||||
"description": "CakePHP skeleton app",
|
||||
"homepage": "https://cakephp.org",
|
||||
"type": "project",
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": ">=5.6",
|
||||
"cakephp/cakephp": "3.5.*",
|
||||
"cakephp/migrations": "^1.0",
|
||||
"cakephp/plugin-installer": "^1.0",
|
||||
"friendsofcake/cakephp-csvview": "~3.0",
|
||||
"josegonzalez/dotenv": "2.*",
|
||||
"mobiledetect/mobiledetectlib": "2.*"
|
||||
},
|
||||
"require-dev": {
|
||||
"cakephp/bake": "^1.1",
|
||||
"cakephp/cakephp-codesniffer": "^3.0",
|
||||
"cakephp/debug_kit": "^3.2",
|
||||
"psy/psysh": "@stable"
|
||||
},
|
||||
"suggest": {
|
||||
"markstory/asset_compress": "An asset compression plugin which provides file concatenation and a flexible filter system for preprocessing and minification.",
|
||||
"dereuromark/cakephp-ide-helper": "After baking your code, this keeps your annotations in sync with the code evolving from there on for maximum IDE and PHPStan compatibility.",
|
||||
"phpunit/phpunit": "Allows automated tests to be run without system-wide install.",
|
||||
"cakephp/cakephp-codesniffer": "Allows to check the code against the coding standards used in CakePHP."
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"App\\": "src/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"App\\Test\\": "tests/",
|
||||
"Cake\\Test\\": "vendor/cakephp/cakephp/tests/"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"post-install-cmd": "App\\Console\\Installer::postInstall",
|
||||
"post-create-project-cmd": "App\\Console\\Installer::postInstall",
|
||||
"post-autoload-dump": "Cake\\Composer\\Installer\\PluginInstaller::postAutoloadDump",
|
||||
"check": [
|
||||
"@test",
|
||||
"@cs-check"
|
||||
],
|
||||
"cs-check": "phpcs --colors -p --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests",
|
||||
"cs-fix": "phpcbf --colors --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests",
|
||||
"test": "phpunit --colors=always"
|
||||
},
|
||||
"prefer-stable": true,
|
||||
"config": {
|
||||
"sort-packages": true
|
||||
}
|
||||
}
|
||||
2685
composer.lock
generated
Normal file
2685
composer.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
34
config/.env.default
Normal file
34
config/.env.default
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
# Used as a default to seed config/.env which
|
||||
# enables you to use environment variables to configure
|
||||
# the aspects of your application that vary by
|
||||
# environment.
|
||||
#
|
||||
# To use this file, first copy it into `config/.env`. Also ensure the related
|
||||
# code block for loading this file is uncommented in `config/boostrap.php`
|
||||
#
|
||||
# In development .env files are parsed by PHP
|
||||
# and set into the environment. This provides a simpler
|
||||
# development workflow over standard environment variables.
|
||||
export APP_NAME="__APP_NAME__"
|
||||
export DEBUG="true"
|
||||
export APP_ENCODING="UTF-8"
|
||||
export APP_DEFAULT_LOCALE="en_US"
|
||||
export SECURITY_SALT="__SALT__"
|
||||
|
||||
# Uncomment these to define cache configuration via environment variables.
|
||||
#export CACHE_DURATION="+2 minutes"
|
||||
#export CACHE_DEFAULT_URL="file://tmp/cache/?prefix=${APP_NAME}_default&duration=${CACHE_DURATION}"
|
||||
#export CACHE_CAKECORE_URL="file://tmp/cache/persistent?prefix=${APP_NAME}_cake_core&serialize=true&duration=${CACHE_DURATION}"
|
||||
#export CACHE_CAKEMODEL_URL="file://tmp/cache/models?prefix=${APP_NAME}_cake_model&serialize=true&duration=${CACHE_DURATION}"
|
||||
|
||||
# Uncomment these to define email transport configuration via environment variables.
|
||||
#export EMAIL_TRANSPORT_DEFAULT_URL=""
|
||||
|
||||
# Uncomment these to define database configuration via environment variables.
|
||||
#export DATABASE_URL="mysql://my_app:secret@localhost/${APP_NAME}?encoding=utf8&timezone=UTC&cacheMetadata=true"eIdentifiers=false&persistent=false"
|
||||
#export DATABASE_TEST_URL="mysql://my_app:secret@localhost/test_${APP_NAME}?encoding=utf8&timezone=UTC&cacheMetadata=true"eIdentifiers=false&persistent=false"
|
||||
|
||||
# Uncomment these to define logging configuration via environment variables.
|
||||
#export LOG_DEBUG_URL="file://logs?levels[]=notice&levels[]=info&levels[]=debug&file=debug"
|
||||
#export LOG_ERROR_URL="file://logs?levels[]=warning&levels[]=error&levels[]=critical&levels[]=alert&levels[]=emergency&file=error"
|
||||
357
config/app.default.php
Normal file
357
config/app.default.php
Normal file
@@ -0,0 +1,357 @@
|
||||
<?php
|
||||
return [
|
||||
/**
|
||||
* Debug Level:
|
||||
*
|
||||
* Production Mode:
|
||||
* false: No error messages, errors, or warnings shown.
|
||||
*
|
||||
* Development Mode:
|
||||
* true: Errors and warnings shown.
|
||||
*/
|
||||
'debug' => filter_var(env('DEBUG', true), FILTER_VALIDATE_BOOLEAN),
|
||||
|
||||
/**
|
||||
* Configure basic information about the application.
|
||||
*
|
||||
* - namespace - The namespace to find app classes under.
|
||||
* - defaultLocale - The default locale for translation, formatting currencies and numbers, date and time.
|
||||
* - encoding - The encoding used for HTML + database connections.
|
||||
* - base - The base directory the app resides in. If false this
|
||||
* will be auto detected.
|
||||
* - dir - Name of app directory.
|
||||
* - webroot - The webroot directory.
|
||||
* - wwwRoot - The file path to webroot.
|
||||
* - baseUrl - To configure CakePHP to *not* use mod_rewrite and to
|
||||
* use CakePHP pretty URLs, remove these .htaccess
|
||||
* files:
|
||||
* /.htaccess
|
||||
* /webroot/.htaccess
|
||||
* And uncomment the baseUrl key below.
|
||||
* - fullBaseUrl - A base URL to use for absolute links.
|
||||
* - imageBaseUrl - Web path to the public images directory under webroot.
|
||||
* - cssBaseUrl - Web path to the public css directory under webroot.
|
||||
* - jsBaseUrl - Web path to the public js directory under webroot.
|
||||
* - paths - Configure paths for non class based resources. Supports the
|
||||
* `plugins`, `templates`, `locales` subkeys, which allow the definition of
|
||||
* paths for plugins, view templates and locale files respectively.
|
||||
*/
|
||||
'App' => [
|
||||
'namespace' => 'App',
|
||||
'encoding' => env('APP_ENCODING', 'UTF-8'),
|
||||
'defaultLocale' => env('APP_DEFAULT_LOCALE', 'en_US'),
|
||||
'base' => false,
|
||||
'dir' => 'src',
|
||||
'webroot' => 'webroot',
|
||||
'wwwRoot' => WWW_ROOT,
|
||||
// 'baseUrl' => env('SCRIPT_NAME'),
|
||||
'fullBaseUrl' => false,
|
||||
'imageBaseUrl' => 'img/',
|
||||
'cssBaseUrl' => 'css/',
|
||||
'jsBaseUrl' => 'js/',
|
||||
'paths' => [
|
||||
'plugins' => [ROOT . DS . 'plugins' . DS],
|
||||
'templates' => [APP . 'Template' . DS],
|
||||
'locales' => [APP . 'Locale' . DS],
|
||||
],
|
||||
],
|
||||
|
||||
/**
|
||||
* Security and encryption configuration
|
||||
*
|
||||
* - salt - A random string used in security hashing methods.
|
||||
* The salt value is also used as the encryption key.
|
||||
* You should treat it as extremely sensitive data.
|
||||
*/
|
||||
'Security' => [
|
||||
'salt' => env('SECURITY_SALT', '__SALT__'),
|
||||
],
|
||||
|
||||
/**
|
||||
* Apply timestamps with the last modified time to static assets (js, css, images).
|
||||
* Will append a querystring parameter containing the time the file was modified.
|
||||
* This is useful for busting browser caches.
|
||||
*
|
||||
* Set to true to apply timestamps when debug is true. Set to 'force' to always
|
||||
* enable timestamping regardless of debug value.
|
||||
*/
|
||||
'Asset' => [
|
||||
// 'timestamp' => true,
|
||||
],
|
||||
|
||||
/**
|
||||
* Configure the cache adapters.
|
||||
*/
|
||||
'Cache' => [
|
||||
'default' => [
|
||||
'className' => 'File',
|
||||
'path' => CACHE,
|
||||
'url' => env('CACHE_DEFAULT_URL', null),
|
||||
],
|
||||
|
||||
/**
|
||||
* Configure the cache used for general framework caching.
|
||||
* Translation cache files are stored with this configuration.
|
||||
* Duration will be set to '+2 minutes' in bootstrap.php when debug = true
|
||||
* If you set 'className' => 'Null' core cache will be disabled.
|
||||
*/
|
||||
'_cake_core_' => [
|
||||
'className' => 'File',
|
||||
'prefix' => 'myapp_cake_core_',
|
||||
'path' => CACHE . 'persistent/',
|
||||
'serialize' => true,
|
||||
'duration' => '+1 years',
|
||||
'url' => env('CACHE_CAKECORE_URL', null),
|
||||
],
|
||||
|
||||
/**
|
||||
* Configure the cache for model and datasource caches. This cache
|
||||
* configuration is used to store schema descriptions, and table listings
|
||||
* in connections.
|
||||
* Duration will be set to '+2 minutes' in bootstrap.php when debug = true
|
||||
*/
|
||||
'_cake_model_' => [
|
||||
'className' => 'File',
|
||||
'prefix' => 'myapp_cake_model_',
|
||||
'path' => CACHE . 'models/',
|
||||
'serialize' => true,
|
||||
'duration' => '+1 years',
|
||||
'url' => env('CACHE_CAKEMODEL_URL', null),
|
||||
],
|
||||
],
|
||||
|
||||
/**
|
||||
* Configure the Error and Exception handlers used by your application.
|
||||
*
|
||||
* By default errors are displayed using Debugger, when debug is true and logged
|
||||
* by Cake\Log\Log when debug is false.
|
||||
*
|
||||
* In CLI environments exceptions will be printed to stderr with a backtrace.
|
||||
* In web environments an HTML page will be displayed for the exception.
|
||||
* With debug true, framework errors like Missing Controller will be displayed.
|
||||
* When debug is false, framework errors will be coerced into generic HTTP errors.
|
||||
*
|
||||
* Options:
|
||||
*
|
||||
* - `errorLevel` - int - The level of errors you are interested in capturing.
|
||||
* - `trace` - boolean - Whether or not backtraces should be included in
|
||||
* logged errors/exceptions.
|
||||
* - `log` - boolean - Whether or not you want exceptions logged.
|
||||
* - `exceptionRenderer` - string - The class responsible for rendering
|
||||
* uncaught exceptions. If you choose a custom class you should place
|
||||
* the file for that class in src/Error. This class needs to implement a
|
||||
* render method.
|
||||
* - `skipLog` - array - List of exceptions to skip for logging. Exceptions that
|
||||
* extend one of the listed exceptions will also be skipped for logging.
|
||||
* E.g.:
|
||||
* `'skipLog' => ['Cake\Network\Exception\NotFoundException', 'Cake\Network\Exception\UnauthorizedException']`
|
||||
* - `extraFatalErrorMemory` - int - The number of megabytes to increase
|
||||
* the memory limit by when a fatal error is encountered. This allows
|
||||
* breathing room to complete logging or error handling.
|
||||
*/
|
||||
'Error' => [
|
||||
'errorLevel' => E_ALL,
|
||||
'exceptionRenderer' => 'Cake\Error\ExceptionRenderer',
|
||||
'skipLog' => [],
|
||||
'log' => true,
|
||||
'trace' => true,
|
||||
],
|
||||
|
||||
/**
|
||||
* Email configuration.
|
||||
*
|
||||
* By defining transports separately from delivery profiles you can easily
|
||||
* re-use transport configuration across multiple profiles.
|
||||
*
|
||||
* You can specify multiple configurations for production, development and
|
||||
* testing.
|
||||
*
|
||||
* Each transport needs a `className`. Valid options are as follows:
|
||||
*
|
||||
* Mail - Send using PHP mail function
|
||||
* Smtp - Send using SMTP
|
||||
* Debug - Do not send the email, just return the result
|
||||
*
|
||||
* You can add custom transports (or override existing transports) by adding the
|
||||
* appropriate file to src/Mailer/Transport. Transports should be named
|
||||
* 'YourTransport.php', where 'Your' is the name of the transport.
|
||||
*/
|
||||
'EmailTransport' => [
|
||||
'default' => [
|
||||
'className' => 'Mail',
|
||||
// The following keys are used in SMTP transports
|
||||
'host' => 'localhost',
|
||||
'port' => 25,
|
||||
'timeout' => 30,
|
||||
'username' => null,
|
||||
'password' => null,
|
||||
'client' => null,
|
||||
'tls' => null,
|
||||
'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null),
|
||||
],
|
||||
],
|
||||
|
||||
/**
|
||||
* Email delivery profiles
|
||||
*
|
||||
* Delivery profiles allow you to predefine various properties about email
|
||||
* messages from your application and give the settings a name. This saves
|
||||
* duplication across your application and makes maintenance and development
|
||||
* easier. Each profile accepts a number of keys. See `Cake\Mailer\Email`
|
||||
* for more information.
|
||||
*/
|
||||
'Email' => [
|
||||
'default' => [
|
||||
'transport' => 'default',
|
||||
'from' => 'you@localhost',
|
||||
//'charset' => 'utf-8',
|
||||
//'headerCharset' => 'utf-8',
|
||||
],
|
||||
],
|
||||
|
||||
/**
|
||||
* Connection information used by the ORM to connect
|
||||
* to your application's datastores.
|
||||
* Do not use periods in database name - it may lead to error.
|
||||
* See https://github.com/cakephp/cakephp/issues/6471 for details.
|
||||
* Drivers include Mysql Postgres Sqlite Sqlserver
|
||||
* See vendor\cakephp\cakephp\src\Database\Driver for complete list
|
||||
*/
|
||||
'Datasources' => [
|
||||
'default' => [
|
||||
'className' => 'Cake\Database\Connection',
|
||||
'driver' => 'Cake\Database\Driver\Mysql',
|
||||
'persistent' => false,
|
||||
'host' => 'localhost',
|
||||
/**
|
||||
* CakePHP will use the default DB port based on the driver selected
|
||||
* MySQL on MAMP uses port 8889, MAMP users will want to uncomment
|
||||
* the following line and set the port accordingly
|
||||
*/
|
||||
//'port' => 'non_standard_port_number',
|
||||
'username' => 'my_app',
|
||||
'password' => 'secret',
|
||||
'database' => 'my_app',
|
||||
'encoding' => 'utf8',
|
||||
'timezone' => 'UTC',
|
||||
'flags' => [],
|
||||
'cacheMetadata' => true,
|
||||
'log' => false,
|
||||
|
||||
/**
|
||||
* Set identifier quoting to true if you are using reserved words or
|
||||
* special characters in your table or column names. Enabling this
|
||||
* setting will result in queries built using the Query Builder having
|
||||
* identifiers quoted when creating SQL. It should be noted that this
|
||||
* decreases performance because each query needs to be traversed and
|
||||
* manipulated before being executed.
|
||||
*/
|
||||
'quoteIdentifiers' => false,
|
||||
|
||||
/**
|
||||
* During development, if using MySQL < 5.6, uncommenting the
|
||||
* following line could boost the speed at which schema metadata is
|
||||
* fetched from the database. It can also be set directly with the
|
||||
* mysql configuration directive 'innodb_stats_on_metadata = 0'
|
||||
* which is the recommended value in production environments
|
||||
*/
|
||||
//'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
|
||||
|
||||
'url' => env('DATABASE_URL', null),
|
||||
],
|
||||
|
||||
/**
|
||||
* The test connection is used during the test suite.
|
||||
*/
|
||||
'test' => [
|
||||
'className' => 'Cake\Database\Connection',
|
||||
'driver' => 'Cake\Database\Driver\Mysql',
|
||||
'persistent' => false,
|
||||
'host' => 'localhost',
|
||||
//'port' => 'non_standard_port_number',
|
||||
'username' => 'my_app',
|
||||
'password' => 'secret',
|
||||
'database' => 'test_myapp',
|
||||
'encoding' => 'utf8',
|
||||
'timezone' => 'UTC',
|
||||
'cacheMetadata' => true,
|
||||
'quoteIdentifiers' => false,
|
||||
'log' => false,
|
||||
//'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
|
||||
'url' => env('DATABASE_TEST_URL', null),
|
||||
],
|
||||
],
|
||||
|
||||
/**
|
||||
* Configures logging options
|
||||
*/
|
||||
'Log' => [
|
||||
'debug' => [
|
||||
'className' => 'Cake\Log\Engine\FileLog',
|
||||
'path' => LOGS,
|
||||
'file' => 'debug',
|
||||
'url' => env('LOG_DEBUG_URL', null),
|
||||
'scopes' => false,
|
||||
'levels' => ['notice', 'info', 'debug'],
|
||||
],
|
||||
'error' => [
|
||||
'className' => 'Cake\Log\Engine\FileLog',
|
||||
'path' => LOGS,
|
||||
'file' => 'error',
|
||||
'url' => env('LOG_ERROR_URL', null),
|
||||
'scopes' => false,
|
||||
'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'],
|
||||
],
|
||||
// To enable this dedicated query log, you need set your datasource's log flag to true
|
||||
'queries' => [
|
||||
'className' => 'Cake\Log\Engine\FileLog',
|
||||
'path' => LOGS,
|
||||
'file' => 'queries',
|
||||
'url' => env('LOG_QUERIES_URL', null),
|
||||
'scopes' => ['queriesLog'],
|
||||
],
|
||||
],
|
||||
|
||||
/**
|
||||
* Session configuration.
|
||||
*
|
||||
* Contains an array of settings to use for session configuration. The
|
||||
* `defaults` key is used to define a default preset to use for sessions, any
|
||||
* settings declared here will override the settings of the default config.
|
||||
*
|
||||
* ## Options
|
||||
*
|
||||
* - `cookie` - The name of the cookie to use. Defaults to 'CAKEPHP'. Avoid using `.` in cookie names,
|
||||
* as PHP will drop sessions from cookies with `.` in the name.
|
||||
* - `cookiePath` - The url path for which session cookie is set. Maps to the
|
||||
* `session.cookie_path` php.ini config. Defaults to base path of app.
|
||||
* - `timeout` - The time in minutes the session should be valid for.
|
||||
* Pass 0 to disable checking timeout.
|
||||
* Please note that php.ini's session.gc_maxlifetime must be equal to or greater
|
||||
* than the largest Session['timeout'] in all served websites for it to have the
|
||||
* desired effect.
|
||||
* - `defaults` - The default configuration set to use as a basis for your session.
|
||||
* There are four built-in options: php, cake, cache, database.
|
||||
* - `handler` - Can be used to enable a custom session handler. Expects an
|
||||
* array with at least the `engine` key, being the name of the Session engine
|
||||
* class to use for managing the session. CakePHP bundles the `CacheSession`
|
||||
* and `DatabaseSession` engines.
|
||||
* - `ini` - An associative array of additional ini values to set.
|
||||
*
|
||||
* The built-in `defaults` options are:
|
||||
*
|
||||
* - 'php' - Uses settings defined in your php.ini.
|
||||
* - 'cake' - Saves session files in CakePHP's /tmp directory.
|
||||
* - 'database' - Uses CakePHP's database sessions.
|
||||
* - 'cache' - Use the Cache class to save sessions.
|
||||
*
|
||||
* To define a custom session handler, save it at src/Network/Session/<name>.php.
|
||||
* Make sure the class implements PHP's `SessionHandlerInterface` and set
|
||||
* Session.handler to <name>
|
||||
*
|
||||
* To use database sessions, load the SQL file located at config/schema/sessions.sql
|
||||
*/
|
||||
'Session' => [
|
||||
'defaults' => 'php',
|
||||
],
|
||||
];
|
||||
218
config/bootstrap.php
Normal file
218
config/bootstrap.php
Normal file
@@ -0,0 +1,218 @@
|
||||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since 0.10.8
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/*
|
||||
* Configure paths required to find CakePHP + general filepath constants
|
||||
*/
|
||||
require __DIR__ . '/paths.php';
|
||||
|
||||
/*
|
||||
* Bootstrap CakePHP.
|
||||
*
|
||||
* Does the various bits of setup that CakePHP needs to do.
|
||||
* This includes:
|
||||
*
|
||||
* - Registering the CakePHP autoloader.
|
||||
* - Setting the default application paths.
|
||||
*/
|
||||
require CORE_PATH . 'config' . DS . 'bootstrap.php';
|
||||
|
||||
use Cake\Cache\Cache;
|
||||
use Cake\Console\ConsoleErrorHandler;
|
||||
use Cake\Core\App;
|
||||
use Cake\Core\Configure;
|
||||
use Cake\Core\Configure\Engine\PhpConfig;
|
||||
use Cake\Core\Plugin;
|
||||
use Cake\Database\Type;
|
||||
use Cake\Datasource\ConnectionManager;
|
||||
use Cake\Error\ErrorHandler;
|
||||
use Cake\Http\ServerRequest;
|
||||
use Cake\Log\Log;
|
||||
use Cake\Mailer\Email;
|
||||
use Cake\Utility\Inflector;
|
||||
use Cake\Utility\Security;
|
||||
|
||||
/**
|
||||
* Uncomment block of code below if you want to use `.env` file during development.
|
||||
* You should copy `config/.env.default to `config/.env` and set/modify the
|
||||
* variables as required.
|
||||
*/
|
||||
// if (!env('APP_NAME') && file_exists(CONFIG . '.env')) {
|
||||
// $dotenv = new \josegonzalez\Dotenv\Loader([CONFIG . '.env']);
|
||||
// $dotenv->parse()
|
||||
// ->putenv()
|
||||
// ->toEnv()
|
||||
// ->toServer();
|
||||
// }
|
||||
|
||||
/*
|
||||
* Read configuration file and inject configuration into various
|
||||
* CakePHP classes.
|
||||
*
|
||||
* By default there is only one configuration file. It is often a good
|
||||
* idea to create multiple configuration files, and separate the configuration
|
||||
* that changes from configuration that does not. This makes deployment simpler.
|
||||
*/
|
||||
try {
|
||||
Configure::config('default', new PhpConfig());
|
||||
Configure::load('app', 'default', false);
|
||||
} catch (\Exception $e) {
|
||||
exit($e->getMessage() . "\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* Load an environment local configuration file.
|
||||
* You can use a file like app_local.php to provide local overrides to your
|
||||
* shared configuration.
|
||||
*/
|
||||
//Configure::load('app_local', 'default');
|
||||
|
||||
/*
|
||||
* When debug = true the metadata cache should only last
|
||||
* for a short time.
|
||||
*/
|
||||
if (Configure::read('debug')) {
|
||||
Configure::write('Cache._cake_model_.duration', '+2 minutes');
|
||||
Configure::write('Cache._cake_core_.duration', '+2 minutes');
|
||||
}
|
||||
|
||||
/*
|
||||
* Set server timezone to UTC. You can change it to another timezone of your
|
||||
* choice but using UTC makes time calculations / conversions easier.
|
||||
* Check http://php.net/manual/en/timezones.php for list of valid timezone strings.
|
||||
*/
|
||||
date_default_timezone_set('UTC');
|
||||
|
||||
/*
|
||||
* Configure the mbstring extension to use the correct encoding.
|
||||
*/
|
||||
mb_internal_encoding(Configure::read('App.encoding'));
|
||||
|
||||
/*
|
||||
* Set the default locale. This controls how dates, number and currency is
|
||||
* formatted and sets the default language to use for translations.
|
||||
*/
|
||||
ini_set('intl.default_locale', Configure::read('App.defaultLocale'));
|
||||
|
||||
/*
|
||||
* Register application error and exception handlers.
|
||||
*/
|
||||
$isCli = PHP_SAPI === 'cli';
|
||||
if ($isCli) {
|
||||
(new ConsoleErrorHandler(Configure::read('Error')))->register();
|
||||
} else {
|
||||
(new ErrorHandler(Configure::read('Error')))->register();
|
||||
}
|
||||
|
||||
/*
|
||||
* Include the CLI bootstrap overrides.
|
||||
*/
|
||||
if ($isCli) {
|
||||
require __DIR__ . '/bootstrap_cli.php';
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the full base URL.
|
||||
* This URL is used as the base of all absolute links.
|
||||
*
|
||||
* If you define fullBaseUrl in your config file you can remove this.
|
||||
*/
|
||||
if (!Configure::read('App.fullBaseUrl')) {
|
||||
$s = null;
|
||||
if (env('HTTPS')) {
|
||||
$s = 's';
|
||||
}
|
||||
|
||||
$httpHost = env('HTTP_HOST');
|
||||
if (isset($httpHost)) {
|
||||
Configure::write('App.fullBaseUrl', 'http' . $s . '://' . $httpHost);
|
||||
}
|
||||
unset($httpHost, $s);
|
||||
}
|
||||
|
||||
Cache::setConfig(Configure::consume('Cache'));
|
||||
ConnectionManager::setConfig(Configure::consume('Datasources'));
|
||||
Email::setConfigTransport(Configure::consume('EmailTransport'));
|
||||
Email::setConfig(Configure::consume('Email'));
|
||||
Log::setConfig(Configure::consume('Log'));
|
||||
Security::setSalt(Configure::consume('Security.salt'));
|
||||
|
||||
/*
|
||||
* The default crypto extension in 3.0 is OpenSSL.
|
||||
* If you are migrating from 2.x uncomment this code to
|
||||
* use a more compatible Mcrypt based implementation
|
||||
*/
|
||||
//Security::engine(new \Cake\Utility\Crypto\Mcrypt());
|
||||
|
||||
/*
|
||||
* Setup detectors for mobile and tablet.
|
||||
*/
|
||||
ServerRequest::addDetector('mobile', function ($request) {
|
||||
$detector = new \Detection\MobileDetect();
|
||||
|
||||
return $detector->isMobile();
|
||||
});
|
||||
ServerRequest::addDetector('tablet', function ($request) {
|
||||
$detector = new \Detection\MobileDetect();
|
||||
|
||||
return $detector->isTablet();
|
||||
});
|
||||
|
||||
/*
|
||||
* Enable immutable time objects in the ORM.
|
||||
*
|
||||
* You can enable default locale format parsing by adding calls
|
||||
* to `useLocaleParser()`. This enables the automatic conversion of
|
||||
* locale specific date formats. For details see
|
||||
* @link https://book.cakephp.org/3.0/en/core-libraries/internationalization-and-localization.html#parsing-localized-datetime-data
|
||||
*/
|
||||
Type::build('time')
|
||||
->useImmutable();
|
||||
Type::build('date')
|
||||
->useImmutable();
|
||||
Type::build('datetime')
|
||||
->useImmutable();
|
||||
Type::build('timestamp')
|
||||
->useImmutable();
|
||||
|
||||
/*
|
||||
* Custom Inflector rules, can be set to correctly pluralize or singularize
|
||||
* table, model, controller names or whatever other string is passed to the
|
||||
* inflection functions.
|
||||
*/
|
||||
//Inflector::rules('plural', ['/^(inflect)or$/i' => '\1ables']);
|
||||
//Inflector::rules('irregular', ['red' => 'redlings']);
|
||||
//Inflector::rules('uninflected', ['dontinflectme']);
|
||||
//Inflector::rules('transliteration', ['/å/' => 'aa']);
|
||||
|
||||
/*
|
||||
* Plugins need to be loaded manually, you can either load them one by one or all of them in a single call
|
||||
* Uncomment one of the lines below, as you need. make sure you read the documentation on Plugin to use more
|
||||
* advanced ways of loading plugins
|
||||
*
|
||||
* Plugin::loadAll(); // Loads all plugins at once
|
||||
* Plugin::load('Migrations'); //Loads a single plugin named Migrations
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Only try to load DebugKit in development mode
|
||||
* Debug Kit should not be installed on a production system
|
||||
*/
|
||||
if (Configure::read('debug')) {
|
||||
Plugin::load('DebugKit', ['bootstrap' => true]);
|
||||
}
|
||||
|
||||
Plugin::load('AsdCurl', ['autoload' => true, 'bootstrap' => true, 'routes' => true]);
|
||||
38
config/bootstrap_cli.php
Normal file
38
config/bootstrap_cli.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since 3.0.0
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
use Cake\Core\Configure;
|
||||
use Cake\Core\Exception\MissingPluginException;
|
||||
use Cake\Core\Plugin;
|
||||
|
||||
/**
|
||||
* Additional bootstrapping and configuration for CLI environments should
|
||||
* be put here.
|
||||
*/
|
||||
|
||||
// Set the fullBaseUrl to allow URLs to be generated in shell tasks.
|
||||
// This is useful when sending email from shells.
|
||||
//Configure::write('App.fullBaseUrl', php_uname('n'));
|
||||
|
||||
// Set logs to different files so they don't have permission conflicts.
|
||||
Configure::write('Log.debug.file', 'cli-debug');
|
||||
Configure::write('Log.error.file', 'cli-error');
|
||||
|
||||
try {
|
||||
Plugin::load('Bake');
|
||||
} catch (MissingPluginException $e) {
|
||||
// Do not halt if the plugin is missing
|
||||
}
|
||||
|
||||
Plugin::load('Migrations');
|
||||
85
config/paths.php
Normal file
85
config/paths.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since 3.0.0
|
||||
* @license MIT License (https://opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
|
||||
/**
|
||||
* Use the DS to separate the directories in other defines
|
||||
*/
|
||||
if (!defined('DS')) {
|
||||
define('DS', DIRECTORY_SEPARATOR);
|
||||
}
|
||||
|
||||
/**
|
||||
* These defines should only be edited if you have cake installed in
|
||||
* a directory layout other than the way it is distributed.
|
||||
* When using custom settings be sure to use the DS and do not add a trailing DS.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The full path to the directory which holds "src", WITHOUT a trailing DS.
|
||||
*/
|
||||
define('ROOT', dirname(__DIR__));
|
||||
|
||||
/**
|
||||
* The actual directory name for the application directory. Normally
|
||||
* named 'src'.
|
||||
*/
|
||||
define('APP_DIR', 'src');
|
||||
|
||||
/**
|
||||
* Path to the application's directory.
|
||||
*/
|
||||
define('APP', ROOT . DS . APP_DIR . DS);
|
||||
|
||||
/**
|
||||
* Path to the config directory.
|
||||
*/
|
||||
define('CONFIG', ROOT . DS . 'config' . DS);
|
||||
|
||||
/**
|
||||
* File path to the webroot directory.
|
||||
*/
|
||||
define('WWW_ROOT', ROOT . DS . 'webroot' . DS);
|
||||
|
||||
/**
|
||||
* Path to the tests directory.
|
||||
*/
|
||||
define('TESTS', ROOT . DS . 'tests' . DS);
|
||||
|
||||
/**
|
||||
* Path to the temporary files directory.
|
||||
*/
|
||||
define('TMP', ROOT . DS . 'tmp' . DS);
|
||||
|
||||
/**
|
||||
* Path to the logs directory.
|
||||
*/
|
||||
define('LOGS', ROOT . DS . 'logs' . DS);
|
||||
|
||||
/**
|
||||
* Path to the cache files directory. It can be shared between hosts in a multi-server setup.
|
||||
*/
|
||||
define('CACHE', TMP . 'cache' . DS);
|
||||
|
||||
/**
|
||||
* The absolute path to the "cake" directory, WITHOUT a trailing DS.
|
||||
*
|
||||
* CakePHP should always be installed with composer, so look there.
|
||||
*/
|
||||
define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'vendor' . DS . 'cakephp' . DS . 'cakephp');
|
||||
|
||||
/**
|
||||
* Path to the cake directory.
|
||||
*/
|
||||
define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
|
||||
define('CAKE', CORE_PATH . 'src' . DS);
|
||||
39
config/requirements.php
Normal file
39
config/requirements.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since 3.5.0
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/*
|
||||
* You can empty out this file, if you are certain that you match all requirements.
|
||||
*/
|
||||
|
||||
/*
|
||||
* You can remove this if you are confident that your PHP version is sufficient.
|
||||
*/
|
||||
if (version_compare(PHP_VERSION, '5.6.0') < 0) {
|
||||
trigger_error('Your PHP version must be equal or higher than 5.6.0 to use CakePHP.' . PHP_EOL, E_USER_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
* You can remove this if you are confident you have intl installed.
|
||||
*/
|
||||
if (!extension_loaded('intl')) {
|
||||
trigger_error('You must enable the intl extension to use CakePHP.' . PHP_EOL, E_USER_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
* You can remove this if you are confident you have mbstring installed.
|
||||
*/
|
||||
if (!extension_loaded('mbstring')) {
|
||||
trigger_error('You must enable the mbstring extension to use CakePHP.' . PHP_EOL, E_USER_ERROR);
|
||||
}
|
||||
82
config/routes.php
Normal file
82
config/routes.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
/**
|
||||
* Routes configuration
|
||||
*
|
||||
* In this file, you set up routes to your controllers and their actions.
|
||||
* Routes are very important mechanism that allows you to freely connect
|
||||
* different URLs to chosen controllers and their actions (functions).
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
use Cake\Core\Plugin;
|
||||
use Cake\Routing\RouteBuilder;
|
||||
use Cake\Routing\Router;
|
||||
use Cake\Routing\Route\DashedRoute;
|
||||
|
||||
/**
|
||||
* The default class to use for all routes
|
||||
*
|
||||
* The following route classes are supplied with CakePHP and are appropriate
|
||||
* to set as the default:
|
||||
*
|
||||
* - Route
|
||||
* - InflectedRoute
|
||||
* - DashedRoute
|
||||
*
|
||||
* If no call is made to `Router::defaultRouteClass()`, the class used is
|
||||
* `Route` (`Cake\Routing\Route\Route`)
|
||||
*
|
||||
* Note that `Route` does not do any inflections on URLs which will result in
|
||||
* inconsistently cased URLs when used with `:plugin`, `:controller` and
|
||||
* `:action` markers.
|
||||
*
|
||||
*/
|
||||
Router::defaultRouteClass(DashedRoute::class);
|
||||
|
||||
Router::scope('/', function (RouteBuilder $routes) {
|
||||
/**
|
||||
* Here, we are connecting '/' (base path) to a controller called 'Pages',
|
||||
* its action called 'display', and we pass a param to select the view file
|
||||
* to use (in this case, src/Template/Pages/home.ctp)...
|
||||
*/
|
||||
$routes->connect('/', ['controller' => 'Pages', 'action' => 'display', 'home']);
|
||||
|
||||
/**
|
||||
* ...and connect the rest of 'Pages' controller's URLs.
|
||||
*/
|
||||
$routes->connect('/pages/*', ['controller' => 'Pages', 'action' => 'display']);
|
||||
|
||||
/**
|
||||
* Connect catchall routes for all controllers.
|
||||
*
|
||||
* Using the argument `DashedRoute`, the `fallbacks` method is a shortcut for
|
||||
* `$routes->connect('/:controller', ['action' => 'index'], ['routeClass' => 'DashedRoute']);`
|
||||
* `$routes->connect('/:controller/:action/*', [], ['routeClass' => 'DashedRoute']);`
|
||||
*
|
||||
* Any route class can be used with this method, such as:
|
||||
* - DashedRoute
|
||||
* - InflectedRoute
|
||||
* - Route
|
||||
* - Or your own route class
|
||||
*
|
||||
* You can remove these routes once you've connected the
|
||||
* routes you want in your application.
|
||||
*/
|
||||
$routes->fallbacks(DashedRoute::class);
|
||||
});
|
||||
|
||||
/**
|
||||
* Load all plugin routes. See the Plugin documentation on
|
||||
* how to customize the loading of plugin routes.
|
||||
*/
|
||||
Plugin::routes();
|
||||
18
config/schema/i18n.sql
Normal file
18
config/schema/i18n.sql
Normal file
@@ -0,0 +1,18 @@
|
||||
# Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
#
|
||||
# Licensed under The MIT License
|
||||
# For full copyright and license information, please see the LICENSE.txt
|
||||
# Redistributions of files must retain the above copyright notice.
|
||||
# MIT License (https://opensource.org/licenses/mit-license.php)
|
||||
|
||||
CREATE TABLE i18n (
|
||||
id int NOT NULL auto_increment,
|
||||
locale varchar(6) NOT NULL,
|
||||
model varchar(255) NOT NULL,
|
||||
foreign_key int(10) NOT NULL,
|
||||
field varchar(255) NOT NULL,
|
||||
content text,
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE INDEX I18N_LOCALE_FIELD(locale, model, foreign_key, field),
|
||||
INDEX I18N_FIELD(model, foreign_key, field)
|
||||
);
|
||||
15
config/schema/sessions.sql
Normal file
15
config/schema/sessions.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
# Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
#
|
||||
# Licensed under The MIT License
|
||||
# For full copyright and license information, please see the LICENSE.txt
|
||||
# Redistributions of files must retain the above copyright notice.
|
||||
# MIT License (https://opensource.org/licenses/mit-license.php)
|
||||
|
||||
CREATE TABLE `sessions` (
|
||||
`id` char(40) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
|
||||
`created` datetime DEFAULT CURRENT_TIMESTAMP, -- optional, requires MySQL 5.6.5+
|
||||
`modified` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- optional, requires MySQL 5.6.5+
|
||||
`data` blob DEFAULT NULL, -- for PostgreSQL use bytea instead of blob
|
||||
`expires` int(10) unsigned DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
16
index.php
Normal file
16
index.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since 0.10.0
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
require 'webroot' . DIRECTORY_SEPARATOR . 'index.php';
|
||||
40
phpunit.xml.dist
Normal file
40
phpunit.xml.dist
Normal file
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit
|
||||
colors="true"
|
||||
processIsolation="false"
|
||||
stopOnFailure="false"
|
||||
syntaxCheck="false"
|
||||
bootstrap="./tests/bootstrap.php"
|
||||
>
|
||||
<php>
|
||||
<ini name="memory_limit" value="-1"/>
|
||||
<ini name="apc.enable_cli" value="1"/>
|
||||
</php>
|
||||
|
||||
<!-- Add any additional test suites you want to run here -->
|
||||
<testsuites>
|
||||
<testsuite name="app">
|
||||
<directory>./tests/TestCase</directory>
|
||||
</testsuite>
|
||||
<!-- Add plugin test suites here. -->
|
||||
</testsuites>
|
||||
|
||||
<!-- Setup a listener for fixtures -->
|
||||
<listeners>
|
||||
<listener
|
||||
class="\Cake\TestSuite\Fixture\FixtureInjector"
|
||||
file="./vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureInjector.php">
|
||||
<arguments>
|
||||
<object class="\Cake\TestSuite\Fixture\FixtureManager" />
|
||||
</arguments>
|
||||
</listener>
|
||||
</listeners>
|
||||
|
||||
<!-- Ignore vendor tests in code coverage reports -->
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory suffix=".php">./src/</directory>
|
||||
<directory suffix=".php">./plugins/*/src/</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
||||
11
plugins/AsdCurl/README.md
Normal file
11
plugins/AsdCurl/README.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# AsdCurl plugin for CakePHP
|
||||
|
||||
## Installation
|
||||
|
||||
You can install this plugin into your CakePHP application using [composer](http://getcomposer.org).
|
||||
|
||||
The recommended way to install composer packages is:
|
||||
|
||||
```
|
||||
composer require your-name-here/AsdCurl
|
||||
```
|
||||
23
plugins/AsdCurl/composer.json
Normal file
23
plugins/AsdCurl/composer.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "your-name-here/AsdCurl",
|
||||
"description": "AsdCurl plugin for CakePHP",
|
||||
"type": "cakephp-plugin",
|
||||
"require": {
|
||||
"php": ">=5.5.9",
|
||||
"cakephp/cakephp": ">=3.3.2 <4.0.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "*"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"AsdCurl\\": "src"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"AsdCurl\\Test\\": "tests",
|
||||
"Cake\\Test\\": "./vendor/cakephp/cakephp/tests"
|
||||
}
|
||||
}
|
||||
}
|
||||
35
plugins/AsdCurl/config/bootstrap.php
Normal file
35
plugins/AsdCurl/config/bootstrap.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Cake\Core\Configure;
|
||||
use Cake\Core\Configure\Engine\PhpConfig;
|
||||
|
||||
try {
|
||||
Configure::config('default', new PhpConfig());
|
||||
Configure::load('app', 'default', false);
|
||||
} catch (\Exception $e) {
|
||||
exit($e->getMessage() . "\n");
|
||||
}
|
||||
|
||||
//define('SCHULPORTAL_BASE0_URL', "https://portal.schulen.bayern.de");
|
||||
//define('SCHULPORTAL_BASE_URL', SCHULPORTAL_BASE0_URL . '/uniquesig2d1dfad4a11c25e42c462e53b4721e48/uniquesig0');
|
||||
//define('SCHULPORTAL_ASD_BASE_URL', SCHULPORTAL_BASE0_URL . '/uniquesigc3ba1685059aaf325d44099df697a0a635e79a4ec36ec614a98f3bf4b79d7c043ac3880605b7751df91d11233380ad86/uniquesig0/asd');
|
||||
define('SCHULPORTAL_ASD_BASE_URL', 'http://192.168.56.3:8280/asd');
|
||||
|
||||
|
||||
|
||||
//Configure::write('AsdCurl.proxy','10.1.248.1:82');
|
||||
//Configure::write('AsdCurl.cookiejar', '/tmp/cookies.txt');
|
||||
//Configure::write('AsdCurl.cookiefile', '/tmp/cookies.txt');
|
||||
Configure::write('AsdCurl.cookiejar', 'C:/xampp/tmp/cookies.txt');
|
||||
Configure::write('AsdCurl.cookiefile', 'C:/xampp/tmp/cookies.txt');
|
||||
|
||||
Configure::write('AsdCurl.cookie', 'cookiename=cookievalue');
|
||||
Configure::write('AsdCurl.useragent', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0');
|
||||
Configure::write('AsdCurl.cert','C:/xampp/htdocs/ssl_KM_Z2016_asd.trinkl.pem');
|
||||
//Configure::write('AsdCurl.schulbase0url',SCHULPORTAL_BASE0_URL);
|
||||
//Configure::write('AsdCurl.schulbaseurl',SCHULPORTAL_BASE_URL);
|
||||
Configure::write('AsdCurl.asdbaseurl',SCHULPORTAL_ASD_BASE_URL);
|
||||
|
||||
|
||||
?>
|
||||
|
||||
12
plugins/AsdCurl/config/routes.php
Normal file
12
plugins/AsdCurl/config/routes.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
use Cake\Routing\RouteBuilder;
|
||||
use Cake\Routing\Router;
|
||||
use Cake\Routing\Route\DashedRoute;
|
||||
|
||||
Router::plugin(
|
||||
'AsdCurl',
|
||||
['path' => '/asd-curl'],
|
||||
function (RouteBuilder $routes) {
|
||||
$routes->fallbacks(DashedRoute::class);
|
||||
}
|
||||
);
|
||||
43
plugins/AsdCurl/phpunit.xml.dist
Normal file
43
plugins/AsdCurl/phpunit.xml.dist
Normal file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit
|
||||
colors="true"
|
||||
processIsolation="false"
|
||||
stopOnFailure="false"
|
||||
syntaxCheck="false"
|
||||
bootstrap="./tests/bootstrap.php"
|
||||
>
|
||||
<php>
|
||||
<ini name="memory_limit" value="-1"/>
|
||||
<ini name="apc.enable_cli" value="1"/>
|
||||
</php>
|
||||
|
||||
<!-- Add any additional test suites you want to run here -->
|
||||
<testsuites>
|
||||
<testsuite name="AsdCurl Test Suite">
|
||||
<directory>./tests/TestCase</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<!-- Setup a listener for fixtures -->
|
||||
<listeners>
|
||||
<listener
|
||||
class="\Cake\TestSuite\Fixture\FixtureInjector"
|
||||
file="./vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureInjector.php">
|
||||
<arguments>
|
||||
<object class="\Cake\TestSuite\Fixture\FixtureManager" />
|
||||
</arguments>
|
||||
</listener>
|
||||
</listeners>
|
||||
|
||||
<!-- Prevent coverage reports from looking in tests and vendors -->
|
||||
<filter>
|
||||
<blacklist>
|
||||
<directory suffix=".php">./vendor/</directory>
|
||||
<directory suffix=".ctp">./vendor/</directory>
|
||||
|
||||
<directory suffix=".php">./tests/</directory>
|
||||
<directory suffix=".ctp">./tests/</directory>
|
||||
</blacklist>
|
||||
</filter>
|
||||
|
||||
</phpunit>
|
||||
198
plugins/AsdCurl/src/AsdCurl.php
Normal file
198
plugins/AsdCurl/src/AsdCurl.php
Normal file
@@ -0,0 +1,198 @@
|
||||
<?php
|
||||
namespace AsdCurl;
|
||||
|
||||
use Cake\Core\Configure;
|
||||
|
||||
|
||||
|
||||
class AsdCurl
|
||||
{
|
||||
public $status;
|
||||
public $error;
|
||||
public $html;
|
||||
public $message;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->status = false;
|
||||
$this->error = false;
|
||||
$this->html = '';
|
||||
$this->message = '';
|
||||
}
|
||||
|
||||
public function init_curl_params()
|
||||
{
|
||||
$ch = curl_init();
|
||||
//curl_setopt($ch, CURLOPT_PROXY, Configure::read('AsdCurl.proxy'));
|
||||
curl_setopt($ch, CURLOPT_PROXY, false);
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, Configure::read('AsdCurl.useragent'));
|
||||
curl_setopt($ch, CURLOPT_HEADER, false);
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
|
||||
curl_setopt($ch, CURLOPT_COOKIEJAR, Configure::read('AsdCurl.cookiejar'));
|
||||
curl_setopt($ch, CURLOPT_COOKIEFILE, Configure::read('AsdCurl.cookiefile'));
|
||||
curl_setopt($ch, CURLOPT_COOKIE, Configure::read('AsdCurl.cookie'));
|
||||
//curl_setopt($ch, CURLOPT_SSLCERT, Configure::read('AsdCurl.cert'));
|
||||
//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
return ($ch);
|
||||
}
|
||||
|
||||
public function get_string_between($string, $start, $end)
|
||||
{
|
||||
//debug($start);
|
||||
//debug($end);
|
||||
$string = " " . $string;
|
||||
$ini = strpos($string, $start);
|
||||
//debug($ini);
|
||||
//debug($string);die;
|
||||
if ($ini == 0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
$ini += strlen($start);
|
||||
$len = strpos($string, $end, $ini) - $ini;
|
||||
$sub = substr($string, $ini, $len);
|
||||
$elem = explode(' ', $sub)[0];
|
||||
return str_replace('"', '', $elem);
|
||||
}
|
||||
|
||||
public function exec_curl($ch, $url, $post)
|
||||
{
|
||||
if ($post == false) {
|
||||
curl_setopt($ch, CURLOPT_POST, 0);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array());
|
||||
} else {
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
|
||||
}
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
$this->html = curl_exec($ch);
|
||||
//debug(curl_errno($ch));
|
||||
//debug(curl_getinfo($ch, CURLINFO_HTTP_CODE));
|
||||
if (curl_errno($ch)) {
|
||||
$this->status = false;
|
||||
$this->error = 'Couldn\'t send request: ' . curl_error($ch);
|
||||
} else {
|
||||
$resultStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
if ($resultStatus != 200) {
|
||||
$this->status = false;
|
||||
$this->error = 'Request failed: HTTP status code: ' . $resultStatus;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function login_asd($ch)
|
||||
{
|
||||
$SCHULPORTAL_ASD_BASE_URL = Configure::read('AsdCurl.asdbaseurl');
|
||||
$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/asddv/dv_xy_00.jsf', false);
|
||||
if(!($this->status)) {
|
||||
die($this->error);
|
||||
}
|
||||
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
|
||||
|
||||
$login_data = [
|
||||
//'asd_username' => 'A005_TrinklW',
|
||||
//'asd_password' => 'HiegTzs!12',
|
||||
'asd_username' => 'A005_Superuser',
|
||||
'asd_password' => 'asdtest01',
|
||||
];
|
||||
$post = [
|
||||
'login:username' => $login_data['asd_username'],
|
||||
'login:password' => $login_data['asd_password'],
|
||||
'login' => 'login',
|
||||
'javax.faces.ViewState' => $viewstate,
|
||||
'login:loginButton' => 'login:loginButton',
|
||||
];
|
||||
//debug($SCHULPORTAL_ASD_BASE_URL . '/login/login.jsf');die;
|
||||
|
||||
$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/login/login.jsf', $post);
|
||||
if(!($this->status)) {
|
||||
die($this->error);
|
||||
}
|
||||
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
|
||||
Configure::write('Session', ['viewstate' => $viewstate]);
|
||||
}
|
||||
|
||||
public function login_mstr($ch) {
|
||||
$SCHULPORTAL_MSTR_BASE_URL = Configure::read('AsdCurl.mstrbaseurl');
|
||||
$url = '/asp';
|
||||
//debug($SCHULPORTAL_MSTR_BASE_URL . $url);die;
|
||||
$this->exec_curl($ch, $SCHULPORTAL_MSTR_BASE_URL . $url, false);
|
||||
|
||||
//debug($this->html);die;
|
||||
|
||||
$post = [
|
||||
'Uid' => 'A005_TrinklW',
|
||||
'Pwd' => 'HiegTzs!12',
|
||||
];
|
||||
$pvar['ConnMode'] = $this->get_string_between($this->html, '<input name="ConnMode" id="ConnMode" type="hidden" class="mstrHiddenInput" value="', '"/>');
|
||||
$pvar['3054'] = $this->get_string_between($this->html, '<input name="3054" id="3054" type="submit" value="', '" class="mstrButton"/>');
|
||||
$mstr_login_vars = array('evt', 'src', 'target', 'key', 'Port', 'Project', 'Server', 'login', 'smartBanner', 'lb');
|
||||
foreach ($mstr_login_vars as $var) {
|
||||
$value = $this->get_string_between($this->html, 'name="' . $var . '" type="hidden" class="mstrHiddenInput" value="', '"/>');
|
||||
//$value = $this->get_string_between($this->html, 'name="' . $var . '" value=', 'type="hidden"');
|
||||
$pvar[$var] = $value;
|
||||
}
|
||||
|
||||
$post = array_merge($post, $pvar);
|
||||
//debug($post);die;
|
||||
$this->exec_curl($ch, $SCHULPORTAL_MSTR_BASE_URL . '/asp/Main.aspx', $post);
|
||||
if(strpos($this->html,'Login failure')) {
|
||||
$this->status = false;
|
||||
}
|
||||
//debug($this->html);die;
|
||||
}
|
||||
|
||||
public function logout_mstr($ch) {
|
||||
$SCHULPORTAL_MSTR_BASE_URL = Configure::read('AsdCurl.mstrbaseurl');
|
||||
$url = '/asp/Main.aspx';
|
||||
$post = [
|
||||
'evt' => '3008',
|
||||
'src' => 'mstrWeb.3008',
|
||||
'xts' => exec('date +%s%3N'),
|
||||
];
|
||||
$this->exec_curl($ch, $SCHULPORTAL_MSTR_BASE_URL . $url, $post);
|
||||
curl_close($ch);
|
||||
}
|
||||
|
||||
public function login_school($ch)
|
||||
{
|
||||
$SCHULPORTAL_BASE0_URL = Configure::read('AsdCurl.schulbase0url');
|
||||
$SCHULPORTAL_BASE_URL = Configure::read('AsdCurl.schulbaseurl');
|
||||
//$login_data = $this->request->session()->read('data');
|
||||
|
||||
$this->exec_curl($ch, $SCHULPORTAL_BASE_URL, false);
|
||||
if(!($this->status)) {
|
||||
die($this->error);
|
||||
}
|
||||
$login_data = [
|
||||
'portal_username' => 'asd.trinkl',
|
||||
'portal_password' => 'HiegTzs!181',
|
||||
];
|
||||
|
||||
$post = [
|
||||
'user_name' => $login_data['portal_username'],
|
||||
'password' => $login_data['portal_password'],
|
||||
'repository' => 'schulen.bayern.de',
|
||||
'site_name' => 'schulportal',
|
||||
'secure' => '1',
|
||||
'resource_id' => '2',
|
||||
'login_type' => '2',
|
||||
];
|
||||
// Anmeldeformular fuer das Schulportal abschicken - Step 2
|
||||
|
||||
$this->exec_curl($ch, $SCHULPORTAL_BASE_URL . '/InternalSite/Validate.asp', $post);
|
||||
if(!($this->status)) {
|
||||
die($this->error);
|
||||
}
|
||||
}
|
||||
|
||||
public function exec_mstr($ch, $url, $post)
|
||||
{
|
||||
$SCHULPORTAL_MSTR_BASE_URL = Configure::read('AsdCurl.mstrbaseurl');
|
||||
$html = $this->exec_curl($ch, $SCHULPORTAL_MSTR_BASE_URL . $url, $post);
|
||||
return ($html);
|
||||
}
|
||||
}
|
||||
336
plugins/AsdCurl/src/AsdUp.php
Normal file
336
plugins/AsdCurl/src/AsdUp.php
Normal file
@@ -0,0 +1,336 @@
|
||||
<?php
|
||||
|
||||
namespace AsdCurl;
|
||||
|
||||
use App\Controller\AppController;
|
||||
use Cake\ORM\TableRegistry;
|
||||
use AsdCurl\AsdCurl;
|
||||
use Cake\Core\Configure;
|
||||
use Cake\I18n\Time;
|
||||
|
||||
class AsdUp extends AsdCurl
|
||||
{
|
||||
public function __construct($url = null)
|
||||
{
|
||||
$this->status = true;
|
||||
$this->error = false;
|
||||
}
|
||||
|
||||
public function change_school($ch,$snr) {
|
||||
$SCHULPORTAL_ASD_BASE_URL = Configure::read('AsdCurl.asdbaseurl');
|
||||
// Schule wechseln
|
||||
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
|
||||
$conversationId = $this->get_string_between($this->html, 'name="conversationId" value="', '" />');
|
||||
|
||||
$post = [
|
||||
'mainForm' => 'mainForm',
|
||||
'referenzBaumAnzeigen' => 'false',
|
||||
'conversationId' => $conversationId,
|
||||
'changeNotification' => 'true',
|
||||
'mainForm:hasChanged' => 'false',
|
||||
'mainForm:hasNotReleased' => 'false',
|
||||
'mainForm:hasPopUpChanged' => 'false',
|
||||
'mainForm:hasAdresseChanged' => 'false',
|
||||
'mainForm:confirmedOverride' => 'true',
|
||||
'mainForm:zuordnungNotification' => 'false',
|
||||
'skipvalidation' => 'true',
|
||||
'mainForm:istAnzeigeMaske' => 'false',
|
||||
'mainForm:schulnr' => $snr,
|
||||
'mainForm:action_anzeigen' => 'Direkt zur gewählten Schule',
|
||||
'mainForm:schuljahr' => '23',
|
||||
'javax.faces.ViewState' => $viewstate
|
||||
];
|
||||
|
||||
$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/asdbu/up_07_50.jsf?cid=' . $conversationId, $post);
|
||||
if(!($this->status)) {
|
||||
die($this->error);
|
||||
}
|
||||
echo $this->html;die;
|
||||
}
|
||||
|
||||
public function goto_budget($ch,$budget) {
|
||||
$SCHULPORTAL_ASD_BASE_URL = Configure::read('AsdCurl.asdbaseurl');
|
||||
// Reiter Unterrichtsplanung aufrufen
|
||||
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
|
||||
$conversationId = $this->get_string_between($this->html, 'name="conversationId" value="', '" />');
|
||||
|
||||
$post = [
|
||||
'headerMenu' => 'headerMenu',
|
||||
'javax.faces.ViewState' => $viewstate,
|
||||
'headerMenu:j_idt29' => 'headerMenu:j_idt29'
|
||||
];
|
||||
$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/asdbv/bv_01_02.jsf?cid=' . $conversationId, $post);
|
||||
if(!($this->status)) {
|
||||
die($this->error);
|
||||
}
|
||||
// Im linken Menue Budget GY anzeigen
|
||||
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
|
||||
$conversationId = $this->get_string_between($this->html, 'name="conversationId" value="', '" />');
|
||||
|
||||
$post = [
|
||||
'sideMenu' => 'sideMenu',
|
||||
'javax.faces.ViewState' => $viewstate,
|
||||
'sideMenu:j_idt52:1:j_idt58:6:j_idt60' => 'sideMenu:j_idt52:1:j_idt58:6:j_idt60'
|
||||
];
|
||||
$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/asdup/up_00_00.jsf?cid=' . $conversationId, $post);
|
||||
if(!($this->status)) {
|
||||
die($this->error);
|
||||
}
|
||||
|
||||
// Schule auswählen
|
||||
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
|
||||
$conversationId = $this->get_string_between($this->html, 'name="conversationId" value="', '" />');
|
||||
|
||||
$post = [
|
||||
'mainForm' => 'mainForm',
|
||||
'referenzBaumAnzeigen' => 'false',
|
||||
'conversationId' => $conversationId,
|
||||
'changeNotification' => 'true',
|
||||
'mainForm:hasChanged' => 'false',
|
||||
'mainForm:hasNotReleased' => 'false',
|
||||
'mainForm:hasPopUpChanged' => 'false',
|
||||
'mainForm:hasAdresseChanged' => 'false',
|
||||
'mainForm:confirmedOverride' => 'true',
|
||||
'mainForm:zuordnungNotification' => 'false',
|
||||
'skipvalidation' => 'false',
|
||||
'mainForm:istAnzeigeMaske' => 'false',
|
||||
'mainForm:nameOffiziell' => 'Bayer.Staatsministerium für Unterricht und Kultus München',
|
||||
'mainForm:schulstellePlzStrasse' => '80333',
|
||||
'mainForm:schulstelleOrt' => 'München',
|
||||
'mainForm:schulnummer' => $budget['snr'],
|
||||
'mainForm:action_anzeigen' => 'Direkt zur gewählten Schule',
|
||||
'javax.faces.ViewState' => $viewstate
|
||||
];
|
||||
$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/asdbu/up_07_51.jsf?cid=' . $conversationId, $post);
|
||||
if(!($this->status)) {
|
||||
die($this->error);
|
||||
}
|
||||
|
||||
// Auf anderen Reiter wechseln
|
||||
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
|
||||
$conversationId = $this->get_string_between($this->html, 'name="conversationId" value="', '" />');
|
||||
|
||||
$post = [
|
||||
'mainForm' => 'mainForm',
|
||||
'referenzBaumAnzeigen' => 'false',
|
||||
'conversationId' => $conversationId,
|
||||
'changeNotification' => 'true',
|
||||
'mainForm:hasChanged' => 'false',
|
||||
'mainForm:hasNotReleased' => 'false',
|
||||
'mainForm:hasPopUpChanged' => 'false',
|
||||
'mainForm:hasAdresseChanged' => 'false',
|
||||
'mainForm:confirmedOverride' => 'true',
|
||||
'mainForm:zuordnungNotification' => 'false',
|
||||
'skipvalidation' => 'false',
|
||||
'mainForm:istAnzeigeMaske' => 'false',
|
||||
'mainForm:schulnr' => '',
|
||||
'mainForm:schuljahr' => '23',
|
||||
'mainForm:schulnummer' => $budget['snr'],
|
||||
'mainForm:tabs.1' => 'Budgetzuschläge',
|
||||
'javax.faces.ViewState' => $viewstate
|
||||
];
|
||||
$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/asdbu/up_07_50.jsf?cid=' . $conversationId, $post);
|
||||
if(!($this->status)) {
|
||||
die($this->error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function read_budget($ch,$snr) {
|
||||
$SCHULPORTAL_ASD_BASE_URL = Configure::read('AsdCurl.asdbaseurl');
|
||||
$htmlParser = new \DOMDocument(); //to parse html using DOMDocument
|
||||
libxml_use_internal_errors(true); // your HTML gives parser warnings, keep them internal
|
||||
$htmlParser->loadHTML($this->html); //Loaded the html string we took from simple xml
|
||||
$htmlParser->preserveWhiteSpace = false;
|
||||
|
||||
$headers = ['checkbox','herkunft','budget','von','bis','count','comment'];
|
||||
$table = $htmlParser->getElementById('mainForm:dataTable:zuschlaege');
|
||||
|
||||
$rows = $table->getElementsByTagName('tr');
|
||||
|
||||
for($i=0;$i < (sizeof($rows)-1);$i++) {
|
||||
$cols = $rows[$i]->getElementsByTagName('td');
|
||||
$j = 0;
|
||||
foreach($cols as $col) {
|
||||
$span = $col->getElementsByTagName('span');
|
||||
//debug(sizeof($span));
|
||||
if(sizeof($span) > 0) {
|
||||
$data[$i][$headers[$j]] = $span->item(0)->nodeValue;
|
||||
}
|
||||
$j++;
|
||||
}
|
||||
}
|
||||
$cols = $rows[sizeof($rows)-1]->getElementsByTagName('td');
|
||||
$span = $cols[1]->getElementsByTagName('span');
|
||||
$sum = $span->item(0)->nodeValue;
|
||||
//$data['sum'] = $sum;
|
||||
return($data);
|
||||
}
|
||||
|
||||
public function del_all_budget($ch,$snr) {
|
||||
//debug($snr);
|
||||
//echo($this->html);
|
||||
$SCHULPORTAL_ASD_BASE_URL = Configure::read('AsdCurl.asdbaseurl');
|
||||
|
||||
$htmlParser = new \DOMDocument(); //to parse html using DOMDocument
|
||||
libxml_use_internal_errors(true); // your HTML gives parser warnings, keep them internal
|
||||
$htmlParser->loadHTML($this->html); //Loaded the html string we took from simple xml
|
||||
$htmlParser->preserveWhiteSpace = false;
|
||||
|
||||
$table = $htmlParser->getElementById('mainForm:dataTable:zuschlaege');
|
||||
|
||||
$rows = $table->getElementsByTagName('tr');
|
||||
$to_del = array();
|
||||
for($i=1;$i < sizeof($rows);$i++) {
|
||||
$cols = $rows[$i]->getElementsByTagName('td');
|
||||
debug(Sizeof($cols));
|
||||
$herkunft = $cols[1]->getElementsByTagName('span')->item(0)->nodeValue;
|
||||
debug($herkunft);
|
||||
if($herkunft == 'ASD') {
|
||||
array_push($to_del,$i);
|
||||
}
|
||||
}
|
||||
debug($to_del);
|
||||
//die;
|
||||
|
||||
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
|
||||
$conversationId = $this->get_string_between($this->html, 'name="conversationId" value="', '" />');
|
||||
|
||||
$post = [
|
||||
'mainForm' => 'mainForm',
|
||||
'referenzBaumAnzeigen' => 'false',
|
||||
'conversationId' => $conversationId,
|
||||
'changeNotification' => 'true',
|
||||
'mainForm:hasChanged' => 'true',
|
||||
'mainForm:hasNotReleased' => 'false',
|
||||
'mainForm:hasPopUpChanged' => 'false',
|
||||
'mainForm:hasAdresseChanged' => 'false',
|
||||
'mainForm:confirmedOverride' => 'true',
|
||||
'mainForm:zuordnungNotification' => 'false',
|
||||
'skipvalidation' => 'false',
|
||||
'mainForm:istAnzeigeMaske' => 'false',
|
||||
'mainForm:schulnr' => '',
|
||||
'mainForm:schuljahr' => '23',
|
||||
'mainForm:schulnummer' => $snr,
|
||||
'mainForm:tab2:artZuschlag' => 'com.hp.asd.wl.domain.standard.Budgetform:1502',
|
||||
'mainForm:tab2:datumBis' => '31.07.2019',
|
||||
'mainForm:tab2:_edit_budget' => '',
|
||||
'mainForm:tab2:_edit_bemerkung' => '',
|
||||
'mainForm:loeschen' => 'Löschen',
|
||||
'javax.faces.ViewState' => $viewstate
|
||||
];
|
||||
foreach($to_del as $value) {
|
||||
$post['mainForm:tab2:_' . $value .'_select'] = 'on';
|
||||
}
|
||||
//debug($post);die;
|
||||
$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/asdbu/up_07_50.jsf?cid=' . $conversationId, $post);
|
||||
if(!($this->status)) {
|
||||
die($this->error);
|
||||
}
|
||||
|
||||
// Budget speichern
|
||||
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
|
||||
$conversationId = $this->get_string_between($this->html, 'name="conversationId" value="', '" />');
|
||||
|
||||
$post = [
|
||||
'mainForm' => 'mainForm',
|
||||
'referenzBaumAnzeigen' => 'false',
|
||||
'conversationId' => $conversationId,
|
||||
'changeNotification' => 'true',
|
||||
'mainForm:hasChanged' => 'true',
|
||||
'mainForm:hasNotReleased' => 'false',
|
||||
'mainForm:hasPopUpChanged' => 'false',
|
||||
'mainForm:hasAdresseChanged' => 'false',
|
||||
'mainForm:confirmedOverride' => 'true',
|
||||
'mainForm:zuordnungNotification' => 'false',
|
||||
'skipvalidation' => 'false',
|
||||
'mainForm:istAnzeigeMaske' => 'false',
|
||||
'mainForm:schulnr' => '',
|
||||
'mainForm:schuljahr' => '23',
|
||||
'mainForm:schulnummer' => $snr,
|
||||
'mainForm:tab2:artZuschlag' => 'com.hp.asd.wl.domain.standard.Budgetform:1502',
|
||||
'mainForm:tab2:datumBis' => '31.07.2019',
|
||||
'mainForm:tab2:_edit_budget' => '',
|
||||
'mainForm:tab2:_edit_bemerkung' => '',
|
||||
'mainForm:speichern' => 'Speichern',
|
||||
'javax.faces.ViewState' => $viewstate
|
||||
];
|
||||
$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/asdbu/up_07_50.jsf?cid=' . $conversationId, $post);
|
||||
if(!($this->status)) {
|
||||
die($this->error);
|
||||
}
|
||||
return($to_del);
|
||||
}
|
||||
|
||||
public function write_budget($ch,$budget) {
|
||||
$SCHULPORTAL_ASD_BASE_URL = Configure::read('AsdCurl.asdbaseurl');
|
||||
|
||||
// Budget eintragen
|
||||
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
|
||||
$conversationId = $this->get_string_between($this->html, 'name="conversationId" value="', '" />');
|
||||
|
||||
$post = [
|
||||
'mainForm' => 'mainForm',
|
||||
'referenzBaumAnzeigen' => 'false',
|
||||
'conversationId' => $conversationId,
|
||||
'changeNotification' => 'true',
|
||||
'mainForm:hasChanged' => 'true',
|
||||
'mainForm:hasNotReleased' => 'false',
|
||||
'mainForm:hasPopUpChanged' => 'false',
|
||||
'mainForm:hasAdresseChanged' => 'false',
|
||||
'mainForm:confirmedOverride' => 'true',
|
||||
'mainForm:zuordnungNotification' => 'false',
|
||||
'skipvalidation' => 'false',
|
||||
'mainForm:istAnzeigeMaske' => 'false',
|
||||
'mainForm:schulnr' => '',
|
||||
'mainForm:schuljahr' => '23',
|
||||
'mainForm:schulnummer' => $budget['snr'],
|
||||
'mainForm:tab2:artZuschlag' => 'com.hp.asd.wl.domain.standard.Budgetform:' . $budget['budget_id'],
|
||||
'mainForm:tab2:datumBis' => '31.07.2019',
|
||||
'mainForm:tab2:_edit_budget' => $budget['count'],
|
||||
'mainForm:tab2:_edit_bemerkung' => $budget['comment'],
|
||||
'mainForm:tab2:hinzufuegen' => 'Hinzufügen',
|
||||
'javax.faces.ViewState' => $viewstate
|
||||
];
|
||||
$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/asdbu/up_07_50.jsf?cid=' . $conversationId, $post);
|
||||
if(!($this->status)) {
|
||||
die($this->error);
|
||||
}
|
||||
|
||||
// Budget speichern
|
||||
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
|
||||
$conversationId = $this->get_string_between($this->html, 'name="conversationId" value="', '" />');
|
||||
|
||||
$post = [
|
||||
'mainForm' => 'mainForm',
|
||||
'referenzBaumAnzeigen' => 'false',
|
||||
'conversationId' => $conversationId,
|
||||
'changeNotification' => 'true',
|
||||
'mainForm:hasChanged' => 'true',
|
||||
'mainForm:hasNotReleased' => 'false',
|
||||
'mainForm:hasPopUpChanged' => 'false',
|
||||
'mainForm:hasAdresseChanged' => 'false',
|
||||
'mainForm:confirmedOverride' => 'true',
|
||||
'mainForm:zuordnungNotification' => 'false',
|
||||
'skipvalidation' => 'false',
|
||||
'mainForm:istAnzeigeMaske' => 'false',
|
||||
'mainForm:schulnr' => '',
|
||||
'mainForm:schuljahr' => '23',
|
||||
'mainForm:schulnummer' => $budget['snr'],
|
||||
'mainForm:tab2:artZuschlag' => 'com.hp.asd.wl.domain.standard.Budgetform:' . $budget['budget_id'],
|
||||
'mainForm:tab2:datumBis' => '31.07.2019',
|
||||
'mainForm:tab2:_edit_budget' => '',
|
||||
'mainForm:tab2:_edit_bemerkung' => '',
|
||||
'mainForm:speichern' => 'Speichern',
|
||||
'javax.faces.ViewState' => $viewstate
|
||||
];
|
||||
$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/asdbu/up_07_50.jsf?cid=' . $conversationId, $post);
|
||||
if(!($this->status)) {
|
||||
die($this->error);
|
||||
}
|
||||
|
||||
//echo $this->html;die;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
10
plugins/AsdCurl/src/Controller/AppController.php
Normal file
10
plugins/AsdCurl/src/Controller/AppController.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace AsdCurl\Controller;
|
||||
|
||||
use App\Controller\AppController as BaseController;
|
||||
|
||||
class AppController extends BaseController
|
||||
{
|
||||
|
||||
}
|
||||
35
plugins/AsdCurl/src/Url.php
Normal file
35
plugins/AsdCurl/src/Url.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace AsdCurl;
|
||||
|
||||
class Url
|
||||
{
|
||||
/**
|
||||
* URL source
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $src;
|
||||
|
||||
public function __construct($url)
|
||||
{
|
||||
// Prepend http:// if the url doesn't contain it
|
||||
if (!stristr($url, 'http://') && !stristr($url, 'https://')) {
|
||||
$url = 'http://' . $url;
|
||||
}
|
||||
|
||||
if (!$url || !filter_var($url, FILTER_VALIDATE_URL)) {
|
||||
throw new InvalidUrlException($url);
|
||||
}
|
||||
|
||||
$url = str_replace(array(';', '"', '<?'), '', strip_tags($url));
|
||||
$url = str_replace(array('\077', '\''), array(' ', '/'), $url);
|
||||
|
||||
$this->src = $url;
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
return $this->src;
|
||||
}
|
||||
}
|
||||
0
plugins/AsdCurl/webroot/empty
Normal file
0
plugins/AsdCurl/webroot/empty
Normal file
0
plugins/empty
Normal file
0
plugins/empty
Normal file
52
src/Application.php
Normal file
52
src/Application.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since 3.3.0
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
namespace App;
|
||||
|
||||
use Cake\Core\Configure;
|
||||
use Cake\Error\Middleware\ErrorHandlerMiddleware;
|
||||
use Cake\Http\BaseApplication;
|
||||
use Cake\Routing\Middleware\AssetMiddleware;
|
||||
use Cake\Routing\Middleware\RoutingMiddleware;
|
||||
|
||||
/**
|
||||
* Application setup class.
|
||||
*
|
||||
* This defines the bootstrapping logic and middleware layers you
|
||||
* want to use in your application.
|
||||
*/
|
||||
class Application extends BaseApplication
|
||||
{
|
||||
/**
|
||||
* Setup the middleware queue your application will use.
|
||||
*
|
||||
* @param \Cake\Http\MiddlewareQueue $middlewareQueue The middleware queue to setup.
|
||||
* @return \Cake\Http\MiddlewareQueue The updated middleware queue.
|
||||
*/
|
||||
public function middleware($middlewareQueue)
|
||||
{
|
||||
$middlewareQueue
|
||||
// Catch any exceptions in the lower layers,
|
||||
// and make an error page/response
|
||||
->add(ErrorHandlerMiddleware::class)
|
||||
|
||||
// Handle plugin/theme assets like CakePHP normally does.
|
||||
->add(AssetMiddleware::class)
|
||||
|
||||
// Add routing middleware.
|
||||
->add(new RoutingMiddleware($this));
|
||||
|
||||
return $middlewareQueue;
|
||||
}
|
||||
}
|
||||
246
src/Console/Installer.php
Normal file
246
src/Console/Installer.php
Normal file
@@ -0,0 +1,246 @@
|
||||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since 3.0.0
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
namespace App\Console;
|
||||
|
||||
if (!defined('STDIN')) {
|
||||
define('STDIN', fopen('php://stdin', 'r'));
|
||||
}
|
||||
|
||||
use Cake\Utility\Security;
|
||||
use Composer\Script\Event;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Provides installation hooks for when this application is installed via
|
||||
* composer. Customize this class to suit your needs.
|
||||
*/
|
||||
class Installer
|
||||
{
|
||||
|
||||
/**
|
||||
* An array of directories to be made writable
|
||||
*/
|
||||
const WRITABLE_DIRS = [
|
||||
'logs',
|
||||
'tmp',
|
||||
'tmp/cache',
|
||||
'tmp/cache/models',
|
||||
'tmp/cache/persistent',
|
||||
'tmp/cache/views',
|
||||
'tmp/sessions',
|
||||
'tmp/tests'
|
||||
];
|
||||
|
||||
/**
|
||||
* Does some routine installation tasks so people don't have to.
|
||||
*
|
||||
* @param \Composer\Script\Event $event The composer event object.
|
||||
* @throws \Exception Exception raised by validator.
|
||||
* @return void
|
||||
*/
|
||||
public static function postInstall(Event $event)
|
||||
{
|
||||
$io = $event->getIO();
|
||||
|
||||
$rootDir = dirname(dirname(__DIR__));
|
||||
|
||||
static::createAppConfig($rootDir, $io);
|
||||
static::createWritableDirectories($rootDir, $io);
|
||||
|
||||
// ask if the permissions should be changed
|
||||
if ($io->isInteractive()) {
|
||||
$validator = function ($arg) {
|
||||
if (in_array($arg, ['Y', 'y', 'N', 'n'])) {
|
||||
return $arg;
|
||||
}
|
||||
throw new Exception('This is not a valid answer. Please choose Y or n.');
|
||||
};
|
||||
$setFolderPermissions = $io->askAndValidate(
|
||||
'<info>Set Folder Permissions ? (Default to Y)</info> [<comment>Y,n</comment>]? ',
|
||||
$validator,
|
||||
10,
|
||||
'Y'
|
||||
);
|
||||
|
||||
if (in_array($setFolderPermissions, ['Y', 'y'])) {
|
||||
static::setFolderPermissions($rootDir, $io);
|
||||
}
|
||||
} else {
|
||||
static::setFolderPermissions($rootDir, $io);
|
||||
}
|
||||
|
||||
static::setSecuritySalt($rootDir, $io);
|
||||
|
||||
if (class_exists('\Cake\Codeception\Console\Installer')) {
|
||||
\Cake\Codeception\Console\Installer::customizeCodeceptionBinary($event);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the config/app.php file if it does not exist.
|
||||
*
|
||||
* @param string $dir The application's root directory.
|
||||
* @param \Composer\IO\IOInterface $io IO interface to write to console.
|
||||
* @return void
|
||||
*/
|
||||
public static function createAppConfig($dir, $io)
|
||||
{
|
||||
$appConfig = $dir . '/config/app.php';
|
||||
$defaultConfig = $dir . '/config/app.default.php';
|
||||
if (!file_exists($appConfig)) {
|
||||
copy($defaultConfig, $appConfig);
|
||||
$io->write('Created `config/app.php` file');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the `logs` and `tmp` directories.
|
||||
*
|
||||
* @param string $dir The application's root directory.
|
||||
* @param \Composer\IO\IOInterface $io IO interface to write to console.
|
||||
* @return void
|
||||
*/
|
||||
public static function createWritableDirectories($dir, $io)
|
||||
{
|
||||
foreach (static::WRITABLE_DIRS as $path) {
|
||||
$path = $dir . '/' . $path;
|
||||
if (!file_exists($path)) {
|
||||
mkdir($path);
|
||||
$io->write('Created `' . $path . '` directory');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set globally writable permissions on the "tmp" and "logs" directory.
|
||||
*
|
||||
* This is not the most secure default, but it gets people up and running quickly.
|
||||
*
|
||||
* @param string $dir The application's root directory.
|
||||
* @param \Composer\IO\IOInterface $io IO interface to write to console.
|
||||
* @return void
|
||||
*/
|
||||
public static function setFolderPermissions($dir, $io)
|
||||
{
|
||||
// Change the permissions on a path and output the results.
|
||||
$changePerms = function ($path, $perms, $io) {
|
||||
// Get permission bits from stat(2) result.
|
||||
$currentPerms = fileperms($path) & 0777;
|
||||
if (($currentPerms & $perms) == $perms) {
|
||||
return;
|
||||
}
|
||||
|
||||
$res = chmod($path, $currentPerms | $perms);
|
||||
if ($res) {
|
||||
$io->write('Permissions set on ' . $path);
|
||||
} else {
|
||||
$io->write('Failed to set permissions on ' . $path);
|
||||
}
|
||||
};
|
||||
|
||||
$walker = function ($dir, $perms, $io) use (&$walker, $changePerms) {
|
||||
$files = array_diff(scandir($dir), ['.', '..']);
|
||||
foreach ($files as $file) {
|
||||
$path = $dir . '/' . $file;
|
||||
|
||||
if (!is_dir($path)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$changePerms($path, $perms, $io);
|
||||
$walker($path, $perms, $io);
|
||||
}
|
||||
};
|
||||
|
||||
$worldWritable = bindec('0000000111');
|
||||
$walker($dir . '/tmp', $worldWritable, $io);
|
||||
$changePerms($dir . '/tmp', $worldWritable, $io);
|
||||
$changePerms($dir . '/logs', $worldWritable, $io);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the security.salt value in the application's config file.
|
||||
*
|
||||
* @param string $dir The application's root directory.
|
||||
* @param \Composer\IO\IOInterface $io IO interface to write to console.
|
||||
* @return void
|
||||
*/
|
||||
public static function setSecuritySalt($dir, $io)
|
||||
{
|
||||
$newKey = hash('sha256', Security::randomBytes(64));
|
||||
static::setSecuritySaltInFile($dir, $io, $newKey, 'app.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the security.salt value in a given file
|
||||
*
|
||||
* @param string $dir The application's root directory.
|
||||
* @param \Composer\IO\IOInterface $io IO interface to write to console.
|
||||
* @param string $newKey key to set in the file
|
||||
* @param string $file A path to a file relative to the application's root
|
||||
* @return void
|
||||
*/
|
||||
public static function setSecuritySaltInFile($dir, $io, $newKey, $file)
|
||||
{
|
||||
$config = $dir . '/config/' . $file;
|
||||
$content = file_get_contents($config);
|
||||
|
||||
$content = str_replace('__SALT__', $newKey, $content, $count);
|
||||
|
||||
if ($count == 0) {
|
||||
$io->write('No Security.salt placeholder to replace.');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$result = file_put_contents($config, $content);
|
||||
if ($result) {
|
||||
$io->write('Updated Security.salt value in config/' . $file);
|
||||
|
||||
return;
|
||||
}
|
||||
$io->write('Unable to update Security.salt value.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the APP_NAME value in a given file
|
||||
*
|
||||
* @param string $dir The application's root directory.
|
||||
* @param \Composer\IO\IOInterface $io IO interface to write to console.
|
||||
* @param string $appName app name to set in the file
|
||||
* @param string $file A path to a file relative to the application's root
|
||||
* @return void
|
||||
*/
|
||||
public static function setAppNameInFile($dir, $io, $appName, $file)
|
||||
{
|
||||
$config = $dir . '/config/' . $file;
|
||||
$content = file_get_contents($config);
|
||||
$content = str_replace('__APP_NAME__', $appName, $content, $count);
|
||||
|
||||
if ($count == 0) {
|
||||
$io->write('No __APP_NAME__ placeholder to replace.');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$result = file_put_contents($config, $content);
|
||||
if ($result) {
|
||||
$io->write('Updated __APP_NAME__ value in config/' . $file);
|
||||
|
||||
return;
|
||||
}
|
||||
$io->write('Unable to update __APP_NAME__ value.');
|
||||
}
|
||||
}
|
||||
54
src/Controller/AppController.php
Normal file
54
src/Controller/AppController.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since 0.2.9
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
namespace App\Controller;
|
||||
|
||||
use Cake\Controller\Controller;
|
||||
use Cake\Event\Event;
|
||||
|
||||
/**
|
||||
* Application Controller
|
||||
*
|
||||
* Add your application-wide methods in the class below, your controllers
|
||||
* will inherit them.
|
||||
*
|
||||
* @link https://book.cakephp.org/3.0/en/controllers.html#the-app-controller
|
||||
*/
|
||||
class AppController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Initialization hook method.
|
||||
*
|
||||
* Use this method to add common initialization code like loading components.
|
||||
*
|
||||
* e.g. `$this->loadComponent('Security');`
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
parent::initialize();
|
||||
|
||||
$this->loadComponent('RequestHandler');
|
||||
$this->loadComponent('Flash');
|
||||
|
||||
/*
|
||||
* Enable the following components for recommended CakePHP security settings.
|
||||
* see https://book.cakephp.org/3.0/en/controllers/components/security.html
|
||||
*/
|
||||
//$this->loadComponent('Security');
|
||||
//$this->loadComponent('Csrf');
|
||||
}
|
||||
}
|
||||
369
src/Controller/BudgetController.php
Normal file
369
src/Controller/BudgetController.php
Normal file
@@ -0,0 +1,369 @@
|
||||
<?php
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Controller\AppController;
|
||||
use AsdCurl\AsdUp;
|
||||
|
||||
/**
|
||||
* Budget Controller
|
||||
*
|
||||
* @property \App\Model\Table\BudgetTable $Budget
|
||||
*
|
||||
* @method \App\Model\Entity\Budget[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
|
||||
*/
|
||||
class BudgetController extends AppController
|
||||
{
|
||||
public function sajax() {
|
||||
$this->autoRender = false;
|
||||
$myfile = fopen(WWW_ROOT . DS . 'files' . DS . 'debug.txt', "w");
|
||||
$data = $this->request->input('json_decode');
|
||||
|
||||
foreach($data as $line) {
|
||||
//fwrite($myfile,json_encode($line). PHP_EOL);
|
||||
for($i=2;$i < sizeof($line);$i++) {
|
||||
if($line[$i] > 0) {
|
||||
$query = $this->Budget->find('all', [
|
||||
'conditions' => array('snr' => $line[0], 'wl_budget_id' => $i-1)
|
||||
]);
|
||||
|
||||
if(!($query->isEmpty())) {
|
||||
$budget = $query->first();
|
||||
if($budget['count'] != $line[$i] ) {
|
||||
$budget['count'] = $line[$i];
|
||||
$this->Budget->save($budget);
|
||||
}
|
||||
fwrite($myfile,'full' . PHP_EOL);
|
||||
}
|
||||
else {
|
||||
fwrite($myfile,'empty' . PHP_EOL);
|
||||
$new = $this->Budget->newEntity();
|
||||
$new_budget['wl_schooltype_id'] = 4;
|
||||
$new_budget['snr'] = $line[0];
|
||||
$new_budget['wl_budget_id'] = $i-1;
|
||||
$new_budget['count'] = $line[$i];
|
||||
$new_budget['comment'] = 'auto';
|
||||
$new_budget['year'] = '2018';
|
||||
|
||||
$new = $this->Budget->patchEntity($new, $new_budget);
|
||||
|
||||
$this->Budget->save($new);
|
||||
}
|
||||
fwrite($myfile,serialize($budget). PHP_EOL);
|
||||
fwrite($myfile,$line[0] . ' ' .($i-1) . ' ' . $line[$i]. PHP_EOL);
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose($myfile);
|
||||
//debug(json_encode($this->request->data));
|
||||
//debug($this->request);
|
||||
//return(true);
|
||||
}
|
||||
|
||||
public function overview() {
|
||||
$wlBudgets = $this->Budget->wlBudgets->find('list', [
|
||||
'conditions' => array('schulart' => 'GY')
|
||||
]);
|
||||
//debug($wlBudgets);
|
||||
|
||||
$this->loadModel('Schools');
|
||||
$schools = $this->Schools->find('all');
|
||||
$data = array();
|
||||
foreach($schools as $school) {
|
||||
$line = array();
|
||||
array_push($line,$school['dst_schluessel']);
|
||||
array_push($line,$school['dst_name']);
|
||||
foreach($wlBudgets as $wlbudget) {
|
||||
array_push($line,'');
|
||||
//debug($budget);
|
||||
}
|
||||
$data[$school['dst_schluessel']] = $line;
|
||||
}
|
||||
|
||||
$budgets = $this->Budget->find('all');
|
||||
foreach($budgets as $budget) {
|
||||
$i = $budget['wl_budget_id']+1;
|
||||
$data[$budget['snr']][$i] = $budget['count'];
|
||||
}
|
||||
$data_arr = array();
|
||||
foreach($data as $entry) {
|
||||
array_push($data_arr,$entry);
|
||||
}
|
||||
|
||||
$this->set('data',$data_arr);
|
||||
$this->set('wlBudgets',$wlBudgets);
|
||||
}
|
||||
|
||||
public function gettype($id = null) {
|
||||
$budget = $this->Budget->newEntity();
|
||||
if ($this->request->is('post')) {
|
||||
//debug($this->request);
|
||||
$r = $this->request;
|
||||
debug($r->params);
|
||||
$wl_id = $r->params['pass']['0'];
|
||||
//debug($wl_id);die;
|
||||
$wlBudget = $this->Budget->WlBudgets->get($wl_id);
|
||||
debug($wlBudget);
|
||||
debug($r->data);
|
||||
die;
|
||||
}
|
||||
|
||||
$budgettype = $this->Budget->WlBudgets->get($id);
|
||||
//debug($budgettype);
|
||||
$this->loadModel('Schools');
|
||||
$schools = $this->Schools->find('all');
|
||||
//debug($schools);
|
||||
$this->set('budget',$budget);
|
||||
$this->set('schools',$schools);
|
||||
}
|
||||
|
||||
public function importCsv() {
|
||||
$uploadData = '';
|
||||
if ($this->request->is('post')) {
|
||||
if(!empty($this->request->data['file']['name'])){
|
||||
$fileName = $this->request->data['file']['name'];
|
||||
$uploadPath = 'uploads/';
|
||||
$uploadFile = $uploadPath.$fileName;
|
||||
if(move_uploaded_file($this->request->data['file']['tmp_name'],$uploadFile)){
|
||||
$this->Flash->success(__('The File has been uploaded.'));
|
||||
return $this->redirect(['action' => 'displayCsv', $fileName]);
|
||||
} else {
|
||||
$this->Flash->error(__('Unable to upload file, please try again.'));
|
||||
}
|
||||
} else {
|
||||
$this->Flash->error(__('Please choose a file to upload.'));
|
||||
}
|
||||
}
|
||||
$this->set('uploadData', $uploadData);
|
||||
}
|
||||
|
||||
public function displayCsv($filename) {
|
||||
//debug($filename);die;
|
||||
$uploadPath = 'uploads/';
|
||||
$handle = fopen($uploadPath.$filename, "r");
|
||||
$head = true;
|
||||
$content_arr = array();
|
||||
if ($handle) {
|
||||
while (($line = fgets($handle)) !== false) {
|
||||
if(strlen($line) > 2) {
|
||||
if($head) {
|
||||
$headers = explode(';',$line);
|
||||
$head = false;
|
||||
}
|
||||
else {
|
||||
array_push($content_arr,explode(';',$line));
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose($handle);
|
||||
} else {
|
||||
// error opening the file.
|
||||
}
|
||||
$this->set('headers',$headers);
|
||||
$this->set('content_arr',$content_arr);
|
||||
}
|
||||
|
||||
public function exportCsv() {
|
||||
$this->response->download('export.csv');
|
||||
|
||||
$exports = $this->Budget->find('all', [
|
||||
'contain' => ['WlBudgets'],
|
||||
'fields' => ['Budget.snr','WlBudgets.wl_werteliste_id','WlBudgets.wl_kurz_bezeichnung','Budget.count','Budget.comment']
|
||||
]);
|
||||
$data = array();
|
||||
foreach($exports as $export) {
|
||||
$line['snr'] = $export->snr;
|
||||
$line['werteliste_id'] = $export->wl_budget->wl_werteliste_id;
|
||||
$line['bezeichnung'] = $export->wl_budget->wl_kurz_bezeichnung;
|
||||
$line['count'] = $export->count;
|
||||
$line['comment'] = $export->comment;
|
||||
array_push($data,$line);
|
||||
//debug(json_decode(json_encode($export)));
|
||||
}
|
||||
//debug($data);die;
|
||||
$_serialize = 'data';
|
||||
$_header = ['Schulnummer', 'Werteliste ID', 'Bezeichnung', 'Count', 'Comment'];
|
||||
$_delimiter = ';';
|
||||
$this->set(compact('data', '_serialize', '_header', '_delimiter'));
|
||||
$this->viewBuilder()->className('CsvView.Csv');
|
||||
|
||||
}
|
||||
|
||||
public function writeAsd()
|
||||
{
|
||||
$curl = new AsdUp();
|
||||
//debug($curl->status);
|
||||
$ch = $curl->init_curl_params();
|
||||
//$curl->login_school($ch); //Login Schulportal
|
||||
$curl->login_asd($ch);
|
||||
//debug($curl->html);
|
||||
|
||||
$budget['snr'] = '9310';
|
||||
$budget['budget_id'] = '1519';
|
||||
$budget['count'] = '5';
|
||||
$budget['comment'] = 'Schüler Hans Mustermann';
|
||||
$curl->goto_budget($ch,$budget);
|
||||
$curl->write_budget($ch,$budget);
|
||||
$snr = '0181';
|
||||
$curl->change_school($ch,$snr);
|
||||
$this->set('html',$curl->html);
|
||||
}
|
||||
|
||||
public function readAsd($snr) {
|
||||
//debug($snr);
|
||||
$snr = '9310';
|
||||
$curl = new AsdUp();
|
||||
$ch = $curl->init_curl_params();
|
||||
$curl->login_asd($ch);
|
||||
$budget['snr'] = $snr;
|
||||
$curl->goto_budget($ch,$budget);
|
||||
$data = $curl->read_budget($ch,$snr);
|
||||
//debug($data);
|
||||
$asd_budget = $this->Budget->find('all',array('conditions' => array('snr' => $snr)));
|
||||
|
||||
|
||||
foreach($asd_budget as $entry) {
|
||||
$new['herkunft'] = 'ASD';
|
||||
//debug($entry);
|
||||
$wl_budget = json_decode(json_encode($this->Budget->WlBudgets->get($entry['wl_budget_id'])));
|
||||
//debug($wl_budget);
|
||||
$new['budget'] = $wl_budget->wl_kurz_bezeichnung;
|
||||
$new['von'] = '01.08.2018';
|
||||
$new['bis'] = '31.07.2019';
|
||||
$new['count'] = $entry['count'];
|
||||
$new['comment'] = $entry['comment'];
|
||||
//debug($new);
|
||||
|
||||
array_push($data,$new);
|
||||
}
|
||||
//debug($data);
|
||||
//die;
|
||||
|
||||
$budget = $this->Budget->newEntity();
|
||||
if ($this->request->is('post')) {
|
||||
$budget = $this->Budget->patchEntity($budget, $this->request->getData());
|
||||
//debug($budget);
|
||||
//debug($this->referer);die;
|
||||
if ($this->Budget->save($budget)) {
|
||||
$this->Flash->success(__('The budget has been saved.'));
|
||||
|
||||
return $this->redirect(['action' => 'readAsd',$snr]);
|
||||
}
|
||||
$this->Flash->error(__('The budget could not be saved. Please, try again.'));
|
||||
}
|
||||
$wlSchooltypes = $this->Budget->WlSchooltypes->find('list', ['limit' => 200]);
|
||||
$wlBudgets = $this->Budget->WlBudgets->find('list', ['limit' => 200]);
|
||||
$this->set(compact('budget', 'wlSchooltypes', 'wlBudgets'));
|
||||
$this->set('data',$data);
|
||||
$this->set('snr',$snr);
|
||||
}
|
||||
|
||||
public function delAllAsd($snr) {
|
||||
$curl = new AsdUp();
|
||||
$ch = $curl->init_curl_params();
|
||||
$curl->login_asd($ch);
|
||||
$budget['snr'] = $snr;
|
||||
$curl->goto_budget($ch,$budget);
|
||||
$to_del = $curl->del_all_budget($ch,$snr);
|
||||
$this->set('to_del',$to_del);
|
||||
}
|
||||
|
||||
/**
|
||||
* Index method
|
||||
*
|
||||
* @return \Cake\Http\Response|void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->paginate = [
|
||||
'contain' => ['WlSchooltypes', 'WlBudgets']
|
||||
];
|
||||
$budget = $this->paginate($this->Budget);
|
||||
|
||||
$this->set(compact('budget'));
|
||||
}
|
||||
|
||||
/**
|
||||
* View method
|
||||
*
|
||||
* @param string|null $id Budget id.
|
||||
* @return \Cake\Http\Response|void
|
||||
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
|
||||
*/
|
||||
public function view($id = null)
|
||||
{
|
||||
$budget = $this->Budget->get($id, [
|
||||
'contain' => ['WlSchooltypes', 'Schools', 'WlBudgets']
|
||||
]);
|
||||
|
||||
$this->set('budget', $budget);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add method
|
||||
*
|
||||
* @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise.
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$budget = $this->Budget->newEntity();
|
||||
if ($this->request->is('post')) {
|
||||
$budget = $this->Budget->patchEntity($budget, $this->request->getData());
|
||||
debug($budget);die;
|
||||
if ($this->Budget->save($budget)) {
|
||||
$this->Flash->success(__('The budget has been saved.'));
|
||||
|
||||
return $this->redirect(['action' => 'index']);
|
||||
}
|
||||
$this->Flash->error(__('The budget could not be saved. Please, try again.'));
|
||||
}
|
||||
$wlSchooltypes = $this->Budget->WlSchooltypes->find('list', ['limit' => 200]);
|
||||
$wlBudgets = $this->Budget->WlBudgets->find('list', ['limit' => 200]);
|
||||
$this->set(compact('budget', 'wlSchooltypes', 'wlBudgets'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit method
|
||||
*
|
||||
* @param string|null $id Budget id.
|
||||
* @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise.
|
||||
* @throws \Cake\Network\Exception\NotFoundException When record not found.
|
||||
*/
|
||||
public function edit($id = null)
|
||||
{
|
||||
$budget = $this->Budget->get($id, [
|
||||
'contain' => []
|
||||
]);
|
||||
if ($this->request->is(['patch', 'post', 'put'])) {
|
||||
$budget = $this->Budget->patchEntity($budget, $this->request->getData());
|
||||
if ($this->Budget->save($budget)) {
|
||||
$this->Flash->success(__('The budget has been saved.'));
|
||||
|
||||
return $this->redirect(['action' => 'index']);
|
||||
}
|
||||
$this->Flash->error(__('The budget could not be saved. Please, try again.'));
|
||||
}
|
||||
$wlSchooltypes = $this->Budget->WlSchooltypes->find('list', ['limit' => 200]);
|
||||
$wlBudgets = $this->Budget->WlBudgets->find('list', ['limit' => 200]);
|
||||
$this->set(compact('budget', 'wlSchooltypes', 'wlBudgets'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete method
|
||||
*
|
||||
* @param string|null $id Budget id.
|
||||
* @return \Cake\Http\Response|null Redirects to index.
|
||||
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
|
||||
*/
|
||||
public function delete($id = null)
|
||||
{
|
||||
$this->request->allowMethod(['post', 'delete']);
|
||||
$budget = $this->Budget->get($id);
|
||||
if ($this->Budget->delete($budget)) {
|
||||
$this->Flash->success(__('The budget has been deleted.'));
|
||||
} else {
|
||||
$this->Flash->error(__('The budget could not be deleted. Please, try again.'));
|
||||
}
|
||||
|
||||
return $this->redirect(['action' => 'index']);
|
||||
}
|
||||
}
|
||||
0
src/Controller/Component/empty
Normal file
0
src/Controller/Component/empty
Normal file
68
src/Controller/ErrorController.php
Normal file
68
src/Controller/ErrorController.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since 3.3.4
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
namespace App\Controller;
|
||||
|
||||
use Cake\Event\Event;
|
||||
|
||||
/**
|
||||
* Error Handling Controller
|
||||
*
|
||||
* Controller used by ExceptionRenderer to render error responses.
|
||||
*/
|
||||
class ErrorController extends AppController
|
||||
{
|
||||
/**
|
||||
* Initialization hook method.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
$this->loadComponent('RequestHandler');
|
||||
}
|
||||
|
||||
/**
|
||||
* beforeFilter callback.
|
||||
*
|
||||
* @param \Cake\Event\Event $event Event.
|
||||
* @return \Cake\Http\Response|null|void
|
||||
*/
|
||||
public function beforeFilter(Event $event)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* beforeRender callback.
|
||||
*
|
||||
* @param \Cake\Event\Event $event Event.
|
||||
* @return \Cake\Http\Response|null|void
|
||||
*/
|
||||
public function beforeRender(Event $event)
|
||||
{
|
||||
parent::beforeRender($event);
|
||||
|
||||
$this->viewBuilder()->setTemplatePath('Error');
|
||||
}
|
||||
|
||||
/**
|
||||
* afterFilter callback.
|
||||
*
|
||||
* @param \Cake\Event\Event $event Event.
|
||||
* @return \Cake\Http\Response|null|void
|
||||
*/
|
||||
public function afterFilter(Event $event)
|
||||
{
|
||||
}
|
||||
}
|
||||
69
src/Controller/PagesController.php
Normal file
69
src/Controller/PagesController.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since 0.2.9
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
namespace App\Controller;
|
||||
|
||||
use Cake\Core\Configure;
|
||||
use Cake\Network\Exception\ForbiddenException;
|
||||
use Cake\Network\Exception\NotFoundException;
|
||||
use Cake\View\Exception\MissingTemplateException;
|
||||
|
||||
/**
|
||||
* Static content controller
|
||||
*
|
||||
* This controller will render views from Template/Pages/
|
||||
*
|
||||
* @link https://book.cakephp.org/3.0/en/controllers/pages-controller.html
|
||||
*/
|
||||
class PagesController extends AppController
|
||||
{
|
||||
|
||||
/**
|
||||
* Displays a view
|
||||
*
|
||||
* @param array ...$path Path segments.
|
||||
* @return \Cake\Http\Response|null
|
||||
* @throws \Cake\Network\Exception\ForbiddenException When a directory traversal attempt.
|
||||
* @throws \Cake\Network\Exception\NotFoundException When the view file could not
|
||||
* be found or \Cake\View\Exception\MissingTemplateException in debug mode.
|
||||
*/
|
||||
public function display(...$path)
|
||||
{
|
||||
$count = count($path);
|
||||
if (!$count) {
|
||||
return $this->redirect('/');
|
||||
}
|
||||
if (in_array('..', $path, true) || in_array('.', $path, true)) {
|
||||
throw new ForbiddenException();
|
||||
}
|
||||
$page = $subpage = null;
|
||||
|
||||
if (!empty($path[0])) {
|
||||
$page = $path[0];
|
||||
}
|
||||
if (!empty($path[1])) {
|
||||
$subpage = $path[1];
|
||||
}
|
||||
$this->set(compact('page', 'subpage'));
|
||||
|
||||
try {
|
||||
$this->render(implode('/', $path));
|
||||
} catch (MissingTemplateException $exception) {
|
||||
if (Configure::read('debug')) {
|
||||
throw $exception;
|
||||
}
|
||||
throw new NotFoundException();
|
||||
}
|
||||
}
|
||||
}
|
||||
114
src/Controller/SchoolsController.php
Normal file
114
src/Controller/SchoolsController.php
Normal file
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Controller\AppController;
|
||||
|
||||
/**
|
||||
* Schools Controller
|
||||
*
|
||||
* @property \App\Model\Table\SchoolsTable $Schools
|
||||
*
|
||||
* @method \App\Model\Entity\School[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
|
||||
*/
|
||||
class SchoolsController extends AppController
|
||||
{
|
||||
public function show() {
|
||||
$results = $this->Schools->find('all');
|
||||
|
||||
//$results = $query->all();
|
||||
//debug($results);
|
||||
$this->set('results',$results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Index method
|
||||
*
|
||||
* @return \Cake\Http\Response|void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$schools = $this->paginate($this->Schools);
|
||||
|
||||
$this->set(compact('schools'));
|
||||
}
|
||||
|
||||
/**
|
||||
* View method
|
||||
*
|
||||
* @param string|null $id School id.
|
||||
* @return \Cake\Http\Response|void
|
||||
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
|
||||
*/
|
||||
public function view($id = null)
|
||||
{
|
||||
$school = $this->Schools->get($id, [
|
||||
'contain' => ['Budget']
|
||||
]);
|
||||
|
||||
$this->set('school', $school);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add method
|
||||
*
|
||||
* @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise.
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$school = $this->Schools->newEntity();
|
||||
if ($this->request->is('post')) {
|
||||
$school = $this->Schools->patchEntity($school, $this->request->getData());
|
||||
if ($this->Schools->save($school)) {
|
||||
$this->Flash->success(__('The school has been saved.'));
|
||||
|
||||
return $this->redirect(['action' => 'index']);
|
||||
}
|
||||
$this->Flash->error(__('The school could not be saved. Please, try again.'));
|
||||
}
|
||||
$this->set(compact('school'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit method
|
||||
*
|
||||
* @param string|null $id School id.
|
||||
* @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise.
|
||||
* @throws \Cake\Network\Exception\NotFoundException When record not found.
|
||||
*/
|
||||
public function edit($id = null)
|
||||
{
|
||||
$school = $this->Schools->get($id, [
|
||||
'contain' => []
|
||||
]);
|
||||
if ($this->request->is(['patch', 'post', 'put'])) {
|
||||
$school = $this->Schools->patchEntity($school, $this->request->getData());
|
||||
if ($this->Schools->save($school)) {
|
||||
$this->Flash->success(__('The school has been saved.'));
|
||||
|
||||
return $this->redirect(['action' => 'index']);
|
||||
}
|
||||
$this->Flash->error(__('The school could not be saved. Please, try again.'));
|
||||
}
|
||||
$this->set(compact('school'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete method
|
||||
*
|
||||
* @param string|null $id School id.
|
||||
* @return \Cake\Http\Response|null Redirects to index.
|
||||
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
|
||||
*/
|
||||
public function delete($id = null)
|
||||
{
|
||||
$this->request->allowMethod(['post', 'delete']);
|
||||
$school = $this->Schools->get($id);
|
||||
if ($this->Schools->delete($school)) {
|
||||
$this->Flash->success(__('The school has been deleted.'));
|
||||
} else {
|
||||
$this->Flash->error(__('The school could not be deleted. Please, try again.'));
|
||||
}
|
||||
|
||||
return $this->redirect(['action' => 'index']);
|
||||
}
|
||||
}
|
||||
127
src/Controller/WlBudgetsController.php
Normal file
127
src/Controller/WlBudgetsController.php
Normal file
@@ -0,0 +1,127 @@
|
||||
<?php
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Controller\AppController;
|
||||
|
||||
/**
|
||||
* WlBudgets Controller
|
||||
*
|
||||
* @property \App\Model\Table\WlBudgetsTable $WlBudgets
|
||||
*
|
||||
* @method \App\Model\Entity\WlBudget[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
|
||||
*/
|
||||
class WlBudgetsController extends AppController
|
||||
{
|
||||
|
||||
/**
|
||||
* Index method
|
||||
*
|
||||
* @return \Cake\Http\Response|void
|
||||
*/
|
||||
|
||||
public function select() {
|
||||
|
||||
if ($this->request->is('post')) {
|
||||
//debug($this->request['data']);
|
||||
$budget_id = $this->request['data']['wl_Budgets'];
|
||||
//debug($budget_id);
|
||||
|
||||
return $this->redirect(['controller' => 'budget', 'action' => 'gettype', $budget_id]);
|
||||
}
|
||||
else {
|
||||
$wlBudget = $this->WlBudgets->newEntity();
|
||||
$wlBudgets = $this->WlBudgets->find('list', [
|
||||
'conditions' => array('schulart' => 'GY')
|
||||
]);
|
||||
//debug($wlBudgets);
|
||||
$this->set(compact('wlBudget','wlBudgets'));
|
||||
}
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$wlBudgets = $this->paginate($this->WlBudgets);
|
||||
|
||||
$this->set(compact('wlBudgets'));
|
||||
}
|
||||
|
||||
/**
|
||||
* View method
|
||||
*
|
||||
* @param string|null $id Wl Budget id.
|
||||
* @return \Cake\Http\Response|void
|
||||
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
|
||||
*/
|
||||
public function view($id = null)
|
||||
{
|
||||
$wlBudget = $this->WlBudgets->get($id, [
|
||||
'contain' => ['Budget']
|
||||
]);
|
||||
|
||||
$this->set('wlBudget', $wlBudget);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add method
|
||||
*
|
||||
* @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise.
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$wlBudget = $this->WlBudgets->newEntity();
|
||||
if ($this->request->is('post')) {
|
||||
$wlBudget = $this->WlBudgets->patchEntity($wlBudget, $this->request->getData());
|
||||
if ($this->WlBudgets->save($wlBudget)) {
|
||||
$this->Flash->success(__('The wl budget has been saved.'));
|
||||
|
||||
return $this->redirect(['action' => 'index']);
|
||||
}
|
||||
$this->Flash->error(__('The wl budget could not be saved. Please, try again.'));
|
||||
}
|
||||
$this->set(compact('wlBudget'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit method
|
||||
*
|
||||
* @param string|null $id Wl Budget id.
|
||||
* @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise.
|
||||
* @throws \Cake\Network\Exception\NotFoundException When record not found.
|
||||
*/
|
||||
public function edit($id = null)
|
||||
{
|
||||
$wlBudget = $this->WlBudgets->get($id, [
|
||||
'contain' => []
|
||||
]);
|
||||
if ($this->request->is(['patch', 'post', 'put'])) {
|
||||
$wlBudget = $this->WlBudgets->patchEntity($wlBudget, $this->request->getData());
|
||||
if ($this->WlBudgets->save($wlBudget)) {
|
||||
$this->Flash->success(__('The wl budget has been saved.'));
|
||||
|
||||
return $this->redirect(['action' => 'index']);
|
||||
}
|
||||
$this->Flash->error(__('The wl budget could not be saved. Please, try again.'));
|
||||
}
|
||||
$this->set(compact('wlBudget'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete method
|
||||
*
|
||||
* @param string|null $id Wl Budget id.
|
||||
* @return \Cake\Http\Response|null Redirects to index.
|
||||
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
|
||||
*/
|
||||
public function delete($id = null)
|
||||
{
|
||||
$this->request->allowMethod(['post', 'delete']);
|
||||
$wlBudget = $this->WlBudgets->get($id);
|
||||
if ($this->WlBudgets->delete($wlBudget)) {
|
||||
$this->Flash->success(__('The wl budget has been deleted.'));
|
||||
} else {
|
||||
$this->Flash->error(__('The wl budget could not be deleted. Please, try again.'));
|
||||
}
|
||||
|
||||
return $this->redirect(['action' => 'index']);
|
||||
}
|
||||
}
|
||||
107
src/Controller/WlDstTypController.php
Normal file
107
src/Controller/WlDstTypController.php
Normal file
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Controller\AppController;
|
||||
|
||||
/**
|
||||
* WlDstTyp Controller
|
||||
*
|
||||
* @property \App\Model\Table\WlDstTypTable $WlDstTyp
|
||||
*
|
||||
* @method \App\Model\Entity\WlDstTyp[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
|
||||
*/
|
||||
class WlDstTypController extends AppController
|
||||
{
|
||||
|
||||
/**
|
||||
* Index method
|
||||
*
|
||||
* @return \Cake\Http\Response|void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$wlDstTyp = $this->paginate($this->WlDstTyp);
|
||||
|
||||
$this->set(compact('wlDstTyp'));
|
||||
}
|
||||
|
||||
/**
|
||||
* View method
|
||||
*
|
||||
* @param string|null $id Wl Dst Typ id.
|
||||
* @return \Cake\Http\Response|void
|
||||
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
|
||||
*/
|
||||
public function view($id = null)
|
||||
{
|
||||
$wlDstTyp = $this->WlDstTyp->get($id, [
|
||||
'contain' => []
|
||||
]);
|
||||
|
||||
$this->set('wlDstTyp', $wlDstTyp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add method
|
||||
*
|
||||
* @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise.
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$wlDstTyp = $this->WlDstTyp->newEntity();
|
||||
if ($this->request->is('post')) {
|
||||
$wlDstTyp = $this->WlDstTyp->patchEntity($wlDstTyp, $this->request->getData());
|
||||
if ($this->WlDstTyp->save($wlDstTyp)) {
|
||||
$this->Flash->success(__('The wl dst typ has been saved.'));
|
||||
|
||||
return $this->redirect(['action' => 'index']);
|
||||
}
|
||||
$this->Flash->error(__('The wl dst typ could not be saved. Please, try again.'));
|
||||
}
|
||||
$this->set(compact('wlDstTyp'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit method
|
||||
*
|
||||
* @param string|null $id Wl Dst Typ id.
|
||||
* @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise.
|
||||
* @throws \Cake\Network\Exception\NotFoundException When record not found.
|
||||
*/
|
||||
public function edit($id = null)
|
||||
{
|
||||
$wlDstTyp = $this->WlDstTyp->get($id, [
|
||||
'contain' => []
|
||||
]);
|
||||
if ($this->request->is(['patch', 'post', 'put'])) {
|
||||
$wlDstTyp = $this->WlDstTyp->patchEntity($wlDstTyp, $this->request->getData());
|
||||
if ($this->WlDstTyp->save($wlDstTyp)) {
|
||||
$this->Flash->success(__('The wl dst typ has been saved.'));
|
||||
|
||||
return $this->redirect(['action' => 'index']);
|
||||
}
|
||||
$this->Flash->error(__('The wl dst typ could not be saved. Please, try again.'));
|
||||
}
|
||||
$this->set(compact('wlDstTyp'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete method
|
||||
*
|
||||
* @param string|null $id Wl Dst Typ id.
|
||||
* @return \Cake\Http\Response|null Redirects to index.
|
||||
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
|
||||
*/
|
||||
public function delete($id = null)
|
||||
{
|
||||
$this->request->allowMethod(['post', 'delete']);
|
||||
$wlDstTyp = $this->WlDstTyp->get($id);
|
||||
if ($this->WlDstTyp->delete($wlDstTyp)) {
|
||||
$this->Flash->success(__('The wl dst typ has been deleted.'));
|
||||
} else {
|
||||
$this->Flash->error(__('The wl dst typ could not be deleted. Please, try again.'));
|
||||
}
|
||||
|
||||
return $this->redirect(['action' => 'index']);
|
||||
}
|
||||
}
|
||||
107
src/Controller/WlSchooltypesController.php
Normal file
107
src/Controller/WlSchooltypesController.php
Normal file
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Controller\AppController;
|
||||
|
||||
/**
|
||||
* WlSchooltypes Controller
|
||||
*
|
||||
* @property \App\Model\Table\WlSchooltypesTable $WlSchooltypes
|
||||
*
|
||||
* @method \App\Model\Entity\WlSchooltype[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
|
||||
*/
|
||||
class WlSchooltypesController extends AppController
|
||||
{
|
||||
|
||||
/**
|
||||
* Index method
|
||||
*
|
||||
* @return \Cake\Http\Response|void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$wlSchooltypes = $this->paginate($this->WlSchooltypes);
|
||||
|
||||
$this->set(compact('wlSchooltypes'));
|
||||
}
|
||||
|
||||
/**
|
||||
* View method
|
||||
*
|
||||
* @param string|null $id Wl Schooltype id.
|
||||
* @return \Cake\Http\Response|void
|
||||
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
|
||||
*/
|
||||
public function view($id = null)
|
||||
{
|
||||
$wlSchooltype = $this->WlSchooltypes->get($id, [
|
||||
'contain' => ['Budget']
|
||||
]);
|
||||
|
||||
$this->set('wlSchooltype', $wlSchooltype);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add method
|
||||
*
|
||||
* @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise.
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$wlSchooltype = $this->WlSchooltypes->newEntity();
|
||||
if ($this->request->is('post')) {
|
||||
$wlSchooltype = $this->WlSchooltypes->patchEntity($wlSchooltype, $this->request->getData());
|
||||
if ($this->WlSchooltypes->save($wlSchooltype)) {
|
||||
$this->Flash->success(__('The wl schooltype has been saved.'));
|
||||
|
||||
return $this->redirect(['action' => 'index']);
|
||||
}
|
||||
$this->Flash->error(__('The wl schooltype could not be saved. Please, try again.'));
|
||||
}
|
||||
$this->set(compact('wlSchooltype'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit method
|
||||
*
|
||||
* @param string|null $id Wl Schooltype id.
|
||||
* @return \Cake\Http\Response|null Redirects on successful edit, renders view otherwise.
|
||||
* @throws \Cake\Network\Exception\NotFoundException When record not found.
|
||||
*/
|
||||
public function edit($id = null)
|
||||
{
|
||||
$wlSchooltype = $this->WlSchooltypes->get($id, [
|
||||
'contain' => []
|
||||
]);
|
||||
if ($this->request->is(['patch', 'post', 'put'])) {
|
||||
$wlSchooltype = $this->WlSchooltypes->patchEntity($wlSchooltype, $this->request->getData());
|
||||
if ($this->WlSchooltypes->save($wlSchooltype)) {
|
||||
$this->Flash->success(__('The wl schooltype has been saved.'));
|
||||
|
||||
return $this->redirect(['action' => 'index']);
|
||||
}
|
||||
$this->Flash->error(__('The wl schooltype could not be saved. Please, try again.'));
|
||||
}
|
||||
$this->set(compact('wlSchooltype'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete method
|
||||
*
|
||||
* @param string|null $id Wl Schooltype id.
|
||||
* @return \Cake\Http\Response|null Redirects to index.
|
||||
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
|
||||
*/
|
||||
public function delete($id = null)
|
||||
{
|
||||
$this->request->allowMethod(['post', 'delete']);
|
||||
$wlSchooltype = $this->WlSchooltypes->get($id);
|
||||
if ($this->WlSchooltypes->delete($wlSchooltype)) {
|
||||
$this->Flash->success(__('The wl schooltype has been deleted.'));
|
||||
} else {
|
||||
$this->Flash->error(__('The wl schooltype could not be deleted. Please, try again.'));
|
||||
}
|
||||
|
||||
return $this->redirect(['action' => 'index']);
|
||||
}
|
||||
}
|
||||
0
src/Model/Behavior/empty
Normal file
0
src/Model/Behavior/empty
Normal file
46
src/Model/Entity/Budget.php
Normal file
46
src/Model/Entity/Budget.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
namespace App\Model\Entity;
|
||||
|
||||
use Cake\ORM\Entity;
|
||||
|
||||
/**
|
||||
* Budget Entity
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $wl_schooltype_id
|
||||
* @property string $snr
|
||||
* @property int $wl_budget_id
|
||||
* @property int $count
|
||||
* @property string $comment
|
||||
* @property string $year
|
||||
* @property \Cake\I18n\FrozenTime $created
|
||||
* @property \Cake\I18n\FrozenTime $modified
|
||||
*
|
||||
* @property \App\Model\Entity\WlSchooltype $wl_schooltype
|
||||
* @property \App\Model\Entity\WlBudget $wl_budget
|
||||
*/
|
||||
class Budget extends Entity
|
||||
{
|
||||
|
||||
/**
|
||||
* Fields that can be mass assigned using newEntity() or patchEntity().
|
||||
*
|
||||
* Note that when '*' is set to true, this allows all unspecified fields to
|
||||
* be mass assigned. For security purposes, it is advised to set '*' to false
|
||||
* (or remove it), and explicitly make individual fields accessible as needed.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_accessible = [
|
||||
'wl_schooltype_id' => true,
|
||||
'snr' => true,
|
||||
'wl_budget_id' => true,
|
||||
'count' => true,
|
||||
'comment' => true,
|
||||
'year' => true,
|
||||
'created' => true,
|
||||
'modified' => true,
|
||||
'wl_schooltype' => true,
|
||||
'wl_budget' => true
|
||||
];
|
||||
}
|
||||
34
src/Model/Entity/School.php
Normal file
34
src/Model/Entity/School.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
namespace App\Model\Entity;
|
||||
|
||||
use Cake\ORM\Entity;
|
||||
|
||||
/**
|
||||
* School Entity
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $dst_schluessel
|
||||
* @property string $dst_name
|
||||
* @property string $dst_schulart
|
||||
*
|
||||
* @property \App\Model\Entity\Budget[] $budget
|
||||
*/
|
||||
class School extends Entity
|
||||
{
|
||||
|
||||
/**
|
||||
* Fields that can be mass assigned using newEntity() or patchEntity().
|
||||
*
|
||||
* Note that when '*' is set to true, this allows all unspecified fields to
|
||||
* be mass assigned. For security purposes, it is advised to set '*' to false
|
||||
* (or remove it), and explicitly make individual fields accessible as needed.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_accessible = [
|
||||
'dst_schluessel' => true,
|
||||
'dst_name' => true,
|
||||
'dst_schulart' => true,
|
||||
'budget' => true
|
||||
];
|
||||
}
|
||||
38
src/Model/Entity/WlBudget.php
Normal file
38
src/Model/Entity/WlBudget.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
namespace App\Model\Entity;
|
||||
|
||||
use Cake\ORM\Entity;
|
||||
|
||||
/**
|
||||
* WlBudget Entity
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $wl_werteliste_nr
|
||||
* @property string $wl_kurz_bezeichnung
|
||||
* @property string $schulart
|
||||
* @property \Cake\I18n\FrozenTime $created
|
||||
* @property \Cake\I18n\FrozenTime $modfied
|
||||
*
|
||||
* @property \App\Model\Entity\Budget[] $budget
|
||||
*/
|
||||
class WlBudget extends Entity
|
||||
{
|
||||
|
||||
/**
|
||||
* Fields that can be mass assigned using newEntity() or patchEntity().
|
||||
*
|
||||
* Note that when '*' is set to true, this allows all unspecified fields to
|
||||
* be mass assigned. For security purposes, it is advised to set '*' to false
|
||||
* (or remove it), and explicitly make individual fields accessible as needed.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_accessible = [
|
||||
'wl_werteliste_nr' => true,
|
||||
'wl_kurz_bezeichnung' => true,
|
||||
'schulart' => true,
|
||||
'created' => true,
|
||||
'modfied' => true,
|
||||
'budget' => true
|
||||
];
|
||||
}
|
||||
35
src/Model/Entity/WlDstTyp.php
Normal file
35
src/Model/Entity/WlDstTyp.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
namespace App\Model\Entity;
|
||||
|
||||
use Cake\ORM\Entity;
|
||||
|
||||
/**
|
||||
* WlDstTyp Entity
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $key_value
|
||||
* @property string $short
|
||||
* @property string $name
|
||||
* @property \Cake\I18n\FrozenTime $created
|
||||
* @property \Cake\I18n\FrozenTime $modfied
|
||||
*/
|
||||
class WlDstTyp extends Entity
|
||||
{
|
||||
|
||||
/**
|
||||
* Fields that can be mass assigned using newEntity() or patchEntity().
|
||||
*
|
||||
* Note that when '*' is set to true, this allows all unspecified fields to
|
||||
* be mass assigned. For security purposes, it is advised to set '*' to false
|
||||
* (or remove it), and explicitly make individual fields accessible as needed.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_accessible = [
|
||||
'key_value' => true,
|
||||
'short' => true,
|
||||
'name' => true,
|
||||
'created' => true,
|
||||
'modfied' => true
|
||||
];
|
||||
}
|
||||
38
src/Model/Entity/WlSchooltype.php
Normal file
38
src/Model/Entity/WlSchooltype.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
namespace App\Model\Entity;
|
||||
|
||||
use Cake\ORM\Entity;
|
||||
|
||||
/**
|
||||
* WlSchooltype Entity
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $key_value
|
||||
* @property string $short
|
||||
* @property string $name
|
||||
* @property \Cake\I18n\FrozenTime $created
|
||||
* @property \Cake\I18n\FrozenTime $modfied
|
||||
*
|
||||
* @property \App\Model\Entity\Budget[] $budget
|
||||
*/
|
||||
class WlSchooltype extends Entity
|
||||
{
|
||||
|
||||
/**
|
||||
* Fields that can be mass assigned using newEntity() or patchEntity().
|
||||
*
|
||||
* Note that when '*' is set to true, this allows all unspecified fields to
|
||||
* be mass assigned. For security purposes, it is advised to set '*' to false
|
||||
* (or remove it), and explicitly make individual fields accessible as needed.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_accessible = [
|
||||
'key_value' => true,
|
||||
'short' => true,
|
||||
'name' => true,
|
||||
'created' => true,
|
||||
'modfied' => true,
|
||||
'budget' => true
|
||||
];
|
||||
}
|
||||
105
src/Model/Table/BudgetTable.php
Normal file
105
src/Model/Table/BudgetTable.php
Normal file
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
namespace App\Model\Table;
|
||||
|
||||
use Cake\ORM\Query;
|
||||
use Cake\ORM\RulesChecker;
|
||||
use Cake\ORM\Table;
|
||||
use Cake\Validation\Validator;
|
||||
|
||||
/**
|
||||
* Budget Model
|
||||
*
|
||||
* @property \App\Model\Table\WlSchooltypesTable|\Cake\ORM\Association\BelongsTo $WlSchooltypes
|
||||
* @property \App\Model\Table\WlBudgetsTable|\Cake\ORM\Association\BelongsTo $WlBudgets
|
||||
*
|
||||
* @method \App\Model\Entity\Budget get($primaryKey, $options = [])
|
||||
* @method \App\Model\Entity\Budget newEntity($data = null, array $options = [])
|
||||
* @method \App\Model\Entity\Budget[] newEntities(array $data, array $options = [])
|
||||
* @method \App\Model\Entity\Budget|bool save(\Cake\Datasource\EntityInterface $entity, $options = [])
|
||||
* @method \App\Model\Entity\Budget patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
|
||||
* @method \App\Model\Entity\Budget[] patchEntities($entities, array $data, array $options = [])
|
||||
* @method \App\Model\Entity\Budget findOrCreate($search, callable $callback = null, $options = [])
|
||||
*
|
||||
* @mixin \Cake\ORM\Behavior\TimestampBehavior
|
||||
*/
|
||||
class BudgetTable extends Table
|
||||
{
|
||||
|
||||
/**
|
||||
* Initialize method
|
||||
*
|
||||
* @param array $config The configuration for the Table.
|
||||
* @return void
|
||||
*/
|
||||
public function initialize(array $config)
|
||||
{
|
||||
parent::initialize($config);
|
||||
|
||||
$this->setTable('budget');
|
||||
$this->setDisplayField('id');
|
||||
$this->setPrimaryKey('id');
|
||||
|
||||
$this->addBehavior('Timestamp');
|
||||
|
||||
$this->belongsTo('WlSchooltypes', [
|
||||
'foreignKey' => 'wl_schooltype_id',
|
||||
'joinType' => 'INNER'
|
||||
]);
|
||||
$this->belongsTo('WlBudgets', [
|
||||
'foreignKey' => 'wl_budget_id',
|
||||
'joinType' => 'INNER'
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Default validation rules.
|
||||
*
|
||||
* @param \Cake\Validation\Validator $validator Validator instance.
|
||||
* @return \Cake\Validation\Validator
|
||||
*/
|
||||
public function validationDefault(Validator $validator)
|
||||
{
|
||||
$validator
|
||||
->integer('id')
|
||||
->allowEmpty('id', 'create');
|
||||
|
||||
$validator
|
||||
->scalar('snr')
|
||||
->maxLength('snr', 4)
|
||||
->requirePresence('snr', 'create')
|
||||
->notEmpty('snr');
|
||||
|
||||
$validator
|
||||
->integer('count')
|
||||
->requirePresence('count', 'create')
|
||||
->notEmpty('count');
|
||||
|
||||
$validator
|
||||
->scalar('comment')
|
||||
->maxLength('comment', 255)
|
||||
->requirePresence('comment', 'create')
|
||||
->notEmpty('comment');
|
||||
|
||||
$validator
|
||||
->scalar('year')
|
||||
->requirePresence('year', 'create')
|
||||
->notEmpty('year');
|
||||
|
||||
return $validator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a rules checker object that will be used for validating
|
||||
* application integrity.
|
||||
*
|
||||
* @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
|
||||
* @return \Cake\ORM\RulesChecker
|
||||
*/
|
||||
public function buildRules(RulesChecker $rules)
|
||||
{
|
||||
$rules->add($rules->existsIn(['wl_schooltype_id'], 'WlSchooltypes'));
|
||||
$rules->add($rules->existsIn(['wl_budget_id'], 'WlBudgets'));
|
||||
|
||||
return $rules;
|
||||
}
|
||||
}
|
||||
72
src/Model/Table/SchoolsTable.php
Normal file
72
src/Model/Table/SchoolsTable.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
namespace App\Model\Table;
|
||||
|
||||
use Cake\ORM\Query;
|
||||
use Cake\ORM\RulesChecker;
|
||||
use Cake\ORM\Table;
|
||||
use Cake\Validation\Validator;
|
||||
|
||||
/**
|
||||
* Schools Model
|
||||
*
|
||||
* @property \App\Model\Table\BudgetTable|\Cake\ORM\Association\HasMany $Budget
|
||||
*
|
||||
* @method \App\Model\Entity\School get($primaryKey, $options = [])
|
||||
* @method \App\Model\Entity\School newEntity($data = null, array $options = [])
|
||||
* @method \App\Model\Entity\School[] newEntities(array $data, array $options = [])
|
||||
* @method \App\Model\Entity\School|bool save(\Cake\Datasource\EntityInterface $entity, $options = [])
|
||||
* @method \App\Model\Entity\School patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
|
||||
* @method \App\Model\Entity\School[] patchEntities($entities, array $data, array $options = [])
|
||||
* @method \App\Model\Entity\School findOrCreate($search, callable $callback = null, $options = [])
|
||||
*/
|
||||
class SchoolsTable extends Table
|
||||
{
|
||||
|
||||
/**
|
||||
* Initialize method
|
||||
*
|
||||
* @param array $config The configuration for the Table.
|
||||
* @return void
|
||||
*/
|
||||
public function initialize(array $config)
|
||||
{
|
||||
parent::initialize($config);
|
||||
|
||||
$this->setTable('schools');
|
||||
$this->setDisplayField('dst_schluessel');
|
||||
$this->setPrimaryKey('id');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Default validation rules.
|
||||
*
|
||||
* @param \Cake\Validation\Validator $validator Validator instance.
|
||||
* @return \Cake\Validation\Validator
|
||||
*/
|
||||
public function validationDefault(Validator $validator)
|
||||
{
|
||||
$validator
|
||||
->integer('id')
|
||||
->allowEmpty('id', 'create');
|
||||
|
||||
$validator
|
||||
->scalar('dst_schluessel')
|
||||
->maxLength('dst_schluessel', 4)
|
||||
->requirePresence('dst_schluessel', 'create')
|
||||
->notEmpty('dst_schluessel');
|
||||
|
||||
$validator
|
||||
->scalar('dst_name')
|
||||
->maxLength('dst_name', 255)
|
||||
->requirePresence('dst_name', 'create')
|
||||
->notEmpty('dst_name');
|
||||
|
||||
$validator
|
||||
->scalar('dst_schulart')
|
||||
->maxLength('dst_schulart', 4)
|
||||
->allowEmpty('dst_schulart');
|
||||
|
||||
return $validator;
|
||||
}
|
||||
}
|
||||
82
src/Model/Table/WlBudgetsTable.php
Normal file
82
src/Model/Table/WlBudgetsTable.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
namespace App\Model\Table;
|
||||
|
||||
use Cake\ORM\Query;
|
||||
use Cake\ORM\RulesChecker;
|
||||
use Cake\ORM\Table;
|
||||
use Cake\Validation\Validator;
|
||||
|
||||
/**
|
||||
* WlBudgets Model
|
||||
*
|
||||
* @property \App\Model\Table\BudgetTable|\Cake\ORM\Association\HasMany $Budget
|
||||
*
|
||||
* @method \App\Model\Entity\WlBudget get($primaryKey, $options = [])
|
||||
* @method \App\Model\Entity\WlBudget newEntity($data = null, array $options = [])
|
||||
* @method \App\Model\Entity\WlBudget[] newEntities(array $data, array $options = [])
|
||||
* @method \App\Model\Entity\WlBudget|bool save(\Cake\Datasource\EntityInterface $entity, $options = [])
|
||||
* @method \App\Model\Entity\WlBudget patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
|
||||
* @method \App\Model\Entity\WlBudget[] patchEntities($entities, array $data, array $options = [])
|
||||
* @method \App\Model\Entity\WlBudget findOrCreate($search, callable $callback = null, $options = [])
|
||||
*
|
||||
* @mixin \Cake\ORM\Behavior\TimestampBehavior
|
||||
*/
|
||||
class WlBudgetsTable extends Table
|
||||
{
|
||||
|
||||
/**
|
||||
* Initialize method
|
||||
*
|
||||
* @param array $config The configuration for the Table.
|
||||
* @return void
|
||||
*/
|
||||
public function initialize(array $config)
|
||||
{
|
||||
parent::initialize($config);
|
||||
|
||||
$this->setTable('wl_budgets');
|
||||
$this->setDisplayField('wl_kurz_bezeichnung');
|
||||
$this->setPrimaryKey('id');
|
||||
|
||||
$this->addBehavior('Timestamp');
|
||||
|
||||
$this->hasMany('Budget', [
|
||||
'foreignKey' => 'wl_budget_id'
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Default validation rules.
|
||||
*
|
||||
* @param \Cake\Validation\Validator $validator Validator instance.
|
||||
* @return \Cake\Validation\Validator
|
||||
*/
|
||||
public function validationDefault(Validator $validator)
|
||||
{
|
||||
$validator
|
||||
->integer('id')
|
||||
->allowEmpty('id', 'create');
|
||||
|
||||
$validator
|
||||
->scalar('wl_werteliste_nr')
|
||||
->maxLength('wl_werteliste_nr', 10)
|
||||
->allowEmpty('wl_werteliste_nr');
|
||||
|
||||
$validator
|
||||
->scalar('wl_kurz_bezeichnung')
|
||||
->maxLength('wl_kurz_bezeichnung', 30)
|
||||
->allowEmpty('wl_kurz_bezeichnung');
|
||||
|
||||
$validator
|
||||
->scalar('schulart')
|
||||
->maxLength('schulart', 10)
|
||||
->allowEmpty('schulart');
|
||||
|
||||
$validator
|
||||
->dateTime('modfied')
|
||||
->requirePresence('modfied', 'create')
|
||||
->notEmpty('modfied');
|
||||
|
||||
return $validator;
|
||||
}
|
||||
}
|
||||
79
src/Model/Table/WlDstTypTable.php
Normal file
79
src/Model/Table/WlDstTypTable.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
namespace App\Model\Table;
|
||||
|
||||
use Cake\ORM\Query;
|
||||
use Cake\ORM\RulesChecker;
|
||||
use Cake\ORM\Table;
|
||||
use Cake\Validation\Validator;
|
||||
|
||||
/**
|
||||
* WlDstTyp Model
|
||||
*
|
||||
* @method \App\Model\Entity\WlDstTyp get($primaryKey, $options = [])
|
||||
* @method \App\Model\Entity\WlDstTyp newEntity($data = null, array $options = [])
|
||||
* @method \App\Model\Entity\WlDstTyp[] newEntities(array $data, array $options = [])
|
||||
* @method \App\Model\Entity\WlDstTyp|bool save(\Cake\Datasource\EntityInterface $entity, $options = [])
|
||||
* @method \App\Model\Entity\WlDstTyp patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
|
||||
* @method \App\Model\Entity\WlDstTyp[] patchEntities($entities, array $data, array $options = [])
|
||||
* @method \App\Model\Entity\WlDstTyp findOrCreate($search, callable $callback = null, $options = [])
|
||||
*
|
||||
* @mixin \Cake\ORM\Behavior\TimestampBehavior
|
||||
*/
|
||||
class WlDstTypTable extends Table
|
||||
{
|
||||
|
||||
/**
|
||||
* Initialize method
|
||||
*
|
||||
* @param array $config The configuration for the Table.
|
||||
* @return void
|
||||
*/
|
||||
public function initialize(array $config)
|
||||
{
|
||||
parent::initialize($config);
|
||||
|
||||
$this->setTable('wl_dst_typ');
|
||||
$this->setDisplayField('name');
|
||||
$this->setPrimaryKey('id');
|
||||
|
||||
$this->addBehavior('Timestamp');
|
||||
}
|
||||
|
||||
/**
|
||||
* Default validation rules.
|
||||
*
|
||||
* @param \Cake\Validation\Validator $validator Validator instance.
|
||||
* @return \Cake\Validation\Validator
|
||||
*/
|
||||
public function validationDefault(Validator $validator)
|
||||
{
|
||||
$validator
|
||||
->integer('id')
|
||||
->allowEmpty('id', 'create');
|
||||
|
||||
$validator
|
||||
->scalar('key_value')
|
||||
->maxLength('key_value', 4)
|
||||
->requirePresence('key_value', 'create')
|
||||
->notEmpty('key_value');
|
||||
|
||||
$validator
|
||||
->scalar('short')
|
||||
->maxLength('short', 10)
|
||||
->requirePresence('short', 'create')
|
||||
->notEmpty('short');
|
||||
|
||||
$validator
|
||||
->scalar('name')
|
||||
->maxLength('name', 30)
|
||||
->requirePresence('name', 'create')
|
||||
->notEmpty('name');
|
||||
|
||||
$validator
|
||||
->dateTime('modfied')
|
||||
->requirePresence('modfied', 'create')
|
||||
->notEmpty('modfied');
|
||||
|
||||
return $validator;
|
||||
}
|
||||
}
|
||||
85
src/Model/Table/WlSchooltypesTable.php
Normal file
85
src/Model/Table/WlSchooltypesTable.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
namespace App\Model\Table;
|
||||
|
||||
use Cake\ORM\Query;
|
||||
use Cake\ORM\RulesChecker;
|
||||
use Cake\ORM\Table;
|
||||
use Cake\Validation\Validator;
|
||||
|
||||
/**
|
||||
* WlSchooltypes Model
|
||||
*
|
||||
* @property \App\Model\Table\BudgetTable|\Cake\ORM\Association\HasMany $Budget
|
||||
*
|
||||
* @method \App\Model\Entity\WlSchooltype get($primaryKey, $options = [])
|
||||
* @method \App\Model\Entity\WlSchooltype newEntity($data = null, array $options = [])
|
||||
* @method \App\Model\Entity\WlSchooltype[] newEntities(array $data, array $options = [])
|
||||
* @method \App\Model\Entity\WlSchooltype|bool save(\Cake\Datasource\EntityInterface $entity, $options = [])
|
||||
* @method \App\Model\Entity\WlSchooltype patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
|
||||
* @method \App\Model\Entity\WlSchooltype[] patchEntities($entities, array $data, array $options = [])
|
||||
* @method \App\Model\Entity\WlSchooltype findOrCreate($search, callable $callback = null, $options = [])
|
||||
*
|
||||
* @mixin \Cake\ORM\Behavior\TimestampBehavior
|
||||
*/
|
||||
class WlSchooltypesTable extends Table
|
||||
{
|
||||
|
||||
/**
|
||||
* Initialize method
|
||||
*
|
||||
* @param array $config The configuration for the Table.
|
||||
* @return void
|
||||
*/
|
||||
public function initialize(array $config)
|
||||
{
|
||||
parent::initialize($config);
|
||||
|
||||
$this->setTable('wl_schooltypes');
|
||||
$this->setDisplayField('short');
|
||||
$this->setPrimaryKey('id');
|
||||
|
||||
$this->addBehavior('Timestamp');
|
||||
|
||||
$this->hasMany('Budget', [
|
||||
'foreignKey' => 'wl_schooltype_id'
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Default validation rules.
|
||||
*
|
||||
* @param \Cake\Validation\Validator $validator Validator instance.
|
||||
* @return \Cake\Validation\Validator
|
||||
*/
|
||||
public function validationDefault(Validator $validator)
|
||||
{
|
||||
$validator
|
||||
->integer('id')
|
||||
->allowEmpty('id', 'create');
|
||||
|
||||
$validator
|
||||
->scalar('key_value')
|
||||
->maxLength('key_value', 4)
|
||||
->requirePresence('key_value', 'create')
|
||||
->notEmpty('key_value');
|
||||
|
||||
$validator
|
||||
->scalar('short')
|
||||
->maxLength('short', 10)
|
||||
->requirePresence('short', 'create')
|
||||
->notEmpty('short');
|
||||
|
||||
$validator
|
||||
->scalar('name')
|
||||
->maxLength('name', 30)
|
||||
->requirePresence('name', 'create')
|
||||
->notEmpty('name');
|
||||
|
||||
$validator
|
||||
->dateTime('modfied')
|
||||
->requirePresence('modfied', 'create')
|
||||
->notEmpty('modfied');
|
||||
|
||||
return $validator;
|
||||
}
|
||||
}
|
||||
81
src/Shell/ConsoleShell.php
Normal file
81
src/Shell/ConsoleShell.php
Normal file
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since 3.0.0
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
namespace App\Shell;
|
||||
|
||||
use Cake\Console\ConsoleOptionParser;
|
||||
use Cake\Console\Shell;
|
||||
use Cake\Log\Log;
|
||||
use Psy\Shell as PsyShell;
|
||||
|
||||
/**
|
||||
* Simple console wrapper around Psy\Shell.
|
||||
*/
|
||||
class ConsoleShell extends Shell
|
||||
{
|
||||
|
||||
/**
|
||||
* Start the shell and interactive console.
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function main()
|
||||
{
|
||||
if (!class_exists('Psy\Shell')) {
|
||||
$this->err('<error>Unable to load Psy\Shell.</error>');
|
||||
$this->err('');
|
||||
$this->err('Make sure you have installed psysh as a dependency,');
|
||||
$this->err('and that Psy\Shell is registered in your autoloader.');
|
||||
$this->err('');
|
||||
$this->err('If you are using composer run');
|
||||
$this->err('');
|
||||
$this->err('<info>$ php composer.phar require --dev psy/psysh</info>');
|
||||
$this->err('');
|
||||
|
||||
return self::CODE_ERROR;
|
||||
}
|
||||
|
||||
$this->out("You can exit with <info>`CTRL-C`</info> or <info>`exit`</info>");
|
||||
$this->out('');
|
||||
|
||||
Log::drop('debug');
|
||||
Log::drop('error');
|
||||
$this->_io->setLoggers(false);
|
||||
restore_error_handler();
|
||||
restore_exception_handler();
|
||||
|
||||
$psy = new PsyShell();
|
||||
$psy->run();
|
||||
}
|
||||
|
||||
/**
|
||||
* Display help for this console.
|
||||
*
|
||||
* @return \Cake\Console\ConsoleOptionParser
|
||||
*/
|
||||
public function getOptionParser()
|
||||
{
|
||||
$parser = new ConsoleOptionParser('console');
|
||||
$parser->setDescription(
|
||||
'This shell provides a REPL that you can use to interact ' .
|
||||
'with your application in an interactive fashion. You can use ' .
|
||||
'it to run adhoc queries with your models, or experiment ' .
|
||||
'and explore the features of CakePHP and your application.' .
|
||||
"\n\n" .
|
||||
'You will need to have psysh installed for this Shell to work.'
|
||||
);
|
||||
|
||||
return $parser;
|
||||
}
|
||||
}
|
||||
32
src/Template/Budget/add.ctp
Normal file
32
src/Template/Budget/add.ctp
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\Budget $budget
|
||||
*/
|
||||
?>
|
||||
<nav class="large-3 medium-4 columns" id="actions-sidebar">
|
||||
<ul class="side-nav">
|
||||
<li class="heading"><?= __('Actions') ?></li>
|
||||
<li><?= $this->Html->link(__('List Budget'), ['action' => 'index']) ?></li>
|
||||
<li><?= $this->Html->link(__('List Wl Schooltypes'), ['controller' => 'WlSchooltypes', 'action' => 'index']) ?></li>
|
||||
<li><?= $this->Html->link(__('New Wl Schooltype'), ['controller' => 'WlSchooltypes', 'action' => 'add']) ?></li>
|
||||
<li><?= $this->Html->link(__('List Wl Budgets'), ['controller' => 'WlBudgets', 'action' => 'index']) ?></li>
|
||||
<li><?= $this->Html->link(__('New Wl Budget'), ['controller' => 'WlBudgets', 'action' => 'add']) ?></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="budget form large-9 medium-8 columns content">
|
||||
<?= $this->Form->create($budget) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Add Budget') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('wl_schooltype_id', ['options' => $wlSchooltypes]);
|
||||
echo $this->Form->control('snr');
|
||||
echo $this->Form->control('wl_budget_id', ['options' => $wlBudgets]);
|
||||
echo $this->Form->control('count');
|
||||
echo $this->Form->control('comment');
|
||||
echo $this->Form->control('year');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
3
src/Template/Budget/del_all_asd.ctp
Normal file
3
src/Template/Budget/del_all_asd.ctp
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
debug($to_del);
|
||||
?>
|
||||
23
src/Template/Budget/display_csv.ctp
Normal file
23
src/Template/Budget/display_csv.ctp
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
echo '<table>';
|
||||
|
||||
echo '<tr>';
|
||||
foreach ($headers as $header) {
|
||||
echo '<th>' . str_replace('"','',$header) . '</th>';
|
||||
}
|
||||
echo '</tr>';
|
||||
|
||||
|
||||
foreach ($content_arr as $line) {
|
||||
echo '<tr>';
|
||||
foreach ($line as $cell) {
|
||||
echo '<td>' . str_replace('"','',$cell) . '</td>';
|
||||
}
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
|
||||
echo '</table>';
|
||||
|
||||
?>
|
||||
38
src/Template/Budget/edit.ctp
Normal file
38
src/Template/Budget/edit.ctp
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\Budget $budget
|
||||
*/
|
||||
?>
|
||||
<nav class="large-3 medium-4 columns" id="actions-sidebar">
|
||||
<ul class="side-nav">
|
||||
<li class="heading"><?= __('Actions') ?></li>
|
||||
<li><?= $this->Form->postLink(
|
||||
__('Delete'),
|
||||
['action' => 'delete', $budget->id],
|
||||
['confirm' => __('Are you sure you want to delete # {0}?', $budget->id)]
|
||||
)
|
||||
?></li>
|
||||
<li><?= $this->Html->link(__('List Budget'), ['action' => 'index']) ?></li>
|
||||
<li><?= $this->Html->link(__('List Wl Schooltypes'), ['controller' => 'WlSchooltypes', 'action' => 'index']) ?></li>
|
||||
<li><?= $this->Html->link(__('New Wl Schooltype'), ['controller' => 'WlSchooltypes', 'action' => 'add']) ?></li>
|
||||
<li><?= $this->Html->link(__('List Wl Budgets'), ['controller' => 'WlBudgets', 'action' => 'index']) ?></li>
|
||||
<li><?= $this->Html->link(__('New Wl Budget'), ['controller' => 'WlBudgets', 'action' => 'add']) ?></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="budget form large-9 medium-8 columns content">
|
||||
<?= $this->Form->create($budget) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Edit Budget') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('wl_schooltype_id', ['options' => $wlSchooltypes]);
|
||||
echo $this->Form->control('snr');
|
||||
echo $this->Form->control('wl_budget_id', ['options' => $wlBudgets]);
|
||||
echo $this->Form->control('count');
|
||||
echo $this->Form->control('comment');
|
||||
echo $this->Form->control('year');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
1
src/Template/Budget/export_csv.ctp
Normal file
1
src/Template/Budget/export_csv.ctp
Normal file
@@ -0,0 +1 @@
|
||||
<p>Hallo Export</p>
|
||||
13
src/Template/Budget/gettype.ctp
Normal file
13
src/Template/Budget/gettype.ctp
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
echo $this->Form->create($budget);
|
||||
foreach($schools as $school) {
|
||||
//debug($school);die;
|
||||
//echo $this->Form->label('budget.count_'.$school['id'],$school['dst_schluessel'.' '.$school['dst_name']]);
|
||||
echo $this->Form->control('count_'.$school['id'], ['type' => 'decimal','label' => $school['dst_schluessel'] .' '.$school['dst_name'] ]);
|
||||
}
|
||||
|
||||
echo $this->Form->button(__('Submit'));
|
||||
echo $this->Form->end();
|
||||
|
||||
|
||||
10
src/Template/Budget/import_csv.ctp
Normal file
10
src/Template/Budget/import_csv.ctp
Normal file
@@ -0,0 +1,10 @@
|
||||
<h1>Upload File</h1>
|
||||
<div class="content">
|
||||
<?= $this->Flash->render() ?>
|
||||
<div class="upload-frm">
|
||||
<?php echo $this->Form->create($uploadData, ['type' => 'file']); ?>
|
||||
<?php echo $this->Form->input('file', ['type' => 'file', 'class' => 'form-control']); ?>
|
||||
<?php echo $this->Form->button(__('Upload File'), ['type'=>'submit', 'class' => 'form-controlbtn btn-default']); ?>
|
||||
<?php echo $this->Form->end(); ?>
|
||||
</div>
|
||||
</div>
|
||||
65
src/Template/Budget/index.ctp
Normal file
65
src/Template/Budget/index.ctp
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\Budget[]|\Cake\Collection\CollectionInterface $budget
|
||||
*/
|
||||
?>
|
||||
<nav class="large-3 medium-4 columns" id="actions-sidebar">
|
||||
<ul class="side-nav">
|
||||
<li class="heading"><?= __('Actions') ?></li>
|
||||
<li><?= $this->Html->link(__('New Budget'), ['action' => 'add']) ?></li>
|
||||
<li><?= $this->Html->link(__('List Wl Schooltypes'), ['controller' => 'WlSchooltypes', 'action' => 'index']) ?></li>
|
||||
<li><?= $this->Html->link(__('New Wl Schooltype'), ['controller' => 'WlSchooltypes', 'action' => 'add']) ?></li>
|
||||
<li><?= $this->Html->link(__('List Wl Budgets'), ['controller' => 'WlBudgets', 'action' => 'index']) ?></li>
|
||||
<li><?= $this->Html->link(__('New Wl Budget'), ['controller' => 'WlBudgets', 'action' => 'add']) ?></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="budget index large-9 medium-8 columns content">
|
||||
<h3><?= __('Budget') ?></h3>
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"><?= $this->Paginator->sort('id') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('wl_schooltype_id') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('snr') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('wl_budget_id') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('count') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('comment') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('year') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('created') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('modified') ?></th>
|
||||
<th scope="col" class="actions"><?= __('Actions') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($budget as $budget): ?>
|
||||
<tr>
|
||||
<td><?= $this->Number->format($budget->id) ?></td>
|
||||
<td><?= $budget->has('wl_schooltype') ? $this->Html->link($budget->wl_schooltype->short, ['controller' => 'WlSchooltypes', 'action' => 'view', $budget->wl_schooltype->id]) : '' ?></td>
|
||||
<td><?= h($budget->snr) ?></td>
|
||||
<td><?= $budget->has('wl_budget') ? $this->Html->link($budget->wl_budget->wl_kurz_bezeichnung, ['controller' => 'WlBudgets', 'action' => 'view', $budget->wl_budget->id]) : '' ?></td>
|
||||
<td><?= $this->Number->format($budget->count) ?></td>
|
||||
<td><?= h($budget->comment) ?></td>
|
||||
<td><?= h($budget->year) ?></td>
|
||||
<td><?= h($budget->created) ?></td>
|
||||
<td><?= h($budget->modified) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['action' => 'view', $budget->id]) ?>
|
||||
<?= $this->Html->link(__('Edit'), ['action' => 'edit', $budget->id]) ?>
|
||||
<?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $budget->id], ['confirm' => __('Are you sure you want to delete # {0}?', $budget->id)]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="paginator">
|
||||
<ul class="pagination">
|
||||
<?= $this->Paginator->first('<< ' . __('first')) ?>
|
||||
<?= $this->Paginator->prev('< ' . __('previous')) ?>
|
||||
<?= $this->Paginator->numbers() ?>
|
||||
<?= $this->Paginator->next(__('next') . ' >') ?>
|
||||
<?= $this->Paginator->last(__('last') . ' >>') ?>
|
||||
</ul>
|
||||
<p><?= $this->Paginator->counter(['format' => __('Page {{page}} of {{pages}}, showing {{current}} record(s) out of {{count}} total')]) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
65
src/Template/Budget/overview.ctp
Normal file
65
src/Template/Budget/overview.ctp
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
$cols = array();
|
||||
array_push($cols,'SNR');
|
||||
array_push($cols,'Schule');
|
||||
$col_width = array();
|
||||
array_push($col_width,'50');
|
||||
array_push($col_width,'300');
|
||||
foreach($wlBudgets as $budget) {
|
||||
array_push($cols,$budget);
|
||||
array_push($col_width,'30');
|
||||
}
|
||||
//debug(json_encode($cols));
|
||||
?>
|
||||
<div class="controls">
|
||||
<button name="load" id="load" class="intext-btn">Load</button>
|
||||
<button name="save" id="save" class="intext-btn">Save</button>
|
||||
<label><input name="autosave" id="autosave" checked="checked" autocomplete="off" type="checkbox">Autosave</label>
|
||||
</div>
|
||||
<pre id="example1console" class="console">Data loaded</pre>
|
||||
<div id="example"></div>
|
||||
<script>
|
||||
var data = <?php echo json_encode($data); ?>;
|
||||
|
||||
var container = document.getElementById('example');
|
||||
var exampleConsole = document.getElementById('example1console');
|
||||
var autosave = document.getElementById('autosave');
|
||||
var load = document.getElementById('load');
|
||||
var save = document.getElementById('save');
|
||||
var autosaveNotification;
|
||||
var rotated = false;
|
||||
|
||||
var hot = new Handsontable(container, {
|
||||
data: data,
|
||||
width: 1400,
|
||||
height: 1000,
|
||||
rowHeaders: true,
|
||||
wordWrap: false,
|
||||
colHeaders: <?php echo json_encode($cols) ?> ,
|
||||
colWidths: <?php echo json_encode($col_width) ?>,
|
||||
filters: true,
|
||||
dropdownMenu: true,
|
||||
afterGetColHeader: function(i, TH) {
|
||||
if($(TH).find(".testhead").length == 0) {
|
||||
TH.innerHTML = '<div class="testhead">' + TH.innerHTML + '</div>';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Handsontable.dom.addEvent(save, 'click', function() {
|
||||
// save all cell's data
|
||||
//console.log(hot.getData());
|
||||
//console.log(JSON.stringify({data: hot.getData()}));
|
||||
$.ajax({
|
||||
url: "sajax",
|
||||
data: JSON.stringify(hot.getData()),
|
||||
type: 'POST',
|
||||
success: function (res) {
|
||||
//console.log(res);
|
||||
//var data = JSON.parse(res);
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
33
src/Template/Budget/read_asd.ctp
Normal file
33
src/Template/Budget/read_asd.ctp
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
echo '<table>';
|
||||
echo '<tr>';
|
||||
foreach($data[1] as $key => $value) {
|
||||
echo '<th>' . $key . '</th>';
|
||||
}
|
||||
echo '</tr>';
|
||||
for($i=1;$i <= (sizeof($data));$i++) {
|
||||
echo '<tr>';
|
||||
foreach($data[$i] as $key => $value) {
|
||||
echo '<td>' . $value . '</td>';
|
||||
}
|
||||
echo '</tr>';
|
||||
}
|
||||
echo '</table>';
|
||||
//echo '<p>Summe: ' .$data['sum'] . '</p>';
|
||||
?>
|
||||
<div class="budget form large-9 medium-8 columns content">
|
||||
<?= $this->Form->create($budget) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Add Budget') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->hidden('wl_schooltype_id', ['value' => '04']);
|
||||
echo $this->Form->hidden('snr', ['value' => $snr]);
|
||||
echo $this->Form->control('wl_budget_id', ['options' => $wlBudgets]);
|
||||
echo $this->Form->control('count');
|
||||
echo $this->Form->control('comment');
|
||||
echo $this->Form->hidden('year', ['value' => '2018']);
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
0
src/Template/Budget/sajax.ctp
Normal file
0
src/Template/Budget/sajax.ctp
Normal file
60
src/Template/Budget/view.ctp
Normal file
60
src/Template/Budget/view.ctp
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\Budget $budget
|
||||
*/
|
||||
?>
|
||||
<nav class="large-3 medium-4 columns" id="actions-sidebar">
|
||||
<ul class="side-nav">
|
||||
<li class="heading"><?= __('Actions') ?></li>
|
||||
<li><?= $this->Html->link(__('Edit Budget'), ['action' => 'edit', $budget->id]) ?> </li>
|
||||
<li><?= $this->Form->postLink(__('Delete Budget'), ['action' => 'delete', $budget->id], ['confirm' => __('Are you sure you want to delete # {0}?', $budget->id)]) ?> </li>
|
||||
<li><?= $this->Html->link(__('List Budget'), ['action' => 'index']) ?> </li>
|
||||
<li><?= $this->Html->link(__('New Budget'), ['action' => 'add']) ?> </li>
|
||||
<li><?= $this->Html->link(__('List Wl Schooltypes'), ['controller' => 'WlSchooltypes', 'action' => 'index']) ?> </li>
|
||||
<li><?= $this->Html->link(__('New Wl Schooltype'), ['controller' => 'WlSchooltypes', 'action' => 'add']) ?> </li>
|
||||
<li><?= $this->Html->link(__('List Wl Budgets'), ['controller' => 'WlBudgets', 'action' => 'index']) ?> </li>
|
||||
<li><?= $this->Html->link(__('New Wl Budget'), ['controller' => 'WlBudgets', 'action' => 'add']) ?> </li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="budget view large-9 medium-8 columns content">
|
||||
<h3><?= h($budget->id) ?></h3>
|
||||
<table class="vertical-table">
|
||||
<tr>
|
||||
<th scope="row"><?= __('Wl Schooltype') ?></th>
|
||||
<td><?= $budget->has('wl_schooltype') ? $this->Html->link($budget->wl_schooltype->short, ['controller' => 'WlSchooltypes', 'action' => 'view', $budget->wl_schooltype->id]) : '' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Snr') ?></th>
|
||||
<td><?= h($budget->snr) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Wl Budget') ?></th>
|
||||
<td><?= $budget->has('wl_budget') ? $this->Html->link($budget->wl_budget->wl_kurz_bezeichnung, ['controller' => 'WlBudgets', 'action' => 'view', $budget->wl_budget->id]) : '' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Comment') ?></th>
|
||||
<td><?= h($budget->comment) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Year') ?></th>
|
||||
<td><?= h($budget->year) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Id') ?></th>
|
||||
<td><?= $this->Number->format($budget->id) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Count') ?></th>
|
||||
<td><?= $this->Number->format($budget->count) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Created') ?></th>
|
||||
<td><?= h($budget->created) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Modified') ?></th>
|
||||
<td><?= h($budget->modified) ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
5
src/Template/Budget/write_asd.ctp
Normal file
5
src/Template/Budget/write_asd.ctp
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
echo $html;
|
||||
|
||||
?>
|
||||
10
src/Template/Element/Flash/default.ctp
Normal file
10
src/Template/Element/Flash/default.ctp
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
$class = 'message';
|
||||
if (!empty($params['class'])) {
|
||||
$class .= ' ' . $params['class'];
|
||||
}
|
||||
if (!isset($params['escape']) || $params['escape'] !== false) {
|
||||
$message = h($message);
|
||||
}
|
||||
?>
|
||||
<div class="<?= h($class) ?>" onclick="this.classList.add('hidden');"><?= $message ?></div>
|
||||
6
src/Template/Element/Flash/error.ctp
Normal file
6
src/Template/Element/Flash/error.ctp
Normal file
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
if (!isset($params['escape']) || $params['escape'] !== false) {
|
||||
$message = h($message);
|
||||
}
|
||||
?>
|
||||
<div class="message error" onclick="this.classList.add('hidden');"><?= $message ?></div>
|
||||
6
src/Template/Element/Flash/success.ctp
Normal file
6
src/Template/Element/Flash/success.ctp
Normal file
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
if (!isset($params['escape']) || $params['escape'] !== false) {
|
||||
$message = h($message);
|
||||
}
|
||||
?>
|
||||
<div class="message success" onclick="this.classList.add('hidden')"><?= $message ?></div>
|
||||
20
src/Template/Email/html/default.ctp
Normal file
20
src/Template/Email/html/default.ctp
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since 0.10.0
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
$content = explode("\n", $content);
|
||||
|
||||
foreach ($content as $line) :
|
||||
echo '<p> ' . $line . "</p>\n";
|
||||
endforeach;
|
||||
16
src/Template/Email/text/default.ctp
Normal file
16
src/Template/Email/text/default.ctp
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since 0.10.0
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
echo $content;
|
||||
38
src/Template/Error/error400.ctp
Normal file
38
src/Template/Error/error400.ctp
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
use Cake\Core\Configure;
|
||||
use Cake\Error\Debugger;
|
||||
|
||||
$this->layout = 'error';
|
||||
|
||||
if (Configure::read('debug')) :
|
||||
$this->layout = 'dev_error';
|
||||
|
||||
$this->assign('title', $message);
|
||||
$this->assign('templateName', 'error400.ctp');
|
||||
|
||||
$this->start('file');
|
||||
?>
|
||||
<?php if (!empty($error->queryString)) : ?>
|
||||
<p class="notice">
|
||||
<strong>SQL Query: </strong>
|
||||
<?= h($error->queryString) ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($error->params)) : ?>
|
||||
<strong>SQL Query Params: </strong>
|
||||
<?php Debugger::dump($error->params) ?>
|
||||
<?php endif; ?>
|
||||
<?= $this->element('auto_table_warning') ?>
|
||||
<?php
|
||||
if (extension_loaded('xdebug')) :
|
||||
xdebug_print_function_stack();
|
||||
endif;
|
||||
|
||||
$this->end();
|
||||
endif;
|
||||
?>
|
||||
<h2><?= h($message) ?></h2>
|
||||
<p class="error">
|
||||
<strong><?= __d('cake', 'Error') ?>: </strong>
|
||||
<?= __d('cake', 'The requested address {0} was not found on this server.', "<strong>'{$url}'</strong>") ?>
|
||||
</p>
|
||||
43
src/Template/Error/error500.ctp
Normal file
43
src/Template/Error/error500.ctp
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
use Cake\Core\Configure;
|
||||
use Cake\Error\Debugger;
|
||||
|
||||
$this->layout = 'error';
|
||||
|
||||
if (Configure::read('debug')) :
|
||||
$this->layout = 'dev_error';
|
||||
|
||||
$this->assign('title', $message);
|
||||
$this->assign('templateName', 'error500.ctp');
|
||||
|
||||
$this->start('file');
|
||||
?>
|
||||
<?php if (!empty($error->queryString)) : ?>
|
||||
<p class="notice">
|
||||
<strong>SQL Query: </strong>
|
||||
<?= h($error->queryString) ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($error->params)) : ?>
|
||||
<strong>SQL Query Params: </strong>
|
||||
<?php Debugger::dump($error->params) ?>
|
||||
<?php endif; ?>
|
||||
<?php if ($error instanceof Error) : ?>
|
||||
<strong>Error in: </strong>
|
||||
<?= sprintf('%s, line %s', str_replace(ROOT, 'ROOT', $error->getFile()), $error->getLine()) ?>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
echo $this->element('auto_table_warning');
|
||||
|
||||
if (extension_loaded('xdebug')) :
|
||||
xdebug_print_function_stack();
|
||||
endif;
|
||||
|
||||
$this->end();
|
||||
endif;
|
||||
?>
|
||||
<h2><?= __d('cake', 'An Internal Error Has Occurred') ?></h2>
|
||||
<p class="error">
|
||||
<strong><?= __d('cake', 'Error') ?>: </strong>
|
||||
<?= h($message) ?>
|
||||
</p>
|
||||
24
src/Template/Layout/Email/html/default.ctp
Normal file
24
src/Template/Layout/Email/html/default.ctp
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since 0.10.0
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title><?= $this->fetch('title') ?></title>
|
||||
</head>
|
||||
<body>
|
||||
<?= $this->fetch('content') ?>
|
||||
</body>
|
||||
</html>
|
||||
16
src/Template/Layout/Email/text/default.ctp
Normal file
16
src/Template/Layout/Email/text/default.ctp
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since 0.10.0
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
echo $this->fetch('content');
|
||||
16
src/Template/Layout/ajax.ctp
Normal file
16
src/Template/Layout/ajax.ctp
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since 0.10.0
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
echo $this->fetch('content');
|
||||
62
src/Template/Layout/default.ctp
Normal file
62
src/Template/Layout/default.ctp
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since 0.10.0
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
$cakeDescription = 'CakePHP: the rapid development php framework';
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<?= $this->Html->charset() ?>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>
|
||||
<?= $cakeDescription ?>:
|
||||
<?= $this->fetch('title') ?>
|
||||
</title>
|
||||
<?= $this->Html->meta('icon') ?>
|
||||
|
||||
<?= $this->Html->css('base.css') ?>
|
||||
<?= $this->Html->css('cake.css') ?>
|
||||
<?= $this->Html->css('handsontable.min.css') ?>
|
||||
<?= $this->Html->css('handsontable.costum.css') ?>
|
||||
|
||||
<?= $this->Html->script('handsontable.min.js') ?>
|
||||
<?= $this->Html->script('jquery-3.3.1.min.js') ?>
|
||||
|
||||
<?= $this->fetch('meta') ?>
|
||||
<?= $this->fetch('css') ?>
|
||||
<?= $this->fetch('script') ?>
|
||||
</head>
|
||||
<body>
|
||||
<nav class="top-bar expanded" data-topbar role="navigation">
|
||||
<ul class="title-area large-3 medium-4 columns">
|
||||
<li class="name">
|
||||
<h1><a href=""><?= $this->fetch('title') ?></a></h1>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="top-bar-section">
|
||||
<ul class="right">
|
||||
<li><a target="_blank" href="https://book.cakephp.org/3.0/">Documentation</a></li>
|
||||
<li><a target="_blank" href="https://api.cakephp.org/3.0/">API</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
<?= $this->Flash->render() ?>
|
||||
<div class="container clearfix">
|
||||
<?= $this->fetch('content') ?>
|
||||
</div>
|
||||
<footer>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
47
src/Template/Layout/error.ctp
Normal file
47
src/Template/Layout/error.ctp
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since 0.10.0
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<?= $this->Html->charset() ?>
|
||||
<title>
|
||||
<?= $this->fetch('title') ?>
|
||||
</title>
|
||||
<?= $this->Html->meta('icon') ?>
|
||||
|
||||
<?= $this->Html->css('base.css') ?>
|
||||
<?= $this->Html->css('cake.css') ?>
|
||||
|
||||
<?= $this->fetch('meta') ?>
|
||||
<?= $this->fetch('css') ?>
|
||||
<?= $this->fetch('script') ?>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="header">
|
||||
<h1><?= __('Error') ?></h1>
|
||||
</div>
|
||||
<div id="content">
|
||||
<?= $this->Flash->render() ?>
|
||||
|
||||
<?= $this->fetch('content') ?>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<?= $this->Html->link(__('Back'), 'javascript:history.back()') ?>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
11
src/Template/Layout/rss/default.ctp
Normal file
11
src/Template/Layout/rss/default.ctp
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
if (!isset($channel)) :
|
||||
$channel = [];
|
||||
endif;
|
||||
if (!isset($channel['title'])) :
|
||||
$channel['title'] = $this->fetch('title');
|
||||
endif;
|
||||
|
||||
echo $this->Rss->document(
|
||||
$this->Rss->channel([], $channel, $this->fetch('content'))
|
||||
);
|
||||
278
src/Template/Pages/home.ctp
Normal file
278
src/Template/Pages/home.ctp
Normal file
@@ -0,0 +1,278 @@
|
||||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since 0.10.0
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
use Cake\Cache\Cache;
|
||||
use Cake\Core\Configure;
|
||||
use Cake\Core\Plugin;
|
||||
use Cake\Datasource\ConnectionManager;
|
||||
use Cake\Error\Debugger;
|
||||
use Cake\Network\Exception\NotFoundException;
|
||||
|
||||
$this->layout = false;
|
||||
|
||||
if (!Configure::read('debug')) :
|
||||
throw new NotFoundException(
|
||||
'Please replace src/Template/Pages/home.ctp with your own version or re-enable debug mode.'
|
||||
);
|
||||
endif;
|
||||
|
||||
$cakeDescription = 'CakePHP: the rapid development PHP framework';
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<?= $this->Html->charset() ?>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>
|
||||
<?= $cakeDescription ?>
|
||||
</title>
|
||||
|
||||
<?= $this->Html->meta('icon') ?>
|
||||
<?= $this->Html->css('base.css') ?>
|
||||
<?= $this->Html->css('cake.css') ?>
|
||||
<?= $this->Html->css('home.css') ?>
|
||||
<link href="https://fonts.googleapis.com/css?family=Raleway:500i|Roboto:300,400,700|Roboto+Mono" rel="stylesheet">
|
||||
</head>
|
||||
<body class="home">
|
||||
|
||||
<header class="row">
|
||||
<div class="header-image"><?= $this->Html->image('cake.logo.svg') ?></div>
|
||||
<div class="header-title">
|
||||
<h1>Welcome to CakePHP <?= Configure::version() ?> Red Velvet. Build fast. Grow solid.</h1>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="columns large-12">
|
||||
<div class="ctp-warning alert text-center">
|
||||
<p>Please be aware that this page will not be shown if you turn off debug mode unless you replace src/Template/Pages/home.ctp with your own version.</p>
|
||||
</div>
|
||||
<div id="url-rewriting-warning" class="alert url-rewriting">
|
||||
<ul>
|
||||
<li class="bullet problem">
|
||||
URL rewriting is not properly configured on your server.<br />
|
||||
1) <a target="_blank" href="https://book.cakephp.org/3.0/en/installation.html#url-rewriting">Help me configure it</a><br />
|
||||
2) <a target="_blank" href="https://book.cakephp.org/3.0/en/development/configuration.html#general-configuration">I don't / can't use URL rewriting</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php Debugger::checkSecurityKeys(); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="columns large-6">
|
||||
<h4>Environment</h4>
|
||||
<ul>
|
||||
<?php if (version_compare(PHP_VERSION, '5.6.0', '>=')) : ?>
|
||||
<li class="bullet success">Your version of PHP is 5.6.0 or higher (detected <?= PHP_VERSION ?>).</li>
|
||||
<?php else : ?>
|
||||
<li class="bullet problem">Your version of PHP is too low. You need PHP 5.6.0 or higher to use CakePHP (detected <?= PHP_VERSION ?>).</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (extension_loaded('mbstring')) : ?>
|
||||
<li class="bullet success">Your version of PHP has the mbstring extension loaded.</li>
|
||||
<?php else : ?>
|
||||
<li class="bullet problem">Your version of PHP does NOT have the mbstring extension loaded.</li>;
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (extension_loaded('openssl')) : ?>
|
||||
<li class="bullet success">Your version of PHP has the openssl extension loaded.</li>
|
||||
<?php elseif (extension_loaded('mcrypt')) : ?>
|
||||
<li class="bullet success">Your version of PHP has the mcrypt extension loaded.</li>
|
||||
<?php else : ?>
|
||||
<li class="bullet problem">Your version of PHP does NOT have the openssl or mcrypt extension loaded.</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (extension_loaded('intl')) : ?>
|
||||
<li class="bullet success">Your version of PHP has the intl extension loaded.</li>
|
||||
<?php else : ?>
|
||||
<li class="bullet problem">Your version of PHP does NOT have the intl extension loaded.</li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="columns large-6">
|
||||
<h4>Filesystem</h4>
|
||||
<ul>
|
||||
<?php if (is_writable(TMP)) : ?>
|
||||
<li class="bullet success">Your tmp directory is writable.</li>
|
||||
<?php else : ?>
|
||||
<li class="bullet problem">Your tmp directory is NOT writable.</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (is_writable(LOGS)) : ?>
|
||||
<li class="bullet success">Your logs directory is writable.</li>
|
||||
<?php else : ?>
|
||||
<li class="bullet problem">Your logs directory is NOT writable.</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $settings = Cache::getConfig('_cake_core_'); ?>
|
||||
<?php if (!empty($settings)) : ?>
|
||||
<li class="bullet success">The <em><?= $settings['className'] ?>Engine</em> is being used for core caching. To change the config edit config/app.php</li>
|
||||
<?php else : ?>
|
||||
<li class="bullet problem">Your cache is NOT working. Please check the settings in config/app.php</li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<hr />
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="columns large-6">
|
||||
<h4>Database</h4>
|
||||
<?php
|
||||
try {
|
||||
$connection = ConnectionManager::get('default');
|
||||
$connected = $connection->connect();
|
||||
} catch (Exception $connectionError) {
|
||||
$connected = false;
|
||||
$errorMsg = $connectionError->getMessage();
|
||||
if (method_exists($connectionError, 'getAttributes')) :
|
||||
$attributes = $connectionError->getAttributes();
|
||||
if (isset($errorMsg['message'])) :
|
||||
$errorMsg .= '<br />' . $attributes['message'];
|
||||
endif;
|
||||
endif;
|
||||
}
|
||||
?>
|
||||
<ul>
|
||||
<?php if ($connected) : ?>
|
||||
<li class="bullet success">CakePHP is able to connect to the database.</li>
|
||||
<?php else : ?>
|
||||
<li class="bullet problem">CakePHP is NOT able to connect to the database.<br /><?= $errorMsg ?></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="columns large-6">
|
||||
<h4>DebugKit</h4>
|
||||
<ul>
|
||||
<?php if (Plugin::loaded('DebugKit')) : ?>
|
||||
<li class="bullet success">DebugKit is loaded.</li>
|
||||
<?php else : ?>
|
||||
<li class="bullet problem">DebugKit is NOT loaded. You need to either install pdo_sqlite, or define the "debug_kit" connection name.</li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<hr />
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="columns large-6">
|
||||
<h3>Editing this Page</h3>
|
||||
<ul>
|
||||
<li class="bullet cutlery">To change the content of this page, edit: src/Template/Pages/home.ctp.</li>
|
||||
<li class="bullet cutlery">You can also add some CSS styles for your pages at: webroot/css/.</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="columns large-6">
|
||||
<h3>Getting Started</h3>
|
||||
<ul>
|
||||
<li class="bullet book"><a target="_blank" href="https://book.cakephp.org/3.0/en/">CakePHP 3.0 Docs</a></li>
|
||||
<li class="bullet book"><a target="_blank" href="https://book.cakephp.org/3.0/en/tutorials-and-examples/bookmarks/intro.html">The 15 min Bookmarker Tutorial</a></li>
|
||||
<li class="bullet book"><a target="_blank" href="https://book.cakephp.org/3.0/en/tutorials-and-examples/blog/blog.html">The 15 min Blog Tutorial</a></li>
|
||||
<li class="bullet book"><a target="_blank" href="https://book.cakephp.org/3.0/en/tutorials-and-examples/cms/installation.html">The 15 min CMS Tutorial</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="columns large-12 text-center">
|
||||
<h3 class="more">More about Cake</h3>
|
||||
<p>
|
||||
CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Front Controller and MVC.<br />
|
||||
Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility.
|
||||
</p>
|
||||
</div>
|
||||
<hr/>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="columns large-4">
|
||||
<i class="icon support">P</i>
|
||||
<h3>Help and Bug Reports</h3>
|
||||
<ul>
|
||||
<li class="bullet cutlery">
|
||||
<a href="irc://irc.freenode.net/cakephp">irc.freenode.net #cakephp</a>
|
||||
<ul><li>Live chat about CakePHP</li></ul>
|
||||
</li>
|
||||
<li class="bullet cutlery">
|
||||
<a href="http://cakesf.herokuapp.com/">Slack</a>
|
||||
<ul><li>CakePHP Slack support</li></ul>
|
||||
</li>
|
||||
<li class="bullet cutlery">
|
||||
<a href="https://github.com/cakephp/cakephp/issues">CakePHP Issues</a>
|
||||
<ul><li>CakePHP issues and pull requests</li></ul>
|
||||
</li>
|
||||
<li class="bullet cutlery">
|
||||
<a href="http://discourse.cakephp.org/">CakePHP Forum</a>
|
||||
<ul><li>CakePHP official discussion forum</li></ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="columns large-4">
|
||||
<i class="icon docs">r</i>
|
||||
<h3>Docs and Downloads</h3>
|
||||
<ul>
|
||||
<li class="bullet cutlery">
|
||||
<a href="https://api.cakephp.org/3.0/">CakePHP API</a>
|
||||
<ul><li>Quick Reference</li></ul>
|
||||
</li>
|
||||
<li class="bullet cutlery">
|
||||
<a href="https://book.cakephp.org/3.0/en/">CakePHP Documentation</a>
|
||||
<ul><li>Your Rapid Development Cookbook</li></ul>
|
||||
</li>
|
||||
<li class="bullet cutlery">
|
||||
<a href="https://bakery.cakephp.org">The Bakery</a>
|
||||
<ul><li>Everything CakePHP</li></ul>
|
||||
</li>
|
||||
<li class="bullet cutlery">
|
||||
<a href="https://plugins.cakephp.org">CakePHP plugins repo</a>
|
||||
<ul><li>A comprehensive list of all CakePHP plugins created by the community</li></ul>
|
||||
</li>
|
||||
<li class="bullet cutlery">
|
||||
<a href="https://github.com/cakephp/">CakePHP Code</a>
|
||||
<ul><li>For the Development of CakePHP Git repository, Downloads</li></ul>
|
||||
</li>
|
||||
<li class="bullet cutlery">
|
||||
<a href="https://github.com/FriendsOfCake/awesome-cakephp">CakePHP Awesome List</a>
|
||||
<ul><li>A curated list of amazingly awesome CakePHP plugins, resources and shiny things.</li></ul>
|
||||
</li>
|
||||
<li class="bullet cutlery">
|
||||
<a href="https://www.cakephp.org">CakePHP</a>
|
||||
<ul><li>The Rapid Development Framework</li></ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="columns large-4">
|
||||
<i class="icon training">s</i>
|
||||
<h3>Training and Certification</h3>
|
||||
<ul>
|
||||
<li class="bullet cutlery">
|
||||
<a href="https://cakefoundation.org/">Cake Software Foundation</a>
|
||||
<ul><li>Promoting development related to CakePHP</li></ul>
|
||||
</li>
|
||||
<li class="bullet cutlery">
|
||||
<a href="https://training.cakephp.org/">CakePHP Training</a>
|
||||
<ul><li>Learn to use the CakePHP framework</li></ul>
|
||||
</li>
|
||||
<li class="bullet cutlery">
|
||||
<a href="https://certification.cakephp.org/">CakePHP Certification</a>
|
||||
<ul><li>Become a certified CakePHP developer</li></ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
27
src/Template/Schools/add.ctp
Normal file
27
src/Template/Schools/add.ctp
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\School $school
|
||||
*/
|
||||
?>
|
||||
<nav class="large-3 medium-4 columns" id="actions-sidebar">
|
||||
<ul class="side-nav">
|
||||
<li class="heading"><?= __('Actions') ?></li>
|
||||
<li><?= $this->Html->link(__('List Schools'), ['action' => 'index']) ?></li>
|
||||
<li><?= $this->Html->link(__('List Budget'), ['controller' => 'Budget', 'action' => 'index']) ?></li>
|
||||
<li><?= $this->Html->link(__('New Budget'), ['controller' => 'Budget', 'action' => 'add']) ?></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="schools form large-9 medium-8 columns content">
|
||||
<?= $this->Form->create($school) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Add School') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('dst_schluessel');
|
||||
echo $this->Form->control('dst_name');
|
||||
echo $this->Form->control('dst_schulart');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
33
src/Template/Schools/edit.ctp
Normal file
33
src/Template/Schools/edit.ctp
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\School $school
|
||||
*/
|
||||
?>
|
||||
<nav class="large-3 medium-4 columns" id="actions-sidebar">
|
||||
<ul class="side-nav">
|
||||
<li class="heading"><?= __('Actions') ?></li>
|
||||
<li><?= $this->Form->postLink(
|
||||
__('Delete'),
|
||||
['action' => 'delete', $school->id],
|
||||
['confirm' => __('Are you sure you want to delete # {0}?', $school->id)]
|
||||
)
|
||||
?></li>
|
||||
<li><?= $this->Html->link(__('List Schools'), ['action' => 'index']) ?></li>
|
||||
<li><?= $this->Html->link(__('List Budget'), ['controller' => 'Budget', 'action' => 'index']) ?></li>
|
||||
<li><?= $this->Html->link(__('New Budget'), ['controller' => 'Budget', 'action' => 'add']) ?></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="schools form large-9 medium-8 columns content">
|
||||
<?= $this->Form->create($school) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Edit School') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('dst_schluessel');
|
||||
echo $this->Form->control('dst_name');
|
||||
echo $this->Form->control('dst_schulart');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
53
src/Template/Schools/index.ctp
Normal file
53
src/Template/Schools/index.ctp
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\School[]|\Cake\Collection\CollectionInterface $schools
|
||||
*/
|
||||
?>
|
||||
<nav class="large-3 medium-4 columns" id="actions-sidebar">
|
||||
<ul class="side-nav">
|
||||
<li class="heading"><?= __('Actions') ?></li>
|
||||
<li><?= $this->Html->link(__('New School'), ['action' => 'add']) ?></li>
|
||||
<li><?= $this->Html->link(__('List Budget'), ['controller' => 'Budget', 'action' => 'index']) ?></li>
|
||||
<li><?= $this->Html->link(__('New Budget'), ['controller' => 'Budget', 'action' => 'add']) ?></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="schools index large-9 medium-8 columns content">
|
||||
<h3><?= __('Schools') ?></h3>
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"><?= $this->Paginator->sort('id') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('dst_schluessel') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('dst_name') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('dst_schulart') ?></th>
|
||||
<th scope="col" class="actions"><?= __('Actions') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($schools as $school): ?>
|
||||
<tr>
|
||||
<td><?= $this->Number->format($school->id) ?></td>
|
||||
<td><?= h($school->dst_schluessel) ?></td>
|
||||
<td><?= h($school->dst_name) ?></td>
|
||||
<td><?= h($school->dst_schulart) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['action' => 'view', $school->id]) ?>
|
||||
<?= $this->Html->link(__('Edit'), ['action' => 'edit', $school->id]) ?>
|
||||
<?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $school->id], ['confirm' => __('Are you sure you want to delete # {0}?', $school->id)]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="paginator">
|
||||
<ul class="pagination">
|
||||
<?= $this->Paginator->first('<< ' . __('first')) ?>
|
||||
<?= $this->Paginator->prev('< ' . __('previous')) ?>
|
||||
<?= $this->Paginator->numbers() ?>
|
||||
<?= $this->Paginator->next(__('next') . ' >') ?>
|
||||
<?= $this->Paginator->last(__('last') . ' >>') ?>
|
||||
</ul>
|
||||
<p><?= $this->Paginator->counter(['format' => __('Page {{page}} of {{pages}}, showing {{current}} record(s) out of {{count}} total')]) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
23
src/Template/Schools/show.ctp
Normal file
23
src/Template/Schools/show.ctp
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
$results_array = json_decode(json_encode($results), true);
|
||||
$anzahl = sizeof($results_array);
|
||||
|
||||
//debug($results_array);die;
|
||||
|
||||
echo $this->Html->link('Export CSV',['controller' => 'budget', 'action' => 'export-csv']) . ' ';
|
||||
echo $this->Html->link('Import CSV',['controller' => 'budget', 'action' => 'import-csv']);
|
||||
|
||||
echo '<table>';
|
||||
for($i = 0;$i < $anzahl/2;$i++) {
|
||||
$l = $results_array[$i*2];
|
||||
$r = $results_array[$i*2+1];
|
||||
echo '<tr>
|
||||
<td>' . $this->Html->link($l['dst_schluessel'] . ' ' . $l['dst_name'],['controller' => 'budget', 'action' => 'readAsd',$l['dst_schluessel'] ]) . '</td>
|
||||
<td>' . $this->Html->link($r['dst_schluessel'] . ' ' . $r['dst_name'],['controller' => 'budget', 'action' => 'readAsd',$r['dst_schluessel'] ]) . '</td>
|
||||
</tr>';
|
||||
//debug($results);
|
||||
}
|
||||
echo '</table>';
|
||||
|
||||
?>
|
||||
75
src/Template/Schools/view.ctp
Normal file
75
src/Template/Schools/view.ctp
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\School $school
|
||||
*/
|
||||
?>
|
||||
<nav class="large-3 medium-4 columns" id="actions-sidebar">
|
||||
<ul class="side-nav">
|
||||
<li class="heading"><?= __('Actions') ?></li>
|
||||
<li><?= $this->Html->link(__('Edit School'), ['action' => 'edit', $school->id]) ?> </li>
|
||||
<li><?= $this->Form->postLink(__('Delete School'), ['action' => 'delete', $school->id], ['confirm' => __('Are you sure you want to delete # {0}?', $school->id)]) ?> </li>
|
||||
<li><?= $this->Html->link(__('List Schools'), ['action' => 'index']) ?> </li>
|
||||
<li><?= $this->Html->link(__('New School'), ['action' => 'add']) ?> </li>
|
||||
<li><?= $this->Html->link(__('List Budget'), ['controller' => 'Budget', 'action' => 'index']) ?> </li>
|
||||
<li><?= $this->Html->link(__('New Budget'), ['controller' => 'Budget', 'action' => 'add']) ?> </li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="schools view large-9 medium-8 columns content">
|
||||
<h3><?= h($school->dst_schluessel) ?></h3>
|
||||
<table class="vertical-table">
|
||||
<tr>
|
||||
<th scope="row"><?= __('Dst Schluessel') ?></th>
|
||||
<td><?= h($school->dst_schluessel) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Dst Name') ?></th>
|
||||
<td><?= h($school->dst_name) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Dst Schulart') ?></th>
|
||||
<td><?= h($school->dst_schulart) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Id') ?></th>
|
||||
<td><?= $this->Number->format($school->id) ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="related">
|
||||
<h4><?= __('Related Budget') ?></h4>
|
||||
<?php if (!empty($school->budget)): ?>
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<th scope="col"><?= __('Id') ?></th>
|
||||
<th scope="col"><?= __('Wl Schooltype Id') ?></th>
|
||||
<th scope="col"><?= __('School Id') ?></th>
|
||||
<th scope="col"><?= __('Wl Budget Id') ?></th>
|
||||
<th scope="col"><?= __('Count') ?></th>
|
||||
<th scope="col"><?= __('Comment') ?></th>
|
||||
<th scope="col"><?= __('Year') ?></th>
|
||||
<th scope="col"><?= __('Created') ?></th>
|
||||
<th scope="col"><?= __('Modified') ?></th>
|
||||
<th scope="col" class="actions"><?= __('Actions') ?></th>
|
||||
</tr>
|
||||
<?php foreach ($school->budget as $budget): ?>
|
||||
<tr>
|
||||
<td><?= h($budget->id) ?></td>
|
||||
<td><?= h($budget->wl_schooltype_id) ?></td>
|
||||
<td><?= h($budget->school_id) ?></td>
|
||||
<td><?= h($budget->wl_budget_id) ?></td>
|
||||
<td><?= h($budget->count) ?></td>
|
||||
<td><?= h($budget->comment) ?></td>
|
||||
<td><?= h($budget->year) ?></td>
|
||||
<td><?= h($budget->created) ?></td>
|
||||
<td><?= h($budget->modified) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['controller' => 'Budget', 'action' => 'view', $budget->id]) ?>
|
||||
<?= $this->Html->link(__('Edit'), ['controller' => 'Budget', 'action' => 'edit', $budget->id]) ?>
|
||||
<?= $this->Form->postLink(__('Delete'), ['controller' => 'Budget', 'action' => 'delete', $budget->id], ['confirm' => __('Are you sure you want to delete # {0}?', $budget->id)]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
28
src/Template/WlBudgets/add.ctp
Normal file
28
src/Template/WlBudgets/add.ctp
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\WlBudget $wlBudget
|
||||
*/
|
||||
?>
|
||||
<nav class="large-3 medium-4 columns" id="actions-sidebar">
|
||||
<ul class="side-nav">
|
||||
<li class="heading"><?= __('Actions') ?></li>
|
||||
<li><?= $this->Html->link(__('List Wl Budgets'), ['action' => 'index']) ?></li>
|
||||
<li><?= $this->Html->link(__('List Budget'), ['controller' => 'Budget', 'action' => 'index']) ?></li>
|
||||
<li><?= $this->Html->link(__('New Budget'), ['controller' => 'Budget', 'action' => 'add']) ?></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="wlBudgets form large-9 medium-8 columns content">
|
||||
<?= $this->Form->create($wlBudget) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Add Wl Budget') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('wl_werteliste_nr');
|
||||
echo $this->Form->control('wl_kurz_bezeichnung');
|
||||
echo $this->Form->control('schulart');
|
||||
echo $this->Form->control('modfied');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
34
src/Template/WlBudgets/edit.ctp
Normal file
34
src/Template/WlBudgets/edit.ctp
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\WlBudget $wlBudget
|
||||
*/
|
||||
?>
|
||||
<nav class="large-3 medium-4 columns" id="actions-sidebar">
|
||||
<ul class="side-nav">
|
||||
<li class="heading"><?= __('Actions') ?></li>
|
||||
<li><?= $this->Form->postLink(
|
||||
__('Delete'),
|
||||
['action' => 'delete', $wlBudget->id],
|
||||
['confirm' => __('Are you sure you want to delete # {0}?', $wlBudget->id)]
|
||||
)
|
||||
?></li>
|
||||
<li><?= $this->Html->link(__('List Wl Budgets'), ['action' => 'index']) ?></li>
|
||||
<li><?= $this->Html->link(__('List Budget'), ['controller' => 'Budget', 'action' => 'index']) ?></li>
|
||||
<li><?= $this->Html->link(__('New Budget'), ['controller' => 'Budget', 'action' => 'add']) ?></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="wlBudgets form large-9 medium-8 columns content">
|
||||
<?= $this->Form->create($wlBudget) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Edit Wl Budget') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('wl_werteliste_nr');
|
||||
echo $this->Form->control('wl_kurz_bezeichnung');
|
||||
echo $this->Form->control('schulart');
|
||||
echo $this->Form->control('modfied');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
57
src/Template/WlBudgets/index.ctp
Normal file
57
src/Template/WlBudgets/index.ctp
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\WlBudget[]|\Cake\Collection\CollectionInterface $wlBudgets
|
||||
*/
|
||||
?>
|
||||
<nav class="large-3 medium-4 columns" id="actions-sidebar">
|
||||
<ul class="side-nav">
|
||||
<li class="heading"><?= __('Actions') ?></li>
|
||||
<li><?= $this->Html->link(__('New Wl Budget'), ['action' => 'add']) ?></li>
|
||||
<li><?= $this->Html->link(__('List Budget'), ['controller' => 'Budget', 'action' => 'index']) ?></li>
|
||||
<li><?= $this->Html->link(__('New Budget'), ['controller' => 'Budget', 'action' => 'add']) ?></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="wlBudgets index large-9 medium-8 columns content">
|
||||
<h3><?= __('Wl Budgets') ?></h3>
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"><?= $this->Paginator->sort('id') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('wl_werteliste_nr') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('wl_kurz_bezeichnung') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('schulart') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('created') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('modfied') ?></th>
|
||||
<th scope="col" class="actions"><?= __('Actions') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($wlBudgets as $wlBudget): ?>
|
||||
<tr>
|
||||
<td><?= $this->Number->format($wlBudget->id) ?></td>
|
||||
<td><?= h($wlBudget->wl_werteliste_nr) ?></td>
|
||||
<td><?= h($wlBudget->wl_kurz_bezeichnung) ?></td>
|
||||
<td><?= h($wlBudget->schulart) ?></td>
|
||||
<td><?= h($wlBudget->created) ?></td>
|
||||
<td><?= h($wlBudget->modfied) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['action' => 'view', $wlBudget->id]) ?>
|
||||
<?= $this->Html->link(__('Edit'), ['action' => 'edit', $wlBudget->id]) ?>
|
||||
<?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $wlBudget->id], ['confirm' => __('Are you sure you want to delete # {0}?', $wlBudget->id)]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="paginator">
|
||||
<ul class="pagination">
|
||||
<?= $this->Paginator->first('<< ' . __('first')) ?>
|
||||
<?= $this->Paginator->prev('< ' . __('previous')) ?>
|
||||
<?= $this->Paginator->numbers() ?>
|
||||
<?= $this->Paginator->next(__('next') . ' >') ?>
|
||||
<?= $this->Paginator->last(__('last') . ' >>') ?>
|
||||
</ul>
|
||||
<p><?= $this->Paginator->counter(['format' => __('Page {{page}} of {{pages}}, showing {{current}} record(s) out of {{count}} total')]) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
18
src/Template/WlBudgets/select.ctp
Normal file
18
src/Template/WlBudgets/select.ctp
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\WlBudget $wlBudget
|
||||
*/
|
||||
?>
|
||||
|
||||
<div class="wlBudgets form large-9 medium-8 columns content">
|
||||
<?= $this->Form->create($wlBudget) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Edit Wl Budget') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('wl_Budgets');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
83
src/Template/WlBudgets/view.ctp
Normal file
83
src/Template/WlBudgets/view.ctp
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\WlBudget $wlBudget
|
||||
*/
|
||||
?>
|
||||
<nav class="large-3 medium-4 columns" id="actions-sidebar">
|
||||
<ul class="side-nav">
|
||||
<li class="heading"><?= __('Actions') ?></li>
|
||||
<li><?= $this->Html->link(__('Edit Wl Budget'), ['action' => 'edit', $wlBudget->id]) ?> </li>
|
||||
<li><?= $this->Form->postLink(__('Delete Wl Budget'), ['action' => 'delete', $wlBudget->id], ['confirm' => __('Are you sure you want to delete # {0}?', $wlBudget->id)]) ?> </li>
|
||||
<li><?= $this->Html->link(__('List Wl Budgets'), ['action' => 'index']) ?> </li>
|
||||
<li><?= $this->Html->link(__('New Wl Budget'), ['action' => 'add']) ?> </li>
|
||||
<li><?= $this->Html->link(__('List Budget'), ['controller' => 'Budget', 'action' => 'index']) ?> </li>
|
||||
<li><?= $this->Html->link(__('New Budget'), ['controller' => 'Budget', 'action' => 'add']) ?> </li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="wlBudgets view large-9 medium-8 columns content">
|
||||
<h3><?= h($wlBudget->wl_kurz_bezeichnung) ?></h3>
|
||||
<table class="vertical-table">
|
||||
<tr>
|
||||
<th scope="row"><?= __('Wl Werteliste Nr') ?></th>
|
||||
<td><?= h($wlBudget->wl_werteliste_nr) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Wl Kurz Bezeichnung') ?></th>
|
||||
<td><?= h($wlBudget->wl_kurz_bezeichnung) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Schulart') ?></th>
|
||||
<td><?= h($wlBudget->schulart) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Id') ?></th>
|
||||
<td><?= $this->Number->format($wlBudget->id) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Created') ?></th>
|
||||
<td><?= h($wlBudget->created) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Modfied') ?></th>
|
||||
<td><?= h($wlBudget->modfied) ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="related">
|
||||
<h4><?= __('Related Budget') ?></h4>
|
||||
<?php if (!empty($wlBudget->budget)): ?>
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<th scope="col"><?= __('Id') ?></th>
|
||||
<th scope="col"><?= __('Wl Schooltype Id') ?></th>
|
||||
<th scope="col"><?= __('Snr') ?></th>
|
||||
<th scope="col"><?= __('Wl Budget Id') ?></th>
|
||||
<th scope="col"><?= __('Count') ?></th>
|
||||
<th scope="col"><?= __('Comment') ?></th>
|
||||
<th scope="col"><?= __('Year') ?></th>
|
||||
<th scope="col"><?= __('Created') ?></th>
|
||||
<th scope="col"><?= __('Modified') ?></th>
|
||||
<th scope="col" class="actions"><?= __('Actions') ?></th>
|
||||
</tr>
|
||||
<?php foreach ($wlBudget->budget as $budget): ?>
|
||||
<tr>
|
||||
<td><?= h($budget->id) ?></td>
|
||||
<td><?= h($budget->wl_schooltype_id) ?></td>
|
||||
<td><?= h($budget->snr) ?></td>
|
||||
<td><?= h($budget->wl_budget_id) ?></td>
|
||||
<td><?= h($budget->count) ?></td>
|
||||
<td><?= h($budget->comment) ?></td>
|
||||
<td><?= h($budget->year) ?></td>
|
||||
<td><?= h($budget->created) ?></td>
|
||||
<td><?= h($budget->modified) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['controller' => 'Budget', 'action' => 'view', $budget->id]) ?>
|
||||
<?= $this->Html->link(__('Edit'), ['controller' => 'Budget', 'action' => 'edit', $budget->id]) ?>
|
||||
<?= $this->Form->postLink(__('Delete'), ['controller' => 'Budget', 'action' => 'delete', $budget->id], ['confirm' => __('Are you sure you want to delete # {0}?', $budget->id)]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
26
src/Template/WlDstTyp/add.ctp
Normal file
26
src/Template/WlDstTyp/add.ctp
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\WlDstTyp $wlDstTyp
|
||||
*/
|
||||
?>
|
||||
<nav class="large-3 medium-4 columns" id="actions-sidebar">
|
||||
<ul class="side-nav">
|
||||
<li class="heading"><?= __('Actions') ?></li>
|
||||
<li><?= $this->Html->link(__('List Wl Dst Typ'), ['action' => 'index']) ?></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="wlDstTyp form large-9 medium-8 columns content">
|
||||
<?= $this->Form->create($wlDstTyp) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Add Wl Dst Typ') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('key_value');
|
||||
echo $this->Form->control('short');
|
||||
echo $this->Form->control('name');
|
||||
echo $this->Form->control('modfied');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
32
src/Template/WlDstTyp/edit.ctp
Normal file
32
src/Template/WlDstTyp/edit.ctp
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\WlDstTyp $wlDstTyp
|
||||
*/
|
||||
?>
|
||||
<nav class="large-3 medium-4 columns" id="actions-sidebar">
|
||||
<ul class="side-nav">
|
||||
<li class="heading"><?= __('Actions') ?></li>
|
||||
<li><?= $this->Form->postLink(
|
||||
__('Delete'),
|
||||
['action' => 'delete', $wlDstTyp->id],
|
||||
['confirm' => __('Are you sure you want to delete # {0}?', $wlDstTyp->id)]
|
||||
)
|
||||
?></li>
|
||||
<li><?= $this->Html->link(__('List Wl Dst Typ'), ['action' => 'index']) ?></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="wlDstTyp form large-9 medium-8 columns content">
|
||||
<?= $this->Form->create($wlDstTyp) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Edit Wl Dst Typ') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('key_value');
|
||||
echo $this->Form->control('short');
|
||||
echo $this->Form->control('name');
|
||||
echo $this->Form->control('modfied');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
55
src/Template/WlDstTyp/index.ctp
Normal file
55
src/Template/WlDstTyp/index.ctp
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\WlDstTyp[]|\Cake\Collection\CollectionInterface $wlDstTyp
|
||||
*/
|
||||
?>
|
||||
<nav class="large-3 medium-4 columns" id="actions-sidebar">
|
||||
<ul class="side-nav">
|
||||
<li class="heading"><?= __('Actions') ?></li>
|
||||
<li><?= $this->Html->link(__('New Wl Dst Typ'), ['action' => 'add']) ?></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="wlDstTyp index large-9 medium-8 columns content">
|
||||
<h3><?= __('Wl Dst Typ') ?></h3>
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"><?= $this->Paginator->sort('id') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('key_value') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('short') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('name') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('created') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('modfied') ?></th>
|
||||
<th scope="col" class="actions"><?= __('Actions') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($wlDstTyp as $wlDstTyp): ?>
|
||||
<tr>
|
||||
<td><?= $this->Number->format($wlDstTyp->id) ?></td>
|
||||
<td><?= h($wlDstTyp->key_value) ?></td>
|
||||
<td><?= h($wlDstTyp->short) ?></td>
|
||||
<td><?= h($wlDstTyp->name) ?></td>
|
||||
<td><?= h($wlDstTyp->created) ?></td>
|
||||
<td><?= h($wlDstTyp->modfied) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['action' => 'view', $wlDstTyp->id]) ?>
|
||||
<?= $this->Html->link(__('Edit'), ['action' => 'edit', $wlDstTyp->id]) ?>
|
||||
<?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $wlDstTyp->id], ['confirm' => __('Are you sure you want to delete # {0}?', $wlDstTyp->id)]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="paginator">
|
||||
<ul class="pagination">
|
||||
<?= $this->Paginator->first('<< ' . __('first')) ?>
|
||||
<?= $this->Paginator->prev('< ' . __('previous')) ?>
|
||||
<?= $this->Paginator->numbers() ?>
|
||||
<?= $this->Paginator->next(__('next') . ' >') ?>
|
||||
<?= $this->Paginator->last(__('last') . ' >>') ?>
|
||||
</ul>
|
||||
<p><?= $this->Paginator->counter(['format' => __('Page {{page}} of {{pages}}, showing {{current}} record(s) out of {{count}} total')]) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
44
src/Template/WlDstTyp/view.ctp
Normal file
44
src/Template/WlDstTyp/view.ctp
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\WlDstTyp $wlDstTyp
|
||||
*/
|
||||
?>
|
||||
<nav class="large-3 medium-4 columns" id="actions-sidebar">
|
||||
<ul class="side-nav">
|
||||
<li class="heading"><?= __('Actions') ?></li>
|
||||
<li><?= $this->Html->link(__('Edit Wl Dst Typ'), ['action' => 'edit', $wlDstTyp->id]) ?> </li>
|
||||
<li><?= $this->Form->postLink(__('Delete Wl Dst Typ'), ['action' => 'delete', $wlDstTyp->id], ['confirm' => __('Are you sure you want to delete # {0}?', $wlDstTyp->id)]) ?> </li>
|
||||
<li><?= $this->Html->link(__('List Wl Dst Typ'), ['action' => 'index']) ?> </li>
|
||||
<li><?= $this->Html->link(__('New Wl Dst Typ'), ['action' => 'add']) ?> </li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="wlDstTyp view large-9 medium-8 columns content">
|
||||
<h3><?= h($wlDstTyp->name) ?></h3>
|
||||
<table class="vertical-table">
|
||||
<tr>
|
||||
<th scope="row"><?= __('Key Value') ?></th>
|
||||
<td><?= h($wlDstTyp->key_value) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Short') ?></th>
|
||||
<td><?= h($wlDstTyp->short) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Name') ?></th>
|
||||
<td><?= h($wlDstTyp->name) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Id') ?></th>
|
||||
<td><?= $this->Number->format($wlDstTyp->id) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Created') ?></th>
|
||||
<td><?= h($wlDstTyp->created) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Modfied') ?></th>
|
||||
<td><?= h($wlDstTyp->modfied) ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user