-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbilling.php
More file actions
214 lines (195 loc) · 6.76 KB
/
billing.php
File metadata and controls
214 lines (195 loc) · 6.76 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<?php
session_start();
$conn = new mysqli("localhost", "root", 12345, "healthcare");
if (mysqli_connect_errno()) {
die("Connection failed" . mysqli_connect_error());
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$doctor_id = $_POST["doctor_id"];
$patient_id = $_POST["patient_id"];
$invoice_details = $_POST["invoice_details"];
$amount = $_POST["amount"];
$status = "pending";
$sql = "insert into billing (doctor_id,patient_id,invoice_details,amount,status) values ('$doctor_id','$patient_id','$invoice_details','$amount','$status')";
$result = mysqli_query($conn, $sql);
}
$id = $_SESSION["user_id"];
$query = "select * from billing where doctor_id in (select doctor_id from doctor where user_id = '$id')";
$result = mysqli_query($conn, $query);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Billing and Invoice</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600&display=swap');
:root {
--primary-color: #28bf96;
--primary-color-dark: #209677;
--text-dark: #111827;
--text-light: #6b7280;
--white: #ffffff;
}
body {
background-color: #f8f9fa;
font-family: 'Roboto', sans-serif;
}
.container {
margin-top: 50px;
}
.form-container {
background-color: #ffffff;
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.form-container label {
font-weight: 500;
}
.form-container input[type="text"],
.form-container input[type="number"],
.form-container textarea {
width: 100%;
padding: 8px;
margin: 5px 0;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
.form-container input[type="submit"] {
background-color: #28bf96;
color: white;
padding: 10px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
}
.form-container input[type="submit"]:hover {
background-color: #209677;
}
.table-container {
margin-top: 30px;
}
table {
width: 100%;
border-collapse: collapse;
}
th,
td {
border: 1px solid #ddd;
padding: 8px;
text-align: left;
}
th {
background-color: #f2f2f2;
text-align: center;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
nav {
padding: 2rem 1rem;
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
}
.nav__logo {
font-size: 1.5rem;
font-weight: 600;
color: var(--primary-color);
}
.nav__links {
list-style: none;
display: flex;
align-items: center;
gap: 2rem;
}
.link a {
text-decoration: none;
color: var(--text-light);
cursor: pointer;
transition: 0.3s;
}
.link a:hover {
color: var(--primary-color);
}
</style>
</head>
<body>
<nav>
<div class="nav__logo"><img src="Images/logo.png" alt=""></div>
<ul class="nav__links">
<li class="link"><a href="profile.php">Profile</a></li>
<li class="link"><a href="appointment.php">Your Appointments</a></li>
<li class="link"><a href="prescription.php">Prescription</a></li>
<li class="link"><a href="messages.php">Messages</a></li>
<li class="link"><a href="cme.php">CME</a></li>
<li class="link"><a href="billing.php">Billing and Invoice</a></li>
<li class="link"><a href="reviews.php">Your Reviews</a></li>
</ul>
</nav>
<div class="container">
<div class="form-container">
<form action="billing.php" method="post">
<div class="mb-3">
<label for="doctor_id">Doctor ID:</label>
<input type="text" name="doctor_id" required>
</div>
<div class="mb-3">
<label for="patient_id">Patient ID:</label>
<input type="text" name="patient_id" required>
</div>
<div class="mb-3">
<label for="invoice_details">Invoice Details:</label>
<textarea name="invoice_details" rows="4" required></textarea>
</div>
<div class="mb-3">
<label for="amount">Amount:</label>
<input type="number" step="0.01" name="amount" required>
</div>
<input type="submit" value="Create Billing Record">
</form>
</div>
</div>
<div class="container">
<div class="table-container">
<h2>List of Invoices Generated by You</h2>
<table>
<thead>
<tr>
<th>Billing Id</th>
<th>Doctor Id</th>
<th>Patient Id</th>
<th>Invoice Details</th>
<th>Amount</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<?php
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_assoc($result)) {
echo "<tr>";
echo "<td>" . $row['billing_id'] . "</td>";
echo "<td>" . $row['doctor_id'] . "</td>";
echo "<td>" . $row['patient_id'] . "</td>";
echo "<td>" . $row['invoice_details'] . "</td>";
echo "<td>" . $row['amount'] . "</td>";
echo "<td>" . $row['status'] . "</td>";
echo "</tr>";
}
} else {
echo "<tr><td colspan='6'>0 Results Found...</td></tr>";
}
?>
</tbody>
</table>
</div>
</div>
</body>
</html>