body.on('click','#quitAccount',function(){QuitAccount(this);}); function EditJobs(obj, job_id) { for (var i=0;i{ if(x.textContent.length>200) x.textContent=x.textContent.substring(0,200)+'...'; }) } function ReceiveTasktypes(data) { var jsn = JSON.parse(data); var divEl = document.getElementById("jobid_"+jsn.jobid); var k = 0; for (var i=1; i< divEl.children.length; i++) { var selectEl = divEl.children[i]; if (selectEl.tagName == "SELECT") { selectEl.innerHTML = jsn.tasktypes[k].html; k++; } } var e=document.querySelectorAll('option') e.forEach(x=>{ if(x.textContent.length>200) x.textContent=x.textContent.substring(0,200)+'...'; }) } function ChangeBasic(val, accid) { var dict = new Object(); //or Map() dict[ 'basic_count' ] = val; dict[ 'accid' ] = accid; sendAjax('result', dict, Reload); } function Reload() { window.location.reload(); } function QuitAccount(obj) { var dict = new Object(); //or Map() dict[ 'quitaccount' ] = obj.title; //sendAjax('', dict, Reload); sendAjax('', dict, Reload); } function ChangeJob(id, jobvalue, index, previous) { var dict = new Object(); //or Map() dict[ 'new' ] = 4; dict[ 'newjob_accid' ] = id; dict[ 'jobvalue' ] = jobvalue; dict[ 'index' ] = index; dict[ 'previous' ] = previous; sendAjax('result', dict, Reload); } function downloadStaff(){ location.href="staffPDF.php"; } $( document ).ready(function() { var Toggled = false; $('.button_staff_toggle').click(function(){ var selector_staff = $(this).attr('data'); $("." + selector_staff ).slideToggle("slow"); $("." + selector_staff + "_top").slideToggle("slow"); if(Toggled==false){$('.button_sou_toggle').html('Свернуть'); Toggled=true; } else {$('.button_sou_toggle').html('Развернуть'); Toggled=false;} return false; }); var data = {}; $('#form6').change(function(){ /* $('#form6').find ('select').each(function() { data[$(this).attr('name')] = $(this).val(); }); */ $(this).submit(); //location.href="index.php?act=staff&order="+ data.asc +"&kind=" + data.kind + "&shift_filter=" + data.shift; }); $( function() { $( "#tabs" ).tabs(); } ); var accountsEntityCount = $('#accountsEntityCount').attr('data_pos'); for (var r = 1; r <= accountsEntityCount; r++) { var countSubJob = $(".data_pos_"+ r +"_0").attr('data'); //console.log(countSubJob); var jobsString = ''; if ( 0 == countSubJob) { jobsString += 'Основная: ' + $(".data_pos_"+ r +"_0 option:selected").text() + '. '; } if ( 0 < countSubJob) { jobsString += 'Основная: ' + $(".data_pos_"+ r +"_0 option:selected").text() + '. '; jobsString += 'Замещающая: '; $point = ', '; for (var i = 1; i <= countSubJob; i++) { if ( i == countSubJob){ $point = '.'; } jobsString += $(".data_pos_"+ r +"_" + i + " option:selected").text() + $point; } } $("#data_pos_top_" + r ).html(jobsString); } });