moved NewItem Button to the MenuBar
This commit is contained in:
@@ -16,9 +16,10 @@ $ItemImage = $_POST['ItemImage'];
|
||||
$headers = get_headers($ItemImage, 1);
|
||||
|
||||
if (strpos($headers['Content-Type'], 'image/') !== false) {
|
||||
$imageLocalLink = 'data/images/' . uniqid() . '.' . pathinfo($ItemImage, PATHINFO_EXTENSION);
|
||||
$strippedimagepath = strtok($ItemImage, '?');
|
||||
$imageLocalLink = 'data/images/' . uniqid() . '.' . pathinfo($strippedimagepath, PATHINFO_EXTENSION);
|
||||
echo "ImageLink: " . $imageLocalLink;
|
||||
file_put_contents($imageLocalLink, fopen($ItemImage, 'r'));
|
||||
file_put_contents($imageLocalLink, fopen($strippedimagepath, 'r'));
|
||||
} else {
|
||||
echo "Link is Not an Image";
|
||||
}
|
||||
@@ -40,7 +41,7 @@ if (false === $stmt) {
|
||||
die('prepare() failed: ' . htmlspecialchars($mysqli->error));
|
||||
}
|
||||
|
||||
$rc = $stmt->bind_param('ssssi', $ItemTitle, $ItemDescription, $imageLocalLink, $ItemImage, $ItemPriceCents);
|
||||
$rc = $stmt->bind_param('ssssi', $ItemTitle, $ItemDescription, $ItemLink, $imageLocalLink, $ItemPriceCents);
|
||||
if (false === $rc) {
|
||||
die('bind_param() failed: ' . htmlspecialchars($stmt->error));
|
||||
}
|
||||
|
22
index.php
22
index.php
@@ -40,6 +40,9 @@ include_once('config/config.php');
|
||||
</svg>
|
||||
<strong>Simple Wishlist</strong>
|
||||
</a>
|
||||
<div class="nav navbar-nav navbar-right">
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary" data-bs-toggle="modal" data-bs-target="#addItemModal">Add Item</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
@@ -78,25 +81,6 @@ include_once('config/config.php');
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="col">
|
||||
<div class="card shadow-sm">
|
||||
<svg class="bd-placeholder-img card-img-top" width="100%" height="225" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Thumbnail" preserveAspectRatio="xMidYMid slice" focusable="false">
|
||||
<title>add new Item</title>
|
||||
<rect width="100%" height="100%" fill="#55595c"></rect><text x="50%" y="50%" fill="#eceeef" dy=".3em">+</text>
|
||||
</svg>
|
||||
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">new Item</h5>
|
||||
<p class="card-text">extend your wishlist by adding a new Item</p>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary" data-bs-toggle="modal" data-bs-target="#addItemModal">Add Item</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user