diff options
Diffstat (limited to 'mayor-orig/mayor-naplo/www/include/modules')
5 files changed, 43 insertions, 10 deletions
diff --git a/mayor-orig/mayor-naplo/www/include/modules/naplo/base/zcheck.php b/mayor-orig/mayor-naplo/www/include/modules/naplo/base/zcheck.php index 91e3905a..12b7dea5 100644 --- a/mayor-orig/mayor-naplo/www/include/modules/naplo/base/zcheck.php +++ b/mayor-orig/mayor-naplo/www/include/modules/naplo/base/zcheck.php @@ -99,4 +99,6 @@ if (count($KERELEM_TAG) ==0) $KERELEM_TAG = array('névsor','jogviszony','órarend, haladási','hiányzás, igazolás','jegy, zárójegy'); + if (!defined('__HABEL_GYURI_DEBUG')) define('__HABEL_GYURI_DEBUG',false); + ?> 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 1ffdda96..94ffa865 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 @@ -232,6 +232,22 @@ global $SZEMESZTER; ); } } + + // utolsó óra + if (__TANAR === true || (__NAPLOADMIN===true && $tanarId>0)) { + if (defined('__USERTANARID') && is_numeric(__USERTANARID)) { // cron esetén nincs ilyen + $q = "SELECT *,getOraTolTime(ora.oraId) AS tolTime, getOraIgTime(ora.oraId) AS igTime FROM (SELECT dt,max(ora) AS utolsooraateremben,teremId,terem.leiras AS teremNev FROM ora LEFT JOIN ".__INTEZMENYDBNEV.".terem USING (teremId) WHERE dt=curdate() AND teremId IS NOT NULL GROUP BY teremId) AS x LEFT JOIN ora ON (ora.dt = x.dt AND x.utolsooraateremben = ora.ora AND x.teremId = ora.teremId) WHERE ora.ki=%u"; + $v = array(__USERTANARID); + $r = db_query($q, array('fv'=>'getHirnokFolyam/haladasi2','modul'=>'naplo','result'=>'indexed','values'=>$v)); + for ($i=0; $i<count($r); $i++) { + $R[mktime()][] = array( + 'hirnokTipus'=>'utolsoora', + 'adat'=>$r[$i] + ); + } + } + } + // Üzenő // /* 20170418 initSzerep(); diff --git a/mayor-orig/mayor-naplo/www/include/modules/naplo/share/kereso.php b/mayor-orig/mayor-naplo/www/include/modules/naplo/share/kereso.php index b2bf2cf6..867fe15e 100644 --- a/mayor-orig/mayor-naplo/www/include/modules/naplo/share/kereso.php +++ b/mayor-orig/mayor-naplo/www/include/modules/naplo/share/kereso.php @@ -5,19 +5,19 @@ $q = "SELECT DISTINCT diak.diakId, TRIM(CONCAT_WS(' ',viseltNevElotag, ViseltCsaladiNev, viseltUtoNev)) AS diakNev, oId, osztalyJel FROM `diak` LEFT JOIN osztalyDiak ON (osztalyDiak.diakId=diak.diakId AND osztalyDiak.beDt<=NOW() AND (osztalyDiak.kiDt>=NOW() OR osztalyDiak.kiDt IS NULL)) LEFT JOIN " . __TANEVDBNEV . ".osztalyNaplo USING (osztalyId) - HAVING (diakNev LIKE '%s' OR oId LIKE '%s') ORDER BY diakNev LIMIT 100"; + HAVING (diakNev LIKE '%s' OR oId LIKE '%s') ORDER BY diakNev"; $r = db_query($q, array('modul'=>'naplo_intezmeny','result'=>'indexed','values'=>array('%'.$pattern.'%','%'.$pattern.'%'))); return $r; } function getTanarokByPattern($pattern) { if ($pattern=='') return false; - $q = "SELECT tanarId, TRIM(CONCAT_WS(' ',viseltNevElotag, ViseltCsaladiNev, viseltUtoNev)) AS tanarNev FROM `tanar` WHERE (kiDt IS NULL OR kiDt >=NOW()) HAVING tanarNev LIKE '%s' ORDER BY tanarNev LIMIT 100"; + $q = "SELECT tanarId, TRIM(CONCAT_WS(' ',viseltNevElotag, ViseltCsaladiNev, viseltUtoNev)) AS tanarNev FROM `tanar` WHERE (kiDt IS NULL OR kiDt >=NOW()) HAVING tanarNev LIKE '%s' ORDER BY tanarNev"; $r = db_query($q, array('modul'=>'naplo_intezmeny','result'=>'indexed','values'=>array('%'.$pattern.'%'))); return $r; } function getTankorokByPattern($pattern) { if ($pattern=='') return false; - $q = "SELECT tankorId, tankorNev AS tankorNev FROM `tankor`HAVING tankorNev LIKE '%s' ORDER BY tankorNev LIMIT 100"; + $q = "SELECT tankorId, tankorNev AS tankorNev FROM `tankor`HAVING tankorNev LIKE '%s' ORDER BY tankorNev"; $r = db_query($q, array('modul'=>'naplo_intezmeny','result'=>'indexed','values'=>array('%'.$pattern.'%'))); return $r; } @@ -25,7 +25,7 @@ if ($pattern=='') return false; if ($SET['diakokkal']!==true) { $p= "TRIM(CONCAT_WS(' ',nevElotag, csaladinev, utonev)) "; - $q = "SELECT szuloId, $p AS szuloNev FROM `szulo` HAVING szuloNev LIKE '%s' ORDER BY szuloNev LIMIT 100"; + $q = "SELECT szuloId, $p AS szuloNev FROM `szulo` HAVING szuloNev LIKE '%s' ORDER BY szuloNev"; $r = db_query($q, array('modul'=>'naplo_intezmeny','result'=>'indexed','values'=>array('%'.$pattern.'%'))); } else { @@ -42,13 +42,12 @@ $subquery = 'LEFT JOIN diak ON (szuloId IN (anyaId,apaId,neveloId,gondviseloId))'; $p = "CONCAT(TRIM(CONCAT_WS(' ',nevElotag, csaladinev, utonev)), ' (',TRIM(CONCAT_WS(' ',viseltNevElotag, ViseltCsaladiNev, viseltUtoNev)),')' ) "; - $q2 = "SELECT szuloId, $p AS szuloNev FROM `szulo` $subquery WHERE TRIM(CONCAT_WS(' ',nevElotag, csaladinev, utonev)) LIKE '%s' $W LIMIT 100"; + $q2 = "SELECT szuloId, $p AS szuloNev FROM `szulo` $subquery WHERE TRIM(CONCAT_WS(' ',nevElotag, csaladinev, utonev)) LIKE '%s' $W "; if (count($DIAKIDS)>0) { - $q1 = "SELECT szuloId, $p AS szuloNev FROM `szulo`$subquery WHERE diakId IN (".implode(',',$DIAKIDS).") $W LIMIT 100"; + $q1 = "SELECT szuloId, $p AS szuloNev FROM `szulo`$subquery WHERE diakId IN (".implode(',',$DIAKIDS).") $W "; $q = "$q1 UNION ($q2)"; } else $q = "($q2)"; $r = db_query("$q ORDER BY szuloNev", array('modul'=>'naplo_intezmeny','result'=>'indexed','values'=>array('%'.$pattern.'%'))); - } return $r; } diff --git a/mayor-orig/mayor-naplo/www/include/modules/naplo/share/orarend.php b/mayor-orig/mayor-naplo/www/include/modules/naplo/share/orarend.php index 0e2a5836..5dae295a 100644 --- a/mayor-orig/mayor-naplo/www/include/modules/naplo/share/orarend.php +++ b/mayor-orig/mayor-naplo/www/include/modules/naplo/share/orarend.php @@ -424,4 +424,16 @@ return db_query($q, array('fv'=>'orarendvane','modul'=>'naplo','result'=>'value')); } + function getUtolsoorak() { + $q = "SELECT *,getOraTolTime(ora.oraId) AS tolTime, getOraIgTime(ora.oraId) AS igTime +FROM (SELECT dt,max(ora) AS utolsooraateremben,teremId,terem.leiras AS teremNev FROM ora LEFT JOIN ".__INTEZMENYDBNEV.".terem +USING (teremId) WHERE teremId IS NOT NULL GROUP BY dt,teremId) AS x LEFT JOIN ora ON (ora.dt = x.dt AND x.utolsooraateremben = ora.ora AND x.teremId = ora.teremId)"; + $r = db_query($q, array('fv'=>'getUtolsoorak','modul'=>'naplo','result'=>'indexed')); + $RES = array(); + for ($i=0; $i<count($r); $i++) { + $RES[$r[$i]['dt']][$r[$i]['teremId']] = $r[$i]; + } + return $RES; + } + ?> diff --git a/mayor-orig/mayor-naplo/www/include/modules/naplo/uzeno/uzeno.php b/mayor-orig/mayor-naplo/www/include/modules/naplo/uzeno/uzeno.php index de157fa3..561c97ff 100644 --- a/mayor-orig/mayor-naplo/www/include/modules/naplo/uzeno/uzeno.php +++ b/mayor-orig/mayor-naplo/www/include/modules/naplo/uzeno/uzeno.php @@ -180,9 +180,13 @@ $txt = ($ADAT['txt']); $dbName = 'naplo_'.__INTEZMENY.'_'.$ADAT['tanev']; - $q = "INSERT INTO `%s`.uzeno (dt,txt,feladoId,feladoTipus,cimzettId,cimzettTipus) VALUES (NOW(), '%s', %u, '%s', %u, '%s')"; - $v = array($dbName, $txt, $feladoId, $feladoTipus, $cimzettId, $cimzettTipus); - return db_query($q,array('fv' => 'uzeno/postUzenet', 'modul' => 'naplo_intezmeny', 'values' => $v)); + if ($cimzettId>0 && $feladoId>0 && $txt!='') { + $q = "INSERT INTO `%s`.uzeno (dt,txt,feladoId,feladoTipus,cimzettId,cimzettTipus) VALUES (NOW(), '%s', %u, '%s', %u, '%s')"; + $v = array($dbName, $txt, $feladoId, $feladoTipus, $cimzettId, $cimzettTipus); + return db_query($q,array('fv' => 'uzeno/postUzenet', 'modul' => 'naplo_intezmeny', 'values' => $v)); + } else { + return false; + } } // v3.1 |