- 1
- 2
- 3
if (!isset ($_POST['filter']['state'])) $_POST['filter']['state'] = 0;
.....
$state = @$_POST['filter']['state'] ? $_POST['filter']['state'] : 0;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+164
if (!isset ($_POST['filter']['state'])) $_POST['filter']['state'] = 0;
.....
$state = @$_POST['filter']['state'] ? $_POST['filter']['state'] : 0;
не, ну а вдруг потеряется
−122
sub GenRandomHash()
{
my $self=shift;
my $number=shift||10;
my $plain='';
my @chars=('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
for (my $i=0;$i<$number;$i++)
{
$plain.=$chars[rand(59)+2];
}
return $plain;
}
Мне бы было лень вбить столько символов :)
+147
http://www.microsoft.com/ru-ru/events/html5camp/
+144
http://www.microsoft.com/ru-ru/events/html5camp/
+161
public function selectItems( $id, $withStrictment = 'no' /* $withStrictment = no, retail, discount */ ) {
if( $withStrictment == 'discount' ) $onlyWithRetailPriceSql = " and items.articul in ( select articul from items_discount ) ";
if( $withStrictment == 'retail' ) $onlyWithRetailPriceSql = " and items.articul in ( select articul from retailPrice ) ";
$a = database::select(" SELECT items.* FROM items WHERE items.id = '$id' and items.deleted = 'no' ");
$a = $a[0];
$this->data = database::select("SELECT items.*,
IF(DATEDIFF(now(),created) <= 30, 'Новинка! ', '') as fresh,
( items.quantity - coalesce(view_pendeditemsquantity.sum,0) ) as quantity,
items_comments.comment as dopDescr, items_comments.comment as comment, items_discount.priceAsUSD as discountPrice,
items_packing.packing,
concat(items.name, ' - ', items.quantity) as name
FROM items
LEFT JOIN view_pendeditemsquantity ON items.articul = view_pendeditemsquantity.articul
LEFT JOIN items_comments ON items.articul = items_comments.articul
left join items_discount on items.articul = items_discount.articul
left join items_packing on items.articul = items_packing.articul
WHERE items.group_id in ( select articul from items where is_group = '1' and name = '{$a['name']}' and group_id = '' )
and items.deleted = 'no'
$onlyWithRetailPriceSql
order by items.quantity desc, items.name asc
");
}
+186
$__language = ($__language == 'en')?'ru':'lv';
мозговынос
+147
[color=red]Обратите внимание:[/color]
http://govnokod.ru/user/4847
+147
Обратите внимание:
http://govnokod.ru/user/4847
+967
try
{
var spWave = new SoundPlayer(open.FileName);
spWave.Play();
spWave.Stop();
fileCorrect = true;
}
catch (InvalidOperationException)
{
MessageBox.Show("Файл не является верным WAV-файлом");
fileCorrect = false;
}
catch
{
MessageBox.Show("Ошибка при открытии файла");
fileCorrect = false;
}
Код мой. Писать толковый парсер не было времени.
+162
$('.tdiv').find('.cancel').parent().append('<span class="error">' + r.msg + '</span>')
чистая параноя