Esempio n. 1
0
	$("#genericOverlay").dialog("open");
}
</script>
	
	<?php 
error_reporting(E_ERROR | E_PARSE);
session_start();
//var_dump($_SESSION);
if (isset($_SESSION['name'])) {
    $userid = $_SESSION["userid"];
    $username = $_SESSION['username'];
    $loggedIn = true;
    error_log("session is set");
}
$dayDAO = new DayDAO();
$securityService = new SecurityService();
if (isset($_GET["dateText"])) {
    $theDate = $_GET["dateText"];
    $dayToDisplay = $dayDAO->getIdForDay($userid, $theDate);
} else {
    if (isset($_GET["randOption"])) {
        $dayToDisplay = $dayDAO->getRandomDay($userid, $_GET["randOption"]);
    } else {
        $theDate = date("Y-m-d", time());
        $dayToDisplay = $dayDAO->getIdForDay($userid, $theDate);
    }
}
error_log("date : " . $dayToDisplay);
if ($dayToDisplay === 0) {
    $chosenDate = date("Y-m-d", strtotime($theDate));
Esempio n. 2
0
<?php

require_once dirname(dirname(__FILE__)) . '/dao/DayDAO.php';
$dayDAO = new DayDAO();
$days = $dayDAO->getAllDayId();
foreach ($days as $dayId) {
    echo "checking " . $dayId . "... <br/>";
    $dayDAO->deleteDayIfUnused($dayId);
}
Esempio n. 3
0
<?php

require_once dirname(dirname(__FILE__)) . '/dao/UserDAO.php';
require_once dirname(dirname(__FILE__)) . '/dao/DayDAO.php';
require_once dirname(dirname(__FILE__)) . '/conf.php';
require_once dirname(dirname(__FILE__)) . '/dao/GmailDAO.php';
date_default_timezone_set('Africa/Johannesburg');
error_reporting(E_ERROR | E_PARSE);
session_start();
$userid = $_SESSION['userid'];
$chosenDate = $_SESSION['chosenDate'];
$diplayDate = $_SESSION['diplayDate'];
$dayDAO = new DayDAO();
if (isset($_GET["dateText"])) {
    $theDate = $_GET["dateText"];
    $dayToDisplay = $dayDAO->getIdForDay($userid, $theDate);
} else {
    $dayToDisplay = $dayDAO->getRandomDayForStatusUpdate($userid);
}
$unformattedDate = $dayDAO->getDateForDayId($userid, $dayToDisplay);
$chosenDate = date("Y-m-d", strtotime($unformattedDate));
$diplayDate = date("Y F j l", strtotime($chosenDate));
$_SESSION['chosenDate'] = $chosenDate;
$_SESSION['diplayDate'] = $diplayDate;
error_log($userid . " : status update : " . $chosenDate);
?>
<script type="text/javascript">
	$(document).ready(function(){
		$("button").button();
	});
Esempio n. 4
0
<div id="picturedatepicker"></div>

<br/>
<div id="displayDate" style="font-size: 1.4em; color: #C0C0C0; background-color: #FAF5F5; padding: 3px;"></div>


<br/>
<button onclick="reloadPage();">Random</button>
<button onclick="gotoPictureUpload();" >Upload Pictures</button>

<div id="dateSelector"></div>


<?php 
$userid = $_SESSION["userid"];
$dayDAO = new DayDAO();
$earliestDate = $dayDAO->getEarliestDateOfMemory($userid);
$earliestYear = intval(substr($earliestDate, 0, 4));
$currentYear = date("Y");
error_log($earliestYear . "  AND " . $currentYear);
?>
<select id="year" class="selectInput" style="font-size: 1.3em; color: #C0C0C0;">
	<?php 
for ($i = $currentYear; $i >= $earliestYear; $i--) {
    ?>
		<option value="<?php 
    echo $i;
    ?>
"><?php 
    echo $i;
    ?>