1. PHP / Говнокод #1171

    +152

    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
    if (@$_GET['sortid']=="asc") { $sortus="ORDER BY id ASC"; $urlsortid="desc"; }
     elseif (@$_GET['sortid']=="desc") { $sortus="ORDER BY id DESC"; $urlsortid="asc"; }	
     else { $urlsortid="desc"; }
     
     if (@$_GET['sortdatereg']=="asc") { $sortus="ORDER BY date_reg ASC"; $urlsortdatreg="desc"; }
    elseif (@$_GET['sortdatereg']=="desc"){ $sortus="ORDER BY date_reg DESC"; $urlsortdatreg="asc"; }
    else { $urlsortdatreg="asc";}
    
    
     if (@$_GET['sortmail']=="asc") { $sortus="ORDER BY email ASC"; $urlsortmail="desc"; }
    elseif (@$_GET['sortmail']=="desc"){ $sortus="ORDER BY email DESC"; $urlsortmail="asc"; }
     else { $urlsortmail="asc"; }
     
     if (@$_GET['sortname']=="asc") { $sortus="ORDER BY username ASC"; $urlsortname="desc"; }
    elseif (@$_GET['sortname']=="desc"){ $sortus="ORDER BY username DESC"; $urlsortname="asc"; }
     else { $urlsortname="asc"; }
     
      if (@$_GET['sortip']=="asc") { $sortus="ORDER BY reg_ip ASC"; $urlsortip="desc"; }
    elseif (@$_GET['sortip']=="desc"){ $sortus="ORDER BY reg_ip DESC"; $urlsortip="asc"; }
     else { $urlsortip="asc"; }

    Запостил: guest, 09 Июня 2009

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

    • Не то, чтобы говнокод. Просто нужен рефакторинг.
      Ответить

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