-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedit_product.php
75 lines (58 loc) · 2.62 KB
/
edit_product.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
$pid=$_GET['pid'];
include_once "../shared/connection.php";
$cmd="select * from products where pid=$pid";
$obj=mysqli_query($conn,$cmd);
$row=mysqli_fetch_assoc($obj);
$name=$row['name'];
$details=$row['details'];
$price=$row['price'];
$imname=$row['impath'];
$cmp_name=$row['cmp_name'];
echo "<!DOCTYPE html>
<html>
<head>
<title>Edit</title>
<!-- <link href='https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css' rel='stylesheet' integrity='sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi' crossorigin='anonymous'>
<script src='https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js' integrity='sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3' crossorigin='anonymous'></script> -->
<link rel='stylesheet' href='../login.css'>
<style>
section{
position: relative;
height: 160vh;
width: 100%;
background: url(../images/form_background/img2.jpg);
background-size: cover;
background-position: center center;
}
#back{
color:white;
font-size:20px;
}
</style>
</head>
<body>
<section>
<div class='form-container'>
<form enctype='multipart/form-data' action='edit.php?pid=$pid' method='post'>
<h2>Edit Your Product</h2>
<p>Company Name : $cmp_name</p>
<input class='form-control' placeholder='New Company Name' type='text' name='cmp_name'>
<p>Product Name : $name</p>
<input class='form-control' placeholder='New Product Name' type='text' name='name'>
<p>Price : $$price</p>
<input class='form-control' placeholder='New Price in dollars' type='text' name='price'>
<p>Description : $details</p>
<textarea class='form-control' placeholder='New Product Description' name='details' cols='60' rows='5'></textarea>
<div>
<img src='$imname' widht='200px' height='200px'><p>Old Image</p>
</div>
<input class='form-control' type='file' accept='.jpg,.png' name='imname'>
<input class='btn form-control' type='submit' value='EDIT'>
<center><a id='back' href='view.php'>Go Back!</a></center>
</form>
</div>
</section>
</body>
</html>";
?>