<?php include '../../../models/config.php'; include '../../../models/helpers.php'; function __autoload($name) { include_once "../../../models/classes/{$name}.class.php"; } session_start(); $err = array(); $profil = new Profil($_SESSION['profil_id']); $store = new Store(); $item = $store->getItemById($_POST['id'], $profil->getLevel()); if ($profil->getMoney() < $item['price']) { $err[] = 'Nedostatek peněz'; } if (count($err) < 1) { $money = $profil->getMoney() - $item['price']; $store->buyItem($item['id'], $profil->getId(), $money); echo 'Koupeno'; return; } foreach ($err as $err) { echo "<div>{$err}</div>"; }
<?php include '../../../models/config.php'; include '../../../models/helpers.php'; function __autoload($name) { include_once "../../../models/classes/{$name}.class.php"; } session_start(); $err = array(); $profil = new Profil($_SESSION['profil_id']); $competitions = new Competition(); if ($competitions->userIsRegistratedOnCompetition($profil->getId(), $_POST['id']) == false) { if (isset($_POST['registrate']) && $_POST['registrate'] == 'true') { $competitions->registrateUserForCompetition($profil->getId(), $_POST['id']); } } $competition = $competitions->getCompetition($_POST['id'], $profil->getLevel()); $container = "<h3>{$competition['title']}</h3>"; $container .= "<p>{$competition['description']}</p>"; $container .= "<div>startovné: {$competition['start_price']} EUR</div>"; $date = date('j. n. Y - H:i:s', $competition['date']); $container .= "<div>start: {$date}</div>"; if ($competitions->userIsRegistratedOnCompetition($profil->getId(), $_POST['id']) == true) { $container .= "<div id='registrationToCompetition' onclick='showStartlist(\"{$_POST['id']}\")'>Startovní listina</div>"; $container .= "<div id='startList'></div>"; } else { $container .= "<div id='registrationToCompetition' onclick='registrateOnCompetition(\"{$_POST['id']}\")'>Přihlásit se na závod</div>"; } print $container;
<?php /** * Created by PhpStorm. * User: ununik * Date: 27.08.2015 * Time: 14:33 */ $profil = new Profil(0, $_SESSION['tiary']['login'], $_SESSION['tiary']['password']); $notices = new Notice(); $notices = $notices->getNumNotice($profil->getId()); $headerNotice = ""; if ($notices > 0) { $headerNotice = "!"; if ($notices > 1) { $headerNotice .= '<span class="headerNoticeNum">' . $notices . "</span>"; } } $headerName = "<span class='headerName'>{$profil->getName()}</span>"; $html->addToHeader("<a href='index.php?page=profil'>"); $html->addToHeader($headerName); $html->addToHeader("<img src='images/profile_images/small/{$profil->getProfilImage()}' id='header_profile_image'>"); $html->addToHeader("</a>"); $html->addToHeader("<span class='headerNotice' onclick='getUnseenNotices()'>{$headerNotice}</span>");
<?php include '../../../models/config.php'; include '../../../models/helpers.php'; function __autoload($name) { include_once "../../../models/classes/{$name}.class.php"; } session_start(); $err = array(); $profil = new Profil($_SESSION['profil_id']); $job = new Job(); $activeJob = $job->getJobById(safeText($_POST['id']), $profil->getLevel(), $profil->getJobExpierence()); if ($profil->getActulaEnergy() < $activeJob['energy']) { $err[] = 'Nedostatek energie!'; } if (count($err) < 1) { $energy = $profil->getActulaEnergy() - $activeJob['energy']; $money = $profil->getMoney() + $activeJob['money']; $newJobExperience = $profil->getJobExpierence() + $activeJob['addExpierence']; $job->doJob($energy, $activeJob['energy'], $activeJob['id'], $profil->getId(), $money, $newJobExperience); echo 1; return; } foreach ($err as $err) { echo "<div>{$err}</div>"; }
<?php /** * Created by PhpStorm. * User: ununik * Date: 31.08.2015 * Time: 13:58 */ session_start(); function __autoload($name) { include_once "../../../models/Classes/{$name}.class.php"; } $profil = new Profil(0, $_SESSION['tiary']['login'], $_SESSION['tiary']['password']); $notices = new Notice(); $notices = $notices->seenNotice($_GET['id'], $profil->getId()); echo 'red0';
public function insertion_profil(Profil $unProfil) { $requete = $this->_db->prepare('insert into profil(id,ville,pays,profession,telephone)values(:id,:ville,:pays,:profession,:telephone)'); $requete->execute(array(':id' => $unProfil->getId(), ':ville' => $unProfil->getVille(), ':pays' => $unProfil->getPays(), ':profession' => $unProfil->getProfession(), ':telephone' => $unProfil->getTelephone())); }
<?php /** * Created by PhpStorm. * User: ununik * Date: 25.08.2015 * Time: 17:15 */ $commentsBOXES = ""; foreach ($allComments as $allComment) { $authorComments = new Profil($allComment['author']); $dateComments = date('j. n. Y', $allComment['timestamp']); $textComments = $allComment['text']; $commentsBOXES .= "<div><a href='index.php?page=profil&profil={$authorComments->getId()}'>{$authorComments->getName()}</a></div>"; $commentsBOXES .= "<div>{$dateComments}</div>"; $commentsBOXES .= "<div>{$textComments}</div>"; } return $commentsBOXES;
switch ($profile_image['type']) { case "image/png": $sufix = ".png"; break; case "image/gif": $sufix = ".gif"; break; case "image/jpeg": $sufix = ".jpg"; break; case "image/jpg": $sufix = ".jpg"; break; default: $sufix = ""; $err[] = "Nezn�m� typ souboru."; } move_uploaded_file($profile_image['tmp_name'], '../../../fileadmin/foto/' . $newName . $sufix); $galleryClass->resizeImage(850, $dir . '/' . $newName, '../../../fileadmin/foto/' . $newName . $sufix); $galleryClass->resizeImage(200, $dir . '/_' . $newName, '../../../fileadmin/foto/' . $newName . $sufix); unlink('../../../fileadmin/foto/' . $newName . $sufix); } } else { return; } $title = ""; if (isset($_POST['title'])) { $title = $_POST['title']; } $galleryClass->saveFoto('/' . $fileDir . '/_' . $newName . $sufix, '/' . $fileDir . '/' . $newName . $sufix, $newName . $sufix, $title, $profil->getId(), $gallery); return true;
<?php /** * Created by PhpStorm. * User: ununik * Date: 25.08.2015 * Time: 14:40 */ $entryDB = new Entry(); $entry = $entryDB->showEntry($_GET['id']); $date = date('j. n. Y', $entry['timestamp']); $author = new Profil($entry['author']); if ($author->getId() == $profil->getId()) { $update = "<a href='index.php?page=entries&entry={$entry['id']}'>upravit</a>"; } else { $update = ""; } $title = $entry['title'] . ' | Tiary'; $like = (include_once "controllers/log/entry/entry-like.php"); $comment = (include_once "controllers/log/entry/entry-comment.php"); return include_once "views/entry/entry-html.php";
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 = ""; $ovulation = 0; if (isset($_GET['date'])) { /** * DATUM */ $time = $_GET['date']; $time = str_replace(",", ".", $time); $time = str_replace("-", ".", $time); $time = explode(".", $time);
} session_start(); if (!isset($_SESSION['profil_id']) || $_SESSION['profil_id'] != "") { if (isset($_COOKIE["BIAGAME"]) && $_COOKIE["BIAGAME"] != '') { $cookies = explode("-*-", $_COOKIE["BIAGAME"]); $profil = new Profil(0, $cookies[0], $cookies[1]); } else { $profil = new Profil(); } } else { $profil = new Profil($_SESSION['profil_id']); } $html = new HTML(); $html->addCss("<link href='https://fonts.googleapis.com/css?family=Patrick+Hand&subset=latin,latin-ext' rel='stylesheet' type='text/css'>"); $html->addCss('<link rel="stylesheet" href="css/basicPage.css" type="text/css">'); if ($profil->log == false || $profil->getId() == 0) { include 'controllers/home.php'; } else { if (isset($_GET['page']) && $_GET['page'] != "") { $html->setGetPage(safeText($_GET['page'])); } //ADVICES AND OTHER if ($profil->introduction() == true) { include "controllers/log/advices/introduction.php"; } else { if (file_exists("controllers/log/{$html->getGetPage()}.php")) { include "controllers/log/{$html->getGetPage()}.php"; } else { include "controllers/noPageFound.php"; } include "controllers/log/navigation/navigation.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']; $phlegm = $entry['phlegm'];
<?php /** * Created by PhpStorm. * User: ununik * Date: 19.08.2015 * Time: 15:24 */ $me = $profil->getId(); $relationships = ""; if (isset($_GET['profil']) && $_GET['profil'] != $profil->getId()) { $profil = new Profil($_GET['profil']); $relationship = new Contact(); if (isset($_POST['friends'])) { if ($_POST['friends'] == "new") { $relationship->setNewRelationship($me, $profil->getId()); } elseif ($_POST['friends'] == "check") { $relationship->confirmRelationship($me, $profil->getId()); } elseif ($_POST['friends'] == "delete") { $relationship->deleteRelationship($me, $profil->getId()); } } $relationship = $relationship->isRelationship($me, $profil->getId()); if ($relationship === true) { $relationships = "S tímto sportovcem se znáš. <form action='' method='post'><button name='friends' value='delete'>Zrušit přátelství</button></form>"; } elseif ($relationship === false) { $relationships = "Zatím se neznáte. <form action='' method='post'><button name='friends' value='new'>Odeslat žádost</button></form>"; } elseif ($relationship == "waiting") { $relationships = "Čeká se na potvrzení od druhého sportovce."; } elseif ($relationship == "check") { $relationships = "Tento sportovec se chce s tebou seznámit. <form action='' method='post'><button name='friends' value='check'>Potvrdit žádost</button></form>";
<?php session_start(); function __autoload($name) { include_once "../../../models/Classes/{$name}.class.php"; } $profil = new Profil(0, $_SESSION['tiary']['login'], $_SESSION['tiary']['password']); $calendar = new IntimCalendarImage(); $timestamp_zacatek = $_GET['first_day']; $timestamp_konec = $calendar->howLongThisMenstruation($timestamp_zacatek, $profil->getId()); $actualDay = strtotime("today", $timestamp_zacatek); $datum = date("j. n. Y", $timestamp_zacatek) . ' - ' . date("j. n. Y", $timestamp_konec); $pocet_dnu = ($timestamp_konec - $timestamp_zacatek) / 86400; for ($i = 0; $i < $pocet_dnu; $i++) { $dayInfo = $calendar->getDayInfo($profil->getId(), $actualDay); $days[$i]['timestamp'] = $actualDay; $days[$i]['menstruace'] = $dayInfo['blood']; $days[$i]['temperature'] = $dayInfo['temperature']; $days[$i]['factors'] = $dayInfo['factors']; if (!isset($days[$i]['ovulation'])) { if ($dayInfo['ovulation'] == 1) { $days[$i]['ovulation'] = 1; $days[$i - 1]['ovulation'] = 2; $days[$i + 1]['ovulation'] = 2; $days[$i - 2]['ovulation'] = 2; $days[$i - 3]['ovulation'] = 2; } else { $days[$i]['ovulation'] = 0; } }