availableSpots ? $session->availableSpots : 0; $show_available_spots = false; if ($session->unlimitedSeats) {$show_available_spots = false;} else { if (isset($available_spots_total) && $available_spots_total < 50) { $show_available_spots = true; } else { $show_available_spots = false; } } $priceNotes = $session->priceNotes; $session_extra = $this->GetSessionVar($session); $skillLevelOption = $session->skillLevelOption; if ($skillLevelOption == 'grade') { $gradefrom = $session->gradeRange->from ?? $session->activityId->gradeRange->from; $gradeto = $session->gradeRange->to ?? $session->activityId->gradeRange->to; $icon = "child"; } else { $icon = "child";} $sessionPrice = $session->price; $sessionPriceRange = $session->activityId->priceRange; $sessionPriceRangeFrom = $sessionPriceRange->from; $sessionPriceRangeto = isset($sessionPriceRange->to) ? $sessionPriceRange->to : null; $sessionDateFromFilter = date('n', strtotime($session->dateTimestamp->from)); $sessionDateToFilter = date('n', strtotime($session->dateTimestamp->to)); $oneDaySelectedDate = $this->getValue('oneDaySelectedDate', $session, false); $agefrom = $session->ageRange->from ?? $session->activityId->ageRange->from; $ageto = $session->ageRange->to ?? $session->activityId->ageRange->to; //$location_name = $session->siteLocationId->name; $location_state = $session->siteLocationId->state; $location_country = $session->siteLocationId->country; $location_link = $session->siteLocationId->googleMapUrl; if (!$location_link) { $location_link = "https://www.google.com/maps/place/" . $location . ",+" . $location_state . ",+" . $location_country; } //$description= $session->description; //$description= substr_replace($description, "...", 250); $themeimgFile = plugin_dir_url(__FILE__) . "/assets/images/icon.svg"; $currentdate = date("Y-m-d"); $datefrom = $this->parseDate($session->dateTimestamp->from, 'Y-m-d'); $dateto = $this->parseDate($session->dateTimestamp->to, 'Y-m-d'); //echo $this->datediffInWeeks($currentdate, $dateto); //echo $weeks = $this->weeks_between($datefrom, $dateto); $day = $this->parseDate($session->dateTimestamp->from, 'd'); $month = $this->parseDate($session->dateTimestamp->from, 'm'); $year = $this->parseDate($session->dateTimestamp->from, 'Y'); $dayofWeek[] = $this->dayofweek($day, $month, $year); if ($session->sessionType == "multiWeek") { //print_r($session); ?>