diff options
Diffstat (limited to 'mayor-orig/mayor-naplo/www/policy/private')
-rw-r--r-- | mayor-orig/mayor-naplo/www/policy/private/naplo/haladasi/hazifeladat-pre.php | 6 |
1 files changed, 2 insertions, 4 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 ac911f8b..86ca57a0 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 @@ -61,7 +61,7 @@ $hazifeladatFeltoltesEngedely = readVariable($_POST['hazifeladatFeltoltesEngedely'],'id',0); if ($hazifeladatId>0) { // update if (is_null($hazifeladatHataridoDt)) { - $q = "UPDATE oraHazifeladat set hazifeladatLeiras='%s',hazifeladatFeltoltesEngedely=%u WHERE hazifeladatId=%u"; + $q = "UPDATE oraHazifeladat set hazifeladatLeiras='%s',hazifeladatFeltoltesEngedely=%u,hazifeladatHataridoDt=NULL WHERE hazifeladatId=%u"; $values = array($ADAT['hazifeladatLeiras'],$hazifeladatFeltoltesEngedely,$ADAT['hazifeladatId']); } else { $q = "UPDATE oraHazifeladat set hazifeladatLeiras='%s',hazifeladatFeltoltesEngedely=%u,hazifeladatHataridoDt='%s' WHERE hazifeladatId=%u"; @@ -147,8 +147,6 @@ } if ($sikeresFeltoltes===true) { - // --todo unlink existing?-- - $q = "SELECT hazifeladatDiakFilename FROM oraHazifeladatDiak WHERE hazifeladatId=%u AND diakId=%u"; $values = array($ADAT['hazifeladatId'],$diakId); $oldFilename = db_query($q, array('modul'=>'naplo','result'=>'value','values'=>$values)); @@ -158,7 +156,7 @@ $origFilename = mb_ereg_replace("([^\w\s\d\-_~,;\[\]\(\).])", '', $_FILES['upfile']['name']); $origFilename = mb_ereg_replace("([\.]{2,})", '', $_FILES['upfile']['name']); if ($origFilename=='') $origFilename = $FILEADAT['filename']; - $q = "UPDATE oraHazifeladatDiak SET hazifeladatDiakFilename='%s',hazifeladatDiakOrigFilename='%s' WHERE hazifeladatId=%u AND diakId=%u"; + $q = "UPDATE oraHazifeladatDiak SET hazifeladatDiakFilename='%s',hazifeladatDiakOrigFilename='%s',hazifeladatDiakFileDt=NOW() WHERE hazifeladatId=%u AND diakId=%u"; $values = array($FILEADAT['filename'],$origFilename,$ADAT['hazifeladatId'], $diakId); db_query($q, array('modul'=>'naplo','result'=>'update','values'=>$values)); } |