aboutsummaryrefslogtreecommitdiffstats
path: root/mayor-orig/www/include/modules/naplo/share
diff options
context:
space:
mode:
authorM.Gergo2018-09-07 22:27:52 +0200
committerM.Gergo2018-09-07 22:27:52 +0200
commit8f8fc390374681cd537e4216f0366d6fe8a6c73c (patch)
tree6d19efd3593a0383a48cdac7f78cd0e2ef6fa761 /mayor-orig/www/include/modules/naplo/share
parent63edef615f7828cb0f57bf9ba128a90eb4fe07e0 (diff)
downloadmayor-8f8fc390374681cd537e4216f0366d6fe8a6c73c.tar.gz
mayor-8f8fc390374681cd537e4216f0366d6fe8a6c73c.zip
Rev: 4358
Diffstat (limited to 'mayor-orig/www/include/modules/naplo/share')
-rw-r--r--mayor-orig/www/include/modules/naplo/share/tanar.php2
-rw-r--r--mayor-orig/www/include/modules/naplo/share/terem.php33
2 files changed, 34 insertions, 1 deletions
diff --git a/mayor-orig/www/include/modules/naplo/share/tanar.php b/mayor-orig/www/include/modules/naplo/share/tanar.php
index 32027565..5e23e4ec 100644
--- a/mayor-orig/www/include/modules/naplo/share/tanar.php
+++ b/mayor-orig/www/include/modules/naplo/share/tanar.php
@@ -26,7 +26,7 @@
initTolIgDt($SET['tanev'], $beDt, $kiDt, $SET['override']);
$where = $v = array();
- if ($SET['összes']!==true && in_date_interval(date(),$beDt,$kiDt)==true) { // ha nincs benne a mai nap a vizsgált intervallumban, akkor értelmetlen (lehet) ez a feltétel
+ if ($SET['összes']!==true && in_date_interval(date('Y-m-d H:m:s'),$beDt,$kiDt)==true) { // ha nincs benne a mai nap a vizsgált intervallumban, akkor értelmetlen (lehet) ez a feltétel
$where[] = "statusz IN ('határozatlan idejű','határozott idejű','külső óraadó')";
}
if ($beDt != '') {
diff --git a/mayor-orig/www/include/modules/naplo/share/terem.php b/mayor-orig/www/include/modules/naplo/share/terem.php
index f4a722a2..954f5fbe 100644
--- a/mayor-orig/www/include/modules/naplo/share/terem.php
+++ b/mayor-orig/www/include/modules/naplo/share/terem.php
@@ -109,4 +109,37 @@
}
+ // teremModifier
+
+ function teremModositas($ADAT) {
+
+ if (MAYOR_SOCIAL === true) $ADAT['tanev'] = __TANEV;
+
+ $dt = readVariable($ADAT['dt'], 'datetime', null);
+ initTolIgDt($ADAT['tanev'], $dt, $dt);
+ $tanevDb = tanevDbNev(__INTEZMENY, $ADAT['tanev']);
+
+ $return = false;
+
+ if (is_array($ADAT['foglaltTermek'][ $ADAT['teremId'] ])) {
+ $return = $ADAT['foglaltTermek'][ $ADAT['teremId'] ]['tanarId'];
+ // A foglalt terem felszabadítása
+ $q = "UPDATE `%s`.orarendiOra SET teremId=NULL WHERE tolDt<='%s' AND '%s'<=igDt AND het=%u AND nap=%u AND ora=%u AND teremId=%u";
+ $v = array($tanevDb, $dt, $dt, $ADAT['het'], $ADAT['nap'], $ADAT['ora'], $ADAT['teremId']);
+ db_query($q, array('fv' => 'teremModositas/foglalt terem felszabadítása', 'modul' => 'naplo', 'values' => $v));
+ }
+ // teremhozzárendelés módosítása
+ if ($ADAT['teremId']>0) {
+ $q = "UPDATE `%s`.orarendiOra SET teremId=%u WHERE tolDt <= '%s' AND '%s' <= igDt AND het=%u AND nap=%u AND ora=%u AND tanarId=%u";
+ $v = array($tanevDb, $ADAT['teremId'], $dt, $dt, $ADAT['het'], $ADAT['nap'], $ADAT['ora'], $ADAT['tanarId']);
+ } else {
+ $q = "UPDATE `%s`.orarendiOra SET teremId=NULL WHERE tolDt <= '%s' AND '%s' <= igDt AND het=%u AND nap=%u AND ora=%u AND tanarId=%u AND teremId IS NOT NULL";
+ $v = array($tanevDb, $dt, $dt, $ADAT['het'], $ADAT['nap'], $ADAT['ora'], $ADAT['tanarId']);
+ }
+ db_query($q, array('debug'=>true,'fv' => 'teremModositas/foglalt terem felszabadítása', 'modul' => 'naplo', 'values' => $v));
+
+ return $return;
+
+ }
+
?>