You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.1 KiB
PHP
54 lines
1.1 KiB
PHP
<?
|
|
include_once("../php/include.php");
|
|
|
|
initDatabaseConnection();
|
|
?>
|
|
|
|
<img src="graphics/status.php?status=403" /><br/>
|
|
<br/>
|
|
|
|
Household:
|
|
<select id="household-id">
|
|
<?
|
|
$rows = dbQuery("SELECT * FROM household ORDER BY name");
|
|
foreach($rows as $row) {
|
|
?>
|
|
<option value="<?=$row['id']?>"><?=$row['name']?></option>
|
|
<?
|
|
}
|
|
?>
|
|
</select>
|
|
<button onclick="loadPage('household-create');">Create new</button><br/>
|
|
<br/>
|
|
|
|
<input type="password" id="household-password" autocomplete="off" value="" placeholder="Password" /><br/>
|
|
<br/>
|
|
|
|
<button id="login-button" onclick="login();">Login</button>
|
|
|
|
<script>
|
|
function login() {
|
|
var requestData = {
|
|
action: "login",
|
|
householdId: $('#household-id option:selected').val(),
|
|
password: $('#household-password').val()
|
|
};
|
|
sendRequest(
|
|
"session",
|
|
requestData,
|
|
"login-button",
|
|
function(success, status, response) {
|
|
if(success) {
|
|
$('#logout-button').css("display", "block");
|
|
$('#header-subtitle').html($('#household-id option:selected').text());
|
|
loadPage("household");
|
|
}
|
|
}
|
|
);
|
|
}
|
|
</script>
|
|
|
|
<?
|
|
closeDatabaseConnection();
|
|
?>
|