This repository has been archived by the owner on Nov 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathviewProfile.php
73 lines (61 loc) · 1.99 KB
/
viewProfile.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
<?php
include_once 'head.php';
include_once 'login.php';
if(isset($_GET['userToDisplay']))
{
$userToDisplay = $_GET['userToDisplay'];
}
if(isset($_POST['reviewText']) && $_POST['rating'])
{
$reviewText = $_POST['reviewText'];
$rating = $_POST['rating'];
makeQuery("INSERT INTO reviews VALUES('$userToDisplay', '$rating', '$reviewText')");
header("location: viewProfile.php?userToDisplay=$userToDisplay");
}
showProfile($userToDisplay);
if($userToDisplay != $user)
{
$favoritesQuery = "SELECT * FROM favorites WHERE username='$user'".
" AND favoritedUser='$userToDisplay'";
$favoritesResult = makeQuery($favoritesQuery);
if(mysql_num_rows($favoritesResult))
{
echo "<br /><h3>This User is Currently in Your Favorites</h3>";
}
else
{
echo "<h3><a href='addToFavorites.php?userToAdd=$userToDisplay'>
Add this Doctor to your Favorites</a></h3><br />";
}
}
if($userToDisplay != $user)
{
echo <<<_END
<div class='sixty' align='center'>
<h3><a href='addToFavorites?userToAdd=$userToDisplay'>
Add this Doctor to your Favorites</a></h3><br />
<h3>Have you worked with this doctor? Leave a Review!</h3>
<div style='width:40%;'>
<form method = 'post' action = 'viewProfile.php?userToDisplay=$userToDisplay'>
<span style='font-size:1.4em'>Rating: Low </span>
<input type="radio" name = 'rating' value="1">  1 </input>
<input type="radio" name = 'rating' value="2">  2 </input>
<input type="radio" name = 'rating' value="3">  3 </input>
<input type="radio" name = 'rating' value="4">  4 </input>
<input type="radio" name = 'rating' value="5">  5 </input>
<span style='font-size:1.4em'> High</span>
<br /><br />
<textarea name='reviewText' cols='50' rows='4' placeholder='Enter Written Review Here'>
</textarea>
<BR><BR>
<input class='btn btn-success' type = 'submit' value = 'Submit Review' />
</div></div>
_END;
}
else
{
echo "<h3>This is your profile, to edit, click ".
"<a href='editProfile.php'>here</a></h3>";
}
include_once 'footer.php';
?>