-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy paththerapist.php
148 lines (136 loc) · 4.82 KB
/
therapist.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
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
<?php
// Start the session to access user information
//session_start();
// Check if the therapist is logged in. If not, redirect to the login page.
// if (!isset($_SESSION['email'])) {
// header("Location: therapist_login.php");
// exit();
// }
// if(!isset($_GET['email'])){
// $email=$_GET['email'];
// }
// else{
// header("Location: therapist_login.php");
// exit();
// }
$email= $_POST["email"];
// Assuming you have a database connection established
// Replace "your_database_connection" with the actual database connection
// and "therapist_profiles" with the table name where therapist profiles are stored
$database_connection = mysqli_connect("localhost", "root", "", "stay_free");
if (!$database_connection) {
die("Database connection failed: " . mysqli_connect_error());
}
// Fetch the therapist's profile information based on the email stored in the session
// $email = $_SESSION['email'];
$sql = "SELECT FirstName, LastName, FtMail, Ratings, Fee FROM freetharapist WHERE FtMail = '$email'";
$result = mysqli_query($database_connection, $sql);
// Check if the query was successful and if a row was found
if ($result && mysqli_num_rows($result) > 0) {
// Fetch the profile data
$row = mysqli_fetch_assoc($result);
$FirstName = $row['FirstName'];
$LastName = $row['LastName'];
$Mail = $row['FtMail'];
$Rating = $row['Ratings'];
$Fees = $row['Fee'];
$Therapist = 'Free Session Therapist';
}
else
{
$sql = "SELECT NtFirstName, NtLastName, NtMail, NtRatings, NtFee FROM nominaltherapist WHERE NtMail = '$email'";
$result = mysqli_query($database_connection, $sql);
if ($result && mysqli_num_rows($result) > 0)
{
// Fetch the profile data
$row = mysqli_fetch_assoc($result);
$FirstName = $row['NtFirstName'];
$LastName = $row['NtLastName'];
$Mail = $row['NtMail'];
$Rating = $row['NtRatings'];
$Fees = $row['NtFee'];
$Therapist = 'Standard Session Therapist';
}
else
{
$sql = "SELECT UtFirstName, UtLastName, UtMail, UtRatings, UtFee FROM ultimatetherapist WHERE UtMail = '$email'";
$result = mysqli_query($database_connection, $sql);
if ($result && mysqli_num_rows($result) > 0)
{
// Fetch the profile data
$row = mysqli_fetch_assoc($result);
$FirstName = $row['UtFirstName'];
$LastName = $row['UtLastName'];
$Mail = $row['UtMail'];
$Rating = $row['UtRatings'];
$Fees = $row['UtFee'];
$Therapist = 'Exclusive Session Therapist';
}
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Therapist Profile</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f8f3fc; /* Lavender background color */
color: #8e44ad; /* Dark lavender text color */
margin: 0;
padding: 0;
}
.container {
max-width: 600px;
margin: 20px auto;
padding: 20px;
background-color: #ffffff; /* Set the background color of the container */
border-radius: 5px;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
h2 {
text-align: center;
color: #8e44ad; /* Dark lavender heading color */
}
p {
margin: 10px 0;
}
strong {
font-weight: bold;
}
form {
text-align: center;
}
input[type="submit"] {
padding: 10px 20px;
background-color: #8e44ad; /* Dark lavender background color for the button */
color: #ffffff; /* Set the text color of the button */
border: none;
border-radius: 5px;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #9b59b6; /* Light lavender hover background color for the button */
}
</style>
</head>
<body>
<?php require '<partials/_nav.php' ?>
<div class="container">
<h2>Therapist Profile</h2>
<p><strong>First Name:</strong> <?php echo $FirstName; ?></p>
<p><strong>Last Name:</strong> <?php echo $LastName; ?></p>
<p><strong>Email:</strong> <?php echo $Mail; ?></p>
<p><strong>Rating:</strong> <?php echo $Rating; ?></p>
<p><strong>Fees:</strong> <?php echo $Fees; ?> / session</p>
<p><strong>Plan:</strong> <?php echo $Therapist; ?></p>
<!-- Add a link to update the profile -->
<!-- <a href="update_profile.php">Update Profile</a> -->
<!-- Add logout option to destroy the session -->
<form action="homepage.php" method="post">
<input type="submit" value="Logout">
</form>
</div>
</body>
</html>