diff options
author | M.Gergo | 2020-03-24 18:56:00 +0100 |
---|---|---|
committer | M.Gergo | 2020-03-24 18:56:00 +0100 |
commit | 2f93e272054ed126be63db31d33e90f51f09d30e (patch) | |
tree | 0344db4e179a6aa9ccf2503d6d6ca25fa39e53d0 /mayor-orig/mayor-naplo/www | |
parent | 351ace3031cf063cef346027ae209d218225242a (diff) | |
download | mayor-rev4633.tar.gz mayor-rev4633.zip |
Rev: 4633rev4633
Diffstat (limited to 'mayor-orig/mayor-naplo/www')
4 files changed, 36 insertions, 9 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 d0f4cb6b..a26b39fa 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 @@ -55,14 +55,14 @@ $ADAT['oraAdat'] = getOraadatById($oraId); if (__TANAR===true && $action=='hazifeladatBeiras') { - + $hazifeladatFeltoltesEngedely = readVariable($_POST['hazifeladatFeltoltesEngedely'],'id',0); if ($hazifeladatId>0) { // update - $q = "UPDATE oraHazifeladat set hazifeladatLeiras='%s' WHERE hazifeladatId=%u"; - $values = array($ADAT['hazifeladatLeiras'],$ADAT['hazifeladatId']); + $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)); } elseif ($oraId>0) { // insert - $q = "INSERT IGNORE INTO oraHazifeladat (hazifeladatLeiras,oraId) VALUES ('%s',%u)"; - $values = array($ADAT['hazifeladatLeiras'],$ADAT['oraId']); + $q = "INSERT IGNORE INTO oraHazifeladat (hazifeladatLeiras,oraId,hazifeladatFeltoltesEngedely) VALUES ('%s',%u,%u)"; + $values = array($ADAT['hazifeladatLeiras'],$ADAT['oraId'],$hazifeladatFeltoltesEngedely); $hazifeladatId = db_query($q, array('modul'=>'naplo','result'=>'insert','values'=>$values)); } 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 1169d008..127dfa75 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 @@ -24,8 +24,14 @@ form button.btnHfStatusz:hover span { color: white; } form button.btnHfStatusz.kesz:hover span { color: orange } + #hazifeladatFeltoltesEngedely { + padding:15px 0px 15px 0px; margin:5px 0px; text-align:center; border-radius:2px; background-color:#eee + } + #hazifeladatFeltoltesEngedely.engedelyezve { background-color: #c8e6c9; } - + input.btnSubmit { + margin: 5px auto 5px auto; + } /*---*/ form button.btnLattamStatusz { 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 a8540faa..cddfd0e8 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 @@ -36,8 +36,9 @@ echo '<fieldset class="adatok '.$_class.'"><legend>'._HAZIFELTOLTES.'</legend>'."\n"; echo formBegin(array('enctype'=>'multipart/form-data')); - if (FILE_UPLOAD_ENABLED===false || $ADAT['hazifeladatDiak']['tanarLattamDt']!='' || $ADAT['hazifeladatDiak']['hazifeladatDiakStatus']=='kész') { + if (FILE_UPLOAD_ENABLED===false || $ADAT['hazifeladatAdat']['hazifeladatFeltoltesEngedely'] == 0 || $ADAT['hazifeladatDiak']['tanarLattamDt']!='' || $ADAT['hazifeladatDiak']['hazifeladatDiakStatus']=='kész') { if (FILE_UPLOAD_ENABLED===false) $mert = ', mert a feltöltés le van tiltva'; + elseif ($ADAT['hazifeladatAdat']['hazifeladatFeltoltesEngedely']==0) $mert = ', mert a tanár nem kért ide csatolt házi feladatot'; elseif ($ADAT['hazifeladatDiak']['tanarLattamDt']!='') $mert = ', mert már láttamozta a tanár'; elseif ($ADAT['hazifeladatDiak']['hazifeladatDiakStatus']=='kész') $mert = ', mert már késznek jelölted a feladatot'; echo '<p style="color:#888">nem tudsz új filet feltölteni'.$mert.'</p>'; @@ -131,11 +132,19 @@ removeButtons: 'Cut,Copy,Paste,PasteText,PasteFromWord,Anchor,Underline,Strike,SpecialChar,HorizontalRule' }); </script>"; - echo '<input type="submit">'; + + $_CHK = ($ADAT['hazifeladatAdat']['hazifeladatFeltoltesEngedely']==1) ? 'checked="checked"':''; + $_cls = ($ADAT['hazifeladatAdat']['hazifeladatFeltoltesEngedely']==1) ? 'class="engedelyezve"':''; + echo '<div id="hazifeladatFeltoltesEngedely" '.$_cls.'>'; + echo '<input type="checkbox" name="hazifeladatFeltoltesEngedely" id="hazifeladatFeltoltesEngedelyChk" value="1" '.$_CHK.'/>'; + echo '<label for="hazifeladatFeltoltesEngedelyChk">Diák/Szülő házi feladat csatolás engedélyezve</label>'; + echo '</div>'; + echo '<div style="width:100%; margin:auto; text-align:center;">'; + echo '<input type="submit" class="btnSubmit">'; + echo '</div>'; echo '</fieldset>'."\n"; if ($skin != 'ajax') formEnd(); - if (count($ADAT['hazifeladatDiak'])>0) { echo '<fieldset class="adatok">'; echo '<legend>Visszajelzések</legend>'; diff --git a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/javascript/haladasi/hazifeladat.jquery.min.js b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/javascript/haladasi/hazifeladat.jquery.min.js new file mode 100644 index 00000000..4d225a86 --- /dev/null +++ b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/javascript/haladasi/hazifeladat.jquery.min.js @@ -0,0 +1,12 @@ +$(function() { + + $('input[type="checkbox"]').click(function(){ + if($(this).is(":checked")){ + $('#hazifeladatFeltoltesEngedely').addClass('engedelyezve'); + } + else if($(this).is(":not(:checked)")){ + $('#hazifeladatFeltoltesEngedely').removeClass('engedelyezve'); + } + }); + +});
\ No newline at end of file |