From e22bbedcf69ea347a103d04d194136b8f3a761c8 Mon Sep 17 00:00:00 2001 From: M.Gergo Date: Mon, 24 Aug 2020 13:05:03 +0200 Subject: Rev: 4670 --- .../private/naplo/import/tantargyFelosztas-pre.php | 12 +++++------ .../private/naplo/import/tantargyFelosztas.php | 19 +++++++++++----- .../policy/private/naplo/intezmeny/osztaly-pre.php | 25 +++++++++++++++++++--- 3 files changed, 42 insertions(+), 14 deletions(-) (limited to 'mayor-orig/mayor-naplo/www/policy/private') diff --git a/mayor-orig/mayor-naplo/www/policy/private/naplo/import/tantargyFelosztas-pre.php b/mayor-orig/mayor-naplo/www/policy/private/naplo/import/tantargyFelosztas-pre.php index 8497ec46..fe445355 100644 --- a/mayor-orig/mayor-naplo/www/policy/private/naplo/import/tantargyFelosztas-pre.php +++ b/mayor-orig/mayor-naplo/www/policy/private/naplo/import/tantargyFelosztas-pre.php @@ -94,7 +94,7 @@ if ($DIAKOK[$i]['oId']!='') { $OID2ID[$DIAKOK[$i]['oId']] = intval($DIAKOK[$i]['diakId']); } else { - $ADAT['bug']['diak'][] = $DIAKOK[$i]['oId']; + $ADAT['bug']['diak'][] = $DIAKOK[$i]['oId'].serialize($DIAKOK[$i]); } } // TÁRGYAK @@ -527,7 +527,7 @@ $_D = $ADAT['ttf'][$i]; $q = "select *,tankorSzemeszter.tankorId AS tankorId from tankorSzemeszter LEFT JOIN tankor USING (tankorId) -LEFT JOIN tankorTanar ON (tankorTanar.tankorId=tankor.tankorId AND beDt<=NOW() AND (kiDt is null or kiDt>=NOW())) +LEFT JOIN tankorTanar ON (tankorTanar.tankorId=tankor.tankorId AND beDt<='2020-09-01' AND (kiDt is null or kiDt>='2020-09-01')) LEFT JOIN ".__TANEVDBNEV.".tankorCsoport ON (tankor.tankorId = tankorCsoport.tankorId) LEFT JOIN ".__TANEVDBNEV.".csoport USING (csoportId) WHERE tanev=%u AND szemeszter=%u AND targyId=%u AND oraszam=%f AND tanarId=%u @@ -551,7 +551,7 @@ GROUP BY tankor.tankorId"; // Belerakjuk azon tanköröket is, ahol vélhetően csak a csoport hozzárendelés hiányzik $q = "select *,tankorSzemeszter.tankorId AS tankorId from tankorSzemeszter LEFT JOIN tankor USING (tankorId) -LEFT JOIN tankorTanar ON (tankorTanar.tankorId=tankor.tankorId AND beDt<=NOW() AND (kiDt is null or kiDt>=NOW())) +LEFT JOIN tankorTanar ON (tankorTanar.tankorId=tankor.tankorId AND beDt<='2020-09-01' AND (kiDt is null or kiDt>='2020-09-01')) LEFT JOIN ".__TANEVDBNEV.".tankorCsoport ON (tankor.tankorId = tankorCsoport.tankorId) LEFT JOIN ".__TANEVDBNEV.".csoport USING (csoportId) WHERE tanev=%u AND szemeszter=%u AND targyId=%u AND oraszam=%f AND tanarId=%u @@ -591,7 +591,7 @@ GROUP BY tankor.tankorId"; } $q = "select *,tankorSzemeszter.tankorId AS tankorId from tankorSzemeszter LEFT JOIN tankor USING (tankorId) -LEFT JOIN tankorTanar ON (tankorTanar.tankorId=tankor.tankorId AND beDt<=NOW() AND (kiDt is null or kiDt>=NOW())) +LEFT JOIN tankorTanar ON (tankorTanar.tankorId=tankor.tankorId AND beDt<='2020-09-01' AND (kiDt is null or kiDt>='2020-09-01')) LEFT JOIN tankorOsztaly ON (tankor.tankorId = tankorOsztaly.tankorId) WHERE tanev=%u AND szemeszter=%u AND targyId=%u AND oraszam=%f @@ -611,7 +611,7 @@ GROUP BY tankor.tankorId ORDER BY tankorNev"; } else { $q = "select *,tankorSzemeszter.tankorId AS tankorId from tankorSzemeszter LEFT JOIN tankor USING (tankorId) -LEFT JOIN tankorTanar ON (tankorTanar.tankorId=tankor.tankorId AND beDt<=NOW() AND (kiDt is null or kiDt>=NOW())) +LEFT JOIN tankorTanar ON (tankorTanar.tankorId=tankor.tankorId AND beDt<='2020-09-01' AND (kiDt is null or kiDt>='2020-09-01')) WHERE tanev=%u AND szemeszter=%u AND targyId=%u AND oraszam>=%f AND tanarId IS NULL @@ -662,7 +662,7 @@ GROUP BY tankor.tankorId ORDER BY tankorNev"; // MaYoR: csoportId+targyId+tanarId => tankorId; $lr_naplo = db_connect('naplo'); - $q = "select csoportId, targyId, tanarId, tankor.tankorId FROM tankorCsoport LEFT JOIN csoport USING (csoportId) LEFT JOIN ".__INTEZMENYDBNEV.".tankor USING (tankorId) LEFT JOIN ".__INTEZMENYDBNEV.".tankorTanar ON (tankor.tankorId = tankorTanar.tankorId AND beDt>='2019-09-01' AND (kiDt IS NULL or kiDt>=NOW()))"; + $q = "select csoportId, targyId, tanarId, tankor.tankorId FROM tankorCsoport LEFT JOIN csoport USING (csoportId) LEFT JOIN ".__INTEZMENYDBNEV.".tankor USING (tankorId) LEFT JOIN ".__INTEZMENYDBNEV.".tankorTanar ON (tankor.tankorId = tankorTanar.tankorId AND beDt>='2019-09-01' AND (kiDt IS NULL or kiDt>='2020-09-01'))"; $r = db_query($q, array('fv' => 'pre', 'modul' => 'naplo', 'values' => $v, 'result'=>'indexed'),$lr_naplo); for ($i=0; $i0) + if (count($ADAT['bug']['targy'])>0) { + echo '

