-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathRecruiterApplications.html
More file actions
189 lines (176 loc) · 5.3 KB
/
RecruiterApplications.html
File metadata and controls
189 lines (176 loc) · 5.3 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Applications | PM Internship Portal</title>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" rel="stylesheet">
<link rel="icon" type="image/png" href="AinternFavicon.png">
<style>
body {
font-family: Arial, sans-serif;
background: #f4f7fa;
margin: 0;
display: flex;
}
/* Sidebar */
.sidebar {
width: 250px;
height: 100vh;
background: #2f3b52;
color: #fff;
padding-top: 20px;
position: fixed;
top: 0;
left: 0;
}
.sidebar h2 {
text-align: center;
margin-bottom: 30px;
font-size: 20px;
color: #fff;
}
.sidebar a {
display: block;
padding: 15px 20px;
color: #fff;
text-decoration: none;
margin-bottom: 10px;
border-left: 4px solid transparent;
transition: all 0.3s;
}
.sidebar a:hover, .sidebar a.active {
background: #1e2a3c;
border-left: 4px solid #ff7f50;
}
/* Main Content */
.main {
margin-left: 250px;
padding: 20px;
width: calc(100% - 250px);
}
.container {
background: #fff;
padding: 25px;
border-radius: 10px;
max-width: 100%;
margin: auto;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
h2 {
text-align: center;
margin-bottom: 20px;
color: #2c3e50;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 15px;
}
th, td {
padding: 12px;
text-align: left;
border-bottom: 1px solid #ddd;
}
th {
background: #3498db;
color: white;
}
tr:hover {
background: #f1f1f1;
}
.btn {
padding: 6px 12px;
border: none;
border-radius: 6px;
cursor: pointer;
font-size: 14px;
margin: 2px;
}
.btn-select { background: #2ecc71; color: white; }
.btn-reject { background: #e74c3c; color: white; }
.status {
font-weight: bold;
padding: 6px 10px;
border-radius: 6px;
}
.status.Pending { background: #f1c40f; color: #fff; }
.status.Selected { background: #2ecc71; color: #fff; }
.status.Rejected { background: #e74c3c; color: #fff; }
</style>
</head>
<body>
<!-- Sidebar -->
<div class="sidebar">
<h2><i class="fas fa-graduation-cap"></i> PM Internship</h2>
<a href="recruiter.html"><i class="fas fa-home"></i> Dashboard</a>
<a href="PostInternships.html"><i class="fas fa-briefcase"></i> Post Internships</a>
<a href="RecruiterApplications.html" class="active"><i class="fas fa-file-alt"></i> Applications</a>
<a href="RecruiterSettings.html"><i class="fas fa-cog"></i> Settings</a>
<a href="logout.html"><i class="fas fa-sign-out-alt"></i> Logout</a>
</div>
<!-- Main Content -->
<div class="main">
<div class="container">
<h2><i class="fas fa-users"></i> Internship Applications</h2>
<table id="applicationsTable">
<thead>
<tr>
<th>Student Name</th>
<th>Email</th>
<th>Phone</th>
<th>Skills</th>
<th>Experience</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
<!-- Supabase Script -->
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2.27.0/dist/umd/supabase.min.js"></script>
<script>
const SUPABASE_URL = "https://xozzpzasbdvgpyysuvew.supabase.co";
const SUPABASE_ANON_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InhvenpwemFzYmR2Z3B5eXN1dmV3Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTc3MDA0NjMsImV4cCI6MjA3MzI3NjQ2M30.SiiaH38cNz21EHpvGOZNQCQ5vW2f6H2GBocGn4qYfGM";
const supabase = window.supabase.createClient(SUPABASE_URL, SUPABASE_ANON_KEY);
const tableBody = document.querySelector("#applicationsTable tbody");
// Fetch applications from Supabase
async function fetchApplications() {
const { data, error } = await supabase.from("applications").select("*").order("created_at", { ascending: false });
if (error) {
console.error("Error fetching applications:", error.message);
return;
}
tableBody.innerHTML = "";
data.forEach(app => {
const row = document.createElement("tr");
row.innerHTML = `
<td>${app.student_name}</td>
<td>${app.email}</td>
<td>${app.phone || "-"}</td>
<td>${app.skills || "-"}</td>
<td>${app.experience || "-"}</td>
<td><span class="status ${app.status}">${app.status}</span></td>
<td>
<button class="btn btn-select" onclick="updateStatus('${app.id}', 'Selected')">Select</button>
<button class="btn btn-reject" onclick="updateStatus('${app.id}', 'Rejected')">Reject</button>
</td>
`;
tableBody.appendChild(row);
});
}
// Update status in Supabase
async function updateStatus(id, status) {
const { error } = await supabase.from("applications").update({ status }).eq("id", id);
if (error) {
console.error("Error updating status:", error.message);
} else {
fetchApplications(); // reload table
}
}
// Initial load
fetchApplications();
</script>
</body>
</html>