aboutsummaryrefslogtreecommitdiffstats
path: root/mayor-orig/mayor-naplo/www/include/modules
diff options
context:
space:
mode:
authorM.Gergo2021-12-15 20:35:04 +0100
committerM.Gergo2021-12-15 20:35:04 +0100
commitaaab24c8c081b8e2b42cf8bf003120f27070aa6c (patch)
treef2ca9ae0c7e8a09a5ae1a05a7fce328fb172d870 /mayor-orig/mayor-naplo/www/include/modules
parent933d9a5ad9b7a134148a1a931fb0cab5c782a245 (diff)
downloadmayor-aaab24c8c081b8e2b42cf8bf003120f27070aa6c.tar.gz
mayor-aaab24c8c081b8e2b42cf8bf003120f27070aa6c.zip
Rev: 4825
Diffstat (limited to 'mayor-orig/mayor-naplo/www/include/modules')
-rw-r--r--mayor-orig/mayor-naplo/www/include/modules/naplo/dokumentum/dokumentum.php13
-rw-r--r--mayor-orig/mayor-naplo/www/include/modules/naplo/share/tanar.php18
2 files changed, 27 insertions, 4 deletions
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<count($R); $i++) {
// $q2 = "SELECT osztalyId
// $R[$i]['osztalya'] =
@@ -193,4 +193,20 @@
}
*/
+ function getTanarBySzulDt($md)
+ {
+
+ $lr = db_connect('naplo_intezmeny');
+ if ($md == '') $md = date('m-d');
+ $q = "SELECT tanarId FROM tanar WHERE szuletesiIdo like '%s' AND kiDt is NULL";
+ $tanarIds = db_query($q, array('lr'=>$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;
+ }
+
?>