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

    Всего: 3

  2. Куча / Говнокод #9330

    +129

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    <input type="image" src="/Content/images/1x1.png" name="BasketB" id="submitbutton" />
    <div class="buttons2" id="buttons" style="margin-top: 15px;">
    <a href="javascript:$('#submitbutton').click();"><div class='left2'>&nbsp;</div><div class='center'>Bestellung abschicken</div><div class='right'>&nbsp;</div></a>
    </div>
    <script type="text/javascript">centerImageButtons();</script>

    вот так вот можно сделать кнопку submit

    Lameaux, 06 Февраля 2012

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

    +176

    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
    $query = "
    			SELECT `ord`.*,`cus`.`existing_phone_number`,`cus`.`nova_jednotka`,
    				`cus`.`order_phone`,`cus`.`custom_delivery_date`, `cus`.`delivery_address`,
    				`cus`.`invoice_address`, `cus`.`invoice_street`, `cus`.`invoice_street_number`,
    				`cus`.`invoice_city`, `cus`.`invoice_zip`
    			FROM ".(!empty($_GET["copy_view"]) && $_GET["copy_view"] == 1 ? "`orders`" : "`".$this->table."`")." AS `ord`,
    				`products`, `navigace`, `customers` AS `cus`
    			WHERE `ord`.`order_id` = ".$order_id."
    				AND `ord`.`id_produktu_db` = `products`.`id`
    				AND `products`.`navigace_polozka_id` = `navigace`.`id`
    				AND `cus`.`id` = `ord`.`customers_id`
    			union all
    			select
    				null, null, null, null, null, null, null, null, null, null,
    				null, null, null, null, null, null, null, null, null, null,
    				null, null, null, null, null, null, null, null, null, null,
    				null, null, null, null, null, 
                                    '', tp.description, tp.product_id, tp.activation_price, tp.activation_price_EUR,
    				0, tor.pocet_kusu, tp.name, null, null, null, null, null, null, null,
    				null, null, null, null, null, null, null, null, null, null,
    				null, null, null, null, null, null, null, null, null, null,
    				null, null, null, null, null, null, null, null, null, null,
    				null, null, null, null, null, null, null, null, null, null,
    				null, null, null, null, null, null, null, null, null, null, 
                                    null, null, null, null, null, null, null, null, null, null, null, null, null
    			from tarifs_prop tp
    			inner join tarifs_orders tor on tp.id = tor.tarif_prop_id
    			where tor.order_id = ".$order_id."
    			union all
    			select
    				null, null, null, null, null, null, null, null, null, null,
    				null, null, null, null, null, null, null, null, null, null,
    				null, null, null, null, null, null, null, null, null, null,
    				null, null, null, null, null, '', b.description, b.product_id, b.activation_price, b.activation_price_EUR,
    				0, tor.pocet_kusu, b.name, null, null, null, null, null, null, null,
    				null, null, null, null, null, null, null, null, null, null,
    				null, null, null, null, null, null, null, null, null, null,
    				null, null, null, null, null, null, null, null, null, null,
    				null, null, null, null, null, null, null, null, null, null,
    				null, null, null, null, null, null, null, null, null, null, 
                                    null, null, null, null, null, null, null, 
                                    null, null, null, null, null, null
    			from balicky b
    			inner join tarifs_orders tor on b.id = tor.tarif_balicek_id
    			where tor.order_id = ".$order_id."
    			ORDER BY `user_id` desc";

    а филе нам кабанам, надо продукты из разных таблиц объединить в одну, ну и фто што таблицы разного размера. Зато когда добавляешь новый столбец в таблицу, нужно вручную считать сколько раз нужно добавить null :D

    Lameaux, 29 Ноября 2011

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

    +182

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    /**
    	 * Je jedna deklarovana
    	 * @param mix $value
    	 * @param mix $value2
    	 * @return bool true pokud je schodne
    	 */
    	public static function isOneDeclarate($value, $value2){
    		return (!empty($value) and empty($value2) 
                                    or (empty($value) and !empty($value2)) 
                                    or (!empty($value) and !empty($value2)));
    	}

    Парень хотел написать функцию, которая проверит, что хотя бы один из параметров не пустой, но не учил в школе дискретную математику...

    Lameaux, 24 Ноября 2011

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