2021-11-15 13:43:57 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* wishlist.php
|
|
|
|
*
|
|
|
|
* @author Jay Trees <github.jay@grandel.anonaddy.me>
|
|
|
|
*/
|
|
|
|
|
2022-01-13 15:43:07 +00:00
|
|
|
use wishthis\{Page, User};
|
2021-11-15 13:43:57 +00:00
|
|
|
|
2021-11-15 13:55:05 +00:00
|
|
|
if (isset($_POST['url'], $_POST['wishlist'])) {
|
|
|
|
$database->query('INSERT INTO `products`
|
|
|
|
(`wishlist`, `url`) VALUES
|
|
|
|
(' . $_POST['wishlist'] . ', "' . $_POST['url'] . '")
|
|
|
|
;');
|
|
|
|
}
|
2021-11-15 13:43:57 +00:00
|
|
|
|
2021-11-15 13:55:05 +00:00
|
|
|
$page = new page(__FILE__, 'Add a product');
|
2021-11-15 13:43:57 +00:00
|
|
|
$page->header();
|
2022-01-13 13:15:43 +00:00
|
|
|
$page->navigation();
|
2021-11-15 13:43:57 +00:00
|
|
|
?>
|
|
|
|
<main>
|
2022-01-14 08:28:41 +00:00
|
|
|
<div class="ui container">
|
|
|
|
<div class="ui segment">
|
2022-01-17 12:16:11 +00:00
|
|
|
<h1 class="ui header"><?= $page->title ?></h1>
|
2022-01-14 08:28:41 +00:00
|
|
|
|
|
|
|
<form class="ui form" method="post">
|
|
|
|
<div class="field">
|
|
|
|
<label>URL</label>
|
2022-01-14 08:41:58 +00:00
|
|
|
<input type="url" name="url" />
|
2022-01-14 08:28:41 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="field">
|
2022-01-18 14:19:27 +00:00
|
|
|
<label>Wishlist</label>
|
2022-01-14 08:28:41 +00:00
|
|
|
<select class="ui search selection dropdown loading wishlists" name="wishlist">
|
|
|
|
<option value="">Loading your wishlists...</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<input class="ui primary button" type="submit" value="Add" />
|
|
|
|
</form>
|
|
|
|
</div>
|
2022-01-13 13:15:43 +00:00
|
|
|
</div>
|
2021-11-15 13:43:57 +00:00
|
|
|
</main>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
$page->footer();
|