From aaab24c8c081b8e2b42cf8bf003120f27070aa6c Mon Sep 17 00:00:00 2001 From: M.Gergo Date: Wed, 15 Dec 2021 20:35:04 +0100 Subject: Rev: 4825 --- .../include/modules/naplo/dokumentum/dokumentum.php | 13 ++++++++++--- .../www/include/modules/naplo/share/tanar.php | 18 +++++++++++++++++- 2 files changed, 27 insertions(+), 4 deletions(-) (limited to 'mayor-orig/mayor-naplo/www/include/modules') diff --git a/mayor-orig/mayor-naplo/www/include/modules/naplo/dokumentum/dokumentum.php b/mayor-orig/mayor-naplo/www/include/modules/naplo/dokumentum/dokumentum.php index 9e454063..6dc46577 100644 --- a/mayor-orig/mayor-naplo/www/include/modules/naplo/dokumentum/dokumentum.php +++ b/mayor-orig/mayor-naplo/www/include/modules/naplo/dokumentum/dokumentum.php @@ -2,7 +2,7 @@ function getDokumentumok() { - $q = "SELECT * FROM dokumentum ORDER BY dokumentumId"; + $q = "SELECT * FROM dokumentum ORDER BY dokumentumTipus, dokumentumSorrend"; $v = array(); $r = db_query($q, array('modul'=>'naplo_intezmeny','fv'=>'dokumentum','values'=>$v, 'result'=>'indexed')); return $r; @@ -11,17 +11,24 @@ function getDokumentumokAssoc() { - $q = "select dokumentum.*,IFNULL(tanev,YEAR(dokumentumDt)) AS dokumentumTanev from dokumentum left join szemeszter ON (dokumentumDt>kezdesDt && dokumentumDt<=szemeszter.ZarasDt)"; + $q = "select dokumentum.*,IFNULL(tanev,YEAR(dokumentumDt)) AS dokumentumTanev from dokumentum left join szemeszter ON (dokumentumDt>kezdesDt && dokumentumDt<=szemeszter.ZarasDt) +ORDER BY dokumentumTipus, dokumentumSorrend"; $v = array(); $r = db_query($q, array('modul'=>'naplo_intezmeny','fv'=>'dokumentum','values'=>$v, 'result'=>'indexed')); - return reindex($r,array('dokumentumTipus','dokumentumTanev')); + return (reindex($r,array('dokumentumTipus','dokumentumTanev'))); return $r; } function updateDokumentum($ADAT) { + if ($ADAT['dokumentumSorrend']>0 && readVariable($ADAT['dokumentumId'],'id')>0) { + $q = "UPDATE dokumentum SET dokumentumSorrend=%u WHERE dokumentumId=%u"; + $v = array(intval($ADAT['dokumentumSorrend']),intval($ADAT['dokumentumId'])); + $r = db_query($q, array('modul'=>'naplo_intezmeny','fv'=>'dokumentum','values'=>$v, 'result'=>'update')); + } + return $r; } diff --git a/mayor-orig/mayor-naplo/www/include/modules/naplo/share/tanar.php b/mayor-orig/mayor-naplo/www/include/modules/naplo/share/tanar.php index 0a931863..77b47fb8 100644 --- a/mayor-orig/mayor-naplo/www/include/modules/naplo/share/tanar.php +++ b/mayor-orig/mayor-naplo/www/include/modules/naplo/share/tanar.php @@ -121,7 +121,7 @@ if (!is_array($tanarIds)) $tanarIds = array($tanarIds); $q = "SELECT *,TRIM(CONCAT_WS(' ',viseltNevElotag, ViseltCsaladiNev, viseltUtoNev)) AS tanarNev FROM ".__INTEZMENYDBNEV.".tanar WHERE tanarId IN (".implode(',', array_fill(0, count($tanarIds), '%u')).")"; - $R = db_query($q, array('fv' => 'getTanarAdatById', 'modul' => 'naplo_intezmeny', 'result' => 'indexed', 'values' => $tanarIds)); + $R = db_query($q, array('fv' => 'getTanarAdatById', 'modul' => 'naplo_intezmeny', 'result' => 'indexed', 'values' => $tanarIds), $olr); // for ($i=0; $i$lr,'fv' => 'getTanarBySzulDt', 'modul' => 'naplo_intezmeny', 'result' => 'idonly', 'values' => array('____-'.$md))); + if (count($tanarIds)>0) { + $RET = getTanarAdatById($tanarIds,$lr); + } else { + $RET = false; + } + db_close($lr); + return $RET; + } + ?> -- cgit v1.2.3