3
ExtremeDating - a Hackathon 2013 project.
4
Copyright (C) 2013 Gustav Hartvigsson <gustav.hartvigsson@gmail.com>
5
Copyright (C) 2013 Daniel Johansson <maila@danieljohansson.nu>
8
This program is free software: you can redistribute it and/or modify
9
it under the terms of the GNU Affero General Public License as
10
published by the Free Software Foundation, either version 3 of the
11
License, or (at your option) any later version.
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
GNU Affero General Public License for more details.
18
You should have received a copy of the GNU Affero General Public License
19
along with this program. If not, see <http://www.gnu.org/licenses/>.
21
if($profilename != $username) {
22
$relationinfo = $db->query("SELECT * from dateInterests WHERE(user1='$username' AND user2='$profilename')");
23
$relationquery = $relationinfo->fetchAll();
24
if($relationquery != array()) {
25
echo 'Du har visat intresse för en lunchdejt med den här personen';
26
echo '<form method="POST" action="">';
27
echo '<button type="Submit" name="Unsubscribe">Sluta visa intresse</button>';
29
$relationinfo = $db->query("SELECT * from dateInterests WHERE(user1='$profilename' AND user2='$username')");
30
$relationquery = $relationinfo->fetchAll();
31
if($relationquery != array()) {
32
echo $profilename . ' vill gärna äta lunch med dig också, skicka ett mail och bestäm träff!';
33
include 'planlunch.php';
34
include 'showlunchsuggestions.php';
37
echo 'Vill du gå på lunch med den här personen?';
38
echo '<form method="POST" action="">';
39
echo '<button type="Submit" name="Subscribe">Visa intresse</button>';
42
if (isset($_POST['Subscribe'])) {
43
$relationinfo = $db->query("SELECT * from dateInterests WHERE(user1='$username' AND user2='$profilename')");
44
$relationquery = $relationinfo->fetchAll();
45
if($relationquery == array()) {
46
$db->exec("INSERT INTO dateInterests VALUES ('$username', '$profilename')");
47
echo 'Du har visat intresse för lunch med personen';
49
header("Location:./profile.php?uid=" . $profilename);
52
if (isset($_POST['Unsubscribe']))
54
$db->exec("DELETE FROM dateInterests WHERE (user1='$username' AND user2='$profilename')");
55
echo 'Du har slutat visa intresse för lunch med personen';
57
header("Location:./profile.php?uid=" . $profilename);