Skip to content

Commit c396a1d

Browse files
authored
final update
this is the final update for this project
1 parent 3289ea6 commit c396a1d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+3473
-0
lines changed

README.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Functionality:
2+
1) Login and Register as Patient
3+
2) Login as Doctor (Only admin can register new doctors / edit them)
4+
3) Search Doctors - Search doctors by area, speciality, cost and time slot (Login is not required to do this task)
5+
4) Book Appointment - * Book Appointment with doctors if time-slot is empty [10 minute time slot]
6+
* Once the appointment is booked, fetch time-slot data to database and send notification to that doctor (Notification format: "Username" booked an appointment with you at "time-slot")
7+
5) Payment- Ask patient the payment method once patient selects the time-slot (Card, Bkash whatever doesn't mean shit anyways...it will be just a fucking window or something idk idc)
8+
IMPORTANT: 90% of the payment will be sent to Doctor, 10% to the Admin
9+
7) Cancel appointment - Patient can cancel appointment after booking them (NO cashback [fuck 'em]; and notification regarding cancellation will be sent to that doctor)
10+
8) Login as Doctor (Profile features)
11+
- Notification Bar: Notifies the patient and their appointment schedule
12+
- Payment Bar: The total amount of payment and option to cash out (Card, Bkash whatever doesn't mean shit blah blah)
13+
- Appointment Table: Total history of appointments
14+
15+
9) Login as Patient (Profile features)
16+
- Edit profile name
17+
- Book/Cancel Appointment
18+
- Rate the doctor once appointment is done (out of 5)
19+
20+

about.php

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
session_start();
3+
?>
4+
5+
<!DOCTYPE html>
6+
<html lang="en">
7+
8+
<head>
9+
<meta charset="UTF-8">
10+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
11+
<title>About - TeleDoc</title>
12+
<!-- Bootstrap CSS -->
13+
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
14+
<!-- Custom CSS -->
15+
<link rel="stylesheet" href="css/about.css">
16+
17+
</head>
18+
19+
<body>
20+
<!-- Navbar -->
21+
<?php
22+
require 'navbar.php';
23+
?>
24+
<!-- Main Content -->
25+
<div class="container mt-5 main-content">
26+
<div class="row">
27+
<div class="col-md-6 offset-md-3">
28+
<h1>About TeleDoc</h1>
29+
<p>TeleDoc is a platform where you can search for doctors and book appointments with them online.</p>
30+
<p>With TeleDoc, you can easily find the right doctor for your needs and schedule appointments without
31+
hassle.</p>
32+
</div>
33+
</div>
34+
</div>
35+
36+
<!-- Bootstrap JS and jQuery -->
37+
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
38+
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js"></script>
39+
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
40+
</body>
41+
42+
</html>

admin/add_doc.php

+183
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
<?php
2+
require_once('../connection.php');
3+
session_start();
4+
5+
try {
6+
$conn = Teledoc::connect();
7+
8+
// Fetch user details
9+
$query = "SELECT * FROM info WHERE user_type = 0 AND id = :user_id";
10+
$stmt = $conn->prepare($query);
11+
$stmt->bindParam(':user_id', $_SESSION['user_id']);
12+
$stmt->execute();
13+
$user = $stmt->fetch(PDO::FETCH_ASSOC);
14+
15+
if ($_SERVER["REQUEST_METHOD"] == "POST") {
16+
$name = $_POST['name'];
17+
$email = $_POST['email'];
18+
$degree = $_POST['degree'];
19+
$speciality = $_POST['speciality'];
20+
$division = $_POST['division'];
21+
$chamber_number = $_POST['chamber_number'];
22+
$hospital = $_POST['hospital'];
23+
$chamber_location = $_POST['chamber_location'];
24+
$time_start = $_POST['time_start'];
25+
$time_end = $_POST['time_end'];
26+
$password = $_POST['password'];
27+
$visitcharge = $_POST['visitcharge'];
28+
29+
// Prepare SQL statement
30+
31+
// INSERT INTO `doctor` (`IndexNumber`, ``, , `Password`, , ``, ``, ``, `TimeStart`, `TimeEnd`, `VisitCharge`) VALUES
32+
33+
$query = "INSERT INTO doctor
34+
(Name, Email, Degree, Speciality, Division, ChamberNumber, Hospital, ChamberLocation, TimeStart, TimeEnd, password,VisitCharge)
35+
VALUES
36+
(:name, :email, :degree, :speciality, :division, :chamber_number, :hospital, :chamber_location, :time_start, :time_end, :password,:visitcharge)";
37+
38+
$stmt = $conn->prepare($query);
39+
40+
// Bind parameters
41+
$stmt->bindParam(':name', $name);
42+
$stmt->bindParam(':email', $email);
43+
$stmt->bindParam(':degree', $degree);
44+
$stmt->bindParam(':speciality', $speciality);
45+
$stmt->bindParam(':division', $division);
46+
$stmt->bindParam(':chamber_number', $chamber_number);
47+
$stmt->bindParam(':hospital', $hospital);
48+
$stmt->bindParam(':chamber_location', $chamber_location);
49+
$stmt->bindParam(':time_start', $time_start);
50+
$stmt->bindParam(':time_end', $time_end);
51+
$stmt->bindParam(':password', $password);
52+
$stmt->bindParam(':visitcharge', $visitcharge);
53+
54+
// Execute the query
55+
try {
56+
$stmt->execute();
57+
echo '<script>alert("New Doctor Added inserted successfully!"); </script>';
58+
59+
} catch(PDOException $e) {
60+
echo "Error: " . $e->getMessage();
61+
}
62+
}
63+
64+
} catch(PDOException $e) {
65+
echo 'Error: ' . $e->getMessage();
66+
}
67+
68+
require('header.php');
69+
?>
70+
71+
<div class="container">
72+
<div class="row justify-content-center">
73+
<div class="col-md-8">
74+
<div class="card">
75+
<div class="card-header text-center">
76+
<h3>Admin | Add Doctor</h3>
77+
</div>
78+
<div class="card-body">
79+
<div class="form-group d-flex flex-column">
80+
<label for="username" class="font-weight-bold">Username:</label>
81+
<input type="text" readonly class="form-control" id="username" value="<?php echo $user['name']; ?>">
82+
</div>
83+
<div class="form-group d-flex flex-column">
84+
<label for="total_doctors" class="font-weight-bold">Total Registered Doctor</label>
85+
<input type="text" readonly class="form-control" id="total_doctors" value="<?php echo $docnumber; ?>">
86+
</div>
87+
<div class="table-responsive mt-4">
88+
<!-- Form for adding new doctor -->
89+
<form action="" method="post" id="addDoctorForm">
90+
<div class="form-group">
91+
<label for="name">Name:</label>
92+
<input type="text" class="form-control" id="name" name="name" placeholder="Enter Name" required>
93+
</div>
94+
<div class="form-group">
95+
<label for="email">Email:</label>
96+
<input type="email" class="form-control" id="email" name="email" placeholder="Enter Email" required>
97+
</div>
98+
<div class="form-group">
99+
<label for="degree">Degree:</label>
100+
<input type="text" class="form-control" id="degree" name="degree" placeholder="Enter Degree" required>
101+
</div>
102+
<div class="form-group">
103+
<label for="speciality">Speciality:</label>
104+
<input type="text" class="form-control" id="speciality" name="speciality" placeholder="Enter Speciality" required>
105+
</div>
106+
<div class="form-group">
107+
<label for="division">Division:</label>
108+
<select class="form-control" id="division" name="division" required>
109+
<option value="Sylhet">Sylhet</option>
110+
<option value="Barishal">Barishal</option>
111+
<option value="Chittagong">Chittagong</option>
112+
<option value="Dhaka">Dhaka</option>
113+
<option value="Khulna">Khulna</option>
114+
<option value="Rajshahi">Rajshahi</option>
115+
<option value="Rangpur">Rangpur</option>
116+
<option value="Mymensingh">Mymensingh</option>
117+
</select>
118+
</div>
119+
<div class="form-group">
120+
<label for="chamber_number">Chamber Number:</label>
121+
<input type="text" class="form-control" id="chamber_number" name="chamber_number" placeholder="Enter Chamber Number" required>
122+
</div>
123+
<div class="form-group">
124+
<label for="hospital">Hospital Name:</label>
125+
<input type="text" class="form-control" id="hospital" name="hospital" placeholder="Enter Hospital" required>
126+
</div>
127+
<div class="form-group">
128+
<label for="chamber_location">Chamber Location:</label>
129+
<input type="text" class="form-control" id="chamber_location" name="chamber_location" placeholder="Enter Chamber Location" required>
130+
</div>
131+
<div class="form-group">
132+
<label for="time_start">Time Start:</label>
133+
<input type="time" class="form-control" id="time_start" name="time_start" required>
134+
</div>
135+
<div class="form-group">
136+
<label for="time_end">Time End:</label>
137+
<input type="time" class="form-control" id="time_end" name="time_end" required>
138+
</div>
139+
140+
<div class="form-group">
141+
<label for="visitcharge">Visit Charge:</label>
142+
<input type="number" class="form-control" id="visitcharge" name="visitcharge" placeholder="Enter Visit Charge" required>
143+
</div>
144+
<div class="form-group">
145+
<label for="password">Password:</label>
146+
<input type="password" class="form-control" id="password" name="password" placeholder="Enter Password" required>
147+
</div>
148+
<div class="form-group">
149+
<label for="confirm_password">Confirm Password:</label>
150+
<input type="password" class="form-control" id="confirm_password" name="confirm_password" placeholder="Enter Confirmed Password" required>
151+
<small id="passwordHelpBlock" class="form-text text-danger"></small>
152+
</div>
153+
<button type="submit" class="btn btn-primary">Submit</button>
154+
</form>
155+
</div>
156+
</div>
157+
<div class="card-footer text-center">
158+
<a href="admin_logout.php" class="btn btn-danger">Logout</a>
159+
</div>
160+
</div>
161+
</div>
162+
</div>
163+
</div>
164+
165+
<script>
166+
document.addEventListener('DOMContentLoaded', function() {
167+
document.getElementById('addDoctorForm').addEventListener('submit', function(event) {
168+
let password = document.getElementById('password').value;
169+
let confirmPassword = document.getElementById('confirm_password').value;
170+
let error = document.getElementById('passwordHelpBlock');
171+
172+
if (password !== confirmPassword) {
173+
error.textContent = "Passwords do not match!";
174+
event.preventDefault(); // Prevent form submission
175+
} else {
176+
error.textContent = ""; // Clear error message if passwords match
177+
}
178+
});
179+
});
180+
</script>
181+
182+
183+
<?php require("footer.php"); ?>

admin/admin_logout.php

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
session_start();
3+
4+
5+
session_unset();
6+
session_destroy();
7+
8+
9+
header("Location:index.php");
10+
exit;
11+
?>

0 commit comments

Comments
 (0)