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/share/ora.php60
-rw-r--r--mayor-orig/mayor-naplo/www/include/modules/naplo/share/oraModifier.php16
2 files changed, 72 insertions, 4 deletions
diff --git a/mayor-orig/mayor-naplo/www/include/modules/naplo/share/ora.php b/mayor-orig/mayor-naplo/www/include/modules/naplo/share/ora.php
index 602f26e1..1809ab50 100644
--- a/mayor-orig/mayor-naplo/www/include/modules/naplo/share/ora.php
+++ b/mayor-orig/mayor-naplo/www/include/modules/naplo/share/ora.php
@@ -24,16 +24,22 @@
tankorNev,
feladatTipusId,
munkaido,
- hazifeladatId, hazifeladatLeiras
+ hazifeladatId,
+ hazifeladatLeiras,
+ hazifeladatFeltoltesEngedely,
+ hazifeladatHataridoDt,
+ cimkeId, cimkeLeiras
FROM `%s`.ora
LEFT JOIN `%s`.oraHazifeladat USING (oraId)
+ LEFT JOIN `%s`.oraCimke USING (oraId)
+ LEFT JOIN ".__INTEZMENYDBNEV.".cimke USING (cimkeId)
LEFT JOIN ".__INTEZMENYDBNEV.".tankorSzemeszter USING (tankorId)
LEFT JOIN ".__INTEZMENYDBNEV.".tanar AS t1 ON ki=t1.tanarId
LEFT JOIN ".__INTEZMENYDBNEV.".tanar AS t2 ON kit=t2.tanarId
LEFT JOIN ".__INTEZMENYDBNEV.".feladatTipus USING (feladatTipusId)
LEFT JOIN ".__INTEZMENYDBNEV.".terem USING (teremId)
WHERE oraId=%u AND (tanev=%u OR feladatTipusId IS NOT NULL)";
- $v = array(tanevDbNev(__INTEZMENY, $tanev),tanevDbNev(__INTEZMENY, $tanev), $oraId, $tanev);
+ $v = array(tanevDbNev(__INTEZMENY, $tanev),tanevDbNev(__INTEZMENY, $tanev), tanevDbNev(__INTEZMENY, $tanev), $oraId, $tanev);
return db_query($q, array('fv' => 'getOraAdatById', 'modul' => 'naplo_intezmeny', 'result' => 'record', 'values' => $v), $olr);
} else {
@@ -349,6 +355,8 @@
} else {
$q = "SELECT * FROM ora
LEFT JOIN oraHazifeladat USING (oraId)
+LEFT JOIN oraCimke USING (oraId)
+LEFT JOIN ".__INTEZMENYDBNEV.".cimke USING (cimkeId)
WHERE dt>='%s' and dt<='%s' AND (ki=%u OR kit=%u) $WHERE ORDER BY dt,ora";
array_unshift($v, $tolDt, $igDt, $tanarId, $tanarId);
if ($SET['result']=='assoc')
@@ -389,13 +397,19 @@ WHERE dt>='%s' and dt<='%s' AND (ki=%u OR kit=%u) $WHERE ORDER BY dt,ora";
$RE = db_query($q, array('modul' => 'naplo', 'fv' => 'getOrak', 'result' => 'indexed', 'values' => $v));
} else {
if ($SET['elmaradokNelkul'])
- $q = "SELECT *,getOraTolTime(ora.oraId) AS tolTime,getOraIgTime(ora.oraId) AS igTime FROM ora
+ $q = "SELECT *,getOraTolTime(ora.oraId) AS tolTime,getOraIgTime(ora.oraId) AS igTime, cimkeId, cimkeLeiras
+FROM ora
LEFT JOIN oraHazifeladat USING (oraId)
+LEFT JOIN oraCimke USING (oraId)
+LEFT JOIN ".__INTEZMENYDBNEV.".cimke USING (cimkeId)
WHERE dt>='%s' and dt<='%s' AND tankorId IN (".implode(',', array_fill(0, count($TANKORIDK), '%u')).")
AND tipus NOT IN ('elmarad','elmarad máskor')";
else
- $q = "SELECT *,getOraTolTime(ora.oraId) AS tolTime,getOraIgTime(ora.oraId) AS igTime FROM ora
+ $q = "SELECT *,getOraTolTime(ora.oraId) AS tolTime,getOraIgTime(ora.oraId) AS igTime, cimkeId, cimkeLeiras
+FROM ora
LEFT JOIN oraHazifeladat USING (oraId)
+LEFT JOIN oraCimke USING (oraId)
+LEFT JOIN ".__INTEZMENYDBNEV.".cimke USING (cimkeId)
WHERE dt>='%s' and dt<='%s' AND tankorId IN (".implode(',', array_fill(0, count($TANKORIDK), '%u')).")";
$R = db_query($q, array('modul' => 'naplo', 'fv' => 'getOrak', 'result' => 'indexed', 'values' => $v));
$RE['tankorok']=array();
@@ -621,6 +635,18 @@ WHERE dt>='%s' and dt<='%s' AND tankorId IN (".implode(',', array_fill(0, count(
return $R;
}
+ function getKovetkezoOraAdatByOraId($oraId) {
+ if ($oraId>0) {
+ $q = "SELECT * FROM ora WHERE oraId = %u";
+ $v = array($oraId);
+ $ORA = db_query($q,array('debug'=>false,'fv'=>'oraMostVane','modul'=>'naplo','values'=>$v,'result'=>'record'));
+ $q = "SELECT * FROM ora WHERE dt>'%s' AND tankorId=%u AND tipus NOT IN ('elmarad','elmarad_máskor') ORDER BY dt LIMIT 1";
+ $v = array($ORA['dt'],$ORA['tankorId']);
+ $R = db_query($q,array('debug'=>false,'fv'=>'oraMostVane','modul'=>'naplo','values'=>$v,'result'=>'record'));
+ }
+ return $R;
+ }
+
function getDiakOra($diakId,$dt,$ora,$olr_intezmeny = '',$olr_naplo) { // jelenlét mezőt nem vesszük figyelembe!!!
// diakId->tankor->ora
@@ -657,5 +683,31 @@ WHERE dt>='%s' and dt<='%s' AND tankorId IN (".implode(',', array_fill(0, count(
return $R;
}
+ function getDiakHazifeladatByHatarido($diakId,$ADAT,$olr='') {
+ $dt = $hazifeladatHataridoDt = readVariable($ADAT['hazifeladatHataridoDt'],'date',null);
+ $R = array();
+ if ($diakId>0 && !is_null($hazifeladatHataridoDt)) {
+ $tankorIds = getTankorByDiakId($diakId, __TANEV, $SET = array('csakId' => true, 'tolDt' => $dt, 'igDt' => $dt, 'result'=>'idonly'),$olr);
+ if (count($tankorIds)>0) {
+ $q = "SELECT *,getNev(tankorId,'tankor') AS tankorNev
+FROM oraHazifeladat
+LEFT JOIN ora USING (oraId)
+LEFT JOIN oraHazifeladatDiak ON (oraHazifeladat.hazifeladatId = oraHazifeladatDiak.hazifeladatId AND diakId=%u)
+WHERE tankorId IN (".implode(',',$tankorIds).") AND hazifeladatHataridoDt BETWEEN '%s' AND '%s 23:59:59'";
+ $v = array($diakId,$hazifeladatHataridoDt,$hazifeladatHataridoDt);
+ } else { // fallback
+ $q = "SELECT *,getNev(tankorId,'tankor') AS tankorNev FROM oraHazifeladat LEFT JOIN oraHazifeladatDiak USING (hazifeladatId) LEFT JOIN ora USING (oraId) WHERE diakId=%u AND DATE(hazifeladatHataridoDt)='%s'";
+ $v = array($diakId,$hazifeladatHataridoDt);
+ }
+ $R = db_query($q,array('debug'=>false,'fv'=>'getDiakhazifeladatByOraIds','modul'=>'naplo','values'=>$v,'result'=>'indexed'),$olr);
+ }
+ return $R;
+ }
+
+ function getOsztalyHazifeladatByHatarido($osztalyId,$ADAT,$olr='') {
+ // loop $diakId
+ $hazifeladatHataridoDt = $ADAT['hazifeladatHataridoDt'];
+
+ }
?>
diff --git a/mayor-orig/mayor-naplo/www/include/modules/naplo/share/oraModifier.php b/mayor-orig/mayor-naplo/www/include/modules/naplo/share/oraModifier.php
index 53b6c763..8c5bd077 100644
--- a/mayor-orig/mayor-naplo/www/include/modules/naplo/share/oraModifier.php
+++ b/mayor-orig/mayor-naplo/www/include/modules/naplo/share/oraModifier.php
@@ -156,4 +156,20 @@
}
+ function oraHazifeladatDiakLatta($hazifeladatId) {
+ if (__DIAK===true && $hazifeladatId>0) {
+ if (defined('__USERDIAKID') && __USERDIAKID>0) {
+ $diakId=__USERDIAKID;
+ } elseif (defined('__SZULODIAKID') && __SZULODIAKID>0) {
+ $diakId=__SZULODIAKID;
+ }
+ if ($diakId>0) {
+ $q = "INSERT IGNORE INTO oraHazifeladatDiak (hazifeladatId,diakId,diakLattamDt) VALUES (%u,%u,NOW())";
+ $values = array($hazifeladatId, $diakId);
+ db_query($q, array('modul'=>'naplo','result'=>'insert','values'=>$values));
+ }
+ }
+ }
+
+
?> \ No newline at end of file