diff options
author | M.Gergo | 2020-03-31 19:40:35 +0200 |
---|---|---|
committer | M.Gergo | 2020-03-31 19:40:35 +0200 |
commit | 0ba1d0c88b25762d4acb0f4b5425778f0cbc76a9 (patch) | |
tree | 967d5c6f8477b2871ae022b9bd56fc9697af4bbd /mayor-orig/mayor-naplo/www/policy/private | |
parent | 2f564886b387ecd47ce4f88cabb26a706a32c56c (diff) | |
parent | 4c6b313fae97ccb7eaae75b5d05881f10469e13d (diff) | |
download | mayor-0ba1d0c88b25762d4acb0f4b5425778f0cbc76a9.tar.gz mayor-0ba1d0c88b25762d4acb0f4b5425778f0cbc76a9.zip |
Merge branch 'MaYor-dev'
Az eddigi fejlesztések a forrásból -> (devel@mayor.hu)
Diffstat (limited to 'mayor-orig/mayor-naplo/www/policy/private')
3 files changed, 35 insertions, 13 deletions
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 23d9f391..ac911f8b 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 @@ -53,21 +53,32 @@ $values = array($ADAT['oraId']); $ADAT['hazifeladatId'] = $hazifeladatId = db_query($q, array('modul'=>'naplo','result'=>'value','values'=>$values)); $ADAT['oraAdat'] = getOraadatById($oraId); + $ADAT['oraAdat']['oraBeirhato'] = oraBeirhato($ADAT['oraAdat']['oraId']); $ADAT['nevsor'] = getTankorDiakjaiByInterval($ADAT['oraAdat']['tankorId'], __TANEV, $ADAT['oraAdat']['dt'], $ADAT['oraAdat']['dt']); - + $ADAT['kovetkezoOraAdat'] = getKovetkezoOraAdatByOraId($ADAT['oraAdat']['oraId']); if (__TANAR===true && $action=='hazifeladatBeiras') { + $hazifeladatHataridoDt = readVariable($_POST['hazifeladatHataridoDt'],'datetime',null); $hazifeladatFeltoltesEngedely = readVariable($_POST['hazifeladatFeltoltesEngedely'],'id',0); if ($hazifeladatId>0) { // update - $q = "UPDATE oraHazifeladat set hazifeladatLeiras='%s',hazifeladatFeltoltesEngedely=%u WHERE hazifeladatId=%u"; - $values = array($ADAT['hazifeladatLeiras'],$hazifeladatFeltoltesEngedely,$ADAT['hazifeladatId']); - $r = db_query($q, array('modul'=>'naplo','result'=>'update','values'=>$values)); + if (is_null($hazifeladatHataridoDt)) { + $q = "UPDATE oraHazifeladat set hazifeladatLeiras='%s',hazifeladatFeltoltesEngedely=%u WHERE hazifeladatId=%u"; + $values = array($ADAT['hazifeladatLeiras'],$hazifeladatFeltoltesEngedely,$ADAT['hazifeladatId']); + } else { + $q = "UPDATE oraHazifeladat set hazifeladatLeiras='%s',hazifeladatFeltoltesEngedely=%u,hazifeladatHataridoDt='%s' WHERE hazifeladatId=%u"; + $values = array($ADAT['hazifeladatLeiras'],$hazifeladatFeltoltesEngedely,$hazifeladatHataridoDt,$ADAT['hazifeladatId']); + } + $r = db_query($q, array('debug'=>false,'modul'=>'naplo','result'=>'update','values'=>$values)); } elseif ($oraId>0) { // insert - $q = "INSERT IGNORE INTO oraHazifeladat (hazifeladatLeiras,oraId,hazifeladatFeltoltesEngedely) VALUES ('%s',%u,%u)"; - $values = array($ADAT['hazifeladatLeiras'],$ADAT['oraId'],$hazifeladatFeltoltesEngedely); + if (is_null($hazifeladatHataridoDt)) { + $q = "INSERT IGNORE INTO oraHazifeladat (hazifeladatLeiras,oraId,hazifeladatFeltoltesEngedely) VALUES ('%s',%u,%u)"; + $values = array($ADAT['hazifeladatLeiras'],$ADAT['oraId'],$hazifeladatFeltoltesEngedely); + } else { + $q = "INSERT IGNORE INTO oraHazifeladat (hazifeladatLeiras,oraId,hazifeladatFeltoltesEngedely,hazifeladatHataridoDt) VALUES ('%s',%u,%u,'%s')"; + $values = array($ADAT['hazifeladatLeiras'],$ADAT['oraId'],$hazifeladatFeltoltesEngedely,$hazifeladatHataridoDt); + } $hazifeladatId = db_query($q, array('modul'=>'naplo','result'=>'insert','values'=>$values)); - } - if ($oraId>0 && strtotime(date('Y-m-d'))>=strtotime($ADAT['oraAdat']['dt'])) { + if ($oraId>0 && $ADAT['oraAdat']['oraBeirhato']===true ) { $leiras = readVariable($_POST['oraLeiras'],'string'); updateHaladasiNaploOra($oraId, $leiras); } @@ -105,9 +116,11 @@ } 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)); + // $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)); + + oraHazifeladatDiakLatta($ADAT['hazifeladatId']); if ($action=='hazifeladatKesz') { if ($diakId>0 && $ADAT['hazifeladatId']>0) { @@ -168,6 +181,7 @@ $ADAT['hazifeladatDiak'] = db_query($q, array('debug'=>false,'modul'=>'naplo','result'=>'indexed','values'=>$values)); } $ADAT['oraAdat'] = getOraadatById($oraId); + $ADAT['oraAdat']['oraBeirhato'] = oraBeirhato($ADAT['oraAdat']['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 c56b6d87..262ff572 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 @@ -235,7 +235,14 @@ $_napok = getNapok(array('tolDt'=>$tolDt,'igDt'=>$igDt)); for ($i=0; $i<count($_napok); $i++) { + $_dt = $_napok[$i]; $ADAT['napok'][($i+1)] = getNapAdat($_napok[$i]); + if ($diakId>0) { + $lr = db_connect('naplo'); + $_HF = getDiakHazifeladatByHatarido($diakId,array('hazifeladatHataridoDt'=>$_dt),$lr); + if (is_array($_HF) && count($_HF)>0) $ADAT['hazifeladat'][$_dt] = $_HF; + db_close($lr); + } } if (_POLICY!='public' && is_array($TANKOROK)) { diff --git a/mayor-orig/mayor-naplo/www/policy/private/naplo/tools/getOraAdat-pre.php b/mayor-orig/mayor-naplo/www/policy/private/naplo/tools/getOraAdat-pre.php index 31dd4699..064bc796 100644 --- a/mayor-orig/mayor-naplo/www/policy/private/naplo/tools/getOraAdat-pre.php +++ b/mayor-orig/mayor-naplo/www/policy/private/naplo/tools/getOraAdat-pre.php @@ -27,9 +27,10 @@ $leiras = readVariable($_POST['leiras'], 'string'); updateHaladasiNaploOra($oraId,$leiras); } - $_JSON['oraAdat'] = $ORAADAT = getOraAdatById($oraId); - + if ($ORAADAT['hazifeladatId']>0) { + oraHazifeladatDiakLatta($ORAADAT['hazifeladatId']); // log: diakLattamDt + } if ($dolgozatBeirhato === true && $action=='dolgozatBeiras') { $dolgozatId = ujDolgozat('',$ORAADAT['tankorId']); dolgozatModositas($dolgozatId,'',$ORAADAT['dt']); |