-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuddyRequest.php
More file actions
141 lines (128 loc) Β· 5.62 KB
/
buddyRequest.php
File metadata and controls
141 lines (128 loc) Β· 5.62 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
<?php
include_once(__DIR__ . "/classes/Buddy.php");
session_start();
if (!isset($_SESSION['user'])) {
header("Location: login.php");
}
$user = new Buddy();
$user->setId($_SESSION["id"]);
$userData = $user->allUserData();
$pendingMatch = $user->pendingMatch();
if (empty($pendingMatch)) {
header('location: index.php');
}
$pendingMatch = $user->pendingMatch();
$match = $user->searchPendingMatch($pendingMatch);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/style.css">
<title>Buddy verzoek!</title>
</head>
<body>
<?php include_once('nav.inc.php'); ?>
<div class="form form--login">
<div class="container__buddyCard">
<?php
$counter = 0;
if ($userData['interests'] == $match['interests']) {
$counter++;
$interests = htmlspecialchars($userData['interests']);
}
if ($userData['hobbies'] == $match['hobbies']) {
$counter++;
$hobbies = htmlspecialchars($userData['hobbies']);
}
if ($userData['beverage'] == $match['beverage']) {
$counter++;
$beverage = htmlspecialchars($userData['beverage']);
}
if ($userData['pet'] == $match['pet']) {
$counter++;
$pet = htmlspecialchars($userData['pet']);
}
?>
<div
class="container buddyCard priority<?php echo $counter; ?>">
<h3><?php echo htmlspecialchars($match['firstname1']) . " " . htmlspecialchars($match['lastname1']) . " wil buddies worden"; ?>
</h3>
<img class="avatar"
src="uploads/<?php echo htmlspecialchars($match["avatar1"]) ?>"
alt="profile picture">
<?php if (isset($interests)): ?>
<?php if ($interests == "Both"): ?>
<h4><?php echo "Jullie hebben beide interesse in design en development"; ?>
</h4>
<?php else: ?>
<h4><?php echo "Jullie hebben beide interesse in " . $interests; ?>
</h4>
<?php endif; endif; ?>
<?php if (isset($hobbies)): ?>
<?php if ($hobbies == "Tv"): ?>
<h4><?php echo "Jullie hebben beide de hobby tv kijken πΊ"; ?>
</h4>
<?php elseif ($hobbies == "Party"): ?>
<h4><?php echo "Jullie houden beide van een feestje π₯³"; ?>
</h4>
<?php else: ?>
<h4><?php echo "Jullie houden beide van lang uit te slapen π΄"; ?>
</h4>
<?php endif; endif; ?>
<?php if (isset($beverage)): ?>
<?php if ($beverage == "Beer"): ?>
<h4><?php echo "Jullie houden er beide van om een frisse pint te drinken πΊ"; ?>
</h4>
<?php elseif ($beverage == "Coffee"): ?>
<h4><?php echo "Jullie houden er beide van een in de ochtend een lekkere kop koffie te drinken β"; ?>
</h4>
<?php elseif ($beverage == "Soda"): ?>
<h4><?php echo "Jullie houden er beide van om een lekker glas frisdrank te drinken π₯€"; ?>
</h4>
<?php else: ?>
<h4><?php echo "Jullie houden er beide van om thee te drinken π΅"; ?>
</h4>
<?php endif; endif; ?>
<?php if (isset($pet)): ?>
<?php if ($pet == "Bunny"): ?>
<h4><?php echo "Jullie houden beide van konijnen π"; ?>
</h4>
<?php elseif ($pet == "Cat"): ?>
<h4><?php echo "Jullie houden beide van katten π"; ?>
</h4>
<?php elseif ($pet == "Dog"): ?>
<h4><?php echo "Jullie houden beide van honden π"; ?>
</h4>
<?php elseif ($pet == "Horse"): ?>
<h4><?php echo "Jullie houden beide van paarden π"; ?>
</h4>
<?php else: ?>
<h4><?php echo "Jullie houden beide evenveel van alle dieren π"; ?>
</h4>
<?php endif; endif; ?>
<div class="form__field">
<input type="submit" value="accepteer buddy!" class="btn btn--primary" id="buddyMatching"
data-userId2=<?php echo $match['id2']; ?>
data-userId1= <?php echo $match['id1']; ?>
onclick="acceptMatch(this);" >
</div>
<div class="form__field">
<label for="description">waarom je niet accepteert (niet verplicht)</label>
<textarea type="textarea" id="reasonAnswer" name="reasonAnswer"></textarea>
</div>
<div class="form__field">
<input type="submit" value="weiger buddy!" class="btn btn--primary btn--bottom" data-userId2=<?php echo $match['id2']; ?>
data-userId1= <?php echo $match['id1']; ?>
onclick="rejectMatch(this);">
</div>
</div>
</div>
</div>
<?php include_once('footer.inc.php'); ?>
<script src="js/accept.js"></script>
<script src="js/reject.js"></script>
</body>
</html>