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

    +7

    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
    for (var s5_responsive_mobile_sidebar_menu_auto_open_y = 0; s5_responsive_mobile_sidebar_menu_auto_open_y < s5_responsive_mobile_sidebar_menu_auto_open.length; s5_responsive_mobile_sidebar_menu_auto_open_y++) {
                    if (s5_responsive_mobile_sidebar_menu_auto_open[s5_responsive_mobile_sidebar_menu_auto_open_y].className == "s5_mobile_sidebar_active") {
                        if (s5_responsive_mobile_sidebar_menu_auto_open[s5_responsive_mobile_sidebar_menu_auto_open_y].parentNode.parentNode.parentNode) {
                            if (s5_responsive_mobile_sidebar_menu_auto_open[s5_responsive_mobile_sidebar_menu_auto_open_y].parentNode.parentNode.parentNode.className == "s5_responsive_mobile_sidebar_sub") {
                                s5_responsive_mobile_sidebar_menu_auto_open[s5_responsive_mobile_sidebar_menu_auto_open_y].parentNode.parentNode.parentNode.style.display = "block";
                                s5_responsive_mobile_sidebar_menu_auto_open[s5_responsive_mobile_sidebar_menu_auto_open_y].parentNode.parentNode.parentNode.previousSibling.className = "s5_mobile_sidebar_h3_open";
                            }
                        } else if (s5_responsive_mobile_sidebar_menu_auto_open[s5_responsive_mobile_sidebar_menu_auto_open_y].parentNode.parentNode.parentNode.parentNode) {
                            if (s5_responsive_mobile_sidebar_menu_auto_open[s5_responsive_mobile_sidebar_menu_auto_open_y].parentNode.parentNode.parentNode.parentNode.className == "s5_responsive_mobile_sidebar_sub") {
                                s5_responsive_mobile_sidebar_menu_auto_open[s5_responsive_mobile_sidebar_menu_auto_open_y].parentNode.parentNode.parentNode.parentNode.style.display = "block";
                                s5_responsive_mobile_sidebar_menu_auto_open[s5_responsive_mobile_sidebar_menu_auto_open_y].parentNode.parentNode.parentNode.parentNode.previousSibling.className = "s5_mobile_sidebar_h3_open";
                            }
                        } else if (s5_responsive_mobile_sidebar_menu_auto_open[s5_responsive_mobile_sidebar_menu_auto_open_y].parentNode.parentNode.parentNode.parentNode.parentNode) {
                            if (s5_responsive_mobile_sidebar_menu_auto_open[s5_responsive_mobile_sidebar_menu_auto_open_y].parentNode.parentNode.parentNode.parentNode.parentNode.className == "s5_responsive_mobile_sidebar_sub") {
                                s5_responsive_mobile_sidebar_menu_auto_open[s5_responsive_mobile_sidebar_menu_auto_open_y].parentNode.parentNode.parentNode.parentNode.parentNode.style.display = "block";
                                s5_responsive_mobile_sidebar_menu_auto_open[s5_responsive_mobile_sidebar_menu_auto_open_y].parentNode.parentNode.parentNode.parentNode.parentNode.previousSibling.className = "s5_mobile_sidebar_h3_open";
                            }
                        } else if (s5_responsive_mobile_sidebar_menu_auto_open[s5_responsive_mobile_sidebar_menu_auto_open_y].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode) {
                            if (s5_responsive_mobile_sidebar_menu_auto_open[s5_responsive_mobile_sidebar_menu_auto_open_y].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.className == "s5_responsive_mobile_sidebar_sub") {
                                s5_responsive_mobile_sidebar_menu_auto_open[s5_responsive_mobile_sidebar_menu_auto_open_y].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.display = "block";
                                s5_responsive_mobile_sidebar_menu_auto_open[s5_responsive_mobile_sidebar_menu_auto_open_y].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.previousSibling.className = "s5_mobile_sidebar_h3_open";
                            }
                        } else if (s5_responsive_mobile_sidebar_menu_auto_open[s5_responsive_mobile_sidebar_menu_auto_open_y].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode) {
                            if (s5_responsive_mobile_sidebar_menu_auto_open[s5_responsive_mobile_sidebar_menu_auto_open_y].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.className == "s5_responsive_mobile_sidebar_sub") {
                                s5_responsive_mobile_sidebar_menu_auto_open[s5_responsive_mobile_sidebar_menu_auto_open_y].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.display = "block";
                                s5_responsive_mobile_sidebar_menu_auto_open[s5_responsive_mobile_sidebar_menu_auto_open_y].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.previousSibling.className = "s5_mobile_sidebar_h3_open";
                            }
                        } else if (s5_responsive_mobile_sidebar_menu_auto_open[s5_responsive_mobile_sidebar_menu_auto_open_y].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode) {
                            if (s5_responsive_mobile_sidebar_menu_auto_open[s5_responsive_mobile_sidebar_menu_auto_open_y].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.className == "s5_responsive_mobile_sidebar_sub") {
                                s5_responsive_mobile_sidebar_menu_auto_open[s5_responsive_mobile_sidebar_menu_auto_open_y].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.display = "block";
                                s5_responsive_mobile_sidebar_menu_auto_open[s5_responsive_mobile_sidebar_menu_auto_open_y].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.previousSibling.className = "s5_mobile_sidebar_h3_open";
                            }
                    }
                }

    Понятия не имею что эта хрень делает. Полностью цикл не влез, посмотреть можно тут http://www.ben-gurion.com/templates/zoka/js/s5_responsive_mobile_bar.js

    syxov, 04 Сентября 2015

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

    +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
    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
    public static string Get(this HttpWebRequest req)
            {
                string res;
                string ErrorCode="";
    
                try
                {
                    ErrorCode = "100";
                    Thread.Sleep(1000);
                    HttpWebResponse response = (HttpWebResponse)req.GetResponse();
                    Thread.Sleep(1000);
                    ErrorCode = "101";
                    Stream dataStream = response.GetResponseStream();
                    ErrorCode = "102";
                    StreamReader sr = new StreamReader(dataStream, Encoding.UTF8);
                    ErrorCode = "103";
                    res = sr.ReadToEnd();
                    ErrorCode = "104";
                }
                catch
                {
                    try
                    {
                        ErrorCode = "105";
                        Thread.Sleep(1000);
                        HttpWebResponse response = (HttpWebResponse) req.GetResponse();
                        Thread.Sleep(1000);
                        ErrorCode = "106";
                        Stream dataStream = response.GetResponseStream();
                        ErrorCode = "107";
                        StreamReader sr = new StreamReader(dataStream, Encoding.UTF8);
                        ErrorCode = "108";
                        res = sr.ReadToEnd();
                        ErrorCode = "109";
                    }
                    catch
                    {
                        try
                        {
                            ErrorCode = "110";
                            Thread.Sleep(1000);
                            HttpWebResponse response = (HttpWebResponse)req.GetResponse();
                            Thread.Sleep(1000);
                            ErrorCode = "111";
                            Stream dataStream = response.GetResponseStream();
                            ErrorCode = "112";
                            StreamReader sr = new StreamReader(dataStream, Encoding.UTF8);
                            ErrorCode = "113";
                            res = sr.ReadToEnd();
                            ErrorCode = "114";
                        }
                        catch
                        {
                            res = "Error doing get to " + req.RequestUri.AbsoluteUri + " ErrorCode: " + ErrorCode;
                        }
                    }
                }
    
                return res;
            }

    Нашел в проекте код до 2010 год, автор неизвестен :(

    kiberg, 04 Сентября 2015

    Комментарии (101)
  3. C# / Говнокод #18671

    −1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    var inited = Connectivity.Init().Result;
    inited = ServerService.Init().Result && inited;
    inited = AccountInfoService.Init().Result && inited;
    inited = InitMandatoryServices() && inited;
    
    IsInit = inited;

    vldalx, 04 Сентября 2015

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

    +1

    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
    <?php defined('START') or die;
     
    # For Licence and Disclaimer of this code, see http://coresky.net/license
    # Filename: unique
    # Portname: mysql_ php module (clear cloud)
     
    function trace($var, $show_error = false, $line = 0, $file = '', $context = null) {
        global $sky;
        if (!isset($sky)) return;
        if ($sky->debug || $sky->s_prod_error && true === $show_error) {
            is_string($var) or $var = var_export($var, true);
            if (is_string($show_error)) $var = "$show_error: $var" and $show_error = false;
            if ($has_deep = !$file) {
                $deep = 1 + $line;
                $trace = debug_backtrace();
                $file = $trace[$line]['file'];
                $line = $trace[$line]['line'];
            }
            $error = "$file:$line:\n" . html($var);
            if ($show_error) {
                $sky->was_arror = true;
                if (CLI) echo $has_deep ? "\n$file:$line:\n$var\n\n" : "\n$var\n\n";
                if ($sky->s_prod_error) {
                    $sky->error_prod .= NOW . ' - ' . START;
                    if (in_array(START, ['front', 'admin'])) $sky->error_prod .= ' uri: ' . html(URI);
                    $sky->error_prod .= "\n$error\n\n";
                }
            }
            if ($sky->debug) {
                if ($show_error) {
                    $sky->tracing .= "$file:$line:\n" . '<span class="error">' . html($var) . "</span>\n";
                    ob_start();
                    debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
                    $backtrace = html(ob_get_clean());
                    if ($sky->error_on_page) {
                        $sky->errors .= sprintf("<h1>%s</h1><pre>$error\n\n$backtrace</pre>", $sky->error_title ? $sky->error_title : 'User Error');
                        $sky->error_title = '';
                        if ($str = $sky->context($context, $has_deep ? $deep : 2)) $sky->errors .= "<pre>$str</pre>";
                    } else {
                        $sky->tracing .= "BACKTRACE:\n$backtrace\n";
                        if (AJAX) exit;
                        if (!CLI) echo "<br /><b>SKY:</b> " . html($var) . " at <b>$file</b> on line <b>$line</b>";
                    }
                    $sky->tracing .= "\n";
                } else $sky->tracing .= "$error\n\n";
            }
        }
    }
     
    function sql($sql, $deep = 1) {
        global $sky;
        if (in_array($mode = $sql[0], ['+', '-', '~', '@', '%', '^', '>'])) $sql = substr($sql, 1);
        if ($run = '^' != $mode) $result = mysql_query($sql);
        if (($sky->debug || $sky->s_prod_error) && $deep && $run) {
            $sky->qn++;
            if ($no = mysql_errno()) $sky->error_title = 'SQL Error';
            trace("SQL: $sql" . ($no ? ",\nERROR in MySQL - $no: " . mysql_error() : ''), (bool)$no, $deep);
        }
        switch (strtolower(substr($sql, 0, 6))) {
            case 'delete': case 'update': case 'replac': return mysql_affected_rows();
            case 'insert': return mysql_insert_id();
            case 'select': switch ($mode) {
                case '+': return mysql_result($result, 0);
                case '-': return mysql_fetch_row($result);
                case '~': return mysql_fetch_assoc($result);
                case '@': return fetch($result, 0);
                case '%': return fetch($result, 0, 'assoc');
                case '^': return sprintf("\$q = sql('%s', %d);", escape($sql, "'\\"), 1 + $deep) . fetch;
                case '>': return ($r = mysql_fetch_assoc($result)) ? (object)$r : null;
            }
        }
        return $result;
    }
     
    function sqlf() {
        $ary = func_get_args();
        $func = 'return is_array($v) ? _join($v, ", ", "' . strtolower(substr($sql = array_shift($ary), 0, 1)) . '") : $v;';
        return sql(vsprintf($sql, array_map(create_function('$v', $func), $ary)), 2);
    }
     
    function fetch($q, $p = false, $func = 'row') {
        if (is_bool($p)) return $p ? mysql_fetch_row($q) : mysql_fetch_assoc($q);
        $func = "mysql_fetch_$func";
        for ($cnt = mysql_num_fields($q), $ary = []; $r = $func($q); ) {
            $key = current(array_splice($r, $p, 1));
            if (1 == $cnt) $ary[] = $key;
            else $ary[$key] = 2 == $cnt ? current($r) : $r;
        }
        return $ary; # mysql_free_result($q);
    }
     
    define('fetch', 'if ($r = mysql_fetch_assoc($q)) extract($r, EXTR_PREFIX_ALL, "r"); return $r;');
     
    function cnt($q, $rows = true) {
        return $rows ? mysql_num_rows($q) : mysql_num_fields($q);
    }
     
    function _join($ary, $by = ', ', $x = false) {
        $keys = array_keys($ary);
        $vals = array_values($ary);

    http://ru.coresky.net/code
    Nuff said.

    corebug, 04 Сентября 2015

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

    −1

    1. 1
    this.tmpl('registration.button.back.content', {stepNumber: ~~stepNumber})

    Двойная тильда, Карл!!! *facepalm*

    Orion189, 04 Сентября 2015

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

    +5

    1. 1
    2. 2
    3. 3
    #id="map" {
      display: none !important;
    }

    css master

    develop_id666, 04 Сентября 2015

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

    +4

    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
    public function isMobile()
    {
        // ...
    
        if (in_array (strtolower (substr ($user_agent, 0, 4)), array (
            '1207' => '1207', '3gso' => '3gso', '4thp' => '4thp', '501i' => '501i', '502i' => '502i', '503i' => '503i', '504i' => '504i',
            '505i' => '505i', '506i' => '506i', '6310' => '6310', '6590' => '6590', '770s' => '770s', '802s' => '802s', 'a wa' => 'a wa',
            'acer' => 'acer', 'acs-' => 'acs-', 'airn' => 'airn', 'alav' => 'alav', 'asus' => 'asus', 'attw' => 'attw', 'au-m' => 'au-m',
            'aur ' => 'aur ', 'aus ' => 'aus ', 'abac' => 'abac', 'acoo' => 'acoo', 'aiko' => 'aiko', 'alco' => 'alco', 'alca' => 'alca',
            'amoi' => 'amoi', 'anex' => 'anex', 'anny' => 'anny', 'anyw' => 'anyw', 'aptu' => 'aptu', 'arch' => 'arch', 'argo' => 'argo',
            'bell' => 'bell', 'bird' => 'bird', 'bw-n' => 'bw-n', 'bw-u' => 'bw-u', 'beck' => 'beck', 'benq' => 'benq', 'bilb' => 'bilb',
            'blac' => 'blac', 'c55/' => 'c55/', 'cdm-' => 'cdm-', 'chtm' => 'chtm', 'capi' => 'capi', 'cond' => 'cond', 'craw' => 'craw',
            'dall' => 'dall', 'dbte' => 'dbte', 'dc-s' => 'dc-s', 'dica' => 'dica', 'ds-d' => 'ds-d', 'ds12' => 'ds12', 'dait' => 'dait',
            'devi' => 'devi', 'dmob' => 'dmob', 'doco' => 'doco', 'dopo' => 'dopo', 'el49' => 'el49', 'erk0' => 'erk0', 'esl8' => 'esl8',
            'ez40' => 'ez40', 'ez60' => 'ez60', 'ez70' => 'ez70', 'ezos' => 'ezos', 'ezze' => 'ezze', 'elai' => 'elai', 'emul' => 'emul',
            'eric' => 'eric', 'ezwa' => 'ezwa', 'fake' => 'fake', 'fly-' => 'fly-', 'fly_' => 'fly_', 'g-mo' => 'g-mo', 'g1 u' => 'g1 u',
            'g560' => 'g560', 'gf-5' => 'gf-5', 'grun' => 'grun', 'gene' => 'gene', 'go.w' => 'go.w', 'good' => 'good', 'grad' => 'grad',
            'hcit' => 'hcit', 'hd-m' => 'hd-m', 'hd-p' => 'hd-p', 'hd-t' => 'hd-t', 'hei-' => 'hei-', 'hp i' => 'hp i', 'hpip' => 'hpip',
            'hs-c' => 'hs-c', 'htc ' => 'htc ', 'htc-' => 'htc-', 'htca' => 'htca', 'htcg' => 'htcg', 'htcp' => 'htcp', 'htcs' => 'htcs',
            'htct' => 'htct', 'htc_' => 'htc_', 'haie' => 'haie', 'hita' => 'hita', 'huaw' => 'huaw', 'hutc' => 'hutc', 'i-20' => 'i-20',
            'i-go' => 'i-go', 'i-ma' => 'i-ma', 'i230' => 'i230', 'iac' => 'iac', 'iac-' => 'iac-', 'iac/' => 'iac/', 'ig01' => 'ig01',
            'im1k' => 'im1k', 'inno' => 'inno', 'iris' => 'iris', 'jata' => 'jata', 'java' => 'java', 'kddi' => 'kddi', 'kgt' => 'kgt',
            'kgt/' => 'kgt/', 'kpt ' => 'kpt ', 'kwc-' => 'kwc-', 'klon' => 'klon', 'lexi' => 'lexi', 'lg g' => 'lg g', 'lg-a' => 'lg-a',
            'lg-b' => 'lg-b', 'lg-c' => 'lg-c', 'lg-d' => 'lg-d', 'lg-f' => 'lg-f', 'lg-g' => 'lg-g', 'lg-k' => 'lg-k', 'lg-l' => 'lg-l',
            'lg-m' => 'lg-m', 'lg-o' => 'lg-o', 'lg-p' => 'lg-p', 'lg-s' => 'lg-s', 'lg-t' => 'lg-t', 'lg-u' => 'lg-u', 'lg-w' => 'lg-w',
            'lg/k' => 'lg/k', 'lg/l' => 'lg/l', 'lg/u' => 'lg/u', 'lg50' => 'lg50', 'lg54' => 'lg54', 'lge-' => 'lge-', 'lge/' => 'lge/',
            'lynx' => 'lynx', 'leno' => 'leno', 'm1-w' => 'm1-w', 'm3ga' => 'm3ga', 'm50/' => 'm50/', 'maui' => 'maui', 'mc01' => 'mc01',
            'mc21' => 'mc21', 'mcca' => 'mcca', 'medi' => 'medi', 'meri' => 'meri', 'mio8' => 'mio8', 'mioa' => 'mioa', 'mo01' => 'mo01',
            'mo02' => 'mo02', 'mode' => 'mode', 'modo' => 'modo', 'mot ' => 'mot ', 'mot-' => 'mot-', 'mt50' => 'mt50', 'mtp1' => 'mtp1',
            'mtv ' => 'mtv ', 'mate' => 'mate', 'maxo' => 'maxo', 'merc' => 'merc', 'mits' => 'mits', 'mobi' => 'mobi', 'motv' => 'motv',
            'mozz' => 'mozz', 'n100' => 'n100', 'n101' => 'n101', 'n102' => 'n102', 'n202' => 'n202', 'n203' => 'n203', 'n300' => 'n300',
            'n302' => 'n302', 'n500' => 'n500', 'n502' => 'n502', 'n505' => 'n505', 'n700' => 'n700', 'n701' => 'n701', 'n710' => 'n710',
            'nec-' => 'nec-', 'nem-' => 'nem-', 'newg' => 'newg', 'neon' => 'neon', 'netf' => 'netf', 'noki' => 'noki', 'nzph' => 'nzph',
            'webc' => 'webc', 'whit' => 'whit', 'winw' => 'winw', 'wmlb' => 'wmlb', 'xda-' => 'xda-'
        ))) {
            return true;
        }
        return false;
    }

    Я правда не знаю что это ваще и зачем.

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

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

    +2

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    function checkIfLogged(){
        var user = localStorage.getItem('user');
        if(!user) {
            logout();
            window.location.hash = '#/login';
            return false;
        } else {
            return true;
        }
    }

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

    Комментарии (0)
  9. Куча / Говнокод #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)
  10. 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)