-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit.php
More file actions
80 lines (61 loc) · 1.88 KB
/
Copy pathedit.php
File metadata and controls
80 lines (61 loc) · 1.88 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
<?php
include "config.php";
$id = $_GET['id'];
$stmt = $conn->prepare("SELECT * FROM medicines WHERE id = ?");
$stmt->execute([$id]);
$medicine = $stmt->fetch();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Edit Medicine</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="dashboard">
<!-- Sidebar -->
<aside class="sidebar">
<h2>Pharmacy</h2>
<a href="index.php">Dashboard</a>
<a href="add_medicine.php">Add Medicine</a>
</aside>
<!-- Main Content -->
<div class="main-content">
<!-- Topbar -->
<header class="topbar">
<h1>Edit Medicine</h1>
<a href="index.php" class="btn add-btn">← Back</a>
</header>
<!-- Edit Form -->
<section class="content-section">
<form action="update.php" method="POST" class="form-card">
<input type="hidden" name="id" value="<?= $medicine['id'] ?>">
<label>Name</label>
<input
type="text"
name="name"
value="<?= $medicine['name'] ?>"
required
>
<label>Quantity</label>
<input
type="number"
name="quantity"
value="<?= $medicine['quantity'] ?>"
required
>
<label>Price (PKR)</label>
<input
type="number"
name="price"
value="<?= $medicine['price'] ?>"
required
>
<button class="btn add-btn">Update Medicine</button>
</form>
</section>
</div>
</div>
</body>
</html>