newAct($_GET['sd4'])==true) { $re = $u->buyItem($sid,(int)$_GET['buy'],(int)$_GET['x']); }else{ $re = 'Вы уверены что хотите купить этот предмет?'; } }elseif(isset($_GET['add_alt_char'])) { //Ложим предмет $itm = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `data` LIKE "%alt_cat=%" AND `id` = "'.mysql_real_escape_string($_GET['add_alt_char']).'" AND `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `inShop` = "0" AND `inOdet` = "0" AND `inTransfer` = "0" LIMIT 1')); if(!isset($itm['id'])) { $re = 'Подходящий предмет не найден'; }else{ if($u->itemsX($itm['id'])==1) { $itm_m = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "'.$itm['item_id'].'" LIMIT 1')); mysql_query('UPDATE `items_users` SET `inShop` = "'.$sid.'" WHERE `id` = "'.$itm['id'].'" LIMIT 1'); $re = 'Предмет "'.$itm_m['name'].'" успешно добавлен'; }else{ //группа $re = 'Разделите группу предметов'; } } }elseif(isset($_GET['clear_alt_char'])){ //Ложим предмет $itm = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `data` LIKE "%alt_cat=%" AND `id` = "'.mysql_real_escape_string($_GET['clear_alt_char']).'" AND `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `inShop` = "'.$sid.'" AND `inOdet` = "0" AND `inTransfer` = "0" LIMIT 1')); if(!isset($itm['id'])) { $re = 'Подходящий предмет не найден'; }else{ $itm_m = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "'.$itm['item_id'].'" LIMIT 1')); mysql_query('UPDATE `items_users` SET `inShop` = "0",`lastUPD` = "'.time().'" WHERE `id` = "'.$itm['id'].'" LIMIT 1'); $re = 'Предмет "'.$itm_m['name'].'" успешно убран'; } }elseif(isset($_GET['createLaba'])) { $vaza = true; $rec1 = ''; $rec2 = ''; $rec3 = ''; $rec3l = 0; $sp = mysql_query('SELECT `id`,`item_id` FROM `items_users` WHERE `data` LIKE "%alt_cat=1%" AND `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `inShop` = "'.$sid.'" AND `inOdet` = "0" AND `inTransfer` = "0" ORDER BY `item_id` ASC LIMIT 1000'); while($pl = mysql_fetch_array($sp)) { if($pl['item_id']!=2555) { $rec1 .= $pl['item_id'].','; $rec3 .= ' `id`='.$pl['id'].' OR'; $rec3l++; }elseif($pl['item_id']==2555) { $vaza = true; } } $sp = mysql_query('SELECT `id`,`item_id` FROM `items_users` WHERE `data` LIKE "%alt_cat=2%" AND `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `inShop` = "'.$sid.'" AND `inOdet` = "0" AND `inTransfer` = "0" ORDER BY `item_id` ASC LIMIT 1000'); while($pl = mysql_fetch_array($sp)) { if($pl['item_id']!=2555) { $rec2 .= $pl['item_id'].','; $rec3 .= ' `id`='.$pl['id'].' OR'; $rec3l++; }elseif($pl['item_id']==2555) { $vaza = true; } } $rec1 = rtrim($rec1,','); $rec2 = rtrim($rec2,','); $rec3 = rtrim($rec3,'OR'); $rec = mysql_fetch_array(mysql_query('SELECT * FROM `alt_cat` WHERE `itm_1` = "'.$rec1.'" AND `itm_2` = "'.$rec2.'" AND `shop` = "'.$sid.'" AND `active` = "1" LIMIT 1')); if(isset($rec['id']) && $rec3 = '') { $itm = mysql_fetch_array(mysql_query('SELECT `id`, `name` FROM `items_main` WHERE `id` = "'.$rec['itm_add'].'" LIMIT 1')); $itm_data = mysql_fetch_array(mysql_query('SELECT `data` FROM `items_main_data` WHERE `items_id` = "'.mysql_real_escape_string($itm['id']).'"')); if(isset($itm['id'])) { if($vaza==true && isset($itm_data['data'])){ $itm_data = \Core\ConversionHelper::dataStringToArray($itm_data['data']); $itm_data = array('srok'=>$itm_data['srok']); // Извлекаем только срок! $itm_data['srok'] = (int)$itm_data['srok']; // Только Цифры! if(isset($itm_data['srok']) and $itm_data['srok']>0){ $itm_data['srok'] = $itm_data['srok']*3; // В три раза больше срок хранения! $itm_data = '|'.\Core\ConversionHelper::arrayToDataString($itm_data); } } else { $itm_data = NULL; } \User\ItemsModel::addItem($itm['id'],$u->info['id'],$itm_data,NULL,NULL,true); mysql_query('UPDATE `items_users` SET `delete` = "'.time().'",`inShop` = "0" WHERE '.$rec3.' LIMIT '.$rec3l); $re = 'Предмет "'.$itm['name'].'" был успешно создан!'; }else{ $re = 'Не удалось получить чарку по рецепту...'; } } else { if($u->info['admin']>0) { echo '
Лаборатория |
Масса: =$u->aves['now']?>/=$u->aves['max']?>
'Соединить чарки',2=>'Рецепты');
$i=1;
while($i!=-1)
{
if(isset($otdels_array[$i]))
{
if(isset($_GET['otdel']) && $_GET['otdel']==$i)
{
$color = 'C7C7C7';
} else {
$color = 'e2e0e0';
}
echo '
'.$otdels_array[$i].'
';
} else {
$i = -2;
}
$i++;
}
?>
|