Bugfixes
This commit is contained in:
@@ -3,17 +3,17 @@
|
||||
#
|
||||
# Cake is a shell script for invoking CakePHP shell commands
|
||||
#
|
||||
# CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
# 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. (http://cakefoundation.org)
|
||||
# @link http://cakephp.org CakePHP(tm) Project
|
||||
# @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
# @link https://cakephp.org CakePHP(tm) Project
|
||||
# @since 1.2.0
|
||||
# @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
# @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
#
|
||||
################################################################################
|
||||
|
||||
|
||||
Executable
+46
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env sh
|
||||
################################################################################
|
||||
#
|
||||
# Cake is a shell script for invoking CakePHP shell commands
|
||||
#
|
||||
# CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
# Copyright (c) Cake Software Foundation, Inc. (http://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. (http://cakefoundation.org)
|
||||
# @link http://cakephp.org CakePHP(tm) Project
|
||||
# @since 1.2.0
|
||||
# @license http://www.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
|
||||
+1
-2
@@ -6,12 +6,11 @@
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": ">=5.5.9",
|
||||
"cakephp/cakephp": "3.3.*",
|
||||
"cakephp/cakephp": "3.6.*",
|
||||
"mobiledetect/mobiledetectlib": "2.*",
|
||||
"cakephp/migrations": "~1.0",
|
||||
"cakephp/plugin-installer": "*",
|
||||
"sunra/php-simple-html-dom-parser": "^1.5",
|
||||
"microweber/screen": "^1.0",
|
||||
"spatie/array-to-xml": "^2.7"
|
||||
},
|
||||
"require-dev": {
|
||||
|
||||
Generated
+323
-357
File diff suppressed because it is too large
Load Diff
@@ -150,12 +150,12 @@ if (!Configure::read('App.fullBaseUrl')) {
|
||||
unset($httpHost, $s);
|
||||
}
|
||||
|
||||
Cache::config(Configure::consume('Cache'));
|
||||
ConnectionManager::config(Configure::consume('Datasources'));
|
||||
Email::configTransport(Configure::consume('EmailTransport'));
|
||||
Email::config(Configure::consume('Email'));
|
||||
Log::config(Configure::consume('Log'));
|
||||
Security::salt(Configure::consume('Security.salt'));
|
||||
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.
|
||||
@@ -215,6 +215,8 @@ Type::build('timestamp')
|
||||
*
|
||||
*/
|
||||
|
||||
Plugin::load('Migrations');
|
||||
|
||||
/*
|
||||
* Only try to load DebugKit in development mode
|
||||
* Debug Kit should not be installed on a production system
|
||||
|
||||
@@ -17,11 +17,14 @@ define('SCHULPORTAL_ASD_BASE_URL', SCHULPORTAL_BASE0_URL . '/uniquesigc3ba168505
|
||||
define('SCHULPORTAL_MSTR_BASE_URL', SCHULPORTAL_BASE0_URL . '/uniquesig182e937bef9540ecffb7e0ba167caaea052491068bd93a46e70dbd73bf9f8963/uniquesig1/asd');
|
||||
|
||||
|
||||
Configure::write('AsdCurl.proxy','10.1.248.1:82');
|
||||
//Configure::write('AsdCurl.proxy','10.1.248.1:82');
|
||||
//Configure::write('AsdCurl.proxy','www.proxy.bybn.de:80');
|
||||
Configure::write('AsdCurl.proxy','127.0.0.1:8080');
|
||||
Configure::write('AsdCurl.cookiejar', '/tmp/cookies.txt');
|
||||
Configure::write('AsdCurl.cookiefile', '/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.useragent', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36');
|
||||
Configure::write('AsdCurl.cert','/var/www/html/ssl_KM_Z2016_asd.trinkl.pem');
|
||||
Configure::write('AsdCurl.schulbase0url',SCHULPORTAL_BASE0_URL);
|
||||
Configure::write('AsdCurl.schulbaseurl',SCHULPORTAL_BASE_URL);
|
||||
|
||||
@@ -22,11 +22,14 @@ class AsdCurl
|
||||
|
||||
public function init_curl_params()
|
||||
{
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_PROXY, Configure::read('AsdCurl.proxy'));
|
||||
$ch = curl_init('https://portal.schulen.bayern.de/');
|
||||
//curl_setopt($ch, CURLOPT_PROXY, Configure::read('AsdCurl.proxy'));
|
||||
//curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
|
||||
curl_setopt($ch, CURLOPT_PROXY, "");
|
||||
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_FOLLOWLOCATION, false);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
|
||||
curl_setopt($ch, CURLOPT_COOKIEJAR, Configure::read('AsdCurl.cookiejar'));
|
||||
@@ -58,6 +61,7 @@ class AsdCurl
|
||||
|
||||
public function exec_curl($ch, $url, $post)
|
||||
{
|
||||
//debug($url);die;
|
||||
if ($post == false) {
|
||||
curl_setopt($ch, CURLOPT_POST, 0);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array());
|
||||
@@ -68,6 +72,8 @@ class AsdCurl
|
||||
}
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
$this->html = curl_exec($ch);
|
||||
//echo 'Hallo';
|
||||
//echo $this->html;die;
|
||||
//debug(curl_errno($ch));
|
||||
//debug(curl_getinfo($ch, CURLINFO_HTTP_CODE));
|
||||
if (curl_errno($ch)) {
|
||||
@@ -93,7 +99,9 @@ class AsdCurl
|
||||
|
||||
$login_data = [
|
||||
'asd_username' => 'A005_TrinklW',
|
||||
'asd_password' => 'HiegTzs!12',
|
||||
'asd_password' => 'HiegTzs!183',
|
||||
//'asd_username' => 'A005_KnollmüllerP',
|
||||
//'asd_password' => 'Ooricha8e!',
|
||||
];
|
||||
$post = [
|
||||
'login:username' => $login_data['asd_username'],
|
||||
@@ -108,6 +116,7 @@ class AsdCurl
|
||||
}
|
||||
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
|
||||
Configure::write('Session', ['viewstate' => $viewstate]);
|
||||
//echo $this->html;die;
|
||||
}
|
||||
|
||||
public function login_mstr($ch) {
|
||||
@@ -154,17 +163,23 @@ class AsdCurl
|
||||
|
||||
public function login_school($ch)
|
||||
{
|
||||
//echo 'Hallo';die;
|
||||
$SCHULPORTAL_BASE0_URL = Configure::read('AsdCurl.schulbase0url');
|
||||
//$SCHULPORTAL_BASE0_URL = "https://portal.schulen.bayern.de/SecureSchulportalPortalHomePage";
|
||||
$SCHULPORTAL_BASE_URL = Configure::read('AsdCurl.schulbaseurl');
|
||||
//$SCHULPORTAL_BASE_URL = Configure::read('AsdCurl.schulbaseurl') . '/SecureSchulportalPortalHomePage';
|
||||
//$login_data = $this->request->session()->read('data');
|
||||
|
||||
//echo $SCHULPORTAL_BASE_URL;
|
||||
|
||||
$this->exec_curl($ch, $SCHULPORTAL_BASE_URL, false);
|
||||
if(!($this->status)) {
|
||||
die($this->error);
|
||||
}
|
||||
//echo $this->html; die;
|
||||
$login_data = [
|
||||
'portal_username' => 'asd.trinkl',
|
||||
'portal_password' => 'HiegTzs!182',
|
||||
'portal_password' => 'HiegTzs!184',
|
||||
];
|
||||
|
||||
$post = [
|
||||
@@ -178,10 +193,13 @@ class AsdCurl
|
||||
];
|
||||
// Anmeldeformular fuer das Schulportal abschicken - Step 2
|
||||
|
||||
//https://portal.schulen.bayern.de/uniquesig2d1dfad4a11c25e42c462e53b4721e48/uniquesig0/SecureSchulportalPortalHomePage/
|
||||
//$this->exec_curl($ch, $SCHULPORTAL_BASE_URL . '/SecureSchulportalPortalHomePage', $post);
|
||||
$this->exec_curl($ch, $SCHULPORTAL_BASE_URL . '/InternalSite/Validate.asp', $post);
|
||||
if(!($this->status)) {
|
||||
die($this->error);
|
||||
}
|
||||
//debug($this->html);die;
|
||||
}
|
||||
|
||||
public function exec_mstr($ch, $url, $post)
|
||||
|
||||
@@ -24,12 +24,13 @@ class AsdUs extends AsdCurl
|
||||
$post = [
|
||||
'sideMenu' => 'sideMenu',
|
||||
'javax.faces.ViewState' => $viewstate,
|
||||
'sideMenu:j_idt51:0:j_idt57:1:j_idt59' => 'sideMenu:j_idt51:0:j_idt57:1:j_idt59',
|
||||
'sideMenu:j_idt52:0:j_idt58:1:j_idt60' => 'sideMenu:j_idt52:0:j_idt58:1:j_idt60',
|
||||
];
|
||||
$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/asdus/us_00_00.jsf?cid=' . $conversationId, $post);
|
||||
if(!($this->status)) {
|
||||
die($this->error);
|
||||
}
|
||||
//echo $this->html;die;
|
||||
// In Maske US 01 01 alle Felder leer lassen und "Suchen" ausführen
|
||||
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
|
||||
$conversationId = $this->get_string_between($this->html, 'name="conversationId" value="', '" />');
|
||||
@@ -52,6 +53,7 @@ class AsdUs extends AsdCurl
|
||||
'mainForm:dienststelle_plzstrasse' => '',
|
||||
'mainForm:dienststelle_ort' => '',
|
||||
'mainForm:dienststelle_sat_kurz_bezeichnung' => 'EMPTY:0',
|
||||
//'mainForm:dienststelle_sat_kurz_bezeichnung' => 'com.hp.asd.wl.domain.standard.SchulartRechtlich:747',
|
||||
'mainForm:dienststelle_bdg_kurz_bezeichnung' => 'EMPTY:0',
|
||||
'mainForm:dienststelle_wl_kurz_bezeichnung' => 'EMPTY:0',
|
||||
'mainForm:dienststelle_dst_wl_regierung_id_u' => 'EMPTY:0',
|
||||
@@ -67,10 +69,12 @@ class AsdUs extends AsdCurl
|
||||
if(!($this->status)) {
|
||||
die($this->error);
|
||||
}
|
||||
//echo $this->html;
|
||||
// Auf der Ergebnisseite auf "Alle" Klicken
|
||||
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
|
||||
$conversationId = $this->get_string_between($this->html, 'name="conversationId" value="', '" />');
|
||||
//$mainform = $this->get_string_between($this->html, '\\\':\\\'', '\\\'},\\\'\\\')\');return false\" class=\"ignoreChangeNotification notBold\">ALLE</a>');
|
||||
$mainform = $this->get_string_between($this->html, '\\\':\\\'', '\\\'},\\\'\\\')\')\;return false\" class=\"ignoreChangeNotification notBold\">ALLE</a>');
|
||||
|
||||
//debug($mainform);die;
|
||||
$post = [
|
||||
'mainForm' => 'mainForm',
|
||||
@@ -86,7 +90,7 @@ class AsdUs extends AsdCurl
|
||||
'skipvalidation' => 'true',
|
||||
'mainForm:istAnzeigeMaske' => 'false',
|
||||
'javax.faces.ViewState' => $viewstate,
|
||||
'mainForm:j_idt189' => 'mainForm:j_idt189',
|
||||
'mainForm:j_idt184' => 'mainForm:j_idt184',
|
||||
];
|
||||
$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/asdus/us_01_02.jsf?cid=' . $conversationId, $post);
|
||||
if(!($this->status)) {
|
||||
@@ -188,6 +192,7 @@ class AsdUs extends AsdCurl
|
||||
if(!($this->status)) {
|
||||
die($this->error);
|
||||
}
|
||||
echo $this->html;die;
|
||||
// Auf der Ergebnisseite auf "Alle" Klicken
|
||||
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
|
||||
$conversationId = $this->get_string_between($this->html, 'name="conversationId" value="', '" />');
|
||||
@@ -207,7 +212,7 @@ class AsdUs extends AsdCurl
|
||||
'skipvalidation' => 'true',
|
||||
'mainForm:istAnzeigeMaske' => 'false',
|
||||
'javax.faces.ViewState' => $viewstate,
|
||||
'mainForm:j_idt189' => 'mainForm:j_idt189',
|
||||
'mainForm:j_idt184' => 'mainForm:j_idt184'
|
||||
];
|
||||
$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/asdup/up_03_02.jsf?cid=' . $conversationId, $post);
|
||||
if(!($this->status)) {
|
||||
|
||||
@@ -61,7 +61,7 @@ class AppController extends Controller
|
||||
public function beforeRender(Event $event)
|
||||
{
|
||||
if (!array_key_exists('_serialize', $this->viewVars) &&
|
||||
in_array($this->response->type(), ['application/json', 'application/xml'])
|
||||
in_array($this->response->getType(), ['application/json', 'application/xml'])
|
||||
) {
|
||||
$this->set('_serialize', true);
|
||||
}
|
||||
|
||||
@@ -82,8 +82,11 @@ class CurlsController extends AppController
|
||||
//debug($curl->status);
|
||||
$ch = $curl->init_curl_params();
|
||||
$curl->login_school($ch);
|
||||
|
||||
$curl->login_asd($ch);
|
||||
//echo $curl->html;die;
|
||||
$curl->save_us_data($ch);
|
||||
//echo $curl->html;die;
|
||||
$this->set('html',$curl->html);
|
||||
$this->redirect(['action' => 'getjsonus']);
|
||||
}
|
||||
@@ -113,10 +116,11 @@ class CurlsController extends AppController
|
||||
$this->set('results',$results);
|
||||
$file = new File('/var/www/html/asd-control/webroot/files/data-us.json', true, 0644);
|
||||
$file->create();
|
||||
debug(json_encode($results));
|
||||
$status = $file->write(json_encode($results), 'w', true);
|
||||
echo $status;
|
||||
$file->close();
|
||||
$this->viewBuilder()->layout('getjson');
|
||||
$this->viewBuilder()->setLayout('getjson');
|
||||
}
|
||||
|
||||
public function getjsonup() {
|
||||
@@ -138,7 +142,7 @@ class CurlsController extends AppController
|
||||
$time = Time::createFromTimestamp($ts);
|
||||
$time->timezone = 'Europe/Paris';
|
||||
$this->set('time', $time);
|
||||
$this->viewBuilder()->layout('pivot');
|
||||
$this->viewBuilder()->setLayout('pivot');
|
||||
}
|
||||
|
||||
public function upStatistik() {
|
||||
|
||||
@@ -16,9 +16,10 @@ class OfficesController extends AppController
|
||||
|
||||
$office = $this->Offices->newEntity();
|
||||
if ($this->request->is(['patch', 'post', 'put'])) {
|
||||
//debug($this->request['data']);die;
|
||||
$options = [
|
||||
'length' => 0,
|
||||
'delimiter' => ',',
|
||||
'delimiter' => ';',
|
||||
'enclosure' => '"',
|
||||
'escape' => '\\',
|
||||
'headers' => false,
|
||||
@@ -39,12 +40,13 @@ class OfficesController extends AppController
|
||||
$j++;
|
||||
}
|
||||
//debug($data);
|
||||
//debug($data['d_dst_schluessel']);
|
||||
$office = $this->Offices->find('all',['conditions' => array('dst_schluessel' => $data['d_dst_schluessel'])])->first();
|
||||
|
||||
$office['d_regierung'] = $data['d_regierung'];
|
||||
$office['d_mb'] = $data['d_mb'];
|
||||
$office['d_schulamt'] = $data['d_schulamt'];
|
||||
//debug($office);
|
||||
//debug($office);die;
|
||||
|
||||
if (!($this->Offices->save($office))) {
|
||||
debug($office);die;
|
||||
@@ -55,6 +57,8 @@ class OfficesController extends AppController
|
||||
}
|
||||
|
||||
}
|
||||
$this->set(compact('office'));
|
||||
$this->set('_serialize', ['office']);
|
||||
|
||||
}
|
||||
|
||||
@@ -104,8 +108,8 @@ class OfficesController extends AppController
|
||||
//debug($entities);die;
|
||||
//$result = $this->Offices->saveMany($entities);
|
||||
}
|
||||
//$this->set(compact('office'));
|
||||
//$this->set('_serialize', ['office']);
|
||||
$this->set(compact('office'));
|
||||
$this->set('_serialize', ['office']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,224 @@
|
||||
<?php
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Controller\AppController;
|
||||
use ZipArchive;
|
||||
|
||||
/**
|
||||
* Usfails Controller
|
||||
*
|
||||
* @property \App\Model\Table\UsfailsTable $Usfails
|
||||
*
|
||||
* @method \App\Model\Entity\Usfail[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
|
||||
*/
|
||||
class UsfailsController extends AppController
|
||||
{
|
||||
public function ftp() {
|
||||
$ftp_server = "10.190.22.35";
|
||||
$ftp_port = "2587";
|
||||
$ftp_user = "LfStaD-Log";
|
||||
$ftp_pass = "135!Log!086";
|
||||
$local_file = '/test/test.zip';
|
||||
$zip_pass = '!US-US-2018!';
|
||||
$local_folder = '/test';
|
||||
|
||||
$conn_id = ftp_connect($ftp_server, $ftp_port) or die("Couldn't connect to $ftp_server");
|
||||
|
||||
if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) {
|
||||
echo "Angemeldet als $ftp_user@$ftp_server\n";
|
||||
} else {
|
||||
echo "Anmeldung als $ftp_user nicht möglich\n";
|
||||
}
|
||||
|
||||
ftp_chdir($conn_id, 'ap-csv');
|
||||
$contents = ftp_nlist($conn_id, ".");
|
||||
//debug($contents);
|
||||
$abschluss = array_search('US_2018.zip',$contents);
|
||||
//debug($abschluss);
|
||||
//die;
|
||||
ftp_get($conn_id, $local_file, $contents[$abschluss], FTP_BINARY);
|
||||
|
||||
$zip = new ZipArchive();
|
||||
$zip_status = $zip->open($local_file);
|
||||
|
||||
if ($zip_status === true) {
|
||||
if ($zip->setPassword($zip_pass)) {
|
||||
if (!$zip->extractTo('/test/results/'))
|
||||
echo "Extraction failed (wrong password?)";
|
||||
}
|
||||
//debug($zip->statIndex(0));
|
||||
$file = $zip->statIndex(0)['name'];
|
||||
//debug($file);
|
||||
//debug($file);
|
||||
$zip->close();
|
||||
}
|
||||
else {
|
||||
die("Failed opening archive: " . @$zip->getStatusString() . " (code: " . $zip_status . ")");
|
||||
}
|
||||
//echo '/bin/sed -i -E "s/[0-9]{4}[A-Z0-9]{4}[0-9]{17}/XXXXXXXX/g" /test/results/' . $file;
|
||||
//die;
|
||||
exec('/bin/sed -i -E "s/[0-9]{4}[A-Z0-9]{4}[0-9]{17}/XXXXXXXX/g" /test/results/' . $file);
|
||||
rename('/test/results/'.$file,'/var/www/html/asd-control/webroot/files/us/results.csv');
|
||||
|
||||
ftp_close($conn_id);
|
||||
return $this->redirect(['controller' => 'Usfails', 'action' => 'import']);
|
||||
}
|
||||
|
||||
public function import() {
|
||||
|
||||
$sqls = $this->Usfails->schema()->truncateSql($this->Usfails->connection());
|
||||
foreach ($sqls as $sql) {
|
||||
$this->Usfails->connection()->execute($sql)->execute();
|
||||
}
|
||||
$options = [
|
||||
'length' => 0,
|
||||
'delimiter' => ';',
|
||||
'enclosure' => ' ',
|
||||
'escape' => '\\',
|
||||
'headers' => false,
|
||||
'text' => false,
|
||||
'excel_bom' => false,
|
||||
];
|
||||
|
||||
|
||||
$filepath = '/var/www/html/asd-control/webroot/files/us/results.csv';
|
||||
$handle = fopen($filepath, "r");
|
||||
$i = 1;
|
||||
//$header = fgetcsv($handle, $options['length'], $options['delimiter']);
|
||||
while ($row = fgetcsv($handle, $options['length'], $options['delimiter'])) {
|
||||
//debug($row);
|
||||
$data = (object) [];
|
||||
$data->snr = trim($row[0]);
|
||||
$data->name = trim($row[1]);
|
||||
$data->status = trim($row[2]);
|
||||
$data->lieferdatum = date('Y-m-d H:i:s', strtotime(str_replace('-', '/', trim($row[3]))));
|
||||
$data->lieferung = trim($row[4]);
|
||||
$data->auftrag = trim($row[5]);
|
||||
$data->plausi = trim($row[6]);
|
||||
$data->schluessel = trim($row[7]);
|
||||
$data->sst_objekt = trim($row[8]);
|
||||
$data->fehler_kurz = trim($row[9]);
|
||||
$data->fehler_lang = trim($row[10]);
|
||||
$data->korrekturhinweis = trim($row[11]);
|
||||
$data->ref_feld = trim($row[12]);
|
||||
|
||||
$line = $this->Usfails->newEntity();
|
||||
$line = $this->Usfails->patchEntity($line, (array) $data);
|
||||
$fault = $result = $this->Usfails->save($line);
|
||||
//debug($fault);
|
||||
//die;
|
||||
//debug($i++);
|
||||
}
|
||||
//die;
|
||||
return $this->redirect(['action' => 'show']);
|
||||
|
||||
}
|
||||
|
||||
public function show() {
|
||||
$results = $this->Usfails->find('all',array('conditions' => array('plausi != 1')));
|
||||
//debug($results);
|
||||
$this->set('results',$results);
|
||||
$this->viewBuilder()->setLayout('usfails');
|
||||
}
|
||||
|
||||
public function showdetails($snr) {
|
||||
//debug($snr);
|
||||
$details = $this->Usfails->find('all',array('conditions' => array('and' => array('snr' => $snr, 'plausi = 1' ))));
|
||||
$this->set('details',$details);
|
||||
$this->viewBuilder()->setLayout('usfails');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Index method
|
||||
*
|
||||
* @return \Cake\Http\Response|void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$usfails = $this->paginate($this->Usfails);
|
||||
|
||||
$this->set(compact('usfails'));
|
||||
}
|
||||
|
||||
/**
|
||||
* View method
|
||||
*
|
||||
* @param string|null $id Usfail id.
|
||||
* @return \Cake\Http\Response|void
|
||||
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
|
||||
*/
|
||||
public function view($id = null)
|
||||
{
|
||||
$usfail = $this->Usfails->get($id, [
|
||||
'contain' => []
|
||||
]);
|
||||
|
||||
$this->set('usfail', $usfail);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add method
|
||||
*
|
||||
* @return \Cake\Http\Response|null Redirects on successful add, renders view otherwise.
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$usfail = $this->Usfails->newEntity();
|
||||
if ($this->request->is('post')) {
|
||||
$usfail = $this->Usfails->patchEntity($usfail, $this->request->getData());
|
||||
if ($this->Usfails->save($usfail)) {
|
||||
$this->Flash->success(__('The usfail has been saved.'));
|
||||
|
||||
return $this->redirect(['action' => 'index']);
|
||||
}
|
||||
$this->Flash->error(__('The usfail could not be saved. Please, try again.'));
|
||||
}
|
||||
$this->set(compact('usfail'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit method
|
||||
*
|
||||
* @param string|null $id Usfail 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)
|
||||
{
|
||||
$usfail = $this->Usfails->get($id, [
|
||||
'contain' => []
|
||||
]);
|
||||
if ($this->request->is(['patch', 'post', 'put'])) {
|
||||
$usfail = $this->Usfails->patchEntity($usfail, $this->request->getData());
|
||||
if ($this->Usfails->save($usfail)) {
|
||||
$this->Flash->success(__('The usfail has been saved.'));
|
||||
|
||||
return $this->redirect(['action' => 'index']);
|
||||
}
|
||||
$this->Flash->error(__('The usfail could not be saved. Please, try again.'));
|
||||
}
|
||||
$this->set(compact('usfail'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete method
|
||||
*
|
||||
* @param string|null $id Usfail 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']);
|
||||
$usfail = $this->Usfails->get($id);
|
||||
if ($this->Usfails->delete($usfail)) {
|
||||
$this->Flash->success(__('The usfail has been deleted.'));
|
||||
} else {
|
||||
$this->Flash->error(__('The usfail could not be deleted. Please, try again.'));
|
||||
}
|
||||
|
||||
return $this->redirect(['action' => 'index']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
namespace App\Model\Entity;
|
||||
|
||||
use Cake\ORM\Entity;
|
||||
|
||||
/**
|
||||
* Usfail Entity
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $snr
|
||||
* @property string $name
|
||||
* @property string $status
|
||||
* @property \Cake\I18n\FrozenTime $lieferdatum
|
||||
* @property string $lieferung
|
||||
* @property string $auftrag
|
||||
* @property bool $plausi
|
||||
* @property string $schluessel
|
||||
* @property string $sst_objekt
|
||||
* @property string $fehler_kurz
|
||||
* @property string $fehler_lang
|
||||
* @property string $korrekturhinweis
|
||||
* @property string $ref_feld
|
||||
* @property \Cake\I18n\FrozenTime $created
|
||||
* @property \Cake\I18n\FrozenTime $modified
|
||||
*/
|
||||
class Usfail 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 = [
|
||||
'snr' => true,
|
||||
'name' => true,
|
||||
'status' => true,
|
||||
'lieferdatum' => true,
|
||||
'lieferung' => true,
|
||||
'auftrag' => true,
|
||||
'plausi' => true,
|
||||
'schluessel' => true,
|
||||
'sst_objekt' => true,
|
||||
'fehler_kurz' => true,
|
||||
'fehler_lang' => true,
|
||||
'korrekturhinweis' => true,
|
||||
'ref_feld' => true,
|
||||
'created' => true,
|
||||
'modified' => true
|
||||
];
|
||||
}
|
||||
@@ -30,7 +30,7 @@ class ResultsTable extends Table
|
||||
{
|
||||
parent::initialize($config);
|
||||
|
||||
$this->table('results');
|
||||
$this->setTable('results');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
namespace App\Model\Table;
|
||||
|
||||
use Cake\ORM\Query;
|
||||
use Cake\ORM\RulesChecker;
|
||||
use Cake\ORM\Table;
|
||||
use Cake\Validation\Validator;
|
||||
|
||||
/**
|
||||
* Usfails Model
|
||||
*
|
||||
* @method \App\Model\Entity\Usfail get($primaryKey, $options = [])
|
||||
* @method \App\Model\Entity\Usfail newEntity($data = null, array $options = [])
|
||||
* @method \App\Model\Entity\Usfail[] newEntities(array $data, array $options = [])
|
||||
* @method \App\Model\Entity\Usfail|bool save(\Cake\Datasource\EntityInterface $entity, $options = [])
|
||||
* @method \App\Model\Entity\Usfail patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
|
||||
* @method \App\Model\Entity\Usfail[] patchEntities($entities, array $data, array $options = [])
|
||||
* @method \App\Model\Entity\Usfail findOrCreate($search, callable $callback = null, $options = [])
|
||||
*
|
||||
* @mixin \Cake\ORM\Behavior\TimestampBehavior
|
||||
*/
|
||||
class UsfailsTable extends Table
|
||||
{
|
||||
|
||||
/**
|
||||
* Initialize method
|
||||
*
|
||||
* @param array $config The configuration for the Table.
|
||||
* @return void
|
||||
*/
|
||||
public function initialize(array $config)
|
||||
{
|
||||
parent::initialize($config);
|
||||
|
||||
$this->setTable('usfails');
|
||||
$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', 'schluessel', 'sst_objekt', 'fehler_kurz', 'fehler_lang', 'korrekturhinweis', 'ref_feld');
|
||||
|
||||
$validator
|
||||
->scalar('snr')
|
||||
->maxLength('snr', 4)
|
||||
->requirePresence('snr', 'create')
|
||||
->notEmpty('snr');
|
||||
|
||||
$validator
|
||||
->scalar('name')
|
||||
->maxLength('name', 50)
|
||||
->requirePresence('name', 'create')
|
||||
->notEmpty('name');
|
||||
|
||||
$validator
|
||||
->scalar('status')
|
||||
->maxLength('status', 50)
|
||||
->requirePresence('status', 'create')
|
||||
->notEmpty('status');
|
||||
|
||||
$validator
|
||||
->dateTime('lieferdatum')
|
||||
->requirePresence('lieferdatum', 'create')
|
||||
->notEmpty('lieferdatum');
|
||||
|
||||
$validator
|
||||
->scalar('lieferung')
|
||||
->maxLength('lieferung', 20)
|
||||
->requirePresence('lieferung', 'create')
|
||||
->notEmpty('lieferung');
|
||||
|
||||
$validator
|
||||
->scalar('auftrag')
|
||||
->maxLength('auftrag', 20)
|
||||
->requirePresence('auftrag', 'create')
|
||||
->notEmpty('auftrag');
|
||||
|
||||
$validator
|
||||
->boolean('plausi')
|
||||
->requirePresence('plausi', 'create')
|
||||
->notEmpty('plausi');
|
||||
|
||||
return $validator;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,18 @@
|
||||
<table>
|
||||
<tr><th>Typ</th><th>SNR</th><th>Anzahl</th><th>Apcount</th><th>Datum</th></tr>
|
||||
<tr><th>NR</th><th>Typ</th><th>SNR</th><th>Anzahl</th><th>Apcount</th><th>Datum</th></tr>
|
||||
<?php
|
||||
$i=1;
|
||||
foreach($apresults as $apresult) {
|
||||
echo '<tr>';
|
||||
echo '<td>'.$i.'</td>';
|
||||
echo '<td>'.$apresult['aptype'].'</td>';
|
||||
echo '<td>'.$apresult['snr'].'</td>';
|
||||
echo '<td>'.$apresult['anzahl'].'</td>';
|
||||
echo '<td>'.$apresult['apcount'].'</td>';
|
||||
echo '<td>'.date('Y-m-d H:i:s',strtotime($apresult['erzeugungsdatum'])).'</td>';
|
||||
echo '</tr>';
|
||||
$i++;
|
||||
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
@@ -1,11 +1,19 @@
|
||||
<?php
|
||||
echo '<h4 style="margin-left: 30px;">US 2017 - Stand: ' . $time->i18nFormat('dd.MM.yyyy HH:mm') . '</h4>';
|
||||
echo '<h4 style="margin-left: 30px;">US 2018 - Stand: ' . $time->i18nFormat('dd.MM.yyyy HH:mm') . '</h4>';
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function(){
|
||||
$.getJSON("/files/data.json", function(mps) {
|
||||
var origin = window.location.origin;
|
||||
console.log(origin);
|
||||
if (origin == 'http://km-pc-asd-ap.stmukwk.bayern.de') {
|
||||
jsonurl = '/files/data-us.json';
|
||||
}
|
||||
else {
|
||||
jsonurl = '/asd-control/files/data-us.json';
|
||||
}
|
||||
$.getJSON(jsonurl, function(mps) {
|
||||
$("#output").pivotUI(mps, {
|
||||
rows: ["Schulart"],
|
||||
cols: ["Übermittlungsstatus"],
|
||||
@@ -21,7 +29,7 @@ echo '<h4 style="margin-left: 30px;">US 2017 - Stand: ' . $time->i18nFormat('dd.
|
||||
$( "#heading").text(filters.Schulart + ' - ' + filters.Übermittlungsstatus);
|
||||
var names = [];
|
||||
pivotData.forEachMatchingRecord(filters,
|
||||
function(record){ names.push(record.Schule + ' (' + record.Datum.substring(0,10) + ')'); });
|
||||
function(record){ names.push(record.Schule + ' (' + record.Datum.substring(0,10) + ' ' + record.Datum.substring(11,19) + ')'); });
|
||||
//alert(pivotData.getColKeys());
|
||||
//alert(pivotData.colKeys);
|
||||
//pivotData.colKeys.push('Hallo');
|
||||
|
||||
@@ -25,6 +25,8 @@ $cakeDescription = 'ASD - Control';
|
||||
<?= $this->fetch('title') ?>
|
||||
</title>
|
||||
<?= $this->Html->meta('icon') ?>
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="expires" content="-1">
|
||||
|
||||
<?= $this->Html->css('base.css') ?>
|
||||
<?= $this->Html->css('pivot.css') ?>
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://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. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @since 0.10.0
|
||||
* @license http://www.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>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/**
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
*/
|
||||
?>
|
||||
@@ -14,9 +14,9 @@
|
||||
<fieldset>
|
||||
<legend><?=__('Add Office')?></legend>
|
||||
<?php
|
||||
echo $this->Form->input('file', ['type' => 'file']);
|
||||
echo $this->Form->control('file', ['type' => 'file']);
|
||||
?>
|
||||
</fieldset>
|
||||
<?=$this->Form->button(__('Submit'))?>
|
||||
<?=$this->Form->button(__('Submit'))?>
|
||||
<?=$this->Form->end()?>
|
||||
</div>
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\Usfail $usfail
|
||||
*/
|
||||
?>
|
||||
<nav class="large-3 medium-4 columns" id="actions-sidebar">
|
||||
<ul class="side-nav">
|
||||
<li class="heading"><?= __('Actions') ?></li>
|
||||
<li><?= $this->Html->link(__('List Usfails'), ['action' => 'index']) ?></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="usfails form large-9 medium-8 columns content">
|
||||
<?= $this->Form->create($usfail) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Add Usfail') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('snr');
|
||||
echo $this->Form->control('name');
|
||||
echo $this->Form->control('status');
|
||||
echo $this->Form->control('lieferdatum');
|
||||
echo $this->Form->control('lieferung');
|
||||
echo $this->Form->control('auftrag');
|
||||
echo $this->Form->control('plausi');
|
||||
echo $this->Form->control('schluessel');
|
||||
echo $this->Form->control('sst_objekt');
|
||||
echo $this->Form->control('fehler_kurz');
|
||||
echo $this->Form->control('fehler_lang');
|
||||
echo $this->Form->control('korrekturhinweis');
|
||||
echo $this->Form->control('ref_feld');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\Usfail $usfail
|
||||
*/
|
||||
?>
|
||||
<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', $usfail->id],
|
||||
['confirm' => __('Are you sure you want to delete # {0}?', $usfail->id)]
|
||||
)
|
||||
?></li>
|
||||
<li><?= $this->Html->link(__('List Usfails'), ['action' => 'index']) ?></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="usfails form large-9 medium-8 columns content">
|
||||
<?= $this->Form->create($usfail) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Edit Usfail') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('snr');
|
||||
echo $this->Form->control('name');
|
||||
echo $this->Form->control('status');
|
||||
echo $this->Form->control('lieferdatum');
|
||||
echo $this->Form->control('lieferung');
|
||||
echo $this->Form->control('auftrag');
|
||||
echo $this->Form->control('plausi');
|
||||
echo $this->Form->control('schluessel');
|
||||
echo $this->Form->control('sst_objekt');
|
||||
echo $this->Form->control('fehler_kurz');
|
||||
echo $this->Form->control('fehler_lang');
|
||||
echo $this->Form->control('korrekturhinweis');
|
||||
echo $this->Form->control('ref_feld');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\Usfail[]|\Cake\Collection\CollectionInterface $usfails
|
||||
*/
|
||||
?>
|
||||
<nav class="large-3 medium-4 columns" id="actions-sidebar">
|
||||
<ul class="side-nav">
|
||||
<li class="heading"><?= __('Actions') ?></li>
|
||||
<li><?= $this->Html->link(__('New Usfail'), ['action' => 'add']) ?></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="usfails index large-9 medium-8 columns content">
|
||||
<h3><?= __('Usfails') ?></h3>
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"><?= $this->Paginator->sort('id') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('snr') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('name') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('status') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('lieferdatum') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('lieferung') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('auftrag') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('plausi') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('schluessel') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('sst_objekt') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('fehler_kurz') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('fehler_lang') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('korrekturhinweis') ?></th>
|
||||
<th scope="col"><?= $this->Paginator->sort('ref_feld') ?></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 ($usfails as $usfail): ?>
|
||||
<tr>
|
||||
<td><?= $this->Number->format($usfail->id) ?></td>
|
||||
<td><?= h($usfail->snr) ?></td>
|
||||
<td><?= h($usfail->name) ?></td>
|
||||
<td><?= h($usfail->status) ?></td>
|
||||
<td><?= h($usfail->lieferdatum) ?></td>
|
||||
<td><?= h($usfail->lieferung) ?></td>
|
||||
<td><?= h($usfail->auftrag) ?></td>
|
||||
<td><?= h($usfail->plausi) ?></td>
|
||||
<td><?= h($usfail->schluessel) ?></td>
|
||||
<td><?= h($usfail->sst_objekt) ?></td>
|
||||
<td><?= h($usfail->fehler_kurz) ?></td>
|
||||
<td><?= h($usfail->fehler_lang) ?></td>
|
||||
<td><?= h($usfail->korrekturhinweis) ?></td>
|
||||
<td><?= h($usfail->ref_feld) ?></td>
|
||||
<td><?= h($usfail->created) ?></td>
|
||||
<td><?= h($usfail->modified) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['action' => 'view', $usfail->id]) ?>
|
||||
<?= $this->Html->link(__('Edit'), ['action' => 'edit', $usfail->id]) ?>
|
||||
<?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $usfail->id], ['confirm' => __('Are you sure you want to delete # {0}?', $usfail->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>
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
echo '<h1>Übersicht</h1>';
|
||||
echo '<table>';
|
||||
//debug(json_decode(json_encode($results))[0]);
|
||||
echo '<tr>';
|
||||
//foreach (json_decode(json_encode($results))[0] as $key => $value) {
|
||||
echo '<th>snr</th><th>name</th><th>status</th><th>lieferdatum</th><th>lieferung</th><th>auftrag</th><th>sst_objekt</th>';
|
||||
//}
|
||||
echo '</tr>';
|
||||
foreach($results as $result) {
|
||||
//debug($result);
|
||||
$resultarray = json_decode(json_encode($result));
|
||||
//debug($resultarray);
|
||||
echo '<tr>';
|
||||
echo '<td>'. $this->Html->link($resultarray->snr,'/usfails/showdetails/'. $resultarray->snr) . '</td>';
|
||||
echo '<td>'. $resultarray->name . '</td>';
|
||||
echo '<td>'. $resultarray->status . '</td>';
|
||||
$timestamp = strtotime($resultarray->lieferdatum);
|
||||
$new_date = date('Y-m-d H:i',$timestamp );
|
||||
echo '<td>'. $new_date . '</td>';
|
||||
echo '<td>'. $resultarray->lieferung . '</td>';
|
||||
echo '<td>'. $resultarray->auftrag . '</td>';
|
||||
echo '<td>'. $resultarray->sst_objekt . '</td>';
|
||||
//foreach($resultarray as $key => $value) {
|
||||
// echo '<td>'.$value.'</td>';
|
||||
//}
|
||||
echo '</tr>';
|
||||
//debug($result);
|
||||
}
|
||||
echo '</table>';
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
//debug(json_decode(json_encode($results))[0]);
|
||||
|
||||
$count = sizeof(json_decode(json_encode($details)));
|
||||
if($count > 0) {
|
||||
|
||||
|
||||
echo '<h1>Schule</h1>';
|
||||
|
||||
$headings = json_decode(json_encode($details))[0];
|
||||
//debug($headings);
|
||||
echo '<table>';
|
||||
echo '<tr><td width="20%">Schulnummer:</td> <td>' . $headings->snr . '</td></tr>';
|
||||
echo '<tr><td>Name:</td> <td>' . $headings->name . '</td></tr>';
|
||||
echo '<tr><td>Status:</td> <td>' . $headings->status . '</td></tr>';
|
||||
echo '<tr><td>Lieferdatum:</td> <td>' . date('Y-m-d H:i',strtotime($headings->lieferdatum)) . '</td></tr>';
|
||||
echo '<tr><td>Lieferung:</td> <td>' . $headings->lieferung . '</td></tr>';
|
||||
echo '</table>';
|
||||
|
||||
|
||||
|
||||
echo '<h1>Fehler</h1>';
|
||||
|
||||
foreach($details as $detail) {
|
||||
|
||||
|
||||
$detailarray = json_decode(json_encode($detail));
|
||||
echo '<table>';
|
||||
|
||||
echo '<tr><td width="20%">Auftrag</td><td>'.$detailarray->auftrag.'</td></tr>';
|
||||
echo '<tr><td>Schluessel</td><td>'.$detailarray->schluessel.'</td></tr>';
|
||||
echo '<tr><td>sst_objekt</td><td>'.$detailarray->sst_objekt.'</td></tr>';
|
||||
echo '<tr><td>Fehler kurz</td><td>'.$detailarray->fehler_kurz.'</td></tr>';
|
||||
echo '<tr><td>Fehler lang</td><td>'.$detailarray->fehler_lang.'</td></tr>';
|
||||
echo '<tr><td>Korrekturhinweis</td><td>'.$detailarray->korrekturhinweis.'</td></tr>';
|
||||
echo '<tr><td>ref_feld</td><td>'.$detailarray->ref_feld.'</td></tr>';
|
||||
echo '</table>';
|
||||
//debug($result);
|
||||
}
|
||||
|
||||
echo '<p> </p>';
|
||||
}
|
||||
|
||||
else {
|
||||
echo '<h1>Keine Einträge</h1>';
|
||||
}
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\Usfail $usfail
|
||||
*/
|
||||
?>
|
||||
<nav class="large-3 medium-4 columns" id="actions-sidebar">
|
||||
<ul class="side-nav">
|
||||
<li class="heading"><?= __('Actions') ?></li>
|
||||
<li><?= $this->Html->link(__('Edit Usfail'), ['action' => 'edit', $usfail->id]) ?> </li>
|
||||
<li><?= $this->Form->postLink(__('Delete Usfail'), ['action' => 'delete', $usfail->id], ['confirm' => __('Are you sure you want to delete # {0}?', $usfail->id)]) ?> </li>
|
||||
<li><?= $this->Html->link(__('List Usfails'), ['action' => 'index']) ?> </li>
|
||||
<li><?= $this->Html->link(__('New Usfail'), ['action' => 'add']) ?> </li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="usfails view large-9 medium-8 columns content">
|
||||
<h3><?= h($usfail->name) ?></h3>
|
||||
<table class="vertical-table">
|
||||
<tr>
|
||||
<th scope="row"><?= __('Snr') ?></th>
|
||||
<td><?= h($usfail->snr) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Name') ?></th>
|
||||
<td><?= h($usfail->name) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Status') ?></th>
|
||||
<td><?= h($usfail->status) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Lieferung') ?></th>
|
||||
<td><?= h($usfail->lieferung) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Auftrag') ?></th>
|
||||
<td><?= h($usfail->auftrag) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Schluessel') ?></th>
|
||||
<td><?= h($usfail->schluessel) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Sst Objekt') ?></th>
|
||||
<td><?= h($usfail->sst_objekt) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Fehler Kurz') ?></th>
|
||||
<td><?= h($usfail->fehler_kurz) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Fehler Lang') ?></th>
|
||||
<td><?= h($usfail->fehler_lang) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Korrekturhinweis') ?></th>
|
||||
<td><?= h($usfail->korrekturhinweis) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Ref Feld') ?></th>
|
||||
<td><?= h($usfail->ref_feld) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Id') ?></th>
|
||||
<td><?= $this->Number->format($usfail->id) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Lieferdatum') ?></th>
|
||||
<td><?= h($usfail->lieferdatum) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Created') ?></th>
|
||||
<td><?= h($usfail->created) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Modified') ?></th>
|
||||
<td><?= h($usfail->modified) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?= __('Plausi') ?></th>
|
||||
<td><?= $usfail->plausi ? __('Yes') : __('No'); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
namespace App\Test\Fixture;
|
||||
|
||||
use Cake\TestSuite\Fixture\TestFixture;
|
||||
|
||||
/**
|
||||
* UsfailsFixture
|
||||
*
|
||||
*/
|
||||
class UsfailsFixture extends TestFixture
|
||||
{
|
||||
|
||||
/**
|
||||
* Fields
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
// @codingStandardsIgnoreStart
|
||||
public $fields = [
|
||||
'id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'autoIncrement' => true, 'precision' => null],
|
||||
'snr' => ['type' => 'string', 'length' => 4, 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'comment' => '', 'precision' => null, 'fixed' => null],
|
||||
'name' => ['type' => 'string', 'length' => 50, 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'comment' => '', 'precision' => null, 'fixed' => null],
|
||||
'status' => ['type' => 'string', 'length' => 50, 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'comment' => '', 'precision' => null, 'fixed' => null],
|
||||
'lieferdatum' => ['type' => 'datetime', 'length' => null, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null],
|
||||
'lieferung' => ['type' => 'string', 'length' => 20, 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'comment' => '', 'precision' => null, 'fixed' => null],
|
||||
'auftrag' => ['type' => 'string', 'length' => 20, 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'comment' => '', 'precision' => null, 'fixed' => null],
|
||||
'plausi' => ['type' => 'boolean', 'length' => null, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null],
|
||||
'schluessel' => ['type' => 'string', 'length' => 50, 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'comment' => '', 'precision' => null, 'fixed' => null],
|
||||
'sst_objekt' => ['type' => 'string', 'length' => 50, 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'comment' => '', 'precision' => null, 'fixed' => null],
|
||||
'fehler_kurz' => ['type' => 'string', 'length' => 200, 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'comment' => '', 'precision' => null, 'fixed' => null],
|
||||
'fehler_lang' => ['type' => 'string', 'length' => 200, 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'comment' => '', 'precision' => null, 'fixed' => null],
|
||||
'korrekturhinweis' => ['type' => 'string', 'length' => 200, 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'comment' => '', 'precision' => null, 'fixed' => null],
|
||||
'ref_feld' => ['type' => 'string', 'length' => 50, 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'comment' => '', 'precision' => null, 'fixed' => null],
|
||||
'created' => ['type' => 'datetime', 'length' => null, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null],
|
||||
'modified' => ['type' => 'datetime', 'length' => null, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null],
|
||||
'_constraints' => [
|
||||
'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []],
|
||||
],
|
||||
'_options' => [
|
||||
'engine' => 'InnoDB',
|
||||
'collation' => 'utf8_general_ci'
|
||||
],
|
||||
];
|
||||
// @codingStandardsIgnoreEnd
|
||||
|
||||
/**
|
||||
* Records
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $records = [
|
||||
[
|
||||
'id' => 1,
|
||||
'snr' => 'Lo',
|
||||
'name' => 'Lorem ipsum dolor sit amet',
|
||||
'status' => 'Lorem ipsum dolor sit amet',
|
||||
'lieferdatum' => '2018-10-10 06:09:17',
|
||||
'lieferung' => 'Lorem ipsum dolor ',
|
||||
'auftrag' => 'Lorem ipsum dolor ',
|
||||
'plausi' => 1,
|
||||
'schluessel' => 'Lorem ipsum dolor sit amet',
|
||||
'sst_objekt' => 'Lorem ipsum dolor sit amet',
|
||||
'fehler_kurz' => 'Lorem ipsum dolor sit amet',
|
||||
'fehler_lang' => 'Lorem ipsum dolor sit amet',
|
||||
'korrekturhinweis' => 'Lorem ipsum dolor sit amet',
|
||||
'ref_feld' => 'Lorem ipsum dolor sit amet',
|
||||
'created' => '2018-10-10 06:09:17',
|
||||
'modified' => '2018-10-10 06:09:17'
|
||||
],
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
namespace App\Test\TestCase\Controller;
|
||||
|
||||
use App\Controller\UsfailsController;
|
||||
use Cake\TestSuite\IntegrationTestCase;
|
||||
|
||||
/**
|
||||
* App\Controller\UsfailsController Test Case
|
||||
*/
|
||||
class UsfailsControllerTest extends IntegrationTestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Fixtures
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $fixtures = [
|
||||
'app.usfails'
|
||||
];
|
||||
|
||||
/**
|
||||
* Test index method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testIndex()
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test view method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testView()
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test add method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testAdd()
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test edit method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testEdit()
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test delete method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testDelete()
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
namespace App\Test\TestCase\Model\Table;
|
||||
|
||||
use App\Model\Table\UsfailsTable;
|
||||
use Cake\ORM\TableRegistry;
|
||||
use Cake\TestSuite\TestCase;
|
||||
|
||||
/**
|
||||
* App\Model\Table\UsfailsTable Test Case
|
||||
*/
|
||||
class UsfailsTableTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Test subject
|
||||
*
|
||||
* @var \App\Model\Table\UsfailsTable
|
||||
*/
|
||||
public $Usfails;
|
||||
|
||||
/**
|
||||
* Fixtures
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $fixtures = [
|
||||
'app.usfails'
|
||||
];
|
||||
|
||||
/**
|
||||
* setUp method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
$config = TableRegistry::exists('Usfails') ? [] : ['className' => UsfailsTable::class];
|
||||
$this->Usfails = TableRegistry::get('Usfails', $config);
|
||||
}
|
||||
|
||||
/**
|
||||
* tearDown method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function tearDown()
|
||||
{
|
||||
unset($this->Usfails);
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test initialize method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testInitialize()
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test validationDefault method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testValidationDefault()
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+1546
-1551
File diff suppressed because it is too large
Load Diff
+2707
-29
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user