/extremedating/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/extremedating/trunk

« back to all changes in this revision

Viewing changes to php/sidepanel.php

  • Committer: Gustav Hartvigsson
  • Date: 2013-04-15 17:15:56 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20130415171556-q5zcc5mdle93vm1q
code cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<img class="profilepic" src="./get_image.php?userName=<?PHP echo $username;?>"/>
 
2
<a href="profile.php?uid=<?php echo $username; ?>" class="profilename"><?php echo $firstName . " " . $surName;?></a>
 
3
<p class="smallheader">Personer jag vill träffa:</p>
 
4
<?PHP
 
5
/*
 
6
    ExtremeDating - a Hackathon 2013 project.
 
7
    Copyright (C) 2013 Gustav Hartvigsson <gustav.hartvigsson@gmail.com>
 
8
    Copyright (C) 2013 Daniel Johansson <maila@danieljohansson.nu>
 
9
 
 
10
 
 
11
    This program is free software: you can redistribute it and/or modify
 
12
    it under the terms of the GNU Affero General Public License as
 
13
    published by the Free Software Foundation, either version 3 of the
 
14
    License, or (at your option) any later version.
 
15
 
 
16
    This program is distributed in the hope that it will be useful,
 
17
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
18
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
19
    GNU Affero General Public License for more details.
 
20
 
 
21
    You should have received a copy of the GNU Affero General Public License
 
22
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
23
*/
 
24
        $relationinfo = $db->query("SELECT user2 from dateInterests WHERE(user1='$username')");
 
25
        $relationstring = $relationinfo->fetchAll();
 
26
        echo '<UL>';
 
27
        foreach ($relationstring as $relationquery) {
 
28
                $userinfo = $db->query("SELECT firstName from Users WHERE loginName='$relationquery[0]'");
 
29
                $self = $userinfo->fetchAll();
 
30
                $firstName = $self [0]['firstName'];
 
31
                $userinfo = $db->query("SELECT surName from Users WHERE loginName='$relationquery[0]'");
 
32
                $self = $userinfo->fetchAll();
 
33
                $surName = $self [0]['surName'];
 
34
                echo '<li><a href="./profile.php?uid=' . $relationquery[0] . '">' . $firstName . ' ' . $surName . '</a></li>';
 
35
        }
 
36
        echo '</UL>';
 
37
        echo '<p class="smallheader">Personer som vill träffa mig:</p>';
 
38
        echo '<UL>';
 
39
        $relationinfo = $db->query("SELECT user2 from dateInterests WHERE(user1='$username')");
 
40
        $relationstring = $relationinfo->fetchAll();
 
41
        foreach ($relationstring as $relationquery) {
 
42
                $relation2info = $db->query("SELECT user2 from dateInterests WHERE(user1='$relationquery[0]')");
 
43
                $relation2string = $relation2info->fetchAll();
 
44
                foreach ($relation2string as $relation2query) {;
 
45
                        if($relation2query[0] == $username){
 
46
                                $userinfo = $db->query("SELECT firstName from Users WHERE loginName='$relationquery[0]'");
 
47
                                $self = $userinfo->fetchAll();
 
48
                                $firstName = $self [0]['firstName'];
 
49
                                $userinfo = $db->query("SELECT surName from Users WHERE loginName='$relationquery[0]'");
 
50
                                $self = $userinfo->fetchAll();
 
51
                                $surName = $self [0]['surName'];
 
52
                                echo '<li><a href="./profile.php?uid=' . $relationquery[0] . '">' . $firstName . ' ' . $surName . '</a></li>';
 
53
                        }
 
54
                }
 
55
        }
 
56
        echo '</UL>';
 
57
?>