public function __construct()
 {
     $time = time() - getLastLogin($_SESSION["user_id"]);
     $this->buildings = getBuildings($_SESSION["user_id"]);
     $this->buildingsworkers = getBuildingsWorkers($_SESSION["user_id"]);
     $this->userid = $_SESSION["user_id"];
     $this->population = getPopulation($_SESSION["user_id"]);
     $this->food = getFood($_SESSION["user_id"]) * ($this->getFoodProduction() * $time);
     $this->water = getWater($_SESSION["user_id"]) * ($this->getWaterProduction() * $time);
 }
Exemple #2
0
function getStoreCredentials($storeName)
{
    $details = getLastLogin();
    // TODO: prompt for new user/pass if storename isn't same as last login
    $username = $details['username'];
    $password = $details['password'];
    if (empty($username) && empty($password)) {
        return null;
    }
    return new Credentials($username, $password);
}
Exemple #3
0
function render()
{
    $loginDetails = getLastLogin();
    $lastStoreName = $loginDetails['storeName'];
    $lastUsername = $loginDetails['username'];
    $lastPassword = $loginDetails['password'];
    $storeCollection = new StoreCollection('http://api.talis.com/stores');
    $storeCollection->retrieve();
    $storeUris = $storeCollection->get_store_uris();
    asort($storeUris);
    $content = '';
    $content .= '<form method="post"';
    $content .= '<div align="center">';
    $content .= '<select name="storeName">';
    foreach ($storeUris as $storeUri) {
        $storeName = str_replace('http://api.talis.com/stores/', '', $storeUri);
        $content .= '<option ';
        if ($storeName == $lastStoreName) {
            $content .= ' selected="selected" ';
        }
        $content .= ' value="' . $storeName . '">' . $storeName . '</option>';
    }
    $content .= '</select>';
    $content .= '</div>';
    $content .= '<br/><br/><br/>';
    $content .= '<div align="center">';
    $content .= '<label>Username</label><input type="text" name="username" value="' . $lastUsername . '"/>';
    $content .= '<p>';
    $content .= '<label>Password</label><input type="password" name="password" value="' . $lastPassword . '"/>';
    $content .= '</div>';
    $content .= '<br/><br/><br/>';
    $content .= '<div align="center">';
    $content .= '<input type="submit" name="submit" value="Select"/>';
    $content .= '</div>';
    $content .= '</form>';
    renderPage(null, null, 'Choose a store', $content);
}
Exemple #4
0
"><?php 
echo getAuthor($uInfo['user_id']);
?>
</td>
            <td class="row<?php 
echo $row;
?>
"><?php 
echo getDateCreated($uInfo['user_id']);
?>
</td>
            <td class="row<?php 
echo $row;
?>
"><?php 
echo getLastLogin($uInfo['user_id']);
?>
</td>
            <td class="row<?php 
echo $row;
?>
" align="right"><a class="table_edit_link" href="<?php 
echo PAGE_USERS;
?>
?section=edit&id=<?php 
echo $uInfo['user_id'];
?>
">Edit</a> <a class="table_delete_link" href="<?php 
echo PAGE_USERS;
?>
?action=delete&id=<?php 
<?php

$getInfo = getUserInfo($_SESSION["uid"]);
$getLastLog = getLastLogin($_SESSION["uid"]);
foreach ($getInfo as $info) {
    $firstname = $info["firstname"];
    $lastname = $info["lastname"];
    $username = $info["username"];
    $datereg = date('F j, Y', strtotime($info['dateregistered']));
    $timereg = date('h:i A T', strtotime($info['dateregistered']));
    $datecurr = date('F j, Y', strtotime($info['lastlogin']));
    $timecurr = date('h:i A T', strtotime($info['lastlogin']));
}
$log = "";
foreach ($getLastLog as $log) {
    $datelog = date('F j, Y', strtotime($log['login']));
    $timelog = date('h:i A T', strtotime($log['login']));
}
if (!empty($getLastLog)) {
    $log = $datelog . " at " . $timelog;
} else {
    $log = "No data about your previous login.";
}
?>
<div id="accountHolder">
	<span class="pageTitle">My Account</span>
    <div id="acctHolder">
    	<div class="info-field">
        	<label for="firstname">Name:</label>
            <span class="infofield"><?php 
echo $firstname;