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() {