public function howLongThisMenstruation($start, $user) { $db = parent::connect(); $result = $db->prepare("SELECT * FROM `intim_calendar` WHERE `user` = ? && `blood` > ? && `date` > ? ORDER BY `date`"); $result->execute(array($user, 0, $start)); $events = $result->fetchAll(); $intim = new IntimCalendar(); $time = $intim->howLongBetweenMenstruation($user) + $start; foreach ($events as $day) { if ($day['date'] - $start > 5 * 86400) { $time = $day['date']; break; } } return $time; }
$today = strtotime("last monday", $today); $plus = "+8 days"; $nextDate = "+8 days"; $previousDate = "monday"; $num = 7; break; } $today_const = $today; $next = strtotime($plus, $today); $nextDate = strtotime($nextDate, $today); $previousDate = strtotime($previousDate, $today); $entries = new IntimCalendar(); $temperatureSelect = $entries->getLastTemperatur($profil->getId()); $entriesAll = $entries->getEntries($today, $next, $profil->getId()); $thisWeek = strtotime("+8 days", $today); $howLongBetweenMenstruation = $entries->howLongBetweenMenstruation($profil->getId()); $howLongMenstruation = $entries->howLongMenstruation($profil->getId()); $lastMenstruation = $entries->getLastMenstruation($profil->getId()); $lastOvulation = $entries->getLastOvulation($profil->getId()); $predictionTerm = 6; //IMAGE $First_day_of_menstraution_img = $entries->getAllFirstDayMenstruation($profil->getId()); //IMAGE end if ($term == "month") { $month['monthNum'] = date("n", $today); $month['month'] = $mesic[$month['monthNum'] - 1] . ' ' . date("Y", $today); if ($month['monthNum'] == 1) { $month['month-1'] = $mesic[11]; } else { $month['month-1'] = $mesic[$month['monthNum'] - 2]; }