1. Куча / Говнокод #18664

    +2

    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
    ...
            <tr>
              <td class=ArtelAdminTableTdCaption>Заголовок&nbsp;&nbsp;&nbsp;
              <td><input type=text name=f[caption] value="<?=$row['sct_caption']?>" size=50 style=width:340>
            </tr>
    		</table>
        </tr>
    
      <tr>
        <td><input type=submit name=save_Goods_supcatalog3s value="Сохранить">
      </tr>
     </form>
    </table>
    
    ...

    WOW! WOW! WOW!

    tutov2013, 03 Сентября 2015

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

    +3

    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
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    // чето у меня совсем хуёво с сортировками
            if ($a['TYPE_CODE'] == static::STORAGE_TYPE_MAIN && $b['TYPE_CODE'] == static::STORAGE_TYPE_5DAYS) {
                return -1;
            }
    
            if ($a['TYPE_CODE'] == static::STORAGE_TYPE_5DAYS  && $b['TYPE_CODE'] == static::STORAGE_TYPE_MAIN) {
                return 1;
            }
            if (($a['TYPE_CODE'] == static::STORAGE_TYPE_MAIN  && $b['TYPE_CODE'] != static::STORAGE_TYPE_MAIN)
                || ($a['TYPE_CODE'] == static::STORAGE_TYPE_5DAYS && $b['TYPE_CODE'] != static::STORAGE_TYPE_5DAYS)
            ) {
                return -1;
            }
    
            if (($a['TYPE_CODE'] != static::STORAGE_TYPE_MAIN && $b['TYPE_CODE'] == static::STORAGE_TYPE_MAIN)
                || ($a['TYPE_CODE'] != static::STORAGE_TYPE_5DAYS && $b['TYPE_CODE'] == static::STORAGE_TYPE_5DAYS)
            ) {
                return 1;
            }
    
            if (($a['TYPE_CODE'] == static::STORAGE_TYPE_MAIN && $b['TYPE_CODE'] == static::STORAGE_TYPE_MAIN)
                || ($a['TYPE_CODE'] == static::STORAGE_TYPE_5DAYS && $b['TYPE_CODE'] == static::STORAGE_TYPE_5DAYS)
            ) {
                return $a['ID'] < $b['ID'] ? -1 : 1;
            }
    
            if ($a['TYPE_CODE'] == static::STORAGE_TYPE_MAIN && $b['TYPE_CODE'] == static::STORAGE_TYPE_7DAYS) {
                return -1;
            }
    
            if ($a['TYPE_CODE'] == static::STORAGE_TYPE_7DAYS  && $b['TYPE_CODE'] == static::STORAGE_TYPE_MAIN) {
                return 1;
            }
            if (($a['TYPE_CODE'] == static::STORAGE_TYPE_MAIN  && $b['TYPE_CODE'] != static::STORAGE_TYPE_MAIN)
                || ($a['TYPE_CODE'] == static::STORAGE_TYPE_7DAYS && $b['TYPE_CODE'] != static::STORAGE_TYPE_7DAYS)
            ) {
                return -1;
            }
    
            if (($a['TYPE_CODE'] != static::STORAGE_TYPE_MAIN && $b['TYPE_CODE'] == static::STORAGE_TYPE_MAIN)
                || ($a['TYPE_CODE'] != static::STORAGE_TYPE_7DAYS && $b['TYPE_CODE'] == static::STORAGE_TYPE_7DAYS)
            ) {
                return 1;
            }
    
            if (($a['TYPE_CODE'] == static::STORAGE_TYPE_MAIN && $b['TYPE_CODE'] == static::STORAGE_TYPE_MAIN)
                || ($a['TYPE_CODE'] == static::STORAGE_TYPE_7DAYS && $b['TYPE_CODE'] == static::STORAGE_TYPE_7DAYS)
            ) {
                return $a['ID'] < $b['ID'] ? -1 : 1;
            }
    
            if ($a['TYPE_CODE'] == static::STORAGE_TYPE_5DAYS && $b['TYPE_CODE'] == static::STORAGE_TYPE_7DAYS) {
                return -1;
            }
    
            if ($a['TYPE_CODE'] == static::STORAGE_TYPE_7DAYS  && $b['TYPE_CODE'] == static::STORAGE_TYPE_5DAYS) {
                return 1;
            }
            if (($a['TYPE_CODE'] == static::STORAGE_TYPE_5DAYS  && $b['TYPE_CODE'] != static::STORAGE_TYPE_5DAYS)
                || ($a['TYPE_CODE'] == static::STORAGE_TYPE_7DAYS && $b['TYPE_CODE'] != static::STORAGE_TYPE_7DAYS)
            ) {
                return -1;
            }
    
            if (($a['TYPE_CODE'] != static::STORAGE_TYPE_5DAYS && $b['TYPE_CODE'] == static::STORAGE_TYPE_5DAYS)
                || ($a['TYPE_CODE'] != static::STORAGE_TYPE_7DAYS && $b['TYPE_CODE'] == static::STORAGE_TYPE_7DAYS)
            ) {
                return 1;
            }
    
            if (($a['TYPE_CODE'] == static::STORAGE_TYPE_5DAYS && $b['TYPE_CODE'] == static::STORAGE_TYPE_5DAYS)
                || ($a['TYPE_CODE'] == static::STORAGE_TYPE_7DAYS && $b['TYPE_CODE'] == static::STORAGE_TYPE_7DAYS)
            ) {
                return $a['ID'] < $b['ID'] ? -1 : 1;
            }
    
            if ($a['TYPE_CODE'] == static::STORAGE_TYPE_COMING && $b['TYPE_CODE'] == static::STORAGE_TYPE_COMING) {
                $aTs = MakeTimeStamp($a['UF_ARRIVAL_DATE']);
                $bTs = MakeTimeStamp($b['UF_ARRIVAL_DATE']);
                return $aTs < $bTs ? -1 : ($aTs > $bTs ? 1 : 0);
            }
    
            return 1;

    n1ce22rus, 03 Сентября 2015

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

    +9

    1. 1
    for($S='a';$S<'z';){${$S++}=$S;};$$S='a';echo $$$$$$$$$S.($S=$$$$$$S).($S=$$$$$$$$S).$S.($S=$$$$S).' '.$$$$$$$$$S.$S.($S=$$$$S).$$$$$$$$$$$$$$$$$$$$$S.$$$$$$$$$$$$$S;

    Порт hello world с брейнфака

    m0003r, 02 Сентября 2015

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

    +3

    1. 1
    2. 2
    foreach($arResult['ITEMS'] as $key => &$arItem) {
    		$priceRes2 = CIBlockElement::GetList(array(), array("IBLOCK_ID" => 34, "PROPERTY_PERIOD" => 1, "PROPERTY_PERIOD_TYPE" => 85, "PROPERTY_OBJECT_RELATION" => $arItem['ID']), false, false, array("NAME"));

    "Я программист 1C-bitrix и с каждой новой итерацией я делаю новый запрос к инфоблоку."

    tutov2013, 01 Сентября 2015

    Комментарии (177)
  5. C++ / Говнокод #18656

    +7

    1. 1
    void parse_csv_string_string_string_string(string in_file, vector<string>& spectrum_id_list, vector<string>& file_name_list, vector<string>& name_list, vector<string>& id_list) {

    – Дяденька, осторожно, у вас клавиатура солидолом намазана...

    Yuuri, 31 Августа 2015

    Комментарии (3)
  6. JavaScript / Говнокод #18655

    +3

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    if (!$('#enable-continious').is(':checked') && $('#enable-continious').is(':checked')) {
    	...
    } else {
    	...
    }

    Продолжаем находить великие письмена великих людей на проекте. К слову, человек на позиции Senior PHP Developer является автором.

    Un3Solka, 31 Августа 2015

    Комментарии (21)
  7. JavaScript / Говнокод #18654

    +3

    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
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    92. 92
    93. 93
    $(document).ready(function() {
    				if ($('.delivery_type:checked').val() != 0) {
    					var delivery = $('.delivery_type:checked').val();
    					if (delivery == '0') {
    						$('.payment_panel').hide;
    						return (false);
    					}
    				}
    				$('.delivery_type').change(function() {
    					if ($(this).val() == 4) {
    						$('#d_text').html($('#d_text_u').val());
    						$('#dostav').show();
    					}
    					if ($(this).val() == 8) {
    						$('#d_text').html($('#d_text_np').val());
    						$('#dostav').show();
    					}
    					if ($('#d_day').val() <= 5 || ($('#d_day').val() == 5 && $('#d_time').val() < 15)) {
    						if ($(this).val() >= 1 && $(this).val() <= 3 && $('#d_time').val() < 15) {
    							$('#d_text').html($('#d_text_m11').val());
    							$('#dostav').show();
    						}
    						if (($(this).val() == 7 || $(this).val() == 11) && $('#d_time').val() < 15) {
    							$('#d_text').html($('#d_text_m21').val());
    							$('#dostav').show();
    						}
    						if ($(this).val() >= 1 && $(this).val() <= 3 && $('#d_time').val() >= 15) {
    							$('#d_text').html($('#d_text_m12').val());
    							$('#dostav').show();
    						}
    						if (($(this).val() == 7 || $(this).val() == 11) && $('#d_time').val() >= 15) {
    							$('#d_text').html($('#d_text_m22').val());
    							$('#dostav').show();
    						}
    					} else {
    						if ($('#d_day').val() < 7 || ($('#d_day').val() == 7 && $('#d_time').val() < 15)) {
    							if ($(this).val() >= 1 && $(this).val() <= 3) {
    								$('#d_text').html($('#d_text_m31').val());
    								$('#dostav').show();
    							}
    							if (($(this).val() == 7 || $(this).val() == 11)) {
    								$('#d_text').html($('#d_text_m32').val());
    								$('#dostav').show();
    							}
    
    						} else {
    							if ($(this).val() >= 1 && $(this).val() <= 3) {
    								$('#d_text').html($('#d_text_m33').val());
    								$('#dostav').show();
    							}
    							if (($(this).val() == 7 || $(this).val() == 11)) {
    								$('#d_text').html($('#d_text_m34').val());
    								$('#dostav').show();
    							}
    
    						}
    					}
    					if ($(this).val() == 10 || $(this).val() == 9) {
    						$('#dostav').hide();
    					}
    
    					if ($(this).val() > 0 && $(this).val() != 4) {
    						if ($(this).val() == 1) {
    							$('#address').val('ул. ******, 13/14');
    						}
    						if ($(this).val() == 2) {
    							$('#address').val('ул. ******, 127');
    						}
    						if ($(this).val() == 3) {
    							$('#address').val('пр. ******, 98/2');
    						}
    						if ($(this).val() == 7) {
    							$('#address').val('ул. ********, 8');
    						}
    						if ($(this).val() == 11) {
    							$('#address').val('пр. ******, 66');
    						}
    
    					} else {
    						$('#address').val('');
    					}
    					var delivery = $(this).val();
    					$('.dop_fields').hide();
    					$('.dop_fields span').html('');
    					$('.only_ukr').hide();
    					$('.only_kur').hide();
    					$('.only_sv').hide();
    					$('.only_novp').hide('');
    					if (delivery == 4) {
    						$('.only_ukr').show();
    						$('.ukr span').html('*');
    						$('.dop_fields').show();
    					}

    Выбор способа доставки в интернет магазине

    NotFake, 31 Августа 2015

    Комментарии (2)
  8. Куча / Говнокод #18647

    +1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    {% if _view.data['User']['bday']|date("Y") != "2100" %}
         <input id="UserBDay" type="text" name="data[User][bday]" class="txt" placeholder="mm/dd/YYYY" value="{% if _view.data['User']['bday'] != '1970-01-01' %} {{ _view.data['User']['bday']|date("m/d/Y") }} {% endif %}">
    {% else %}
         <input id="UserBDay" type="text" name="data[User][bday]" class="txt" placeholder="mm/dd/YYYY" value="{% if _view.data['User']['bday'] != '1970-01-01' %} {{ _view.data['User']['bday']|date("m/d/") }} {% endif %}">
    {% endif %}

    Вот так вот мы обращаемся с датами рождения.

    SergeyKaravay, 28 Августа 2015

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

    +8

    1. 1
    2. 2
    3. 3
    4. 4
    // Init function
    function init() {
      ...
    }

    Не говнокод, но инвормативные и полезные комментарии - это хорошо.

    keitoaino, 28 Августа 2015

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

    +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
    switch ($result[$j]) {
                        case 0: $res .= $result[$j];
                            break;
                        case 1: $res .= $result[$j];
                            break;
                        case 2: $res .= $result[$j];
                            break;
                        case 3: $res .= $result[$j];
                            break;
                        case 4: $res .= $result[$j];
                            break;
                        case 5: $res .= $result[$j];
                            break;
                        case 6: $res .= $result[$j];
                            break;
                        case 7: $res .= $result[$j];
                            break;
                        case 8: $res .= $result[$j];
                            break;
                        case 9: $res .= $result[$j];
                            break;
                        case 10: $res .= "a";
                            break;
                        case 11: $res .= "b";
                            break;
                        case 12: $res .= "c";
                            break;
                        case 13: $res .= "d";
                            break;
                        case 14: $res .= "e";
                            break;
                        case 15: $res .= "f";
                            break;
                        case 16: $res .= "g";
                            break;
                    }

    p0p, 27 Августа 2015

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