Пример #1
0
         $col = (int) $_POST['col'];
         $cena = (int) $_POST['cena'];
         if ($col <= 0) {
             echo 'Введено неправильное количество<meta http-equiv="refresh" content="1;url=town.php?option=' . $option . '">';
         } elseif ($cena <= 0 or $cena > 9999) {
             echo 'Введена неправильная сумма<meta http-equiv="refresh" content="1;url=town.php?option=' . $option . '">';
         } else {
             if ($is_clan_town) {
                 $max_weight = 10000;
                 $opis_res = $_POST['opis_res'];
             } else {
                 $max_weight = 1000;
                 $opis_res = '';
             }
             $Res = new Res();
             $Res->sell_market($it, $town, $col, $cena, $opis_res, $max_weight);
             echo $Res->message;
             echo '<meta http-equiv="refresh" content="3;url=town.php?option=' . $option . '">';
         }
     }
     break;
 case 'purchase':
     $it = (int) $_GET['it'];
     $Item = new Item($it);
     if ($Item->item['town'] != $town) {
         break;
     }
     if ($dostup_clan == 2 and $Item->item['user_id'] != $user_id) {
         echo 'Хотели купить неположенный предмет? Ну-ну!';
         break;
     }