diff options
Diffstat (limited to 'mayor-orig/mayor-naplo/www/include')
3 files changed, 21 insertions, 9 deletions
diff --git a/mayor-orig/mayor-naplo/www/include/modules/naplo/base/rights.php b/mayor-orig/mayor-naplo/www/include/modules/naplo/base/rights.php index 53eb1ed5..e5653309 100644 --- a/mayor-orig/mayor-naplo/www/include/modules/naplo/base/rights.php +++ b/mayor-orig/mayor-naplo/www/include/modules/naplo/base/rights.php @@ -62,7 +62,7 @@ function initTanev($intezmeny, $tanev) { - global $MYSQL_DATA, $_TANEV; + global $MYSQL_DATA, $_TANEV, $policy; $MYSQL_DATA['naplo'] = $MYSQL_DATA['naplo_base']; $MYSQL_DATA['naplo']['db']= tanevDbNev($intezmeny, $tanev); @@ -85,7 +85,7 @@ if (__FOLYO_TANEV === true) if (__MUNKATERV_OK && __ORAREND_OK && __TANKOROK_OK) checkNaplo(date('Y-m-d')); else { - if (MAYOR_SOCIAL!==true) $_SESSION['alert'][]= 'info:checkNaploFailed:Tanév:'.($_TANEV['tanev']).':Részletek '.((__MUNKATERV_OK)?'munkaterv ok':'#chknaplo1 nincs munkaterv!').':'.((__ORAREND_OK)?'órarend ok':'#chknaplo2 nincs órarend!').':'.((__TANKOROK_OK)?'órarend-tankörök ok':'#chknaplo3 órarendi óra tankör összerendezési hiány!'); + if (MAYOR_SOCIAL!==true && $policy==='private') $_SESSION['alert'][]= 'info:checkNaploFailed:Tanév:'.($_TANEV['tanev']).':Részletek '.((__MUNKATERV_OK)?'munkaterv ok':'#chknaplo1 nincs munkaterv!').':'.((__ORAREND_OK)?'órarend ok':'#chknaplo2 nincs órarend!').':'.((__TANKOROK_OK)?'órarend-tankörök ok':'#chknaplo3 órarendi óra tankör összerendezési hiány!'); } } } diff --git a/mayor-orig/mayor-naplo/www/include/modules/naplo/share/diak.php b/mayor-orig/mayor-naplo/www/include/modules/naplo/share/diak.php index 25ac8d8a..b98dbcb5 100644 --- a/mayor-orig/mayor-naplo/www/include/modules/naplo/share/diak.php +++ b/mayor-orig/mayor-naplo/www/include/modules/naplo/share/diak.php @@ -434,7 +434,7 @@ $q = "SELECT diak.*, TRIM(CONCAT_WS(' ',viseltNevElotag, ViseltCsaladiNev, viseltUtoNev)) AS diakNev, TIMESTAMPDIFF(YEAR, diak.szuletesiIdo, CURDATE()) AS diakEletkor, dj.dt AS jogviszonyDt, dj.statusz AS jogviszonyStatusz FROM ".__INTEZMENYDBNEV.".diak LEFT JOIN ".__INTEZMENYDBNEV.".diakJogviszony AS dj ON diak.diakId=dj.diakId AND dj.dt=(SELECT MAX(dt) FROM ".__INTEZMENYDBNEV.".diakJogviszony WHERE dt<=CURDATE() AND diakId=dj.diakId) - WHERE diak.diakId IN (".implode(',', array_fill(0, count($diakIds), '%u')).")"; + WHERE diak.diakId IN (".implode(',', array_fill(0, count($diakIds), '%u')).") ORDER BY diakNev"; $r = db_query($q, array('fv' => 'getDiakAdatById', 'modul' => 'naplo_intezmeny', 'result' => $result, 'keyfield'=>$SET['keyfield'],'values' => $diakIds), $lr); @@ -444,15 +444,22 @@ function getDiakBySzulDt($md) { + + $lr = db_connect('naplo_intezmeny'); if ($md == '') $md = date('m-d'); - $q = "SELECT diakId FROM diak WHERE szuletesiIdo like '%%-%s' AND jogviszonyVege is NULL"; // credits: Neumayer Béla <szepi1971@gmail.com> - $diakIds = db_query($q, array('fv' => 'getDiakBySzulDt', 'modul' => 'naplo_intezmeny', 'result' => 'idonly', 'values' => array($md))); + $q = "SELECT diakId FROM diak WHERE szuletesiIdo like '%s' AND jogviszonyVege is NULL"; // credits: Neumayer Béla <szepi1971@gmail.com> + $diakIds = db_query($q, array('lr'=>$lr,'fv' => 'getDiakBySzulDt', 'modul' => 'naplo_intezmeny', 'result' => 'idonly', 'values' => array('____-'.$md))); if (count($diakIds)>0) { $RET['diak'] = getDiakAdatById($diakIds); + for ($i=0; $i<count($diakIds); $i++) { + $diakId = $diakIds[$i]; + $RET['diak'][$i]['osztaly'] = getDiakOsztalya($diakId,null,$lr); + } $RET['diakOsztaly'] = getDiakokOsztalyai($diakIds); } else { $RET = false; } + db_close($lr); return $RET; } diff --git a/mayor-orig/mayor-naplo/www/include/modules/naplo/share/hirnok.php b/mayor-orig/mayor-naplo/www/include/modules/naplo/share/hirnok.php index 94ffa865..86cd0e49 100644 --- a/mayor-orig/mayor-naplo/www/include/modules/naplo/share/hirnok.php +++ b/mayor-orig/mayor-naplo/www/include/modules/naplo/share/hirnok.php @@ -191,12 +191,17 @@ global $SZEMESZTER; } // ha diák if (__TANAR === true || (__NAPLOADMIN===true && $tanarId>0)) { if (defined('__USERTANARID') && is_numeric(__USERTANARID)) { + $q = "SELECT COUNT(*) AS dbBeirtOra FROM ora WHERE ki=".__USERTANARID." AND dt <= CURDATE() AND (leiras!='')"; + $dbBeirtOra = db_query($q, array('fv' => 'getBeirasiAdatok', 'modul' => 'naplo', 'result' => 'value')); $q = "SELECT COUNT(*) FROM ora WHERE ki=".__USERTANARID." AND dt <= CURDATE() AND (leiras IS NULL OR leiras='')"; $r = db_query($q, array('fv' => 'getBeirasiAdatok', 'modul' => 'naplo', 'result' => 'value')); - $R[mktime()][] = array( - 'hirnokTipus'=>'haladasiBeiratlan', - 'db'=>$r - ); + if ($dbBeirtOra>0) { // csak ha van mar egy beirt oraja legalabb + $R[mktime()][] = array( + 'hirnokTipus'=>'haladasiBeiratlan', + 'db'=>$r, + 'dbBeirtOra'=>$dbBeirtOra + ); + } $q = "select * from idoszak where NOW() BETWEEN tolDt AND igDt ORDER BY tolDt"; $r = db_query($q, array('fv' => 'getIdoszakAktiv', 'modul' => 'naplo_intezmeny', 'result' => 'indexed')); for ($i=0; $i<count($r); $i++) { |