aboutsummaryrefslogtreecommitdiffstats
path: root/mayor-orig/mayor-naplo/www/include/modules
diff options
context:
space:
mode:
authorM.Gergo2020-09-02 21:02:17 +0200
committerM.Gergo2020-09-02 21:02:17 +0200
commitcf6a58003f47139501a2907f8a4bc400b23fda66 (patch)
treefb7f9e17b609143987ca2f324e27c610886284a9 /mayor-orig/mayor-naplo/www/include/modules
parent9bfbb60898b55ba4e1bd50c052c7ec4aaafc1ff8 (diff)
parent9044c44af70eff76d875137de553d5904e475f6d (diff)
downloadmayor-cf6a58003f47139501a2907f8a4bc400b23fda66.tar.gz
mayor-cf6a58003f47139501a2907f8a4bc400b23fda66.zip
Merge branch 'MaYor-dev'
Diffstat (limited to 'mayor-orig/mayor-naplo/www/include/modules')
-rw-r--r--mayor-orig/mayor-naplo/www/include/modules/naplo/export/kretaOrarend.php70
-rw-r--r--mayor-orig/mayor-naplo/www/include/modules/naplo/tanev/targyBontas.php2
2 files changed, 71 insertions, 1 deletions
diff --git a/mayor-orig/mayor-naplo/www/include/modules/naplo/export/kretaOrarend.php b/mayor-orig/mayor-naplo/www/include/modules/naplo/export/kretaOrarend.php
new file mode 100644
index 00000000..48cf5f52
--- /dev/null
+++ b/mayor-orig/mayor-naplo/www/include/modules/naplo/export/kretaOrarend.php
@@ -0,0 +1,70 @@
+<?php
+
+ function getOrarendAdat($ADAT) {
+
+ global $aHetNapjai, $kretaHETIREND;
+
+ $lr = db_connect('naplo');
+ // orarendiOra - tankor
+ $q = "SELECT * from orarendiOra
+ LEFT JOIN orarendiOraTankor USING (tanarId, targyJel, osztalyJel)
+ LEFT JOIN ".__INTEZMENYDBNEV.".terem USING (teremId)
+ ORDER BY tanarId, het, nap, ora";
+ $v = array();
+ $ADAT['orak'] = db_query($q, array('fv' => 'getOrarendAdat', 'result'=>'indexed','value'=>$v), $lr);
+ $q = "SELECT tankorId, tankorNev, targyNev, kretaTargyNev, csoportNev FROM ".__INTEZMENYDBNEV.".tankor
+ LEFT JOIN ".__INTEZMENYDBNEV.".tankorSzemeszter USING (tankorId)
+ LEFT JOIN ".__INTEZMENYDBNEV.".targy USING (targyId)
+ LEFT JOIN tankorCsoport USING (tankorId)
+ LEFT JOIN csoport USING (csoportId)
+ WHERE tanev=".__TANEV." AND szemeszter=1";
+
+ $v = array();
+ $ADAT['tankor'] = db_query($q, array('fv' => 'getOrarendAdat/tankor', 'result'=>'assoc','keyfield'=>'tankorId','value'=>$v), $lr);
+ foreach ($ADAT['tankor'] as $_tankorId => $T) {
+ $M = explode(' ', $T['csoportNev']);
+
+
+ if (strpos($T['csoportNev'],',') !== false) $ADAT['t2osztaly'][$_tankorId] = '';
+ else $ADAT['t2osztaly'][$_tankorId] = $M[0];
+
+ if (strpos($T['csoportNev'],' ') === false && strpos($T['csoportNev'],'_') === false) $ADAT['t2csoport'][$_tankorId] = '';
+ else $ADAT['t2csoport'][$_tankorId] = $T['csoportNev'];
+ }
+
+
+ db_close($lr);
+ $ADAT['export'][] = array(
+ 'Hetirend','Nap','Óra (adott napon belül)','Osztály','Csoport','Tantárgy','Tanár','Helyiség'
+ );
+ foreach ($ADAT['orak'] as $index => $O) {
+ list($helyseg,$_nev) = explode(" - ",$O['leiras']);
+ $ADAT['export'][] = array(
+ $kretaHETIREND[ $O['het'] ], // Hetirend
+ $aHetNapjai[ $O['nap']-1 ], // Nap
+ $O['ora'], // Óra
+ $ADAT['t2osztaly'][ $O['tankorId'] ], // Osztály
+ $ADAT['t2csoport'][ $O['tankorId'] ], // Csoport
+ $ADAT['tankor'][ $O['tankorId'] ]['kretaTargyNev'], // Tantárgy
+ $ADAT['tanar'][ $O['tanarId'] ]['tanarNev'], // Tanár
+ $helyseg // Helyiség
+ );
+ }
+
+ return $ADAT['export'];
+
+ }
+
+ function exportKretaOrarend($file, $ADAT) {
+
+ $T = $ADAT['export'];
+
+ if ($ADAT['formatum'] == 'xml') return generateXLS("$file.${ADAT['formatum']}", $T, 'kreta_ETTF_simple');
+ elseif ($ADAT['formatum'] == 'csv') return generateCSV("$file.${ADAT['formatum']}", $T, '');
+ elseif ($ADAT['formatum'] == 'ods') return generateODS("$file.${ADAT['formatum']}", $T, 'kreta_ETTF_simple');
+ else return false;
+
+ }
+
+
+?> \ No newline at end of file
diff --git a/mayor-orig/mayor-naplo/www/include/modules/naplo/tanev/targyBontas.php b/mayor-orig/mayor-naplo/www/include/modules/naplo/tanev/targyBontas.php
index 5b31bdec..625e0482 100644
--- a/mayor-orig/mayor-naplo/www/include/modules/naplo/tanev/targyBontas.php
+++ b/mayor-orig/mayor-naplo/www/include/modules/naplo/tanev/targyBontas.php
@@ -74,7 +74,7 @@
$bontasId = db_query($q, array('fv'=>'addBontas/insert','modul'=>'naplo','result'=>'insert','values'=>array($osztalyId,$kepzesOratervId,$targyId)), $lr);
// is_resource mysqli esetán nem jó (object)
- if (!$olr) db_close();
+ if (!$olr) db_close($lr);
return array(
'targyId' => $targyId,