1. JavaScript / Говнокод #28842

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    // ******************************************************************************************************
    function ch_new_nav()
    {
    	
    if((document.getElementById('navig_dat').value.length==10)&&(document.getElementById('navig_smen').value>0)&&(document.getElementById('sel_res_div').value>0))
    	{
    		
    		 
    		current_resource_id = document.getElementById('val_res_new_nav').getAttribute('data-user-id');
    
    		document.getElementById('cur_res_pred_op').src='index.php?do=show&formid=159&p0='+document.getElementById('navig_dat').value.substr(0,4)+document.getElementById('navig_dat').value.substr(5,2)+document.getElementById('navig_dat').value.substr(8,2)+'&p1='+document.getElementById('navig_smen').value+'&p2='+document.getElementById('sel_res_div').value + '&current_resource_id='+current_resource_id;
    		document.getElementById('cur_res_pred_op').style.display='block';
    		
    	//	$("#vpdiv").animate({scrollTop:$('#cur_res_pred_op').offset().top+"px"});
    
    		document.getElementById('nav_tekysh_1').innerText = document.getElementById('navig_dat').value.substr(8,2)+'.'+document.getElementById('navig_dat').value.substr(5,2)+'.'+document.getElementById('navig_dat').value.substr(0,4);
    		document.getElementById('nav_tekysh_2').innerText = document.getElementById('navig_smen').value;
    		document.getElementById('nav_tekysh_3').innerText = document.getElementById('val_res_new_nav').value;
    		document.getElementById('nav_tekysh_4').innerText = document.getElementById('sel_res_div').value;
    		document.getElementById('nav_tekysh_1').name = document.getElementById('navig_dat').value.substr(0,4)+document.getElementById('navig_dat').value.substr(5,2)+document.getElementById('navig_dat').value.substr(8,2);
    		document.getElementById('nav_tekysh_2').name = document.getElementById('navig_smen').value;
    		document.getElementById('nav_tekysh_3').name = document.getElementById('sel_res_div').value;
    
    		var spl_op_res = arr_oprs_c_r_2[document.getElementById('sel_res_div').value].split('|');
    		var spl_op_res_arr = [];
    
    		for (var spl_f_ar=0; spl_f_ar<spl_op_res.length; spl_f_ar++)
    			spl_op_res_arr[spl_op_res[spl_f_ar]] = spl_op_res[spl_f_ar];
    
    		document.getElementById('park_sel_cur_res').innerHTML='<option value="0" selected>Получение списка</option>';
    		document.getElementById('park_sel_cur_res').setAttribute('onchange', 'check_sel_park_pr(this.value)');
    		vote3('full_plan_sz_ch_park.php?p1='+document.getElementById('sel_res_div').value);
    
    
    		for (var td_c_pr=0; td_c_pr<document.getElementsByName('pr_cur_r_op').length; td_c_pr++)
    		{
    			var split_rgb_obj = document.getElementsByName('pr_cur_r_park')[td_c_pr].parentNode.style.background;
    			var split_rgb_obj_repl = split_rgb_obj.replace('rgb(','');
    			split_rgb_obj_repl = split_rgb_obj_repl.replace(')','');
    			split_rgb_obj_repl = split_rgb_obj_repl.replace(' ','');
    			split_rgb_obj_repl = split_rgb_obj_repl.replace(' ','');
    			split_rgb_obj_repl = split_rgb_obj_repl.replace(' ','');
    			split_rgb_obj_repl = split_rgb_obj_repl.split(',');
    
    			if ((split_rgb_obj_repl[0]=='221')&&(split_rgb_obj_repl[1]=='255')&&(split_rgb_obj_repl[2]=='221'))
    				{
    					document.getElementsByName('pr_cur_r_op')[td_c_pr].style.background='#ddffdd';
    					document.getElementsByName('pr_cur_r_park')[td_c_pr].style.background='#ddffdd';
    				}
    					else
    						{
    							document.getElementsByName('pr_cur_r_op')[td_c_pr].style.background='#fff';
    							document.getElementsByName('pr_cur_r_park')[td_c_pr].style.background='#fff';
    						}
    
    			if (document.getElementsByName('pr_cur_r_op')[td_c_pr].parentNode.cells[8].innerHTML.indexOf('<img') !== -1)
    			{
    				var id_op_add_ind_0 = document.getElementsByName('pr_cur_r_op')[td_c_pr].parentNode.cells[8].getElementsByTagName('a')[0].getAttribute('onclick').indexOf('del_op_in_sz');
    				var id_op_add_ind = document.getElementsByName('pr_cur_r_op')[td_c_pr].parentNode.cells[8].getElementsByTagName('a')[0].getAttribute('onclick').indexOf('(',id_op_add_ind_0);
    				var id_op_add_ind_1 = document.getElementsByName('pr_cur_r_op')[td_c_pr].parentNode.cells[8].getElementsByTagName('a')[0].getAttribute('onclick').indexOf(',',id_op_add_ind);
    				var id_op_add_ind_2 = document.getElementsByName('pr_cur_r_op')[td_c_pr].parentNode.cells[8].getElementsByTagName('a')[0].getAttribute('onclick').substr((id_op_add_ind+1),(id_op_add_ind_1-id_op_add_ind-1));
    				document.getElementsByName('pr_cur_r_op')[td_c_pr].parentNode.cells[8].getElementsByTagName('a')[0].innerHTML='<b name="pr_cur_r_op_b">>>></b>';
    				document.getElementsByName('pr_cur_r_op')[td_c_pr].parentNode.cells[8].getElementsByTagName('a')[0].setAttribute('onclick','add_op_in_sz('+id_op_add_ind_2+',this)');
    			}
    
    			document.getElementsByName('pr_cur_r_op_b')[td_c_pr].setAttribute('style','font-size:100%; color:#23609E;');
    			
    			if (spl_op_res_arr[document.getElementsByName('pr_cur_r_op')[td_c_pr].id.substr(9)])
    			{
    				document.getElementsByName('pr_cur_r_op')[td_c_pr].style.background='#99ff99';
    				document.getElementsByName('pr_cur_r_op_b')[td_c_pr].setAttribute('style','font-size:150%; color:#13BD13;');
    			}
    		} // for (var td_c_pr=0; td_c_pr<document.getElementsByName('pr_cur_r_op').length; td_c_pr++)
    		
    	} // if((document.getElementById('navig_dat').value.length==10)&&(document.getElementById('navig_smen').value>0)&&(document.getElementById('sel_res_div').value>0))
    	else
    		alert('Выберите дату, смену, ресурс!');
    } // function ch_new_nav()

    Запостил: kib0rg, 06 Сентября 2023

    Комментарии (0) RSS

    Добавить комментарий

    Ошибка компиляции комментария:
    1. Гости могут высказаться только во вторник, пятницу или субботу
    ava Где здесь C++, guest?!
    А не использовать ли нам bbcode?
    • [b]жирный[/b] — жирный
    • [i]курсив[/i] — курсив
    • [u]подчеркнутый[/u] — подчеркнутый
    • [s]перечеркнутый[/s] — перечеркнутый
    • [blink]мигающий[/blink] — мигающий
    • [color=red]цвет[/color] — цвет (подробнее)
    • [size=20]размер[/size] — размер (подробнее)
    • [code=<language>]some code[/code] (подробнее)
    Проверочный код