Hibás tárgyak

'; + echo '
';
 	var_dump($ADAT['bug']['targy']);
+	echo '
'; + } - if (count($ADAT['bug']['diak'])>0) + if (count($ADAT['bug']['diak'])>0) { + echo '

Hibás diákok

'; + echo '
';
 	var_dump($ADAT['bug']['diak']);
+	echo '
'; + } - echo 'Használt kulcs érték párok:'; - var_dump($ADAT['kulcsertektar']['osztalyjel2id']); - + echo 'Használt kulcs-érték párok (osztályJel-osztályId):'; + echo '
';
+	var_dump($ADAT['kulcsertektar']['osztalyjel2id']);
+    echo '
'; diff --git a/mayor-orig/mayor-naplo/www/policy/private/naplo/intezmeny/osztaly-pre.php b/mayor-orig/mayor-naplo/www/policy/private/naplo/intezmeny/osztaly-pre.php index 5097037f..9222a0c8 100644 --- a/mayor-orig/mayor-naplo/www/policy/private/naplo/intezmeny/osztaly-pre.php +++ b/mayor-orig/mayor-naplo/www/policy/private/naplo/intezmeny/osztaly-pre.php @@ -19,7 +19,9 @@ require_once('include/modules/naplo/share/tankorDiakModifier.php'); require_once('include/modules/naplo/share/hianyzasModifier.php'); require_once('include/modules/naplo/share/jegyModifier.php'); require_once('include/modules/naplo/share/jegy.php'); +require_once('include/share/net/upload.php'); +define('FILE_UPLOAD_DIR',_DOWNLOADDIR.'/private/naplo/upload/'); if (defined('__INTEZMENY') and __INTEZMENY != '') { $ADAT['tanevek'] = getTanevek(true); @@ -40,11 +42,28 @@ else $TA = $_TANEV; /* -------- */ // Adatok frissítése adatállományból -if (__NAPLOADMIN && isset($_POST['fileName']) && $_POST['fileName'] != '') { +if (__NAPLOADMIN===true && + ( + (isset($_POST['fileName']) && $_POST['fileName'] != '') + or + (is_array($_FILES) && $_FILES['upfile']['name']!='') + ) + ) { + define('_SKIP_ON_DUP',readVariable($_POST['skipOnDup'],'bool')); + if (is_array($_FILES) && $_FILES['upfile']['name']!='') { // távoli feltöltés + try { + $_F = array('subdir'=>FILE_UPLOAD_DIR, 'filename'=>uniqid()); // move ide + $sikeresFeltoltes = mayorFileUpload($_F, false); + $fileName = FILE_UPLOAD_DIR.$_F['filename']; + } catch (Exception $e) { + dump($e); + } + } else { // helyi beolvasás + // $fileName = fileNameNormal($_POST['fileName']); + $fileName = ($_POST['fileName']); // TODO + } $mezo_elvalaszto = ' '; // "\t" -// $fileName = fileNameNormal($_POST['fileName']); - $fileName = ($_POST['fileName']); // TODO $ADATOK = array(); if (file_exists($fileName)) { -- cgit v1.2.3