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; }
<?php /** * Created by PhpStorm. * User: ununik * Date: 16.09.2015 * Time: 10:51 */ session_start(); function __autoload($name) { include_once "../../../models/Classes/{$name}.class.php"; } $profil = new Profil(0, $_SESSION['tiary']['login'], $_SESSION['tiary']['password']); $diary = new IntimCalendar(); $date = date("j. n. Y"); if (isset($_GET['timestamp']) && $_GET['timestamp'] != 0) { $date = date("j. n. Y", $_GET['timestamp']); } $temperature = "36.0"; $err = array(); $blood = 0; $menstruace = 0; $timestampEntry = 0; $temperatureSelect = $diary->getLastTemperatur($profil->getId()); $temperatureINPUT = 0; $saved = 0; $factors = ""; $phlegm = ""; $suppository = ""; $comment = "";
$nextDate = "next year"; $previousDate = "last year"; break; default: $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) {
<?php /** * Created by PhpStorm. * User: ununik * Date: 14.09.2015 * Time: 16:05 */ $diar = new IntimCalendar(); $list = ""; $all = $diar->getAllEntry($profil->getId()); foreach ($all as $calendar) { $datelist = date("j. n. Y", $calendar['date']); $list .= "{$datelist} - teplota: {$calendar['temperature']}<br>"; } return $list;
<?php /** * Created by PhpStorm. * User: ununik * Date: 16.09.2015 * Time: 10:51 */ session_start(); function __autoload($name) { include_once "../../../models/Classes/{$name}.class.php"; } $profil = new Profil(0, $_SESSION['tiary']['login'], $_SESSION['tiary']['password']); $id = $_GET['id']; $diary = new IntimCalendar(); $entry = $diary->getEntry($profil->getId(), $id); $date = date("j. n. Y", $entry['date']); $temperature = $entry['temperature']; $err = array(); $blood = $entry['blood']; if ($blood == 0) { $menstruace = 0; } else { $menstruace = 1; } $timestampEntry = $entry['date']; $temperatureSelect = $entry['temperature']; $temperatureINPUT = $entry['temperature']; $saved = 0; $factors = $entry['factors'];