- 1
http://govnokod.reformal.ru/proj/govnokod?ia=613048
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+155
http://govnokod.reformal.ru/proj/govnokod?ia=613048
надеюсь, меня поддержат
+130
catch (Exception e)
{
CommonAPI.SetErrorApp(0, MethodBase.GetCurrentMethod().DeclaringType.Name + "." + MethodBase.GetCurrentMethod().Name, e.Message);
#if DEBUG
throw e;
#else
return 0;
#endif
}
+151
var el = jQuery(this);
if(el.html().length<1){
el.prev().find('div').addClass('over');
var url = jQuery(jQuery(el.prev().children()[0]).children()[1]).attr('href');
url = url.replace('index.php', '')+'?ajax=1';
//url = url.replace(/&task=[^&]+/, '&task=subcatalogs');
el.html(jQuery.ajax({
url: url,
async: false
}).responseText);
var list = jQuery(el.children()[0]);
list.find('.parent').each(function(i,item){
jQuery(item).bind('click', catalogs_click);
jQuery(item).bind('mouseover', catalogs_mouseover);
jQuery(item).bind('mouseout', catalogs_mouseout);
jQuery(item).prev().bind('mouseover', catalogs_mouseover2);
jQuery(item).prev().find('div').bind('mouseover', catalogs_mouseover3);
jQuery(item).prev().find('div a').bind('mouseover', catalogs_mouseover4);
jQuery(item).prev().find('div img').bind('mouseover', catalogs_mouseover5);
});
list.find('.final').each(function(i,item){
jQuery(item).bind('mouseover', catalogs_mouseover6).bind('mouseout', catalogs_mouseout6);
jQuery(item).find('div').bind('mouseover', catalogs_mouseover7).bind('mouseout', catalogs_mouseout7);
jQuery(item).find('div a').bind('mouseover', catalogs_mouseover8).bind('mouseout', catalogs_mouseout8);
jQuery(item).find('div img').bind('mouseover', catalogs_mouseover9).bind('mouseout', catalogs_mouseout9);
});
list.show();
}else{
var list = jQuery(el.children()[0]);
if(!list.children().find('div').hasClass('over')){
el.prev().find('div').addClass('over');
}
list.show();
}
Взялся за проект на фрилансе...
+160
<a href="javascript:;" class="detail_back_link" ahref="/services_catalog/appl_list.php?SECTION=<?=$arResult["Block"]["ID"]?>"></a>
Добавить атрибут ahref к тегу <a> ??? Фантазер-разработчик. И написать href="javascript:;"........
Караул.
+51
#include<iostream>
#include<istream>
#include<fstream>
#include<string>
using namespace std;
const int con=100;
const int MAX=3;
class movie
{
public:
string title;
string genre;
string country;
int year;
double gainings;
};
int main(); {
{
string* argv = new string[10]={ "Star wars", "Harry Potter" , "Lion king", "Lord of the rings" , "Evgozavur", "Cow's house" , "Snow dogs", "Ice age" , "Shrek", "Dino"};
int n=1,gainigs=10;
int a,b,c;
movie film1;
movie film2;
movie film3;
cout << " Enter the title:"<<endl;
cin>>film1.title;
cout << " Enter the genre:"<<endl;
cin>>film1.genre;
cout << " Enter the country:"<<endl;
cin>>film1.dev;
cout << " Enter the year:"<<endl;
cin>>film1.year;
cout << " Enter the gainings:"<<endl;
cin>>a;
while (a>10){
cout << " Enter the gainings:"<<endl;
cin>>a;
}film1.gainings=a;
cout<<endl<<endl<<endl;
cout<<" Enter the title:"<<endl;
cin>>film2.title;
cout<<" Enter the genre:"<<endl;
cin>>film2.genre;
cout<<" Enter the dev:"<<endl;
cin>>film2.dev;
cout<< " Enter the year:"<<endl;
cin >> film2.year;
cout<<" Enter the gainings:"<<endl;
cin>>b;
while (b>10){
cout<<" Enter the gainings:"<<endl;
cin>>b;
}game2.gainings=b;
cout<<endl<<endl<<endl;
cout<<" Enter the title:"<<endl;
cin>>film3.title;
cout<<" Enter the genre:"<<endl;
cin>>film3.genre;
cout<<" Enter the dev:"<<endl;
cin>>film3.dev;
cout<<" Enter the year:"<<endl;
cin>>film3.year;
cout<<" Enter the gainings:"<<endl;
cin>>c;
while (c>10){
cout<<" Enter the gainings:"<<endl;
cin>>c;
}film3.gainings=c;
for (int j=0; j<n; j++)
{
cout<<""<<endl;
cout<<"Title: " <<film1.title<<endl;
cout<<"Genre: " <<film1.genre<<endl;
cout<<"Year: " <<film1.year<<endl;
cout<<"Gainings: "<<film1.gainings<<endl;
cout<<""<<endl;
cout<< "Title: "<<film2.title<<endl;
cout<< "Genre: "<<film2.genre<<endl;
cout<< "Year: "<<film2.year<<endl;
cout<< "Gainings: " << film2.gainings<<endl;
cout<<""<<endl;
cout<<"Title: " <<film3.title <<endl;
cout<<"Genre: " <<film3.genre <<endl;
cout<<"Year: " <<film3.year <<endl;
cout<<"Gainings: "<<film3.Gainings<<endl;
cout<<"works"<<endl;
}
cout<<"printing works"<<endl;
argv[0]=film1.title;
argv[1]=film1.genre;
argv[2]=film1.year;
argv[3]=film1.gainings;
cout<<"adding works"<<endl;
cout<<endl<<endl<<endl;
cout<<argv[0]<<endl;
cout<<argv[1]<<endl;cout<<argv[2]<<endl;cout<<argv[3]<<endl;
cout<<"print after add works"<<endl;
system("pause");
return 0;
}
Из http://forums.bgdev.org/index.php?showtopic=43872
−168
-- Процедура формирования таблицы анализа по FIR
CREATE PROCEDURE KojevnikovFir
@DateFo varchar(10),
@DateTo varchar(10)
AS DECLARE @Polet int, @ProcPolet numeric(4,2)
-- определяю кол-во выполненных рейсов в диапазоне дат----
SET @Polet = (SELECT DISTINCT Count(ID) FROM PPLS WHERE
( ( FLI_ENTRY=1 or FLI_EXIT=1 ) or (DEP=1 and DEP_AERODROME like'UK%' ) or
(ARR=1 and DEST_AERODROME Like'UK%') ) and (ENTRY_TIME >=@DateFo and ENTRY_TIME <=@DateTo))
----------- Начало формирования таблицы FIR-------------------
-- Создаем SCROLL курсор 1 для чтения
DECLARE Cursor_All_Pol CURSOR SCROLL KEYSET TYPE_WARNING FOR SELECT Marsrut,All_Polet
FROM Marsr_All_Pol FOR READ ONLY
-- Открытие курсора 1 и наполнение его данными
OPEN Cursor_All_Pol DECLARE @Marsrut char(11), @All_Polet int,@Count1 int,@Count1_end int
SET @Count1=1 SET @Count1_end = @@CURSOR_ROWS
-- ===========обьявляю и заполняю курсор по 2 таблице==============
DECLARE Cursor_Air CURSOR SCROLL KEYSET TYPE_WARNING
FOR SELECT Marsrut,TYPE_AIRCRAFT,kol_TypeAir FROM Marsr_kol_Air FOR READ ONLY
-- Открытие курсора 2 и наполнение его данными
OPEN Cursor_Air
DECLARE @MarsrutAir char(11),@Type nvarchar(4), @Air_Polet int,@Count2 int,@Count2_end int
SET @Count2 = 0 SET @Count2_end = @@CURSOR_ROWS
-- ===========обьявляю и заполняю курсор по 3 таблице==============
DECLARE Cursor_AK CURSOR SCROLL KEYSET TYPE_WARNING
FOR SELECT Marsrut,ICAO,AK,kol_AK FROM dbo.Marsr_kol_AK FOR READ ONLY
-- Открытие курсора 2 и наполнение его данными
OPEN Cursor_AK
DECLARE @MarsrutAK char(11),@ICAO char(3),@AK varchar(60),@kol_AK int,@Count3 int,@Count3_end int
SET @Count3 = 0 SET @Count3_end = @@CURSOR_ROWS
-- цикл по первому курсору
WHILE @Count1 < @Count1_end BEGIN
-- на 1 запись курсора 1
FETCH NEXT FROM Cursor_All_Pol INTO @Marsrut, @All_Polet
-- вставляю строку маршрута и кол-ва полетов в таблицу
SET @ProcPolet = ((@All_Polet * 100)/@Polet)
INSERT KojevnikovAnalizFIR (Marsrut,All_Polet,PrcAll,TYPE_AIRCRAFT,kol_TypeAir,ICAO,AK,kol_AK)
VALUES (@Marsrut,@All_Polet,@ProcPolet,null,null,null,null,null)
SET @Count1 = @Count1 + 1
-- цикл по второму курсору
FETCH FIRST FROM Cursor_Air INTO @MarsrutAir,@Type,@Air_Polet
SET @Count2 = 1
-- Формирую 1 строку маршрут + ВС
IF @Marsrut = @MarsrutAir BEGIN
INSERT KojevnikovAnalizFIR (Marsrut,All_Polet,PrcAll,TYPE_AIRCRAFT,kol_TypeAir,ICAO,AK,kol_AK)
VALUES (null,null,null,@Type,@Air_Polet,null,null,null)
END --IF
WHILE @Count2 < @Count2_end BEGIN
-- увеличиваю счетчик курсора 2
FETCH NEXT FROM Cursor_Air INTO @MarsrutAir,@Type,@Air_Polet
-- Формирую строку маршрут + ВС
IF @Marsrut = @MarsrutAir BEGIN
INSERT KojevnikovAnalizFIR (Marsrut,All_Polet,PrcAll,TYPE_AIRCRAFT,kol_TypeAir,ICAO,AK,kol_AK)
VALUES (null,null,null,@Type,@Air_Polet,null,null,null)
END --IF
-- закрываю цикл WHILE 2 (второй курсор)
SET @Count2 = @Count2 + 1
END
-- цикл по третьему курсору
FETCH FIRST FROM Cursor_AK INTO @MarsrutAK,@ICAO,@AK,@kol_AK
SET @Count3 = 1
-- Формирую 1 строку маршрут + АК
IF @Marsrut = @MarsrutAK BEGIN
INSERT KojevnikovAnalizFIR (Marsrut,All_Polet,PrcAll,TYPE_AIRCRAFT,kol_TypeAir,ICAO,AK,kol_AK)
VALUES (null,null,null,null,null,@ICAO,@AK,@kol_AK)
END --IF
WHILE @Count3 < @Count3_end BEGIN
-- увеличиваю счетчик курсора 3
FETCH NEXT FROM Cursor_AK INTO @MarsrutAK,@ICAO,@AK,@kol_AK
-- Формирую строку маршрут + ВС
IF @Marsrut = @MarsrutAK BEGIN
INSERT KojevnikovAnalizFIR (Marsrut,All_Polet,PrcAll,TYPE_AIRCRAFT,kol_TypeAir,ICAO,AK,kol_AK)
VALUES (null,null,null,null,null,@ICAO,@AK,@kol_AK)
END --IF
-- закрываю цикл WHILE 2 (второй курсор)
SET @Count3 = @Count3 + 1
END
-- закрываю цикл WHILE 1 (первый курсор)
END
-- Закрываю курсор 2
CLOSE Cursor_Air
-- Удаляю курсор 1 как обьект
DEALLOCATE Cursor_Air
-- Закрываю курсор 3
CLOSE Cursor_AK
-- Удаляю курсор 1 как обьект
DEALLOCATE Cursor_AK
-- Закрываю курсор
CLOSE Cursor_All_Pol
-- Удаляю курсор 1 как обьект
DEALLOCATE Cursor_All_Pol
------------Конец--------------------
GO
select * from KojevnikovAnalizFIR
truncate table dbo.KojevnikovAnalizFIR
DELETE from KojevnikovAnalizFIR
exec dbo.KojevnikovFir '2004-01-01','2004-01-05'
курсор головного мозга 2.1
−157
SELECT ...
FROM ...
WHERE (CASE WHEN big_part = 1 AND blk_flag = 2 THEN -1 ELSE 0 END) <> -1
;
+96
if movcamn[1] then begin
//
if movcams[ 2] then begin if Nmr= 2 then goto m1;
if movcams[ 3] then begin if Nmr= 3 then goto m1;
if movcams[ 4] then begin if Nmr= 4 then goto m1;
if movcams[ 5] then begin if Nmr= 5 then goto m1;
if movcams[ 6] then begin if Nmr= 6 then goto m1;
if movcams[ 7] then begin if Nmr= 7 then goto m1;
if movcams[ 8] then begin if Nmr= 8 then goto m1;
if movcams[ 9] then begin if Nmr= 9 then goto m1;
if movcams[10] then begin if Nmr=10 then goto m1;
if movcams[11] then begin if Nmr=11 then goto m1;
if movcams[12] then begin if Nmr=12 then goto m1;
if movcams[13] then begin if Nmr=13 then goto m1;
if movcams[14] then begin if Nmr=14 then goto m1;
if movcams[15] then begin if Nmr=15 then goto m1;
if movcams[16] then begin if Nmr=16 then goto m1;
if movcams[17] then begin if Nmr=17 then goto m1;
if movcams[18] then begin if Nmr=18 then goto m1;
if movcams[19] then begin if Nmr=19 then goto m1;
if movcams[20] then begin if Nmr=20 then goto m1;
m1: Summs1:=0; movcams[1]:=False; movcamn[1]:=False;
movcam[1,1]:=False; movcam[1,2]:=False; movcam[1,3]:=False; movcam[1,4]:=False;
Summs2:=0; movcams[2]:=False; movcamn[2]:=False;
movcam[2,1]:=False; movcam[2,2]:=False; movcam[2,3]:=False; movcam[2,4]:=False;
if Nmr=2 then goto m2; // <---
Summs3:=0; movcams[3]:=False; movcamn[3]:=False;
movcam[3,1]:=False; movcam[3,2]:=False; movcam[3,3]:=False; movcam[3,4]:=False;
if Nmr=3 then goto m2; // <---
Summs4:=0; movcams[4]:=False; movcamn[4]:=False;
movcam[4,1]:=False; movcam[4,2]:=False; movcam[4,3]:=False; movcam[4,4]:=False;
if Nmr=4 then goto m2; // <---
Summs5:=0; movcams[5]:=False; movcamn[5]:=False;
movcam[5,1]:=False; movcam[5,2]:=False; movcam[5,3]:=False; movcam[5,4]:=False;
if Nmr=5 then goto m2; // <---
Summs6:=0; movcams[6]:=False; movcamn[6]:=False;
movcam[6,1]:=False; movcam[6,2]:=False; movcam[6,3]:=False; movcam[6,4]:=False;
if Nmr=6 then goto m2; // <---
Summs7:=0; movcams[7]:=False; movcamn[7]:=False;
movcam[7,1]:=False; movcam[7,2]:=False; movcam[7,3]:=False; movcam[7,4]:=False;
if Nmr=7 then goto m2; // <---
Summs8:=0; movcams[8]:=False; movcamn[8]:=False;
movcam[8,1]:=False; movcam[8,2]:=False; movcam[8,3]:=False; movcam[8,4]:=False;
if Nmr=8 then goto m2; // <---
Summs9:=0; movcams[9]:=False; movcamn[9]:=False;
movcam[9,1]:=False; movcam[9,2]:=False; movcam[9,3]:=False; movcam[9,4]:=False;
if Nmr=9 then goto m2; // <---
//
Summs10:=0; movcams[10]:=False; movcamn[10]:=False;
movcam[10,1]:=False; movcam[10,2]:=False; movcam[10,3]:=False; movcam[10,4]:=False;
if Nmr=10 then goto m2; // <---
Summs11:=0; movcams[11]:=False; movcamn[11]:=False;
movcam[11,1]:=False; movcam[11,2]:=False; movcam[11,3]:=False; movcam[10,4]:=False;
if Nmr=11 then goto m2; // <---
Summs12:=0; movcams[12]:=False; movcamn[12]:=False;
movcam[12,1]:=False; movcam[12,2]:=False; movcam[12,3]:=False; movcam[10,4]:=False;
if Nmr=12 then goto m2; // <---
Summs13:=0; movcams[13]:=False; movcamn[13]:=False;
movcam[13,1]:=False; movcam[13,2]:=False; movcam[13,3]:=False; movcam[10,4]:=False;
if Nmr=13 then goto m2; // <---
Summs14:=0; movcams[14]:=False; movcamn[14]:=False;
movcam[14,1]:=False; movcam[14,2]:=False; movcam[14,3]:=False; movcam[10,4]:=False;
if Nmr=14 then goto m2; // <---
Summs15:=0; movcams[15]:=False; movcamn[15]:=False;
movcam[15,1]:=False; movcam[15,2]:=False; movcam[15,3]:=False; movcam[10,4]:=False;
if Nmr=15 then goto m2; // <---
Summs16:=0; movcams[16]:=False; movcamn[16]:=False;
movcam[16,1]:=False; movcam[16,2]:=False; movcam[16,3]:=False; movcam[10,4]:=False;
if Nmr=16 then goto m2; // <---
Summs17:=0; movcams[17]:=False; movcamn[17]:=False;
movcam[17,1]:=False; movcam[17,2]:=False; movcam[17,3]:=False; movcam[10,4]:=False;
if Nmr=17 then goto m2; // <---
Summs18:=0; movcams[18]:=False; movcamn[18]:=False;
movcam[18,1]:=False; movcam[18,2]:=False; movcam[18,3]:=False; movcam[10,4]:=False;
if Nmr=18 then goto m2; // <---
Summs19:=0; movcams[19]:=False; movcamn[19]:=False;
movcam[19,1]:=False; movcam[19,2]:=False; movcam[19,3]:=False; movcam[10,4]:=False;
m2:
end; end; end; end; end; end; end; end; end; end; // 20 штук
end; end; end; end; end; end; end; end; end; end;
Попалось в одном проекте, который приходилось расчищать.
Особенно позабавило заботливое "// 20 штук" в конце.
+154
<?php
session_start();
include("database.php");
include("filter.php");
$filter = new Filter();
isset($_GET['cat']) ? $id = $filter->Symbols($_GET['cat']) : exit("Вы зашли на страницу без параметра!");
if ( !isset($_POST['class']) && empty($_POST['class']) )
{
include('header.php');
echo '
<title>Title</title>
';
include('slider.php');
echo '
<div id="Content">
';
}
$query_amount = $mysqli->query("SELECT COUNT(id) FROM `page_film` WHERE `genre_film`='$id' ");
$amount_film = $query_amount->fetch_row();
$query = $mysqli->query("SELECT * FROM `page_film` WHERE `genre_film`='$id' ORDER BY `id` DESC ");
if ( $amount_film[0] > 0 )
while( $row = $query->fetch_array(MYSQLI_ASSOC) )
echo '
<div class="block-film">
<a class="block-link-image" href="../films/film.php?id='.$row['id'].'">
<img src="'.$row['poster'].'" />
</a>
<div class="block-film-text">
<p class="film-name">
<a href="../films/film.php?id='.$row['id'].'">'.$row['title'].'</a>
</p>
<p class="film-mini-name">
<a href="../films/film.php?id='.$row['id'].'">'.$row['desc'].'</a>
</p>
<p class="film-genre"><span>'.$row['genre'].'</span></p>
<p class="film-description">'.$row['description'].'</p>
</div>
</div>
';
if ( !isset($_POST['class']) && empty($_POST['class']) )
{
echo '
</div>
</body>
</html>
';
}
?>
+153
$db = new DB_Sql();
$db->connect();
$sql = "SELECT distinct(absnum) FROM articles";
$db->query($sql);
while ($db->next_record()){
$is_img_sql[] = $db->f('absnum');
}
$Open = opendir($_SERVER['DOCUMENT_ROOT'].'/img/forall/a/');
while(false !== ($gdir = readdir($Open))){
if($gdir != "." && $gdir != ".."){
$dir[] = $gdir;
}
}
closedir($Open);
foreach ($dir as $fdir){
if(is_dir($_SERVER['DOCUMENT_ROOT'].'/img/forall/a/'.$fdir.'/')){
$Open2 = opendir($_SERVER['DOCUMENT_ROOT'].'/img/forall/a/'.$fdir.'/');
while(false !== ($gdir2 = readdir($Open2))){
if($gdir2 != "." && $gdir2 != ".."){
$tmp = intval($fdir.ereg_replace("\..*","",$gdir2));
if(!in_array($tmp,$is_img_sql)){
$delfile = $_SERVER['DOCUMENT_ROOT'].'/img/forall/a/'.$fdir.'/'.$gdir2;
if (is_file($delfile)){
if (unlink($delfile)){
echo "Файл <b>".$delfile."</b> удален<br>";
}
}
}
}
}
closedir($Open2);
}
}
$Open = opendir($_SERVER['DOCUMENT_ROOT'].'/img/g/');
while(false !== ($gdirg = readdir($Open))){
if($gdirg != "." && $gdirg != ".."){
$dirg[] = $gdirg;
}
}
closedir($Open);
foreach ($dirg as $fdir){
$Open2 = opendir($_SERVER['DOCUMENT_ROOT'].'/img/g/'.$fdir.'/');
while(false !== ($gdir2 = readdir($Open2))){
if($gdir2 != "." && $gdir2 != ".."){
$tmp = intval($fdir.$gdir2.ereg_replace("\..*","",$gdir3));
if(!in_array($tmp,$is_img_sql)){
$delfile = $_SERVER['DOCUMENT_ROOT'].'/img/g/'.$fdir.'/'.$gdir2;
if (is_dir($delfile)){
$Opendel = opendir($delfile);
while(false !== ($gdirdel = readdir($Opendel))){
if($gdirdel != "." && $gdirdel != ".."){
$tpmdel = $delfile."/".$gdirdel;
if (is_file($tpmdel)){
unlink($tpmdel);
}
}
}
if (rmdir($delfile)){
echo "Директория <b>".$delfile."</b> удалена<br>";
}
}
}
}
}
closedir($Open2);
}
$sql = "SELECT distinct(absnum) FROM price";
$db->query($sql);
while ($db->next_record()){
$is_img_price[] = $db->f('absnum');
}
$Open = opendir($_SERVER['DOCUMENT_ROOT'].'/img/forall/p/');
while(false !== ($gdirp = readdir($Open))){
if($gdirp != "." && $gdirp != ".."){
$dirp[] = $gdirp;
}
}
closedir($Open);
foreach ($dirp as $fdir){
$Open2 = opendir($_SERVER['DOCUMENT_ROOT'].'/img/forall/p/'.$fdir.'/');
while(false !== ($gdir2 = readdir($Open2))){
if($gdir2 != "." && $gdir2 != ".."){
$tmp = intval($fdir.ereg_replace("\..*","",$gdir2));
if(!in_array($tmp,$is_img_price)){
$delfile = $_SERVER['DOCUMENT_ROOT'].'/img/forall/p/'.$fdir.'/'.$gdir2;
if (is_file($delfile)){
if (unlink($delfile)){
echo "Файл <b>".$delfile."</b> удален<br>";
}
}
}
}
}