-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaccount.php
46 lines (46 loc) · 1.13 KB
/
account.php
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
<?php
include("dbconnect.php");
if(!isset($_SESSION['username'])){
header("Location: login.php");
exit();
}
?>
<!DOCTYPE html>
<html>
<head>
<title><?php echo $_SESSION['username']; ?> - MentorTee</title>
<link rel="stylesheet" href="style.css">
<script type="text/javascript" src="javascript.js"></script>
<?php include("head.php"); ?>
</head>
<body>
<div id="mentor-mentee">
<h2>All my <?php $mm->CheckMentororMentee($_SESSION['username']); ?></h2>
<?php
if(isset($_POST['remove'])){
$mm->RemoveMentor($_POST['mentorusername'], $_SESSION['username']);
}
?>
<?php
$mm->MyMentororMenteeList($_SESSION['username']);
?>
<?php $mm->AvailableMentorList($_SESSION['username']); ?>
<?php
if(isset($_POST['add'])){
$mm->AddNewMentor($_POST['mentorusername'], $_SESSION['username']);
}
?>
<div>
<?php
if(isset($_POST['logout'])){
session_destroy();
echo "<script>location.href = 'login.php';</script>";
}
?>
<form method="POST">
<input class="textinput submiter" type="submit" value="Log out" name="logout" />
</form>
</div>
</div>
</body>
</html>