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

    Всего: 3

  2. PHP / Говнокод #17923

    +157

    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
    <select multiple  name="fields[]">
    <option value="idblank" <?php echo in_array("idblank", $book_fields)?"selected":""; ?> >idblank</option>
    <option value="n_dog" <?php echo in_array("n_dog", $book_fields)?"selected":""; ?> >n_dog</option>
    <option value="n_failpay" <?php echo in_array("n_failpay", $book_fields)?"selected":""; ?> >n_failpay</option>
    <option value="senior" <?php echo in_array("senior", $book_fields)?"selected":""; ?> >senior</option>
    <option value="fio" <?php echo in_array("fio", $book_fields)?"selected":""; ?> >fio</option>
    <option value="date_init" <?php echo in_array("date_init", $book_fields)?"selected":""; ?> >date_init</option>
    <option value="fio_client" <?php echo in_array("fio_client", $book_fields)?"selected":""; ?>>fio_client</option>
    <option value="date_plat" <?php echo in_array("date_plat", $book_fields)?"selected":""; ?>>date_plat</option>
    <option value="pros_total" <?php echo in_array("pros_total", $book_fields)?"selected":""; ?>>pros_total</option>
    <option value="summa_post" <?php echo in_array("summa_post", $book_fields)?"selected":""; ?>>summa_post</option>
    <option value="ostatok" <?php echo in_array("ostatok", $book_fields)?"selected":""; ?>>ostatok</option>
    <option value="effect" <?php echo in_array("effect", $book_fields)?"selected":""; ?>>effect</option>
    <option value="ef" <?php echo in_array("ef", $book_fields)?"selected":""; ?>>ef</option>
    <option value="idcolor" <?php echo in_array("idcolor", $book_fields)?"selected":""; ?>>idcolor</option>
    <option value="inn" <?php echo in_array("inn", $book_fields)?"selected":""; ?>>inn</option>
    <option value="n_schet" <?php echo in_array("n_schet", $book_fields)?"selected":""; ?>>n_schet</option>
    <option value="dom_tel" <?php echo in_array("dom_tel", $book_fields)?"selected":""; ?>>dom_tel</option>
    <option value="mob_tel" <?php echo in_array("mob_tel", $book_fields)?"selected":""; ?>>mob_tel</option>
    <option value="work_tel" <?php echo in_array("work_tel", $book_fields)?"selected":""; ?>>work_tel</option>
    <option value="reg_city" <?php echo in_array("reg_city", $book_fields)?"selected":""; ?>>reg_city</option>
    <option value="reg_region" <?php echo in_array("reg_region", $book_fields)?"selected":""; ?>>reg_region</option>
    <option value="reg_district" <?php echo in_array("reg_district", $book_fields)?"selected":""; ?>>reg_district</option>
    <option value="reg_settlement" <?php echo in_array("reg_settlement", $book_fields)?"selected":""; ?>>reg_settlement</option>
    <option value="reg_adress" <?php echo in_array("reg_adress", $book_fields)?"selected":""; ?>>reg_adress</option>
    <option value="live_city" <?php echo in_array("live_city", $book_fields)?"selected":""; ?>>live_city</option>
    <option value="live_region" <?php echo in_array("live_region", $book_fields)?"selected":""; ?>>live_region</option>
    <option value="live_district" <?php echo in_array("live_district", $book_fields)?"selected":""; ?>>live_district</option>
    <option value="live_settlement" <?php echo in_array("live_settlement", $book_fields)?"selected":""; ?>>live_settlement</option>
    <option value="live_adress" <?php echo in_array("live_adress", $book_fields)?"selected":""; ?>>live_adress</option>
     </select>

    Проверка на выделенный пункт списка

    noffily, 03 Апреля 2015

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

    +163

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    /*--------Перевод текста в верхний регистр-------------*/
    function upper($str) { 
        $trans=array( 
         "а" => "А",  "б" => "Б",  "в" => "В",  "г" => "Г",  "д" => "Д",  "е" => "Е",  
         "ё" => "Ё",  "ж" => "Ж",  "з" => "З",  "и" => "И",  "й" => "Й",  "к" => "К",  
         "л" => "Л",  "м" => "М",  "н" => "Н",  "о" => "О",  "п" => "П",  "р" => "Р",  
         "с" => "С",  "т" => "Т",  "у" => "У",  "ф" => "Ф",  "х" => "Х",  "ц" => "Ц",  
         "ч" => "Ч",  "ш" => "Ш",  "щ" => "Щ",  "ь" => "Ь",  "ы" => "Ы",  "ъ" => "Ъ",  
         "э" => "Э",  "ю" => "Ю",  "я" => "Я",  
        );  
        return strtr($str,  $trans);  
    }

    noffily, 02 Апреля 2015

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

    +155

    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
    foreach ($out as $fio => $massdate) {
    	foreach ($massdate as $date => $masshour) {
    		foreach ($masshour as $hour => $massmm) {
    			foreach ($massmm as $minute) {
    				if (!isset(${'ctrl'.$hour.$date.$fio})) {
    					$rez=0; 
    					$prv_minute=$minute; 
    					${'ctrl'.$hour.$date.$fio}=1;} 
    					ELSE {$rez=$minute-$prv_minute; 
    					 $prv_minute=$minute; }
    																								
    				$summ += $rez;
    			}	
    if (count($massmm)<>1) {$sr=round($summ/(count($massmm)-1), 2);}
    else {$sr=round($summ/count($massmm), 2);}
    $all_out[$fio][$date][$hour]=array(count($massmm), $sr);
    $hours_arr[]=$hour*1;
    //echo "Всего ".count($massmm)." комментария(ев) Среднее время $sr минут(ы) $hour <br>";
    $summ=0;
    		}
    	}
    } 
    $hours_arr=array_unique($hours_arr);
    asort($hours_arr);

    Подарок прошлого разработчика

    noffily, 02 Апреля 2015

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