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();
|
2022-01-13 15:43:07 +00:00
|
|
|
$user = new User();
|
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">
|
|
|
|
<h1 class="ui header">Add a product</h1>
|
|
|
|
|
|
|
|
<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">
|
|
|
|
<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();
|