aboutsummaryrefslogtreecommitdiffstats
path: root/mayor-orig/mayor-naplo/www/include
diff options
context:
space:
mode:
Diffstat (limited to 'mayor-orig/mayor-naplo/www/include')
-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;
+ }
+
?>