/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/showinterest.php

  • Committer: Gustav Hatvigsson
  • Date: 2013-04-14 06:31:37 UTC
  • mto: This revision was merged to the branch mainline in revision 59.
  • Revision ID: gustav.hartvigsson@gmail.com-20130414063137-s2c483lb0rsvwgc7
fixed the "city" bug.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
if($profilename != $username) {
22
22
        $relationinfo = $db->query("SELECT * from dateInterests WHERE(user1='$username' AND user2='$profilename')");
23
23
        $relationquery = $relationinfo->fetchAll();
24
 
  $newusername = $db->query("SELECT firstName, surName FROM Users WHERE loginName = '{$profilename}'");
25
 
  $newusername = $newusername->fetchAll();
26
 
  $newusername = $newusername[0]['firstName'] . " " . $newusername[0]['surName'];
27
24
        if($relationquery != array()) {
28
 
    ?>
29
 
                <p>Du har visat intresse för en lunchdejt med den här personen<p />
30
 
                <form method="POST" action="">
31
 
                <button type="Submit" name="Unsubscribe">Sluta visa intresse</button>
32
 
                </form>
33
 
    <?php
 
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>';
 
28
                echo '</form>';
34
29
                $relationinfo = $db->query("SELECT * from dateInterests WHERE(user1='$profilename' AND user2='$username')");
35
30
                $relationquery = $relationinfo->fetchAll();
36
31
                if($relationquery != array()) {
37
 
                        echo $newusername . ' vill gärna äta lunch med dig också, skicka ett mail och bestäm träff!';
 
32
                        echo $profilename . ' vill gärna äta lunch med dig också, skicka ett mail och bestäm träff!';
38
33
                        include 'planlunch.php';
39
34
                        include 'showlunchsuggestions.php';
40
35
                }
41
36
        } else {
42
 
    ?>
43
 
                <p>Vill du gå på lunch med den här personen?</p>
44
 
                <form method="POST" action="">
45
 
                <button type="Submit" name="Subscribe">Visa intresse</button>
46
 
                </form>
47
 
    <?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>';
 
40
                echo '</form>';
48
41
        }
49
42
        if (isset($_POST['Subscribe'])) {
50
43
                $relationinfo = $db->query("SELECT * from dateInterests WHERE(user1='$username' AND user2='$profilename')");
51
44
                $relationquery = $relationinfo->fetchAll();
52
45
                if($relationquery == array()) {
53
46
                        $db->exec("INSERT INTO dateInterests VALUES ('$username', '$profilename')");
54
 
                        echo '<p>Du har visat intresse för lunch med personen</p>';
 
47
                        echo 'Du har visat intresse för lunch med personen';
55
48
                        sleep(.5);
56
49
                        header("Location:./profile.php?uid=" . $profilename);
57
50
                }
59
52
        if (isset($_POST['Unsubscribe'])) 
60
53
        { 
61
54
                $db->exec("DELETE FROM dateInterests WHERE (user1='$username' AND user2='$profilename')");
62
 
                echo '<p>Du har slutat visa intresse för lunch med personen</p>'; 
 
55
                echo 'Du har slutat visa intresse för lunch med personen'; 
63
56
                sleep(.5);
64
57
                header("Location:./profile.php?uid=" . $profilename);
65
58
        }