2021-11-15 12:09:00 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* wishlist.php
|
|
|
|
*
|
|
|
|
* @author Jay Trees <github.jay@grandel.anonaddy.me>
|
|
|
|
*/
|
|
|
|
|
|
|
|
use wishthis\Page;
|
|
|
|
|
2021-11-15 13:52:11 +00:00
|
|
|
$page = new page(__FILE__, 'Create a wishlist');
|
2021-11-15 12:09:00 +00:00
|
|
|
|
|
|
|
if (isset($_POST['name'])) {
|
|
|
|
$database->query('INSERT INTO `wishlists`
|
2022-01-18 11:43:28 +00:00
|
|
|
(
|
|
|
|
`user`,
|
|
|
|
`name`,
|
|
|
|
`hash`
|
|
|
|
) VALUES (
|
|
|
|
' . $_SESSION['user']['id'] . ',
|
|
|
|
"' . $_POST['name'] . '",
|
|
|
|
"' . time() . $_SESSION['user']['id'] . $_POST['name'] . '"
|
|
|
|
)
|
2021-11-15 12:09:00 +00:00
|
|
|
;');
|
|
|
|
|
2022-01-17 12:52:16 +00:00
|
|
|
header('Location: /?page=wishlist-product-add');
|
2021-11-15 12:09:00 +00:00
|
|
|
die();
|
|
|
|
}
|
|
|
|
|
|
|
|
$page->header();
|
2022-01-14 07:43:48 +00:00
|
|
|
$page->navigation();
|
2021-11-15 12:09:00 +00:00
|
|
|
?>
|
|
|
|
<main>
|
2022-01-14 07:43:48 +00:00
|
|
|
<div class="ui container">
|
2022-01-17 13:52:00 +00:00
|
|
|
<h1 class="ui header"><?= $page->title ?></h1>
|
2022-01-17 12:16:11 +00:00
|
|
|
|
2022-01-17 13:52:00 +00:00
|
|
|
<div class="ui segment">
|
2022-01-14 07:43:48 +00:00
|
|
|
<form class="ui form" method="post">
|
|
|
|
<div class="field">
|
|
|
|
<label>Name</label>
|
2022-01-14 07:47:08 +00:00
|
|
|
<input type="text"
|
|
|
|
name="name"
|
|
|
|
placeholder="<?= getCurrentSeason() ?>"
|
|
|
|
value="<?= getCurrentSeason() ?>"
|
|
|
|
/>
|
2022-01-14 07:43:48 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<input class="ui primary button" type="submit" value="Create" />
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-11-15 12:09:00 +00:00
|
|
|
</main>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
$page->footer();
|