1. Лучший говнокод

    В номинации:
    За время:
  2. JavaScript / Говнокод #13955

    +153

    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
    function Recalc(index) {
                var url = window.location.pathname + "?";
                var data = "DepartureDate=" + $("#AvailabilityList_" + index + "__DepartureDate").val()
    				 + "&DepartureTime=" + $("#AvailabilityList_" + index + "__DepartureTime").val()
                + "&ArrivalDate=" + $("#AvailabilityList_" + index + "__ArrivalDate").val()
                + "&ArrivalTime=" + $("#AvailabilityList_" + index + "__ArrivalTime").val()
                + "&FromCode=" + $("#AvailabilityList_" + index + "__FromCode").val()
                + "&ToCode=" + $("#AvailabilityList_" + index + "__ToCode").val()
                + "&ShipCode=" + $("#AvailabilityList_" + index + "__ShipCode").val()
                + "&ProviderCode=" + $("#AvailabilityList_" + index + "__ProviderCode").val()
                + "&Duration=" + $("#AvailabilityList_" + index + "__Duration").val()
                + "&AdultCount=" + $("#AvailabilityList_" + index + "__AdultCount").val()
                + "&ChildCount=" + $("#AvailabilityList_" + index + "__ChildCount").val()
                + "&FerryID=" + $("#AvailabilityList_" + index + "__FerryID").val()
                + "&Auto=" + $("#AvailabilityList_" + index + "__Auto").val()
                + "&FareCode=" + $("#AvailabilityList_" + index + "__FareCode").val()
                + "&Years[0]=" + $("#AvailabilityList_" + index + "__Years_0_").val()
                + "&Years[1]=" + $("#AvailabilityList_" + index + "__Years_1_").val()
                + "&Years[2]=" + $("#AvailabilityList_" + index + "__Years_2_").val()
                + "&Years[3]=" + $("#AvailabilityList_" + index + "__Years_3_").val()
                + "&Years[4]=" + $("#AvailabilityList_" + index + "__Years_4_").val()
                + "&Years[5]=" + $("#AvailabilityList_" + index + "__Years_5_").val()
                + "&Years[6]=" + $("#AvailabilityList_" + index + "__Years_6_").val()
                + "&Years[7]=" + $("#AvailabilityList_" + index + "__Years_7_").val()
                + "&Years[8]=" + $("#AvailabilityList_" + index + "__Years_8_").val()
                + "&Index=" + index;
                return data;
            }

    Back-end asp.net mvc, кому интересно

    sladkijBubaleh, 16 Октября 2013

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

    +150

    1. 1
    2. 2
    3. 3
    4. 4
    public static function getDeferredSubsCardExpirationDate($date) {
        $ts = strtotime($date);
        return mktime(date('H', $ts), date('i', $ts), date('s', $ts), date('m', $ts), date('d', $ts), date('Y', $ts) + Constants::GIFT_CARD_EXPIRATION_PERIOD);
    }

    ОУКЕЙ

    Sc0rp10, 14 Октября 2013

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

    +152

    1. 1
    $smarty->assign('main_body_style', 'style="' . (((CONF_SHOPPING_CART_VIEW == 2) || ($cart_view == CARTVIEW_FRAME)) ? '' : 'background:#FFFFFF;') . 'min-width:auto;width:auto;_width:auto;"');

    Из контроллера.
    WebAsyst.

    invision70, 12 Октября 2013

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

    +140

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    if (false) {} 
    				else
    				{
    					//какие-то действия
    
    
    }

    desu, 10 Октября 2013

    Комментарии (2)
  6. C++ / Говнокод #13896

    +61

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    УЧИМСЯ ТРАЛИРОВАТЬ ВМЕСТИ С PragramistOtBoga
    
      PragramistOtBoga: ЗДАРОВА ЛАЛКА АЗАЗА
      ЛАЛАКА ПРАГРАМИСТ: ПРевет не тралируй миня пажалузта!!!!!!
      PragramistOtBoga: Ты лах карочи))0))нульскопка Мамку С++ и бал азазазаза лалка затарлин))0
      ЛАЛАКА ПРАГРАМИСТ: Супкпздц((9 миня апять затралил гиниальный траль PragramistOtBoga

    Сиводня маэстра тралинга PragramistOtBoga научит вас тралиравать лалак
    Штобы к завтра дамашку зделали! Смарите у миня праверю))0

    PragramistOtBoga, 04 Октября 2013

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

    +149

    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
    <h2>Задать вопрос online</h2>
    <?
    if (isset ($_POST['message'])) {
    $name = @ trim ($_POST['name']);
    $contact = @ trim ($_POST['contact']);
    $phone = @ trim ($_POST['phone']);
    $message = @ trim ($_POST['message']);
    if (! $name or ! $contact or ! $message) echo ('<p style="color: red">Необходимо заполнить поле e-mail</p>');
    else { mail ("[email protected]",
          "Новое сообщение на сайте!",
          "$message \n\n E-mail: \n $contact", 
    	  "\n\n Телефон: \n $phone",
          "Content-type:text/plain; charset=utf-8");
          echo ('<p style="color: green">Ваше сообщение отправлено, спасибо!</p>');
          $_POST['name'] = $_POST['contact'] = $_POST['phone'] = $_POST['message'] = '';
    }
    }
    ?>
    <form method="POST">
    <p>Ваше имя:</p>
    <input name="name" value="<?=@$_POST['name'];?>"><br><br>
    <p>E-mail*:</p>
    <input name="contact" value="<?=@$_POST['contact'];?>"><br><br>
    <p>Телефон:</p>
    <input name="phone" value="<?=@$_POST['phone'];?>"><br><br>
    <p>Ваше сообщение:</p>
    <textarea name="message"><?=@$_POST['message'];?></textarea><br><br><br><br><br><br>
    <p><input type="submit" value=" Отправить "></p>
    </form>

    bugaaa, 02 Октября 2013

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

    +150

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    $duration_date = date(
        'Y-m-d H:i:s',
        strtotime(
            date(
                'Y-m-d H:i:s',
                strtotime($_REQUEST['task_start_date'])) . ' + ' . $_REQUEST['task_frequency'] . '  ' . $freq_type . ''
        )
    );

    Кто-то может это упростить ? Я уже устал

    __proto__, 01 Октября 2013

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

    +150

    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
    private function checkCookie(){
                      if(!isset($_COOKIE['sessid'])) {
                              $this->userInfo['id'] = 0;
                              $this->userInfo['isAdmin'] = false;
                              return false;
                      }
    
                      $id_lenght = strlen($_COOKIE['sessid']) - 32;
                      $cookie_id = substr($_COOKIE['sessid'],0,$id_lenght);
                      $cookie_hash = substr($_COOKIE['sessid'],$id_lenght);
                      $this->registry['db']->heal($cookie_id); // антиинжект
                      $dbres = $this->registry['db']->query("SELECT password FROM users WHERE user_id = '$cookie_id';")->fetch();
                      if(md5($dbres['password']) == $cookie_hash){
                             $this->userInfo['id'] = $cookie_id;
                             return true;
                      }
                      return false;
          }

    в чем-то гениально

    djumpen, 24 Сентября 2013

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

    +120

    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
    .td_first , .two tr:nth-child(1) {
       max-width: 30px;
       width: 30px !important;
    }
    .td_second, .two tr:nth-child(2) {
       min-width: 60px !important;
       width: expression(this.width < 60 ? 60: true);
       text-align: left;
    }
    .td_third, .two tr:nth-child(3) {
    	text-align: right !important;
    	min-width: 100px !important;
    	width: expression(this.width < 100 ? 100 : true);
    }
    .td_fourth, .two tr:nth-child(4) {
    	text-align: right !important;
        width: 180px;
    }
    .td_fifth, .two tr:nth-child(5) {
    	width: 6
    }

    Типичный CSS код моей конторы)

    sladkijBubaleh, 23 Сентября 2013

    Комментарии (2)
  11. C++ / Говнокод #13789

    +69

    1. 1
    С ДНЕМ МУДАКОВ ЗАДРОТЫ АЗАЗАЗА

    13 СИНТЯБРЯ ДЕНЬ ЛАХОВ И ЗАДРОТАВ
    p.s. мне всево 7 лет и у миня есть ifon 5

    PragramistOtBoga, 13 Сентября 2013

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