From 4cba41696a27f776305c67d637de1e6b77015bcd Mon Sep 17 00:00:00 2001 From: M.Gergo Date: Wed, 25 Mar 2020 01:02:40 +0100 Subject: Rev: 4636 --- .../private/naplo/haladasi/hazifeladat-pre.php | 26 +++++-- .../module-naplo/css/haladasi/hazifeladat.css | 2 + .../module-naplo/html/haladasi/hazifeladat.phtml | 81 +++++++++++++++++++++- 3 files changed, 101 insertions(+), 8 deletions(-) (limited to 'mayor-orig/mayor-naplo/www') 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 a26b39fa..23d9f391 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,6 +53,7 @@ $values = array($ADAT['oraId']); $ADAT['hazifeladatId'] = $hazifeladatId = db_query($q, array('modul'=>'naplo','result'=>'value','values'=>$values)); $ADAT['oraAdat'] = getOraadatById($oraId); + $ADAT['nevsor'] = getTankorDiakjaiByInterval($ADAT['oraAdat']['tankorId'], __TANEV, $ADAT['oraAdat']['dt'], $ADAT['oraAdat']['dt']); if (__TANAR===true && $action=='hazifeladatBeiras') { $hazifeladatFeltoltesEngedely = readVariable($_POST['hazifeladatFeltoltesEngedely'],'id',0); @@ -71,16 +72,31 @@ updateHaladasiNaploOra($oraId, $leiras); } } elseif (__TANAR===true && $action=='lattam') { + $lr = db_connect('naplo'); + db_start_trans($lr); $lattamDiakIds = readVariable($_POST['lattam'],'id'); - $q = "UPDATE oraHazifeladatDiak SET tanarLattamDt=null WHERE hazifeladatId=%u"; - $values = array($ADAT['hazifeladatId'], $_diakId); - db_query($q, array('modul'=>'naplo','result'=>'update','values'=>$values)); + $megsemlattamDiakIds = readVariable($_POST['megsemlattam'],'id'); for ($i=0; $i'naplo','result'=>'update','values'=>$values)); + $q = "SELECT count(*) AS db FROM oraHazifeladatDiak WHERE hazifeladatId=%u AND diakId=%u"; + $db = db_query($q, array('modul'=>'naplo','result'=>'value','values'=>$values),$lr); + if ($db==1) { + $q = "UPDATE oraHazifeladatDiak SET tanarLattamDt=NOW() WHERE hazifeladatId=%u AND diakId=%u"; + $r = db_query($q, array('modul'=>'naplo','result'=>'update','values'=>$values),$lr); + } else { + $q = "INSERT IGNORE INTO oraHazifeladatDiak (hazifeladatId,diakId,tanarLattamDt) VALUES (%u,%u,NOW())"; + db_query($q, array('modul'=>'naplo','result'=>'insert','values'=>$values),$lr); + } + } + for ($i=0; $i'naplo','result'=>'update','values'=>$values),$lr); } + db_commit($lr); + db_close($lr); } elseif (__DIAK===true) { if (defined('__USERDIAKID') && __USERDIAKID>0) { $diakId=__USERDIAKID; diff --git a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/css/haladasi/hazifeladat.css b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/css/haladasi/hazifeladat.css index 127dfa75..cc5f8869 100644 --- a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/css/haladasi/hazifeladat.css +++ b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/css/haladasi/hazifeladat.css @@ -61,5 +61,7 @@ table.hazifeladatDiak tr td a, fieldset.adatok a { color: black; } + table.hazifeladatDiak tr td a:visited, fieldset.adatok a:visited { color: #888; } table.hazifeladatDiak tr td a:hover, fieldset.adatok a:hover { text-decoration:underline; color: cornflowerblue; } + table.hazifeladatDiak tr td.kesz { background-color: lightgreen; color:white; text-align:center } diff --git a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/haladasi/hazifeladat.phtml b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/haladasi/hazifeladat.phtml index cddfd0e8..e03ac99a 100644 --- a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/haladasi/hazifeladat.phtml +++ b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/haladasi/hazifeladat.phtml @@ -88,6 +88,18 @@ } } else { //////////////////////////////////////////////////////////////////////////////////// + + if (__USERTANARID!=$ADAT['oraAdat']['ki']) { // nem saját óra + + echo '
'._HAZIFELADAT.''."\n"; + if ($ADAT['hazifeladatAdat']['hazifeladatLeiras']=='') + { echo '

még nincs kitöltve

'; } + else + { echo ($ADAT['hazifeladatAdat']['hazifeladatLeiras']); } + echo '
'."\n"; + + } else { // saját óra + echo ''; if ($skin != 'ajax') formBegin(array('class'=>'hazifeladat')); echo ''; @@ -145,31 +157,93 @@ echo ''."\n"; if ($skin != 'ajax') formEnd(); + } // saját óra + if (count($ADAT['hazifeladatDiak'])>0) { echo '
'; echo 'Visszajelzések'; putHazifeladatDiak($ADAT); echo '
'; } - } + } } function putHazifeladatDiak($ADAT) { if (count($ADAT['hazifeladatDiak'])==0) return false; + for ($i=0; $i'; + echo ''; + echo ''; + echo ''; + if (__NAPLOADMIN===true || __VEZETOSEG===true) + echo ''; + else + echo ''; + echo ''; + + if (is_array($ADAT['nevsor']['nevek'])) + foreach ($ADAT['nevsor']['nevek'] as $diakId => $ITEM) { + $D = $DIAKHF[$diakId]; + echo ''; + echo ''; + if (__NAPLOADMIN===true || __VEZETOSEG===true) echo ''; + echo ''; + //echo ''; + + $ADAT['dir'] = 'naplo/haladasi/hazifeladat'; + $ADAT['file'] = $D['hazifeladatDiakFilename']; + $href = href('index.php?page=session&f=download&dir='.$ADAT['dir'].'&file='.$ADAT['file'].'&download=true'); + echo ''; + echo ''; + echo ''; + } + echo '
diákláttastátuszcsatolmányláttam
diákstátuszcsatolmányláttam
'.$ITEM['diakNev'].''.$D['diakLattamDt'].''.$D['hazifeladatDiakStatus'].''.$D['hazifeladatDiakMegjegyzes'].''; + if ($D['hazifeladatDiakOrigFilename']!='') { + echo ''.htmlspecialchars($D['hazifeladatDiakOrigFilename']).' '; + } + echo ''; +// if ($ADAT['hazifeladatDiak']['hazifeladatDiakStatus']=='kész') { + if (__TANAR===true && __USERTANARID==$ADAT['oraAdat']['ki']) { + if ($D['tanarLattamDt']=='') { + echo ''; + } else { + echo ''; + } + } else { + if ($D['tanarLattamDt']!='') {echo '';} + } +// } + echo '
'; + echo formEnd(); + + } + + function putHazifeladatDiakOrig($ADAT) { + + if (count($ADAT['hazifeladatDiak'])==0) return false; + echo formBegin(); echo ''; echo ''; echo ''; echo ''; - echo ''; + if (__NAPLOADMIN===true || __VEZETOSEG===true) + echo ''; + else + echo ''; echo ''; for ($i=0; $i'; echo ''; - echo ''; + if (__NAPLOADMIN===true || __VEZETOSEG===true) echo ''; echo ''; echo ''; @@ -198,6 +272,7 @@ } echo '
diákláttastátuszcsatolmányláttam
diákláttastátuszcsatolmányláttam
diákstátuszcsatolmányláttam
'.$D['diakNev'].''.$D['diakLattamDt'].''.$D['diakLattamDt'].''.$D['hazifeladatDiakStatus'].''.$D['hazifeladatDiakMegjegyzes'].'
'; echo formEnd(); + } ?> -- cgit v1.2.3