wishthis/includes/pages/wishlist-product-add.php

48 lines
1.2 KiB
PHP
Raw Normal View History

2021-11-15 13:43:57 +00:00
<?php
/**
* wishlist.php
*
* @author Jay Trees <github.jay@grandel.anonaddy.me>
*/
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();
$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>
<input type="url" name="url" value="<?= $url ?>" />
</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();