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

    +128

    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
    $w=isset($_POST['w'])?(int)$_POST['w']:time();
        $p=$w-(24*3600)*7;
        $n=$w+(24*3600)*7;
    	mysql_query("set @start=date_format(date_sub(from_unixtime($w), interval weekday(from_unixtime($w)) day), '%m%d'),
    		@end=date_format(date_add(from_unixtime($w), interval 6-weekday(from_unixtime($w)) day), '%m%d')");
        
    	$ste=mysql_fetch_assoc(mysql_query('select @start as s,@end as e'));
    	 if($_SESSION['userinfo']['login']=='Stormsfb') echo "date_format(date_sub(from_unixtime($w), interval weekday(from_unixtime($w)) day), '%m%d') <br>date_format(date_add(from_unixtime($w), interval 6-weekday(from_unixtime($w)) day), '%m%d')<br>".
    							"select *,unix_timestamp(d) as u,
    							date_format(d,'%e %b') as dm,
    							date_format(d,'%m%d') as md,
    							date_format(d,'%d.%m.%y') as mdf from users where 
                        date_format(d, '%m%d') between 
                        ".($_POST['month']!='false'?
    					date('m',$w).'01 and '.date('mt',$w):
    					($ste['s']>$ste['e']?' @start and 1231
    					or date_format(d, "%m%d") between '.date('m',$n).'01 and @end ':' @start and @end '))." order by ".($_POST['month']=='false'?'weekday(d)':'date_format(d,"%m%d")');
    	$q=mysql_query("select *,unix_timestamp(d) as u,
    							date_format(d,'%e %b') as dm,
    							date_format(d,'%m%d') as md,
    							date_format(d,'%d.%m') as mdf from users where 
                        date_format(d, '%m%d') between 
                        ".($_POST['month']!='false'?
    					date('m',$w).'01 and '.date('mt',$w):
    					($ste['s']>$ste['e']?' @start and 1231
    					or date_format(d, "%m%d") between '.date('m',$n).'01 and @end ':' @start and @end '))." order by ".($_POST['month']=='false'?'md':'date_format(d,"%m%d")'),_LINK_) or die(mysql_error(_LINK_)); // || $ste['s']>$ste['e']
    					/*
    					это пиздец
    					"select *,unix_timestamp(d) as u,
    							date_format(d,'%e %b') as dm,
    							date_format(d,'%m%d') as md,
    							date_format(d,'%d.%m') as mdf from users where 
                        date_format(d, '%m%d') between 
                        ".($_POST['month']!='false'?
    					date('m',$w).'01 and '.date('mt',$w):
    					($ste['s']>$ste['e']?' @start and 1231
    					union select *,unix_timestamp(d) as u,
    							date_format(d,"%e %b") as dm,
    							date_format(d,"%m%d") as md,
    							date_format(d,"%d.%m") as mdf from users where 
                        date_format(d, "%m%d") 
    					between '.date('m',$n).'01 and @end ':' @start and @end '))." order by date_format(d, '%m%d')"
    					*/

    после нас хоть трава не расти!

    Запостил: GoodTalkBot, 05 Августа 2011

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

    • После нас хоть мускуль лежи!
      Ответить
    • пых в своем разделе уже не помещается лезет в кучу ? Во истину говнокод будет сайтом посвященным пхп. Во всех разделах php и даже небо и Аллах.
      Ответить

    Добавить комментарий