From b252f6ba5c8d7304f3bac7816d9c7cef3fd4197f Mon Sep 17 00:00:00 2001 From: PLESK5 Date: Thu, 23 Mar 2017 17:29:25 +0100 Subject: [PATCH] module training add dirs output, upload --- modules/training/output/index.php | 35 ++++++++++++++++ modules/training/test.php | 68 ------------------------------- modules/training/upload/index.php | 35 ++++++++++++++++ 3 files changed, 70 insertions(+), 68 deletions(-) create mode 100644 modules/training/output/index.php delete mode 100644 modules/training/test.php create mode 100644 modules/training/upload/index.php diff --git a/modules/training/output/index.php b/modules/training/output/index.php new file mode 100644 index 0000000..52b4e5c --- /dev/null +++ b/modules/training/output/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2013 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); +header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); + +header("Cache-Control: no-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; diff --git a/modules/training/test.php b/modules/training/test.php deleted file mode 100644 index 5dffd1b..0000000 --- a/modules/training/test.php +++ /dev/null @@ -1,68 +0,0 @@ -"; - print_r($var); - echo ""; -} - -$original = new ArrayExtended(); -$original_score = new ArrayExtended(); - -$reader = new CSVReader(__DIR__.'/upload/Bilan_original.csv'); -$reader ->skipHeader() - ->onEachLine(function(ArrayExtended $cols) use($original, $original_score) { - $original[] = $cols[0]; - $original_score[] = $cols[1]; - return true; - }) - ->onError(function($failed_num_line) { - debug($failed_num_line); - }) - ->read(); - -$new_version = new ArrayExtended(); -$new_version_score = new ArrayExtended(); - -$reader = new CSVReader(__DIR__.'/upload/BILAN.csv'); -$reader ->skipHeader() - ->setDelimiter("\"") - ->onEachLine(function(ArrayExtended $cols) use($new_version, $new_version_score) { - $new_version[] = $cols[0]; - $new_version_score[] = $cols[1]; - return true; - }) - ->onError(function($failed_num_line) { - debug($failed_num_line); - }) - ->read(); - -$original = $original->toArray(); -$original_score = $original_score->toArray(); -$new_version = $new_version->toArray(); -$new_version_score = $new_version_score->toArray(); - -//debug($new_version); - -//debug(array_diff_assoc($new_version, $original)); -//debug(array_diff_assoc($original, $new_version)); -$diff = array(); -foreach(array_diff($original, $new_version) as $i => $code_client) { - $diff[$code_client] = $original_score[$i]; -} - -debug($diff); -/* -$diff = array(); -foreach(array_diff($new_version, $original) as $i => $code_client) { - $diff[$code_client] = $new_version_score[$i]; -} - -debug($diff); -*/ \ No newline at end of file diff --git a/modules/training/upload/index.php b/modules/training/upload/index.php new file mode 100644 index 0000000..52b4e5c --- /dev/null +++ b/modules/training/upload/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2013 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); +header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); + +header("Cache-Control: no-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit;