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

    Всего: 1

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

    +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
    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
    function getTestDataById ($testid) {
    
    	$query="select * from mdl_test where id=".$testid."";
    	$result = mysql_query($query) or die('getTestDataById query failed: ' . mysql_error());
    
    	while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
    
    	$courseid=$row['courseid'] ;
    	$moduleid=$row['moduleid'];
    	$name=$row['name'];
    	$maxscore=$row['maxscore'];
    	$successscore=$row['successscore'];
    	$attempts=$row['attempts'];
    	$dur=$row['dur'];
    	$showsuccessmessage=$row['showsuccessmessage'];
    	$successmessage=$row['successmessage'];
    	$showfailedmessage=$row['showfailedmessage'];
    	$failedmessage=$row['failedmessage'];
    	$showtestsuccessmessage=$row['showtestsuccessmessage'];
    	$testsuccessmessage=$row['testsuccessmessage'];
    	$showtestfailedmessage=$row['showtestfailedmessage'];
    	$testfailedmessage=$row['testfailedmessage'];
    	$freequestions=$row['freequestions'];
    	$questionsorder=$row['questionsorder'];
    	$defertest=$row['defertest'];
    	$totalperpage=$row['totalperpage'];
    	$showcorrectreply=$row['showcorrectreply'];
    	$showscore=$row['showscore'];
    	$limittype = $row['limittype'];
    	$annotation = $row['annotation'];
    
    	} // end while
    
    	$res=array('courseid'=>$courseid,
    			   'moduleid'=>$moduleid,
    			   'name'=>stripslashes($name),
    			   'maxscore'=>$maxscore,
    			   'successscore'=>$successscore,
    			   'attempts'=>$attempts,
    			   'dur'=>$dur,
    			   'showsuccessmessage'=>$showsuccessmessage,
    			   'successmessage'=>stripslashes($successmessage),
    			   'showfailedmessage'=>$showfailedmessage,
    			   'failedmessage'=>stripslashes($failedmessage),
    			   'showtestsuccessmessage'=>stripslashes($showtestsuccessmessage),
    			   'testsuccessmessage'=>stripslashes($testsuccessmessage),
    			   'showtestfailedmessage'=>stripslashes($showtestfailedmessage),
    			   'testfailedmessage'=>stripslashes($testfailedmessage),
    			   'freequestions'=>stripslashes($freequestions),
    			   'questionsorder'=>stripslashes($questionsorder),
    			   'defertest'=>stripslashes($defertest),
    			   'totalperpage'=>stripslashes($totalperpage),
    			   'showcorrectreply'=>stripslashes($showcorrectreply),
    			   'showscore'=>stripslashes($showscore),
    				'limittype' => stripslashes($limittype),  // Total 21 items
    				'annotation' => stripslashes($annotation));
    
    	return $res;
    
    	} // end of function

    От начальника отдела))) Как вам?))

    Krugly, 09 Марта 2013

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