diff options
author | M.Gergo | 2020-03-25 01:02:40 +0100 |
---|---|---|
committer | M.Gergo | 2020-03-25 01:02:40 +0100 |
commit | 4cba41696a27f776305c67d637de1e6b77015bcd (patch) | |
tree | 7a02b10dda649b7f881bc67482f22f427b036bdd /mayor-orig/mayor-naplo/www | |
parent | f594cba3efc0da6c87b3da9e288245f237cfac51 (diff) | |
download | mayor-rev4636.tar.gz mayor-rev4636.zip |
Rev: 4636rev4636
Diffstat (limited to 'mayor-orig/mayor-naplo/www')
3 files changed, 101 insertions, 8 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 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<count($lattamDiakIds); $i++) { $_diakId = $lattamDiakIds[$i]; - $q = "UPDATE oraHazifeladatDiak SET tanarLattamDt=NOW() WHERE hazifeladatId=%u AND diakId=%u"; $values = array($ADAT['hazifeladatId'], $_diakId); - db_query($q, array('modul'=>'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<count($megsemlattamDiakIds); $i++) { + $_diakId = $megsemlattamDiakIds[$i]; + $q = "UPDATE oraHazifeladatDiak SET tanarLattamDt=null WHERE hazifeladatId=%u AND diakId=%u"; + $values = array($ADAT['hazifeladatId'], $_diakId); + db_query($q, array('modul'=>'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 '<fieldset class="adatok"><legend>'._HAZIFELADAT.'</legend>'."\n"; + if ($ADAT['hazifeladatAdat']['hazifeladatLeiras']=='') + { echo '<p style="color:#aaa;">még nincs kitöltve</p>'; } + else + { echo ($ADAT['hazifeladatAdat']['hazifeladatLeiras']); } + echo '</fieldset>'."\n"; + + } else { // saját óra + echo '<script src="//cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script>'; if ($skin != 'ajax') formBegin(array('class'=>'hazifeladat')); echo '<input type="hidden" name="action" value="hazifeladatBeiras"/>'; @@ -145,31 +157,93 @@ echo '</fieldset>'."\n"; if ($skin != 'ajax') formEnd(); + } // saját óra + if (count($ADAT['hazifeladatDiak'])>0) { echo '<fieldset class="adatok">'; echo '<legend>Visszajelzések</legend>'; putHazifeladatDiak($ADAT); echo '</fieldset>'; } - } + } } function putHazifeladatDiak($ADAT) { if (count($ADAT['hazifeladatDiak'])==0) return false; + for ($i=0; $i<count($ADAT['hazifeladatDiak']); $i++) { + $D = $ADAT['hazifeladatDiak'][$i]; + $DIAKHF[$D['diakId']] = $D; + } + + echo formBegin(); + echo '<input type="hidden" name="action" value="lattam" />'; + echo '<input type="hidden" name="hazifeladatId" value="'.$ADAT['hazifeladatId'].'" />'; + echo '<table class="hazifeladatDiak" cellpadding="1" cellspacing="1">'; + echo '<thead>'; + if (__NAPLOADMIN===true || __VEZETOSEG===true) + echo '<tr><th>diák</th><th>látta</th><th colspan="2">státusz</th><th colspan="1">csatolmány</th><th>láttam</th></tr>'; + else + echo '<tr><th>diák</th><th colspan="2">státusz</th><th colspan="1">csatolmány</th><th>láttam</th></tr>'; + echo '</thead>'; + + if (is_array($ADAT['nevsor']['nevek'])) + foreach ($ADAT['nevsor']['nevek'] as $diakId => $ITEM) { + $D = $DIAKHF[$diakId]; + echo '<tr>'; + echo '<td class="diakNev diakAdat" data-diakid="'.$diakId.'">'.$ITEM['diakNev'].'</td>'; + if (__NAPLOADMIN===true || __VEZETOSEG===true) echo '<td>'.$D['diakLattamDt'].'</td>'; + echo '<td colspan="2" class="'.ekezettelen($D['hazifeladatDiakStatus']).'">'.$D['hazifeladatDiakStatus'].'</td>'; + //echo '<td>'.$D['hazifeladatDiakMegjegyzes'].'</td>'; + + $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 '<td>'; + if ($D['hazifeladatDiakOrigFilename']!='') { + echo '<a href="'.$href.'" target="_blank">'.htmlspecialchars($D['hazifeladatDiakOrigFilename']).'</a> <span class="icon-paper-clip"></span>'; + } + echo '</td>'; + echo '<td style="text-align: center">'; +// if ($ADAT['hazifeladatDiak']['hazifeladatDiakStatus']=='kész') { + if (__TANAR===true && __USERTANARID==$ADAT['oraAdat']['ki']) { + if ($D['tanarLattamDt']=='') { + echo '<button type="submit" name="lattam[]" value="'.$diakId.'" class="btnLattamStatusz"><span class="icon-ok-sign"></span> láttam!</button>'; + } else { + echo '<button type="submit" name="megsemlattam[]" value="'.$diakId.'" class="btnLattamStatusz lattam"><span class="icon-ok-sign"></span> láttam.</button>'; + } + } else { + if ($D['tanarLattamDt']!='') {echo '<span class="icon-ok-sign" style="color:lightblue"></span>';} + } +// } + echo '</td>'; + echo '</tr>'; + } + echo '</table>'; + echo formEnd(); + + } + + function putHazifeladatDiakOrig($ADAT) { + + if (count($ADAT['hazifeladatDiak'])==0) return false; + echo formBegin(); echo '<input type="hidden" name="action" value="lattam" />'; echo '<input type="hidden" name="hazifeladatId" value="'.$ADAT['hazifeladatId'].'" />'; echo '<table class="hazifeladatDiak" cellpadding="1" cellspacing="1">'; echo '<thead>'; - echo '<tr><th>diák</th><th>látta</th><th colspan="2">státusz</th><th colspan="1">csatolmány</th><th>láttam</th></tr>'; + if (__NAPLOADMIN===true || __VEZETOSEG===true) + echo '<tr><th>diák</th><th>látta</th><th colspan="2">státusz</th><th colspan="1">csatolmány</th><th>láttam</th></tr>'; + else + echo '<tr><th>diák</th><th colspan="2">státusz</th><th colspan="1">csatolmány</th><th>láttam</th></tr>'; echo '</thead>'; for ($i=0; $i<count($ADAT['hazifeladatDiak']); $i++) { $D = $ADAT['hazifeladatDiak'][$i]; echo '<tr>'; echo '<td class="diakNev diakAdat" data-diakid="'.$D['diakId'].'">'.$D['diakNev'].'</td>'; - echo '<td>'.$D['diakLattamDt'].'</td>'; + if (__NAPLOADMIN===true || __VEZETOSEG===true) echo '<td>'.$D['diakLattamDt'].'</td>'; echo '<td>'.$D['hazifeladatDiakStatus'].'</td>'; echo '<td>'.$D['hazifeladatDiakMegjegyzes'].'</td>'; @@ -198,6 +272,7 @@ } echo '</table>'; echo formEnd(); + } ?> |