From 1d881d47adc85ec828174964a36b270f41f8079b Mon Sep 17 00:00:00 2001 From: "Igor Barkov [iwork]" Date: Mon, 14 Jan 2019 18:42:45 +0200 Subject: [PATCH] make class greater --- classes/ShopItem.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/classes/ShopItem.php b/classes/ShopItem.php index 9732611..59eefa0 100644 --- a/classes/ShopItem.php +++ b/classes/ShopItem.php @@ -22,10 +22,11 @@ class ShopItem extends Item */ public function printControls() { - $btnPrice = 'Купить за ' . intval($this->cost) . ' кр.'; + $btnPrice = "Купить за {intval($this->cost)} кр."; + $btnLink = "/shop.php?buy={$this->id}&rnd=".mt_rand(); echo << + onclick="location='{$btnLink}'"> BTN; if ($this->count > 0) echo "
(Осталось: {$this->count} штук)"; }