1. Список говнокодов пользователя kib0rg

    Всего: 10

  2. 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)
  3. PHP / Говнокод #28417

    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
    $result5 = dbquery("SELECT MAX(ID) FROM okb_db_itrzadan_statuses where ((ID_edo='".$render_row['ID']."') and (STATUS='Выполнено')) ");
    $name5 = mysql_fetch_row($result5);
    $total5 = $name5[0];
    $result5 = dbquery("SELECT * FROM okb_db_itrzadan_statuses where (ID='".$total5."') ");
    $name5 = mysql_fetch_array($result5);
    $result6 = dbquery("SELECT * FROM okb_db_itrzadan where (ID='".$render_row['ID']."') ");
    $name6 = mysql_fetch_array($result6);
    
    //// дни
    
    if ($name6['DATE_PLAN'][6] == 0) $name6_6 = $name6['DATE_PLAN'][7];
    if ($name6['DATE_PLAN'][6] == 1) $name6_6 = $name6['DATE_PLAN'][7] + 10;
    if ($name6['DATE_PLAN'][6] == 2) $name6_6 = $name6['DATE_PLAN'][7] + 20;
    if ($name6['DATE_PLAN'][6] == 3) $name6_6 = $name6['DATE_PLAN'][7] + 30;
    
    if ($name5['DATA'][6] == 0) $name5_6 = $name5['DATA'][7];
    if ($name5['DATA'][6] == 1) $name5_6 = $name5['DATA'][7] + 10;
    if ($name5['DATA'][6] == 2) $name5_6 = $name5['DATA'][7] + 20;
    if ($name5['DATA'][6] == 3) $name5_6 = $name5['DATA'][7] + 30;
    
    //// мес¤цы
    if ($name6['DATE_PLAN'][5] == 1) $name6_d = 31;
    if ($name6['DATE_PLAN'][5] == 2) $name6_d = 59;
    if ($name6['DATE_PLAN'][5] == 3) $name6_d = 90;
    if ($name6['DATE_PLAN'][5] == 4) $name6_d = 120;
    if ($name6['DATE_PLAN'][5] == 5) $name6_d = 151;
    if ($name6['DATE_PLAN'][5] == 6) $name6_d = 181;
    if ($name6['DATE_PLAN'][5] == 7) $name6_d = 212;
    if ($name6['DATE_PLAN'][5] == 8) $name6_d = 243;
    if ($name6['DATE_PLAN'][5] == 9) $name6_d = 273;
    if (($name6['DATE_PLAN'][5] == 0) and ($name6['DATE_PLAN'][4] == 1)) $name6_d = 304;
    if (($name6['DATE_PLAN'][5] == 1) and ($name6['DATE_PLAN'][4] == 1)) $name6_d = 334;
    if (($name6['DATE_PLAN'][5] == 2) and ($name6['DATE_PLAN'][4] == 1)) $name6_d = 365;
    
    if ($name5['DATA'][5] == 1) $name5_d = 31;
    if ($name5['DATA'][5] == 2) $name5_d = 62;
    if ($name5['DATA'][5] == 3) $name5_d = 90;
    if ($name5['DATA'][5] == 4) $name5_d = 121;
    if ($name5['DATA'][5] == 5) $name5_d = 151;
    if ($name5['DATA'][5] == 6) $name5_d = 182;
    if ($name5['DATA'][5] == 7) $name5_d = 212;
    if ($name5['DATA'][5] == 8) $name5_d = 243;
    if ($name5['DATA'][5] == 9) $name5_d = 274;
    if (($name5['DATA'][5] == 0) and ($name5['DATA'][4] == 1)) $name5_d = 304;
    if (($name5['DATA'][5] == 1) and ($name5['DATA'][4] == 1)) $name5_d = 335;
    if (($name5['DATA'][5] == 2) and ($name5['DATA'][4] == 1)) $name5_d = 365;
    
    //// столетие
    if ($name6['DATE_PLAN'][2] == 0) $name6_2 = $name6['DATE_PLAN'][3];
    if ($name6['DATE_PLAN'][2] == 1) $name6_2 = $name6['DATE_PLAN'][3] + 10;
    if ($name6['DATE_PLAN'][2] == 2) $name6_2 = $name6['DATE_PLAN'][3] + 20;
    if ($name6['DATE_PLAN'][2] == 3) $name6_2 = $name6['DATE_PLAN'][3] + 30;
    if ($name6['DATE_PLAN'][2] == 4) $name6_2 = $name6['DATE_PLAN'][3] + 40;
    if ($name6['DATE_PLAN'][2] == 5) $name6_2 = $name6['DATE_PLAN'][3] + 50;
    if ($name6['DATE_PLAN'][2] == 6) $name6_2 = $name6['DATE_PLAN'][3] + 60;
    if ($name6['DATE_PLAN'][2] == 7) $name6_2 = $name6['DATE_PLAN'][3] + 70;
    if ($name6['DATE_PLAN'][2] == 8) $name6_2 = $name6['DATE_PLAN'][3] + 80;
    if ($name6['DATE_PLAN'][2] == 9) $name6_2 = $name6['DATE_PLAN'][3] + 90;
    
    if ($name5['DATA'][2] == 0) $name5_2 = $name5['DATA'][3];
    if ($name5['DATA'][2] == 1) $name5_2 = $name5['DATA'][3] + 10;
    if ($name5['DATA'][2] == 2) $name5_2 = $name5['DATA'][3] + 20;
    if ($name5['DATA'][2] == 3) $name5_2 = $name5['DATA'][3] + 30;
    if ($name5['DATA'][2] == 4) $name5_2 = $name5['DATA'][3] + 40;
    if ($name5['DATA'][2] == 5) $name5_2 = $name5['DATA'][3] + 50;
    if ($name5['DATA'][2] == 6) $name5_2 = $name5['DATA'][3] + 60;
    if ($name5['DATA'][2] == 7) $name5_2 = $name5['DATA'][3] + 70;
    if ($name5['DATA'][2] == 8) $name5_2 = $name5['DATA'][3] + 80;
    if ($name5['DATA'][2] == 9) $name5_2 = $name5['DATA'][3] + 90;
    
    echo (($name5_6-$name6_6)+($name5_d-$name6_d-1))+($name5_2*365-$name6_2*365)+1;

    kib0rg, 13 Октября 2022

    Комментарии (10)
  4. PHP / Говнокод #28262

    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
    function IntToDate2($x) {
    		$dd = $x*1;
    		$dd_Y = floor($dd/10000);
    		$dd_M = floor(($dd-($dd_Y*10000))/100);
    		$dd_D = $dd-($dd_Y*10000)-($dd_M*100);
    		if ($dd_M<10) $dd_M = "0".$dd_M;
    		if ($dd_D<10) $dd_D = "0".$dd_D;
    		$res = $dd_D.".".$dd_M.".".$dd_Y;
    		if ($dd == 0) $res = "";
    		return $res;
    	}
    
    	
    	function IntToDate($x) {
    		$year = substr( $x, 0, 4 );
    		$month = substr( $x, 4, 2 );    
    		$day = substr( $x, 6, 2 );
    		return $x == 0 ? '' : "$day.$month.$year";
    	}
    
    	
    	function DateToInt2($x) {
    		$dd = explode(".",$x);
    		if (count($dd)>2) {
    			$dd = $dd[0]*1+$dd[1]*100+$dd[2]*10000;
    		} else {
    			$dd = 0;
    		}
    		return $dd;
    	}
    
    	
    		function DateToInt($x) 
    	{
    	  $dd = explode('.',$x);
    	  if (count($dd)>2) 
    		$result = $dd[2].$dd[1].$dd[0];
    		else 
    		  $result = 0;
    
    	  return $result ;
    	}
    		
    		
    	function StrDate($x) {
    		global $MM_Name2;
    
    		$dd = $x*1;
    		$dd_Y = floor($dd/10000);
    		$dd_M = floor(($dd-($dd_Y*10000))/100);
    		$dd_D = $dd-($dd_Y*10000)-($dd_M*100);
    		if ($dd_D<10) $dd_D = "0".$dd_D;
    
    		return $dd_D." ".$MM_Name2[$dd_M]." ".$dd_Y;
    	}
    
    	function StrMonth($x) {
    		global $MM_Name;
    
    		$dd = $x*1;
    		$dd_Y = floor($dd/10000);
    		$dd_M = floor(($dd-($dd_Y*10000))/100);
    		$dd_D = $dd-($dd_Y*10000)-($dd_M*100);
    		if ($dd_D<10) $dd_D = "0".$dd_D;
    
    		return $MM_Name[$dd_M]." ".$dd_Y;
    	}
    
    	$theday = mktime (0,0,0,date("m") ,date("d") ,date("Y"));
    	$today_0=date("d.m.Y",$theday);
    	$today_1=date("d.m.Y",$theday+(1*86400));
    	$today_7=date("d.m.Y",$theday+(7*86400));

    kib0rg, 30 Июня 2022

    Комментарии (0)
  5. PHP / Говнокод #28261

    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
    $URL1 = "db_edit.php?db=$db&field=$field&id=".$row['ID']."&setchbx=0&value=";
    			$URL2 = "db_edit.php?db=$db&field=$field&id=".$row['ID']."&setchbx=1&value=";
    			$Name1 = $Name."_0_".$row['ID'];
    			$Name2 = $Name."_1_".$row['ID'];
    			$NamePP = $Name."_pp_".$row['ID'];
    
    			$values = $row[$field];
    			if ($values=="") $values ="0|";
    			$values = explode("|",$values);
    			$numval = count($values)-1;
    			$lastval = $values[$numval];
    			if ($lastval=="") $lastval = "##";
    			$lastval = explode("#",$lastval);			
    
    			$val = $lastval[2];
    			$sval = $val;
    			if ($val=="") $sval = "---";
    			if ($val=="") $val = $today_0;
    			$dvv = $val;
    			$val = explode(".",$val);
    
    			$bgcl = "#fff";
    			$bcl = "#fff";
    			if ($lastval[2]=="") {
    				$bgcl = "#fff";
    				$bcl = "#fff";
    			} else {
    				
    				if (DateToInt($today_7)>DateToInt($lastval[2])) $bgcl = "#fee";
    				if (DateToInt($today_7)>DateToInt($lastval[2])) $bcl = "#f44";
    				if (DateToInt($today_1)>DateToInt($lastval[2])) $bgcl = "#faa";
    				if (DateToInt($today_1)>DateToInt($lastval[2])) $bcl = "#f44";
    				if (DateToInt($today_0)>DateToInt($lastval[2])) $bgcl = "#f44";
    				if (DateToInt($today_0)>DateToInt($lastval[2])) $bcl = "#f44";
    			}
    			if ($values[0]=="1") {
    				$bgcl = "#afa";
    				$bcl = "#afa";
    			}

    kib0rg, 30 Июня 2022

    Комментарии (0)
  6. PHP / Говнокод #28133

    +1

    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
    $ss_n = 0;
    			$ss_nf = 0;
    			$ss_f = 0;
    			$ss_n_pl = 0;
    			$ss_nf_pl = 0;
    			$ss_f_pl = 0;
    			$ids_count = count($ids);
    		for ($i=0;$i < $ids_count;$i++) {
    			$key = $w_dates[$z]."|1|".$ids[$i];
    			$ss_n += $w_n_s[$key]*1;
    			$ss_nf += $w_nf_s[$key]*1;
    			$ss_f += $w_f_s[$key]*1;
    			$key = $w_dates[$z]."|2|".$ids[$i];
    			$ss_n += $w_n_s[$key]*1;
    			$ss_nf += $w_nf_s[$key]*1;
    			$ss_f += $w_f_s[$key]*1;
    			$key = $w_dates[$z]."|3|".$ids[$i];
    			$ss_n += $w_n_s[$key]*1;
    			$ss_nf += $w_nf_s[$key]*1;
    			$ss_f += $w_f_s[$key]*1;
    		}
    		$ids_count = count($ids);
    		for ($i=0;$i < $ids_count;$i++) {
    			$key = $w_dates[$z]."|1|".$ids[$i];
    			$ss_n_pl = $ss_n_pl + $w_n_s_pl[$key]*1;
    			$ss_nf_pl = $ss_nf_pl + $w_nf_s_pl[$key]*1;
    			$ss_f_pl = $ss_f_pl + $w_f_s_pl[$key]*1;
    			$key = $w_dates[$z]."|2|".$ids[$i];
    			$ss_n_pl = $ss_n_pl + $w_n_s_pl[$key]*1;
    			$ss_nf_pl = $ss_nf_pl + $w_nf_s_pl[$key]*1;
    			$ss_f_pl = $ss_f_pl + $w_f_s_pl[$key]*1;
    			$key = $w_dates[$z]."|3|".$ids[$i];
    			$ss_n_pl = $ss_n_pl + $w_n_s_pl[$key]*1;
    			$ss_nf_pl = $ss_nf_pl + $w_nf_s_pl[$key]*1;
    			$ss_f_pl = $ss_f_pl + $w_f_s_pl[$key]*1;
    		}
    
    		echo "<td class='Field' rowspan='3' style='vertical-align: middle;'><b>".OutNF($ss_n,$ss_nf,$ss_f)."</b></td>\n";
    		echo "<td class='Field' rowspan='3' style='vertical-align: middle;'><b style='color:#aa0000;'>".OutNF($ss_n_pl,$ss_nf_pl,$ss_f_pl)."</b></td>\n";
    
    		echo "</tr><tr>";
    
    		////////////////////////////////////////////////////////////
    		echo "<td class='Field' width='40' style='vertical-align: middle;'><b>II</b></td>\n";
    			$s_n = 0;
    			$s_nf = 0;
    			$s_f = 0;
    			$s_n_pl = 0;
    			$s_nf_pl = 0;
    			$s_f_pl = 0;
    		for ($i=0;$i < count($ids);$i++) {
    			$key = $w_dates[$z]."|2|".$ids[$i];
    			$s_n = $s_n + $w_n_s[$key]*1;
    			$s_nf = $s_nf + $w_nf_s[$key]*1;
    			$s_f = $s_f + $w_f_s[$key]*1;
    			$s_n_pl = $s_n_pl + $w_n_s_pl[$key]*1;
    			$s_nf_pl = $s_nf_pl + $w_nf_s_pl[$key]*1;
    			$s_f_pl = $s_f_pl + $w_f_s_pl[$key]*1;
    			if ($edti_stat[$key]==1){
    				echo "<td class='Field'>".OutNF($w_n_s[$key],$w_nf_s[$key],$w_f_s[$key])."</td>\n";
    			}
    			if ($edti_stat[$key]==0){
    				$link_dat = explode("|", $key);
    				$link_dat2 = $link_dat[0];
    				$link_dat3 = $link_dat[1];
    				echo "<td class='Field'><a target='_bland' href='index.php?do=show&formid=64&p0=".$link_dat2."&p1=".$link_dat3."'><b style='color:#aa0000;'>".OutNF($w_n_s_pl[$key],$w_nf_s_pl[$key],$w_f_s_pl[$key])."</b></a></td>\n";
    			}
    		}
    		echo "<td class='Field'></td>\n";
    		echo "<td class='Field'><b>".OutNF($s_n,$s_nf,$s_f)."</b></td>\n";
    		echo "<td class='Field'></td>\n";
    		echo "<td class='Field'></td>\n";
    		echo "<td class='Field'><b style='color:#aa0000;'>".OutNF($s_n_pl,$s_nf_pl,$s_f_pl)."</b></td>\n";
    		echo "<td class='Field'></td>\n";
    		////////////////////////////////////////////////////////////

    kib0rg, 22 Апреля 2022

    Комментарии (1)
  7. PHP / Говнокод #28132

    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
    if ($arr_tbl_1[$key_1] !== $cur_vid){
    		$cur_vid_key = $key_1;
    		$cur_vid_w = $arr_tbl_1[$key_1];
    		$cur_v_ind = $cur_v_ind + 1;
    		while ($arr_tbl_1[$cur_vid_key] == $cur_vid_w){
    			$sum_cur_v_6 += (float)$arr_tbl_6[$cur_vid_key];
    			$sum_cur_v_7 += (float)$arr_tbl_7[$cur_vid_key];
    			$sum_cur_v_10 += (float)$arr_tbl_10[$cur_vid_key];
    			$cur_vid_key += 1;
    		}
    		if ($sum_cur_v_6==0) { $sum_cur_v_6_0 = 1;}else{ $sum_cur_v_6_0 = $sum_cur_v_6;}
    		if ($sum_cur_v_7==0) { $sum_cur_v_7_0 = 1;}else{ $sum_cur_v_7_0 = $sum_cur_v_7;}
    		if (strlen(substr(strstr($sum_cur_v_6, "."), 1))==0) { $tbl_1_6 = $sum_cur_v_6.".00";}
    		if (strlen(substr(strstr($sum_cur_v_6, "."), 1))==1) { $tbl_1_6 = $sum_cur_v_6."0";}
    		if (strlen(substr(strstr($sum_cur_v_6, "."), 1))==2) { $tbl_1_6 = $sum_cur_v_6;}
    		if (strlen(substr(strstr($sum_cur_v_6, "."), 1))>2) { $tbl_1_6 = number_format($sum_cur_v_6, 2, '.', '');}
    		if (strlen(substr(strstr($sum_cur_v_7, "."), 1))==0) { $tbl_1_7 = $sum_cur_v_7.".00";}
    		if (strlen(substr(strstr($sum_cur_v_7, "."), 1))==1) { $tbl_1_7 = $sum_cur_v_7."0";}
    		if (strlen(substr(strstr($sum_cur_v_7, "."), 1))==2) { $tbl_1_7 = $sum_cur_v_7;}
    		if (strlen(substr(strstr($sum_cur_v_7, "."), 1))>2) { $tbl_1_7 = number_format($sum_cur_v_7, 2, '.', '');}
    		if (strlen(substr(strstr(($sum_cur_v_6-$sum_cur_v_7), "."), 1))==0) { $tbl_1_8 = ($sum_cur_v_6-$sum_cur_v_7).".00";}
    		if (strlen(substr(strstr(($sum_cur_v_6-$sum_cur_v_7), "."), 1))==1) { $tbl_1_8 = ($sum_cur_v_6-$sum_cur_v_7)."0";}
    		if (strlen(substr(strstr(($sum_cur_v_6-$sum_cur_v_7), "."), 1))==2) { $tbl_1_8 = ($sum_cur_v_6-$sum_cur_v_7);}
    		if (strlen(substr(strstr(($sum_cur_v_6-$sum_cur_v_7), "."), 1))>2) { $tbl_1_8 = number_format(($sum_cur_v_6-$sum_cur_v_7), 2, '.', '');}
    		if (strlen(substr(strstr(($sum_cur_v_7/$sum_cur_v_6_0*100), "."), 1))==0) { $tbl_1_9 = ($sum_cur_v_7/$sum_cur_v_6_0*100).".00";}
    		if (strlen(substr(strstr(($sum_cur_v_7/$sum_cur_v_6_0*100), "."), 1))==1) { $tbl_1_9 = ($sum_cur_v_7/$sum_cur_v_6_0*100)."0";}
    		if (strlen(substr(strstr(($sum_cur_v_7/$sum_cur_v_6_0*100), "."), 1))==2) { $tbl_1_9 = ($sum_cur_v_7/$sum_cur_v_6_0*100);}
    		if (strlen(substr(strstr(($sum_cur_v_7/$sum_cur_v_6_0*100), "."), 1))>2) { $tbl_1_9 = number_format(($sum_cur_v_7/$sum_cur_v_6_0*100), 2, '.', '');}
    		if (strlen(substr(strstr($sum_cur_v_10, "."), 1))==0) { $tbl_1_10 = $sum_cur_v_10.".00";}
    		if (strlen(substr(strstr($sum_cur_v_10, "."), 1))==1) { $tbl_1_10 = $sum_cur_v_10."0";}
    		if (strlen(substr(strstr($sum_cur_v_10, "."), 1))==2) { $tbl_1_10 = $sum_cur_v_10;}
    		if (strlen(substr(strstr($sum_cur_v_10, "."), 1))>2) { $tbl_1_10 = number_format($sum_cur_v_10, 2, '.', '');}
    		if (strlen(substr(strstr(($sum_cur_v_10/$sum_cur_v_7_0), "."), 1))==0) { $tbl_1_11 = ($sum_cur_v_10/$sum_cur_v_7_0).".00";}
    		if (strlen(substr(strstr(($sum_cur_v_10/$sum_cur_v_7_0), "."), 1))==1) { $tbl_1_11 = ($sum_cur_v_10/$sum_cur_v_7_0)."0";}
    		if (strlen(substr(strstr(($sum_cur_v_10/$sum_cur_v_7_0), "."), 1))==2) { $tbl_1_11 = ($sum_cur_v_10/$sum_cur_v_7_0);}
    		if (strlen(substr(strstr(($sum_cur_v_10/$sum_cur_v_7_0), "."), 1))>2) { $tbl_1_11 = number_format(($sum_cur_v_10/$sum_cur_v_7_0), 2, '.', '');}
    		echo "<tr>
    		<td class='field' style='background:#CBDEF4;' colspan='5'><b class='not_tr' name='arr_tbl_1_".$cur_v_ind."' style='cursor:pointer; border:1px solid #000; border-radius:6px;' onclick='show_tr_1(this.getAttribute(\"name\"), this.getAttribute(\"class\"), this);'> + </b><b class='not_tr' name='arr_tbl_1_".$cur_v_ind."' style='display:none; cursor:pointer; border:1px solid #000; border-radius:6px;' onclick='show_tr_2(this.getAttribute(\"name\"), this.getAttribute(\"class\"), this);'> -  </b> ".$arr_tbl_1[$key_1]."</td>
    		<td name='max_numb_6' class='field' style='text-align:right; background:#CBDEF4;'>".$tbl_1_6."</td>
    		<td name='max_numb_7' class='field' style='text-align:right; background:#CBDEF4;'>".$tbl_1_7."</td>
    		<td name='max_numb_8' class='field' style='text-align:right; background:#CBDEF4;'>".$tbl_1_8."</td>
    		<td name='max_numb_9' class='field' style='text-align:right; background:#CBDEF4;'>".$tbl_1_9."</td>
    		<td name='max_numb_10' class='field' style='text-align:right; background:#CBDEF4;'>".$tbl_1_10."</td>
    		<td name='max_numb_11' class='field' style='text-align:right; background:#CBDEF4;'>".$tbl_1_11."</td>
    		</tr>";
    		$itog_sum_6 += $sum_cur_v_6;
    		$itog_sum_7 += $sum_cur_v_7;
    		$itog_sum_10 += $sum_cur_v_10;
    		
    		$tbl_1_6 = "";
    		$tbl_1_7 = "";
    		$tbl_1_8 = "";
    		$tbl_1_9 = "";
    		$tbl_1_10 = "";
    		$tbl_1_11 = "";
    		$sum_cur_v_6 = 0;
    		$sum_cur_v_7 = 0;
    		$sum_cur_v_10 = 0;
    	}

    kib0rg, 22 Апреля 2022

    Комментарии (1)
  8. JavaScript / Говнокод #27262

    0

    1. 001
    2. 002
    3. 003
    4. 004
    5. 005
    6. 006
    7. 007
    8. 008
    9. 009
    10. 010
    11. 011
    12. 012
    13. 013
    14. 014
    15. 015
    16. 016
    17. 017
    18. 018
    19. 019
    20. 020
    21. 021
    22. 022
    23. 023
    24. 024
    25. 025
    26. 026
    27. 027
    28. 028
    29. 029
    30. 030
    31. 031
    32. 032
    33. 033
    34. 034
    35. 035
    36. 036
    37. 037
    38. 038
    39. 039
    40. 040
    41. 041
    42. 042
    43. 043
    44. 044
    45. 045
    46. 046
    47. 047
    48. 048
    49. 049
    50. 050
    51. 051
    52. 052
    53. 053
    54. 054
    55. 055
    56. 056
    57. 057
    58. 058
    59. 059
    60. 060
    61. 061
    62. 062
    63. 063
    64. 064
    65. 065
    66. 066
    67. 067
    68. 068
    69. 069
    70. 070
    71. 071
    72. 072
    73. 073
    74. 074
    75. 075
    76. 076
    77. 077
    78. 078
    79. 079
    80. 080
    81. 081
    82. 082
    83. 083
    84. 084
    85. 085
    86. 086
    87. 087
    88. 088
    89. 089
    90. 090
    91. 091
    92. 092
    93. 093
    94. 094
    95. 095
    96. 096
    97. 097
    98. 098
    99. 099
    100. 100
    function check_cur_zak(id_zak, obj)
    {
    	obj.getElementsByTagName('img')[0].style.display='none';
    	obj.getElementsByTagName('img')[1].style.display='block';
    	var ch_ids_tree_dse = arr2_ids_dse[id_zak].split('|');
    	var ch_names_tree_dse = arr2_names_dse[id_zak].split('|');
    	var ch_obozs_tree_dse = arr2_obozs_dse[id_zak].split('|');
    	var ch_child_tree_dse = arr2_child_dse[id_zak].split('|');
    	var cur_tree_dse = '';
    
    	if(document.getElementById('nav_tekysh_3').name>0)
    	{
    		console.log(arr_oprs_c_r_2)
    		var spl_op_res = arr_oprs_c_r_2[document.getElementById('nav_tekysh_3').name].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];
    	}
    
    	for (var ch_t_f_d=0; ch_t_f_d < (ch_ids_tree_dse.length-1); ch_t_f_d++)
    	{
    		var cur_tree_oper_cur_dse = '';
    		var jv3_arr_full_tbl_1_spl = jv2_arr_full_tbl_1_spl[ch_ids_tree_dse[ch_t_f_d]].split('|');
    		var jv3_arr_full_tbl_2_spl = jv2_arr_full_tbl_2_spl[ch_ids_tree_dse[ch_t_f_d]].split('|');
    		var jv3_arr_full_tbl_3_spl = jv2_arr_full_tbl_3_spl[ch_ids_tree_dse[ch_t_f_d]].split('|');
    		var jv3_arr_full_tbl_4_spl = jv2_arr_full_tbl_4_spl[ch_ids_tree_dse[ch_t_f_d]].split('|');
    		var jv3_arr_full_tbl_5_spl = jv2_arr_full_tbl_5_spl[ch_ids_tree_dse[ch_t_f_d]].split('|');
    		var jv3_arr_full_tbl_5_1_spl = jv2_arr_full_tbl_5_1_spl[ch_ids_tree_dse[ch_t_f_d]].split('|');
    		var jv3_arr_full_tbl_6_spl = jv2_arr_full_tbl_6_spl[ch_ids_tree_dse[ch_t_f_d]].split('|');
    		var jv3_arr_full_tbl_7_spl = jv2_arr_full_tbl_7_spl[ch_ids_tree_dse[ch_t_f_d]].split('|');
    		var jv3_arr_full_tbl_8_spl = jv2_arr_full_tbl_8_spl[ch_ids_tree_dse[ch_t_f_d]].split('|');
    		var jv3_arr_full_tbl_9_spl = jv2_arr_full_tbl_9_spl[ch_ids_tree_dse[ch_t_f_d]].split('|');
    		var jv3_arr_full_tbl_10_spl = jv2_arr_full_tbl_10_spl[ch_ids_tree_dse[ch_t_f_d]].split('|');
    		var jv3_arr_full_tbl_11_spl = jv2_arr_full_tbl_11_spl[ch_ids_tree_dse[ch_t_f_d]].split('|');
    		var jv3_arr_full_tbl_12_spl = jv2_arr_full_tbl_12_spl[ch_ids_tree_dse[ch_t_f_d]].split('|');
    		var jv3_arr_full_tbl_14_spl = jv2_arr_full_tbl_14_spl[ch_ids_tree_dse[ch_t_f_d]].split('|');
    		var jv3_arr_full_tbl_15_spl = jv2_arr_full_tbl_15_spl[ch_ids_tree_dse[ch_t_f_d]].split('|');
    		var jv3_arr_full_tbl_16_spl = jv2_arr_full_tbl_16_spl[ch_ids_tree_dse[ch_t_f_d]].split('|');
    
    		jv3_arr_full_tbl_17_spl = jv2_arr_full_tbl_17_spl[ch_ids_tree_dse[ch_t_f_d]].split('|');
    		jv3_arr_full_tbl_18_spl = jv2_arr_full_tbl_18_spl[ch_ids_tree_dse[ch_t_f_d]].split('|');
    		jv3_arr_full_tbl_19_spl = jv2_arr_full_tbl_19_spl[ch_ids_tree_dse[ch_t_f_d]].split('|');
    
    		var cur_dse_op_dse = '';
    		var cur_id_op_dse = '';
    		var cur_vp_op_dse = '';
    		
    		for (var ch_t_f_o=0; ch_t_f_o < (jv3_arr_full_tbl_1_spl.length-1); ch_t_f_o++)
    		{
    			var clas_tr_col = 'fff';
    			var clas_tr_br = 'fff';
    			var clas_tr_pr = 'fff';
    			var clas_tr_park = 'fff';
    			var zadel_op = 0;
    			var stl_b_tr_pr = '';
    			var js_vp_op = '0<br>0.00';
    			var js_ksz_op = '0<br>0.00';
    			// if (jv3_arr_full_tbl_14_spl[ch_t_f_o]>0)
    			// 	{
    			// 			clas_tr_col='ddffdd';
    			// 			clas_tr_br='ddffdd';
    			// 			clas_tr_pr='ddffdd';
    			// 			clas_tr_park='ddffdd';
    			// 	}
    
    			if(document.getElementById('nav_tekysh_3').name>0)
    			{
    				if (spl_op_res_arr[jv3_arr_full_tbl_16_spl[ch_t_f_o]])
    					{
    						clas_tr_pr='99ff99';
    						stl_b_tr_pr = 'font-size:150%; color:#13BD13;padding-left:5px';
    					}
    			var parks_for_cur_res = document.getElementById('park_sel_cur_res').options.length;
    				for (var p_f_c_r=0; p_f_c_r<parks_for_cur_res; p_f_c_r++)
    				{
    					if ((document.getElementById('park_sel_cur_res').options[p_f_c_r].value !== '0')&&(document.getElementById('park_sel_cur_res').options[p_f_c_r].value !== ''))
    					{
    						if (jv3_arr_full_tbl_5_1_spl[ch_t_f_o]==document.getElementById('park_sel_cur_res').options[p_f_c_r].value)
    									clas_tr_park='99ddff';
    					}
    				}
    			}
    
    			if (jv3_arr_full_tbl_12_spl[ch_t_f_o]==1)
    					clas_tr_br='ff9999';
    
    			if (jv3_arr_full_tbl_15_spl[ch_t_f_o]==0)
    			{
    
    				if(jv3_arr_full_tbl_3_spl[ch_t_f_o]=='')
    					jv3_arr_full_tbl_3_spl[ch_t_f_o]='0';
    
    				if(jv3_arr_full_tbl_6_spl[ch_t_f_o]=='')
    					jv3_arr_full_tbl_6_spl[ch_t_f_o]='0.00';
    
    				if(jv3_arr_full_tbl_7_spl[ch_t_f_o]=='')
    					jv3_arr_full_tbl_7_spl[ch_t_f_o]='0';
    
    				if(jv3_arr_full_tbl_8_spl[ch_t_f_o]=='')

    kib0rg, 18 Февраля 2021

    Комментарии (11)
  9. PHP / Говнокод #27235

    +1

    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
    $txtdd = $DI_Date;
    $DI_Date = explode(".",$DI_Date);
    
    $DI_YY = $DI_Date[2];
    $DI_LYY = $DI_YY;
    $DI_NYY = $DI_YY;
    $MY = $DI_Date[1].".".$DI_Date[2];
    
    $DI_MM = $DI_Date[1]-1;
    $DI_LMM = $DI_MM-1;
    if ($DI_LMM<0) $DI_LMM = 11;
    $DI_NMM = $DI_MM+1;
    if ($DI_NMM>11) $DI_NMM = 0;
    
    if ($DI_MM==0) $DI_LYY = $DI_YY-1;
    if ($DI_MM==11) $DI_NYY = $DI_YY+1;
    
    $DI_DD = 1;
    
    $lastM = $DI_MM;
    $yy = $DI_YY;
    if ($lastM<1) {
    	$lastM = 12+$lastM;
    	$yy = $yy - 1;
    }
    $lastM = $DI_DD.".".$lastM.".".$yy;
    
    $nextM = $DI_MM+2;
    $yy = $DI_YY;
    if ($nextM>12) {
    	$nextM = $nextM-12;
    	$yy = $yy + 1;
    }
    $nextM = $DI_DD.".".$nextM.".".$yy;
    
    $lastY = $DI_DD.".".($DI_MM+1).".".($DI_YY-1);
    $nextY = $DI_DD.".".($DI_MM+1).".".($DI_YY+1);

    kib0rg, 05 Февраля 2021

    Комментарии (1)
  10. PHP / Говнокод #26931

    +1

    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
    $DI_WName = Array('ѕн','¬т','—р','„т','ѕт','—б','¬с');
    	$DI_MName = Array('январь','‘евраль','ћарт','јпрель','ћай','»юнь','»юль','јвгуст','—ент¤брь','ќкт¤брь','Ќо¤брь','ƒекабрь');
    
    	$today = TodayDate();
    	$today = explode(".",$today);
    	$today = $today[2]*10000+$today[1]*100+$today[0];
    
    	$DI_Date = TodayDate();
    	if (isset($_GET["p0"])) $DI_Date = $_GET["p0"];
    	$DI_Date = explode(".",$DI_Date);
    
    	$DI_YY = $DI_Date[2];
    	$DI_LYY = $DI_YY;
    	$DI_NYY = $DI_YY;
    
    	$DI_MM = $DI_Date[1]-1;
    	$DI_LMM = $DI_MM-1;
    	if ($DI_LMM<0) $DI_LMM = 11;
    	$DI_NMM = $DI_MM+1;
    	if ($DI_NMM>11) $DI_NMM = 0;
    
    	if ($DI_MM==0) $DI_LYY = $DI_YY-1;
    	if ($DI_MM==11) $DI_NYY = $DI_YY+1;
    
    	$DI_DD = $DI_Date[0];
    
    	$lastM = $DI_MM-2;
    	$yy = $DI_YY;
    	if ($lastM<1) {
    		$lastM = 12+$lastM;
    		$yy = $yy - 1;
    	}
    	$lastM = $DI_DD.".".$lastM.".".$yy;
    
    	$nextM = $DI_MM+4;
    	$yy = $DI_YY;
    	if ($nextM>12) {
    		$nextM = $nextM-12;
    		$yy = $yy + 1;
    	}
    	$nextM = $DI_DD.".".$nextM.".".$yy;
    
    	$lastY = $DI_DD.".".($DI_MM+1).".".($DI_YY-1);
    	$nextY = $DI_DD.".".($DI_MM+1).".".($DI_YY+1);

    kib0rg, 08 Сентября 2020

    Комментарии (3)
  11. PHP / Говнокод #26930

    +1

    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
    function DI_MNum($Mon, $Year) {
    		$nn = Array(31,28,31,30,31,30,31,31,30,31,30,31);
    		$x = 28;
    		$y = (Round($Year/4))*4;
    		if ($y==$Year) $x = 29;
    		$ret = $nn[$Mon];
    		if ($Mon==1) $ret = $x;
    		return $ret;
    	}
    
    	function DI_FirstDay($Mon,$Year) {
    		$x0 = 365;
    		$Y = $Year-1;
    		$days = $Y*$x0+floor($Y/4)+6;
    		for ($j=0; $j<$Mon; $j=$j+1) {
    			$days = $days+DI_MNum($j,$Year);
    		}
    		$week = $days-(7*Round(($days/7)-0.5));
    		return $week;
    	}
    
    	function even_week($Day,$Mon,$Year) {
    		$x0 = 365;
    		$Y = $Year-1;
    		$days = $Y*$x0+floor($Y/4)+6;
    		for ($j=0; $j<$Mon; $j=$j+1) {
    			$days = $days+DI_MNum($j,$Year);
    		}
    		$days = $days + $Day;
    		$weeks = ceil($days/7);
    
    		$res = false;
    		if (2*ceil($weeks/2) == $weeks) $res = true;
    		return $res;
    	}

    kib0rg, 08 Сентября 2020

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