61 lines
1.8 KiB
PHP
61 lines
1.8 KiB
PHP
<?
|
|
/*
|
|
1 Øëåì
|
|
2 Íàðó÷è
|
|
3 Ìå÷
|
|
4 Ðóáàõà
|
|
5 Áðîíÿ
|
|
6 Ïëàù
|
|
7 Ïîÿñ
|
|
8 Ñåðãè
|
|
9 Àìóëåò
|
|
10 Êîëüöî
|
|
11 Ïå÷àòêè
|
|
12 --
|
|
13 Ïåð÷àòêè
|
|
14 Ùèò
|
|
15 --
|
|
16 Øòàíû
|
|
17 Áîòèíêè
|
|
|
|
items_main items_users
|
|
|
|
SELECT `iu`.*, `im`.*
|
|
FROM `items_users` AS `iu`
|
|
LEFT JOIN `items_main` AS `im`
|
|
ON `iu`.`item_id`=`im`.`id`
|
|
WHERE `iu`.`data` LIKE '%frompisher=1%' AND `iu`.`uid` = "3" AND `iu`.`delete` = "0" AND `iu`.`inOdet` = "0" AND `im`.`inslot` >0 AND `im`.`inslot` <18;
|
|
|
|
|
|
$u->info['money1'];
|
|
*/
|
|
$itmm=mysql_query('SELECT `iu`.`id` AS iid, `iu`.*, `im`.*
|
|
FROM `items_users` AS `iu`
|
|
LEFT JOIN `items_main` AS `im`
|
|
ON `iu`.`item_id`=`im`.`id`
|
|
WHERE `iu`.`data` LIKE "%frompisher=1%" AND `iu`.`uid` = "'.$u->info['id'].'" AND `iu`.`delete` = "0" AND `iu`.`inOdet` = "0" AND `im`.`inslot` >0 AND `im`.`inslot` <18');
|
|
$sell=0;
|
|
$selli=0;
|
|
while( $itm = mysql_fetch_array($itmm))
|
|
{
|
|
$sell += $itm['price1'];
|
|
$u->info['money1'] + $itm['price1'];
|
|
mysql_query('UPDATE `items_users` SET `delete`="'.time().'" WHERE `id` = "'.$itm['iid'].'" LIMIT 1');
|
|
$selli++;
|
|
}
|
|
if ($sell>0)
|
|
{
|
|
mysql_query('UPDATE `users` SET `money`=`money`+"'.$sell.'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
|
|
$txt .= '<br>Çàáðàëà ó òåáÿ <b><font color=#009999>'.$selli.'</b></font> âåùåé.';
|
|
$txt .= '<br>Äåðæè <b><font color=#009999>'.$sell.'</b></font> êð. ìàëåö.';
|
|
$txt .= '<br>Ïðèíîñè åùå - ëþáëþ ÿ òàêèå âåùè÷êè!';
|
|
$u->addDelo(1,$u->info['id'],'"<font color=green>Babka.'.$u->info['city'].'</font>": Ïðîäàë áàáêå "<b>'.$selli.'</b>" ïðåäìåòîâ çà <b>'.$sell.'</b> êð.',time(),$u->info['city'],'Babka.'.$u->info['city'].'',(int)$sell,0);
|
|
mysql_query('UPDATE `users_achiv` SET `bv`= `bv`+'.$selli.' WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
|
|
}
|
|
else
|
|
{
|
|
$txt .= '<br><b><font color=red>Íå÷åãî íå ïðèíåñ áàáóøêå!</b></font>';
|
|
}
|
|
|
|
unlink($sell,$itmm,$itm);
|
|
?>
|