From 31bf036be3be01ef7b3bbc9dc08813f0740dab9a Mon Sep 17 00:00:00 2001 From: M.Gergo Date: Mon, 23 Mar 2020 01:17:58 +0100 Subject: Rev: 4630 --- .../www/include/modules/naplo/haladasi/haladasi.php | 1 + .../www/include/modules/naplo/share/ora.php | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'mayor-orig/mayor-naplo/www/include') diff --git a/mayor-orig/mayor-naplo/www/include/modules/naplo/haladasi/haladasi.php b/mayor-orig/mayor-naplo/www/include/modules/naplo/haladasi/haladasi.php index 0be1c61a..92d07ee8 100644 --- a/mayor-orig/mayor-naplo/www/include/modules/naplo/haladasi/haladasi.php +++ b/mayor-orig/mayor-naplo/www/include/modules/naplo/haladasi/haladasi.php @@ -134,6 +134,7 @@ $v = array($sor['oraId']); $sor['cimke'] = db_query($q, array('fv' => 'getHaladasi/cimkek', 'modul' => 'naplo', 'result' => 'idonly', 'values' => $v), $lr); } + $ret[$sor['dt']][] = $sor; } // Nap információk lekérdezése diff --git a/mayor-orig/mayor-naplo/www/include/modules/naplo/share/ora.php b/mayor-orig/mayor-naplo/www/include/modules/naplo/share/ora.php index 7c4c4b4e..602f26e1 100644 --- a/mayor-orig/mayor-naplo/www/include/modules/naplo/share/ora.php +++ b/mayor-orig/mayor-naplo/www/include/modules/naplo/share/ora.php @@ -371,7 +371,7 @@ WHERE dt>='%s' and dt<='%s' AND (ki=%u OR kit=%u) $WHERE ORDER BY dt,ora"; return $RESULT; } - function getOrak($TANKORIDK, $SET=array('tolDt'=>'','igDt'=>'', 'result'=>'likeOrarend', 'elmaradokNelkul'=>false)) { + function getOrak($TANKORIDK, $SET=array('tolDt'=>'','igDt'=>'', 'result'=>'likeOrarend', 'elmaradokNelkul'=>false, 'diakId'=>null)) { /* FIGYELEM! A függvény feltételezi, hogy az átadott tankoridkben az adott intervallumon helyes adatok szerepelnek! -- problémát okozhat, ha hosszú intervallumot adunk meg!!! -- lásd FS#100 */ @@ -404,6 +404,12 @@ WHERE dt>='%s' and dt<='%s' AND tankorId IN (".implode(',', array_fill(0, count( $_put['oo'] = false; $RE['orak'][$R[$i]['dt']][$R[$i]['ora']][$R[$i]['tankorId']] = $_put; if (!in_array($R[$i]['tankorId'],$RE['tankorok'])) $RE['tankorok'][] = intval($R[$i]['tankorId']); + if ($R[$i]['hazifeladatId']>0) { + if ($SET['diakId']>0) { + $diakHazifeladat = getDiakHazifeladatByOraIds(array($R[$i]['oraId']) , $SET['diakId']); + $RE['orak'][$R[$i]['dt']][$R[$i]['ora']][$R[$i]['tankorId']]['diakHazifeladat'] = $diakHazifeladat[$R[$i]['oraId']]; + } + } } } return $RE; @@ -641,5 +647,15 @@ WHERE dt>='%s' and dt<='%s' AND tankorId IN (".implode(',', array_fill(0, count( } } + function getDiakHazifeladatByOraIds($oraIdk,$diakId,$olr='') { + $R = array(); + if (count($oraIdk)>0 && $diakId>0) { + $q = "SELECT * FROM oraHazifeladat LEFT JOIN oraHazifeladatDiak USING (hazifeladatId) WHERE diakId=%u AND oraId IN (".implode(',',$oraIdk).")"; + $v = array($diakId); + $R = db_query($q,array('debug'=>false,'fv'=>'getDiakhazifeladatByOraIds','modul'=>'naplo','values'=>$v,'result'=>'assoc','keyfield'=>'oraId'),$olr); + } + return $R; + } + ?> -- cgit v1.2.3