-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaddMember.php
More file actions
99 lines (84 loc) · 3.01 KB
/
Copy pathaddMember.php
File metadata and controls
99 lines (84 loc) · 3.01 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-icons/1.10.5/font/bootstrap-icons.min.css" rel="stylesheet">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/addMember.css">
</head>
<body>
<?php
session_start();
// set session timeout duration (20 minutes)
$timeout_duration = 1200; // 20 minutes in seconds
// check if the session has expired
if (isset($_SESSION['last_activity']) && (time() - $_SESSION['last_activity']) > $timeout_duration) {
// destroy the session if it has expired
session_unset();
session_destroy();
header("Location: login.php?timeout=true");
exit();
}
$_SESSION['last_activity'] = time();
if (!isset($_SESSION['logged_in']) || $_SESSION['logged_in'] !== true) {
header("Location: login.php");
exit();
}
?>
<?php
require_once("header.php")
?>
<div class="admin-page">
<!-- siderbar for actions -->
<div class="sidebar">
<button onclick="window.location.href='orderMembers.php'">
<i class="bi bi-list-ul"></i> Order Members
</button>
<button onclick="window.location.href='editMembers.php'">
<i class="bi bi-pencil-square"></i> Edit Members
</button>
<button onclick="window.location.href='addMember.php'">
<i class="bi bi-person-plus"></i> Add Member
</button>
<button onclick="window.location.href='adminEventAdd.php'">
<i class="bi bi-person-plus"></i> Add Event
</button>
<button onclick="window.location.href='adminEventEdit.php'">
<i class="bi bi-pencil-square"></i> Edit Event
</button>
<button onclick="window.location.href='adminSignUp.php'">
<i class="bi bi-person-plus"></i> Add User
</button>
</div>
<!-- Content area -->
<div class="content">
<form id="event-form" enctype="multipart/form-data">
<h1>Add Member</h1>
<div class="form-group">
<input type="text" id="memberName" name="memberName" required>
<label for="memberName">Name</label>
</div>
<div class="form-group">
<textarea id="memberBio" rows="4" name = "memberBio" required></textarea>
<label for="memberBio">Bio</label>
</div>
<div class="form-group">
<div class="photo-preview">
<img id="newPhotoPreview" src="" alt="" style="width: 150px; height: auto; display: none;">
</div>
<input type="file" id="newEventPhotoUpload" name = "event_img" accept="image/*" onchange="previewNewPhoto()">
<label for="newEventPhoto"></label>
</div>
<button type="button" onclick="addNewMember()">Submit</button>
</form>
</div>
</div>
<script src="js/addMember.js"></script>
<?php $conn->close(); ?>
<?php
require_once("footer.php")
?>
</body>
</html>