-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdelivery_details.php
More file actions
128 lines (116 loc) · 4.48 KB
/
delivery_details.php
File metadata and controls
128 lines (116 loc) · 4.48 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?php
session_start();
if (isset($_SESSION['username'])) {
echo "<script>location.href='delivery_details.php'</script>";
} else {
echo "<script>alert('Do not access through URL')</script>";
echo "<script>location.href='index.php'</script>";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>BlueCode</title>
<!-- CSS only -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous">
<style>
body {
background: rgb(68,151,200);
background: linear-gradient(90deg, rgba(68,151,200,1) 0%, rgba(169,202,222,1) 44%, rgba(72,152,168,1) 100%);
}
form {
background: #EBF5FB;
padding: 15px;
box-shadow: 0px 0px 15px 0px;
border-radius: 10px;
}
label{
color:black;
}
table {
background: #EBF5FB;
padding: 15px;
box-shadow: 0px 0px 15px 0px;
border-radius: 10px;
}
.logo img{
width:20%;
height:20%;
}
</style>
</head>
<body>
<div class="container-fluid">
<div class="row justify-content-center mt-5">
<div class="col-lg-4 col-md-6 col-sm-12">
<form action="dl_insert.php" method="post" enctype="multipart/form-data">
<div class="logo mb-5 d-flex justify-content-center">
<img src="Images/Blue_Code.png" alt="logo">
</div>
<div class="mb-3">
<h3 class="text-center">Submit Your Informations</h3>
</div>
<div class="mb-3">
<label for="y_name">Your Name:</label>
<input type="text" class="form-control" name="y_name" placeholder="Your Name">
</div>
<div class="mb-3">
<label for="address">Your Address:</label>
<input type="text" class="form-control" name="address" placeholder="Your Address">
</div>
<div class="mb-3">
<label for="productname">Product Name:</label>
<input type="text" class="form-control" name="p_name" placeholder="Product name">
</div>
<div class="mb-3">
<label for="price">Price:</label>
<input type="text" class="form-control" name="price" placeholder="Price">
</div>
<div class="mb-3">
<label for="image">Image:</label>
<input type="file" class="form-control" name="image" required>
</div>
<button type="Submit" class="btn btn-primary fw-bold col-12">Submit</button>
</form>
</div>
</div>
</div>
<div class="container mt-5">
<table class="table table-color">
<thead>
<tr>
<th scope="col">id</th>
<th scope="col">Your Name</th>
<th scope="col">Address</th>
<th scope="col">P_Name</th>
<th scope="col">Price</th>
<th scope="col">Image</th>
<th scope="col">Update</th>
<th scope="col">Delete</th>
</tr>
</thead>
<tbody>
<?php
include 'config.php';
$allData = mysqli_query($conn, "SELECT * FROM `dl_infos`");
while ($row = mysqli_fetch_array($allData)) {
echo "<tr>
<td>$row[id]</td>
<td>$row[y_name]</td>
<td>$row[address]</td>
<td>$row[p_name]</td>
<td>$row[price]</td>
<td><img src='$row[image]' width='100px'></td>
<td><a class='btn btn-warning' href='dl_update.php? id=$row[id]'>Update</a></td>
<td><a class='btn btn-danger' href='dl_delete.php? id=$row[id]'>Delete</a></td>
</tr>";
}
?>
</tbody>
</table>
</div>
</body>
</html>