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.
46 lines
1023 B
PHP
46 lines
1023 B
PHP
<?
|
|
include_once("../php/include.php");
|
|
?>
|
|
<table>
|
|
<tr>
|
|
<td>Name</td>
|
|
<td><input type="text" id="name" value="" placeholder="Adam and Eva" autocomplete="off" /></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Currency</td>
|
|
<td><input type="text" id="currency" value="" placeholder="SEK" autocomplete="off" /></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Password</td>
|
|
<td><input type="password" id="password" value="" placeholder="Minimum 6 characters" autocomplete="off" /></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>
|
|
<button id="cancel-button" onclick="loadPage('login');">Cancel</button>
|
|
<button id="create-button" onclick="createHousehold();">Create household</button>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<script>
|
|
function createHousehold() {
|
|
var requestData = {
|
|
action: "create",
|
|
name: $('#name').val(),
|
|
currency: $('#currency').val(),
|
|
password: $('#password').val()
|
|
};
|
|
sendRequest(
|
|
"household",
|
|
requestData,
|
|
"create-button",
|
|
function(success, status, response) {
|
|
if(success) {
|
|
loadPage("login");
|
|
}
|
|
}
|
|
);
|
|
}
|
|
</script>
|