aboutsummaryrefslogtreecommitdiffstats
path: root/mayor-orig/mayor-naplo/www/policy
diff options
context:
space:
mode:
Diffstat (limited to 'mayor-orig/mayor-naplo/www/policy')
-rw-r--r--mayor-orig/mayor-naplo/www/policy/private/naplo/haladasi/haladasi-pre.php3
-rw-r--r--mayor-orig/mayor-naplo/www/policy/private/naplo/haladasi/hazifeladat-pre.php32
-rw-r--r--mayor-orig/mayor-naplo/www/policy/private/naplo/orarend/orarend-pre.php2
3 files changed, 34 insertions, 3 deletions
diff --git a/mayor-orig/mayor-naplo/www/policy/private/naplo/haladasi/haladasi-pre.php b/mayor-orig/mayor-naplo/www/policy/private/naplo/haladasi/haladasi-pre.php
index 9b397670..a7c57b7f 100644
--- a/mayor-orig/mayor-naplo/www/policy/private/naplo/haladasi/haladasi-pre.php
+++ b/mayor-orig/mayor-naplo/www/policy/private/naplo/haladasi/haladasi-pre.php
@@ -361,6 +361,9 @@ if ( $skin == 'ajax'
}
}
$ADAT['oraLatogatasok'] = getOralatogatasByOraIds($ADAT['ORAIDK']);
+ if (__DIAK===true && $diakId>0) {
+ $ADAT['diakHazifeladat'] = getDiakHazifeladatByOraIds($ADAT['ORAIDK'],$diakId);
+ }
foreach ($ADAT['oraLatogatasok'] as $olId => $olAdat)
foreach ($olAdat['tanarIds'] as $_tanarId) $ADAT['oraLatogatasok'][$olId]['tanarNevek'][] = getTanarNevById($_tanarId);
// Kell a munkaterv!! Ahhoz kell(enek) az osztály(ok)!
diff --git a/mayor-orig/mayor-naplo/www/policy/private/naplo/haladasi/hazifeladat-pre.php b/mayor-orig/mayor-naplo/www/policy/private/naplo/haladasi/hazifeladat-pre.php
index ba0a27c4..28a02d5a 100644
--- a/mayor-orig/mayor-naplo/www/policy/private/naplo/haladasi/hazifeladat-pre.php
+++ b/mayor-orig/mayor-naplo/www/policy/private/naplo/haladasi/hazifeladat-pre.php
@@ -23,7 +23,7 @@
$ADAT['oraId' ] = $oraId = readVariable($_POST['oraId'],'id',readVariable($_GET['oraId'],'id'));
// $ADAT['hazifeladatId' ] = $hazifeladatId = readVariable($_POST['hazifeladatId'],'id', readVariable($_GET['hazifeladatId'],'id'));
$ADAT['hazifeladatLeiras' ] = readVariable($_POST['hazifeladatLeiras'],'string');
- $action = readVariable($_POST['action'],'strictstring',null,array('hazifeladatBeiras'));
+ $action = readVariable($_POST['action'],'strictstring',null,array('hazifeladatBeiras','hazifeladatKesz'));
$q = "SELECT hazifeladatId FROM oraHazifeladat WHERE oraId=%u";
$values = array($ADAT['oraId']);
@@ -46,13 +46,41 @@
$leiras = readVariable($_POST['oraLeiras'],'string');
updateHaladasiNaploOra($oraId, $leiras);
}
+ } elseif (__DIAK===true) {
+ 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($ADAT['hazifeladatId'], $diakId);
+ db_query($q, array('modul'=>'naplo','result'=>'insert','values'=>$values));
+
+ if ($action=='hazifeladatKesz') {
+ if ($diakId>0 && $ADAT['hazifeladatId']>0) {
+ $q = "UPDATE oraHazifeladatDiak SET hazifeladatDiakStatus=IF(hazifeladatDiakStatus='','kész','') WHERE hazifeladatId=%u AND diakId=%u";
+ $values = array($ADAT['hazifeladatId'], $diakId);
+ db_query($q, array('modul'=>'naplo','result'=>'update','values'=>$values));
+ }
+ }
+ $q = "SELECT * FROM oraHazifeladatDiak WHERE hazifeladatId=%u AND diakId=%u";
+ $values = array($ADAT['hazifeladatId'],$diakId);
+ $ADAT['hazifeladatDiak'] = db_query($q, array('modul'=>'naplo','result'=>'record','values'=>$values));
+ }
+
}
$q = "SELECT * FROM oraHazifeladat WHERE oraId=%u";
$values = array($ADAT['oraId']);
$ADAT['hazifeladatAdat'] = db_query($q, array('modul'=>'naplo','result'=>'record','values'=>$values));
- $ADAT['oraAdat'] = getOraadatById($oraId);
+ if (__TANAR===true || __NAPLOADMIN===true || __VEZETOSEG===true) {
+ $q = "SELECT *,getNev(diakId,'diak') AS diakNev FROM oraHazifeladatDiak WHERE hazifeladatId=%u ORDER BY diakNev";
+ $values = array($ADAT['hazifeladatId']);
+ $ADAT['hazifeladatDiak'] = db_query($q, array('debug'=>true,'modul'=>'naplo','result'=>'indexed','values'=>$values));
+ }
+ $ADAT['oraAdat'] = getOraadatById($oraId);
$TOOL['vissza'] = array('tipus'=>'vissza',
'paramName'=>'vissza',
diff --git a/mayor-orig/mayor-naplo/www/policy/private/naplo/orarend/orarend-pre.php b/mayor-orig/mayor-naplo/www/policy/private/naplo/orarend/orarend-pre.php
index 6421687a..c56b6d87 100644
--- a/mayor-orig/mayor-naplo/www/policy/private/naplo/orarend/orarend-pre.php
+++ b/mayor-orig/mayor-naplo/www/policy/private/naplo/orarend/orarend-pre.php
@@ -191,7 +191,7 @@
if ($teremId!='')
$_D = getOrakByTeremId($teremId,array('tolDt'=>$_dt,'igDt'=>$_dt,'result'=>'likeOrarend'));
else
- $_D = getOrak($TANKOROK['haladasi'],array('tolDt'=>$_dt,'igDt'=>$_dt,'result'=>'likeOrarend'));
+ $_D = getOrak($TANKOROK['haladasi'],array('tolDt'=>$_dt,'igDt'=>$_dt,'result'=>'likeOrarend','diakId'=>$diakId));
$ADAT['haladasi']['orak'][$_dt] = $_D['orak'][$_dt];
if (is_array($_D['tankorok'])) $ADAT['haladasi']['tankorok'] = array_map('intval',array_unique(array_merge($_D['tankorok'],$ADAT['haladasi']['tankorok'])));
}