-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsell.php
61 lines (46 loc) · 1.77 KB
/
sell.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
include "inc/head.php";
if(isset($_SESSION['user_data'])){
?>
<section class="login">
<?php
// Error bar include
include "inc/error-bar.php";
?>
<form action="inc/action.php" method="post">
<h2>Sell Product</h2>
<div class="item">
<input type="text" name="title" placeholder="Title" required autocomplete="off" <?php if(isset($_SESSION['sell_data'])){echo "value='" .$_SESSION['sell_data']['title'] . "'";}?>>
<input type="text" name="price" placeholder="Price" required autocomplete="off" <?php if(isset($_SESSION['sell_data'])){echo "value='" .$_SESSION['sell_data']['price'] . "'";}?>>
<input type="text" name="description" placeholder="Description" required autocomplete="off" <?php if(isset($_SESSION['sell_data'])){echo "value='" .$_SESSION['sell_data']['description'] . "'";}?>>
<input type="number" name="quantity" placeholder="Quantity" required autocomplete="off" <?php if(isset($_SESSION['sell_data'])){echo "value='" .$_SESSION['sell_data']['quantity'] . "'";}?>>
<select name="type" id="" required autocomplete="off" placeholder="Description">
<?php echo productType($conn)['print_data']; ?>
</select>
</div>
<button type="submit" name="sell">Add Item</button>
</form>
</section>
<section class="sellitem">
<table>
<tr>
<th>ID</th>
<th>Title</th>
<th>Price</th>
<th>Description</th>
<th>Quantity</th>
<th>Type</th>
<th>Date</th>
<th>Time</th>
<th>Edit</th>
<th>Delete</th>
</tr>
<?php
echo addItemTable($_SESSION['user_data']['user_id'], $conn);
echo "</table>";
}else{
$_SESSION['msg'] = "Please Login or Signup";
header("Location: ../login.php?error");
}
?>
</section>