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

  • Committer: Daniel Johansson
  • Date: 2013-04-13 17:27:51 UTC
  • mfrom: (24.1.2 extremedating)
  • Revision ID: maila@danieljohansson.nu-20130413172751-now2qubz7gyuxi8h
merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE html>
2
1
<html>
3
2
<?PHP
4
3
        session_start();
22
21
    You should have received a copy of the GNU Affero General Public License
23
22
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
24
23
-->
25
 
        <head>
 
24
        <header>
26
25
                <title>Lunchdating</title>
27
26
                <link rel="stylesheet" type="text/css" href="css/main.css"/>
28
27
                <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
29
 
        </head>
30
 
        <?PHP
31
 
        if(isset($_SESSION ['userName'])){
32
 
        $username = $_SESSION ['userName'];
33
 
        include 'php/db.php';
34
 
        $userinfo = $db->query("SELECT firstName from Users WHERE loginName='$username'");
35
 
        $self = $userinfo->fetchAll();
36
 
        $firstName = $self [0]['firstName'];
37
 
        $userinfo = $db->query("SELECT surName from Users WHERE loginName='$username'");
38
 
        $self = $userinfo->fetchAll();
39
 
        $surName = $self [0]['surName'];
40
 
        ?>
41
 
        <body id="wrapper">
42
 
                <div id="profile">
43
 
                        <div id="profileheader">
44
 
                        <div class="logo">
45
 
                        <a href="index.php">
46
 
                        <img src="img/logo.png"/>
47
 
                        </a>
48
 
                                <img src="img/logo.png"/>
49
 
                        </div>
50
 
                                <form action="./logout.php" method="POST">
51
 
                                        <table id="logout">
52
 
                                                <tr>
53
 
                                                        <td><input id="inputbutton1" type="Submit" value="Logga ut"/></td>
54
 
                                                </tr>
55
 
                                        </table>
56
 
                                </form>
57
 
                        </div>
58
 
                        <div id="profileimg">
59
 
                                <img src="img/profilemockup.jpg"/>
60
 
                                <a href="profile.php?uid=<?php echo $username; ?>" class="profilename"><?php echo $firstName . " " . $surName;?></a>
61
 
                                <p class="smallheader">Personer jag vill träffa:</p>
62
 
                                <p class="profilelink">Herp Derp</p>
63
 
                                <p class="profilelink">Jane Doe</p>
64
 
                                <p class="smallheader">Personer som vill träffa mig:</p>
65
 
                                <p class="profilelink">Jane Doe</p>
66
 
                        </div>
67
 
                        <div id="wallflow">
68
 
                        </div>
69
 
                </div>
70
 
        </body>
71
 
        <?PHP
72
 
        } else {
73
 
        ?>
74
 
        <body id="wrapper">
75
 
                <div id="profile">
76
 
                        <div id="profileheader">
77
 
                                <div class="logo">
78
 
                                        <a href="index.php">
 
28
        </header>
 
29
        <body id="wrapper">
 
30
                <div id="profile">
 
31
                        <div id="profileheader">
 
32
                                <div id="logo">
79
33
                                        <img src="img/logo.png"/>
80
 
                                        </a>
81
34
                                </div>
82
35
                                <form action="./login.php" method="POST">
83
36
                                        <table id="login">
84
37
                                                <tr>
85
 
                                                        <td><label for="username">Användarnamn:</label></td>
86
 
                                                        <td><input id="username" class="input" type="input" name="username"/></td>
87
 
                                                </tr>
88
 
                                                <tr>
89
 
                                                        <td><label for="password">Lösenord:</label></td>
90
 
                                                        <td><input id="password" class="input" type="password" name="password"/></td>
91
 
                                                </tr>
92
 
                                                <tr>
93
 
                                                        <td><input id="inputbutton1" type="Submit" value="Logga in"/></td>
94
 
                                                        <td><a href="adduser.php">Registera dig</td>
 
38
                                                        <td><label for="Username">Användarnamn:</label></td>
 
39
                                                        <td><input id="input" type="input" name="username" value="Username"/></td>
 
40
                                                </tr>
 
41
                                                <tr>
 
42
                                                        <td><label for="Password">Lösenord:</label></td>
 
43
                                                        <td><input id="input" type="password" name="password" value="Password"/></td>
 
44
                                                </tr>
 
45
                                                <tr>
 
46
                                                        <td></td>
 
47
                                                        <td><input id="inputbutton1" type="Submit" value="Logga in" action="./login.php"/><input id="inputbutton2" type="Submit" value="Registera mig" action="./adduser.php"/></td>
95
48
                                                </tr>
96
49
                                        </table>
97
50
                                </form>
 
51
 
98
52
                        </div>
99
53
                        <div id="profileimg">
100
54
                        </div>
101
55
                        <div id="wallflow">
 
56
                        <?PHP
 
57
                        if(isset ($_SESSION ['userName'])) echo 'Herp!';
 
58
                        else echo 'DERP!';
 
59
                        ?>
102
60
                        </div>
103
61
                </div>
104
62
        </body>
105
 
        <?PHP } ?>
106
63
</html>