123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- body.on('click','#quitAccount',function(){QuitAccount(this);});
- function EditJobs(obj, job_id) {
- for (var i=0;i<obj.parentElement.children.length; i++)
- {
- obj.parentElement.children[i].disabled = false;
- }
- FillTaskTypes(job_id);
- }
- function FillTaskTypes(job_id) {
- var alltasktypescont = document.getElementById("alltasktypescont");
- var allttselect = alltasktypescont.children[0];
- var divEl = document.getElementById("jobid_"+job_id);
- var k = 0;
- for (var i=1; i< divEl.children.length; i++)
- {
- var selectEl = divEl.children[i];
- if (selectEl.tagName == "SELECT")
- {
- var sel = selectEl.options[selectEl.selectedIndex].value;
- selectEl.innerHTML = allttselect.innerHTML;
- for (var g=0; g < selectEl.options.length; g++) {
- if (selectEl.options[g].value === sel) {
- selectEl.options[g].setAttribute('selected', true);
- }
- }
- k++;
- }
- }
- var e=document.querySelectorAll('option')
- e.forEach(x=>{
- 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 += '<b>Основная: </b>' + $(".data_pos_"+ r +"_0 option:selected").text() + '. ';
- }
- if ( 0 < countSubJob) {
- jobsString += '<b>Основная: </b>' + $(".data_pos_"+ r +"_0 option:selected").text() + '. ';
- jobsString += '<b>Замещающая: </b>';
- $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);
- }
-
- });
|