summaryrefslogtreecommitdiff
path: root/htdocs/moderate/src/header.inc.php
blob: 43100099f173ac3e902682d1f2ac1d3e99f1af31 (plain)
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
<?php
/* $Id: header.inc.php 151 2011-04-19 23:21:06Z jessemorgan $ */

if (!isset($SESSION['currentUser']['id'])) {
    if (isset($_POST['login_email']) and isset($_POST['login_password'])) {
        $db = getDatabase();

        $email = addslashes($_POST['login_email']);
        $password = sha1($_POST['password']);

        $query = "SELECT * FROM jpm_users WHERE `email`='$email' AND `password`='$password'";
        $result = $db->fetchAssocRow($query);

        if ($result) { 
            $SESSION['currentUser'] = $result;
        }
    
    }
}

?><!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" type="text/css" href="<?= $CONFIG['siteroot']?>/admin/admin.css" />

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
    <script>
        $(document).ready(function() {
            $('a.delete').click(function() {
                return confirm('Are you sure you want to delete this?');

            });

            $('a.delete img').hover(function() {
                    $(this).attr('src', '<?= $CONFIG['siteroot'] ?>/admin/images/delete.png');
                },
                function() {
                    $(this).attr('src', '<?= $CONFIG['siteroot'] ?>/admin/images/deletegray.png');
                });

        });
    </script>

</head>
<body>

<h1><a href="<?= $CONFIG['siteroot']?>/admin/index.php">Foursquare Admin Panel</a></h1>
<div id="nav">
    <h2>Navigation</h2>
    <ul>
        <li><a href="<?= $CONFIG['siteroot']?>/admin/online-campus">Online Services</a>
            <ul>
            <li><a href="<?= $CONFIG['siteroot']?>/admin/online-campus/attendance">Online Attendance</a></li>
            </ul>
        </li>

        <li><a href="<?= $CONFIG['siteroot']?>/troubleshoot.php">Troubleshooting Page</a></li>
        <li><a href="<?= $CONFIG['siteroot']?>/admin/accounts/">Accounts</a></li>
        <li><a href="<?= $CONFIG['siteroot']?>/admin/changepassword.php">Change Password</a></li>
        <li><a href="<?= $CONFIG['siteroot']?>/admin/login.php?logout">Logout</a></li>
    </ul>
</div>

<div id="content">