From 3a94dc815ecb3b259e9fa04385420cd99c291e41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=20=D0=9B=D0=B0=D1=80?= =?UTF-8?q?=D0=B8=D0=BE=D0=BD=D0=BE=D0=B2?= Date: Fri, 10 Mar 2023 20:28:24 +0700 Subject: [PATCH] =?UTF-8?q?=D0=91=D0=B0=D0=B3=20=D1=81=20=D0=B8=D0=B7=D0=B1=D1?= =?UTF-8?q?=80=D0=B0=D0=BD=D0=BD=D1=8B=D0=BC=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Classes/RusDate.php | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/app/Classes/RusDate.php b/app/Classes/RusDate.php index 8442c26..217778e 100644 --- a/app/Classes/RusDate.php +++ b/app/Classes/RusDate.php @@ -46,18 +46,25 @@ class RusDate } public static function selected_item($item) { - $Str = json_decode($_COOKIE['favorite_house'], true); - //$Arr = explode(",", $Str); - if (in_array($item, $Str)) - return " active "; - else + if (empty($_COOKIE['favorite_house'])) return ""; - + else { + $Str = json_decode($_COOKIE['favorite_house'], true); + //$Arr = explode(",", $Str); + if (in_array($item, $Str)) + return " active "; + else + return ""; + } } public static function count_item_fav() { - $Arr = json_decode($_COOKIE['favorite_house'], true); - return count($Arr); + if (empty($_COOKIE['favorite_house'])) + return 0; + else { + $Arr = json_decode($_COOKIE['favorite_house'], true); + return count($Arr); + } } public static function clear_items() { -- 1.7.10.4