Current Path : /data/web/virtuals/51568/virtual/www/subdom/agenda/php/zapisy/ |
Current File : /data/web/virtuals/51568/virtual/www/subdom/agenda/php/zapisy/JednaniZaznamy.min.js |
function jednaniZaznamy(){$.ajax({url:"php/zapisy/ajaxJednaniZaznamy.php",type:"POST",dataType:"HTML",data:{data:JSON.stringify({command:"jednaniZaznamy"})},success:function(result){$("#div-supliky-table").html(result),$("#div-dialogy").html("")}})}function jednaniZaznamyDetail(idjednani){$('[id^="jednaniRadek"]').css("background-color","initial"),$.ajax({url:"php/zapisy/ajaxJednaniZaznamy.php",type:"POST",dataType:"HTML",data:{data:JSON.stringify({command:"jednaniZaznamyDetail",idjednani:idjednani})},success:function(result){$("#jednaniRadek"+idjednani).css("background-color","#cadefc"),$("#div-dialogy").html(result)}})}function zaznamyDuvody(){$('[id^="jednaniRadek"]').css("background-color","initial"),$.ajax({url:"php/zapisy/ajaxJednaniZaznamy.php",type:"POST",dataType:"HTML",data:{data:JSON.stringify({command:"zaznamyDuvody"})},success:function(result){$("#div-dialogy").html(result)}})}function duvodAktivni(id){$.ajax({url:"php/zapisy/ajaxJednaniZaznamy.php",type:"POST",dataType:"HTML",data:{data:JSON.stringify({command:"duvodAktivni",id:id})},success:function(result){let aktivni="1"==result?'<i class="far fa-eye"></i>':'<i class="far fa-eye-slash"></i>';$("#polozka-aktivni"+id).html(aktivni)}})}function duvodEdituj(id){let duvod,editace=`<td>\n <input type="text" id="duvod-edit${id}" value="${$("#duvod-duvod"+id).text()}" class="w-100 mt-1">\n </td>\n <td><button class="btn btn-outline-success rounded-0" onclick="duvodEditujUloz(${id})"><i class="far fa-save"></i></button></td> \n <td><button class="btn btn-outline-warning rounded-0" onclick="duvodEditujCancel(${id})"><i class="fas fa-undo"></i></button></td>`;$("#duvod-radek"+id).html(editace)}function duvodEditujCancel(id){$.ajax({url:"php/zapisy/ajaxJednaniZaznamy.php",type:"POST",dataType:"HTML",data:{data:JSON.stringify({command:"duvodEditujCancel",id:id})},success:function(result){$("#duvod-radek"+id).html(result)}})}function duvodEditujUloz(id){let duvod=$("#duvod-edit"+id).val();""==duvod.trim()?alert("Důvod nenech prázdný!"):$.ajax({url:"php/zapisy/ajaxJednaniZaznamy.php",type:"POST",dataType:"HTML",data:{data:JSON.stringify({command:"duvodEditujUloz",id:id,duvod:duvod})},success:function(result){duvodEditujCancel(id)}})}function duvodNovy(){$("#duvod-novy-nazev").val(""),$("#duvod-novy").removeClass("d-none")}function duvodNovyCancel(){$("#duvod-novy").addClass("d-none")}function duvodNovyUloz(){let duvod=$("#duvod-novy-nazev").val();""==duvod.trim()?alert("Důvod nenech prázdný!"):$.ajax({url:"php/zapisy/ajaxJednaniZaznamy.php",type:"POST",dataType:"HTML",data:{data:JSON.stringify({command:"duvodNovyUloz",duvod:duvod})},success:function(result){$("#div-dialogy").html(result)}})}function jednaniZaznamyTridit(trideni){$.ajax({url:"php/zapisy/ajaxJednaniZaznamy.php",type:"POST",dataType:"HTML",data:{data:JSON.stringify({command:"jednaniZaznamyTridit",trideni:trideni})},success:function(result){$("#id-zaznamy-table").html(result)}})}function jednaniZaznamySmazatDotaz(idjednani){}