This commit is contained in:
EvilMuffinHa 2021-09-12 17:31:33 -04:00
commit 60f40bdd55
13 changed files with 317 additions and 318 deletions

File diff suppressed because one or more lines are too long

View File

@ -67,6 +67,13 @@ class StudentWeek extends React.Component {
render() {
if (this.state.isLoading) {
return <View/>
} else {
if (this.state.data.length==0) {
return (
<View style={{alignItems:'center',paddingiorizontal:'10%', height: '100%', backgroundColor: 'white', justifyContent: 'center', padding: '2%'}}>
<Text style={{fontSize: 32, fontWeight: 'bold', marginBottom: '10%', color: 'red', textAlign: 'center'}}>No student of the week</Text>
</View>
)
} else {
console.log(this.state.data[this.state.data.length-1].image)
const iconURI = this.state.data[this.state.data.length-1].image !== undefined?`data:image/png;charset=utf-8;base64,${this.state.data[this.state.data.length-1].image}`:'';
@ -121,5 +128,6 @@ class StudentWeek extends React.Component {
}
}
}
}
export default StudentWeek;

View File

@ -3,6 +3,7 @@ function forwardForImage(id, postloc) {
console.log("askldjf");
let form_elem = document.getElementById(id).children;
let data = [];
var base64=""
for (i = 0; i < form_elem.length; i++) {
console.log(form_elem[i]);
if (form_elem[i].type == "text") {
@ -12,20 +13,36 @@ function forwardForImage(id, postloc) {
data.push(form_elem[i].name + "=" + encodeURIComponent(form_elem[i].value));
}
if (form_elem[i].type == "file") {
var file = document.getElementById(form_elem[i].id).files[0];
getBase64(file, form_elem, i, data, function(form_elem, i, data, res) {
data.push(form_elem[i].name + "=" + encodeURIComponent(res));
});
var file = document.querySelector('input[type=file]')['files'][0]
var reader = new FileReader();
reader.readAsDataURL(file)
reader.onload=function() {
base64 = reader.result
};
reader.onerror = function (error) {
console.log('Error: ', error);
};
}
}
console.log(data);
console.log(data[3]);
var file = document.querySelector('input[type=file]')['files'][0]
var reader = new FileReader();
reader.readAsDataURL(file)
reader.onload=function() {
data.push(reader.result)
console.log(data)
var params = data.join("&");
var xhr = new XMLHttpRequest();
xhr.open("POST", postloc);
console.log(params);
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhr.send(params);
};
reader.onerror = function (error) {
console.log('Error: ', error);
};
console.log(data);
}
function getBase64(file, form_elem, i, data, callback) {

View File

@ -49,7 +49,7 @@
<form action="announcements/add" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
@ -62,7 +62,7 @@
<p class="my-0">Teacher</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="teacher" name="teacher">
<input type="text" class="form-control form-control-sm" id="teacher" name="teacher" required>
</div>
</div>
@ -71,7 +71,7 @@
<p class="my-0">Message</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="message" name="message">
<input type="text" class="form-control form-control-sm" id="message" name="message" required>
</div>
</div>
@ -80,7 +80,7 @@
<p class="my-0">Date of Submission</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="date" name="date">
<input type="text" class="form-control form-control-sm" id="date" name="date" required>
</div>
</div>
@ -89,7 +89,7 @@
<p class="my-0">Time of Submission</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="time" name="time">
<input type="text" class="form-control form-control-sm" id="time" name="time" required>
</div>
</div>
@ -105,13 +105,13 @@
<p class="my-0">ID of announcement to update</p>
</div>
<div style="flex: 1; align: center;">
<input type="number" class="form-control form-control-sm" id="id" name="id">
<input type="number" class="form-control form-control-sm" id="id" name="id" required>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
@ -124,7 +124,7 @@
<p class="my-0">Teacher</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="teacher" name="teacher">
<input type="text" class="form-control form-control-sm" id="teacher" name="teacher" required>
</div>
</div>
@ -133,7 +133,7 @@
<p class="my-0">Message</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="message" name="message">
<input type="text" class="form-control form-control-sm" id="message" name="message" required>
</div>
</div>
@ -142,7 +142,7 @@
<p class="my-0">Date of Submission</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="date" name="date">
<input type="text" class="form-control form-control-sm" id="date" name="date" required>
</div>
</div>
@ -151,7 +151,7 @@
<p class="my-0">Time of Submission</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="time" name="time">
<input type="text" class="form-control form-control-sm" id="time" name="time" required>
</div>
</div>
<input type="submit", value="Submit">

View File

@ -49,7 +49,7 @@
<form action="challenge/add" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
@ -62,7 +62,7 @@
<p class="my-0">Title</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="title" name="title">
<input type="text" class="form-control form-control-sm" id="title" name="title" required>
</div>
</div>
@ -71,7 +71,7 @@
<p class="my-0">Information</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="text" name="text">
<input type="text" class="form-control form-control-sm" id="text" name="text" required>
</div>
</div>
@ -80,7 +80,7 @@
<p class="my-0">Link to Challenge</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="link" name="link">
<input type="text" class="form-control form-control-sm" id="link" name="link" required>
</div>
</div>
@ -96,13 +96,13 @@
<p class="my-0">ID of challenge to update</p>
</div>
<div style="flex: 1; align: center;">
<input type="number" class="form-control form-control-sm" id="id" name="id">
<input type="number" class="form-control form-control-sm" id="id" name="id" required>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
@ -115,7 +115,7 @@
<p class="my-0">Title</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="title" name="title">
<input type="text" class="form-control form-control-sm" id="title" name="title" required>
</div>
</div>
@ -124,7 +124,7 @@
<p class="my-0">Information</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="text" name="text">
<input type="text" class="form-control form-control-sm" id="text" name="text" required>
</div>
</div>
@ -133,7 +133,7 @@
<p class="my-0">Link to Challenge</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="link" name="link">
<input type="text" class="form-control form-control-sm" id="link" name="link" required>
</div>
</div>

View File

@ -50,7 +50,7 @@
<form action="clubs/add" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
@ -63,7 +63,7 @@
<p class="my-0">Name</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="name" name="name">
<input type="text" class="form-control form-control-sm" id="name" name="name" required>
</div>
</div>
@ -72,7 +72,7 @@
<p class="my-0">Meeting Date and Time</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="meeting" name="meeting">
<input type="text" class="form-control form-control-sm" id="meeting" name="meeting" required>
</div>
</div>
@ -81,7 +81,7 @@
<p class="my-0">Meeting Location</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="link" name="link">
<input type="text" class="form-control form-control-sm" id="link" name="link" required>
</div>
</div>
@ -90,7 +90,7 @@
<p class="my-0">Sponsor</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="sponsor" name="sponsor">
<input type="text" class="form-control form-control-sm" id="sponsor" name="sponsor" required>
</div>
</div>
@ -106,13 +106,13 @@
<p class="my-0">ID of club to update</p>
</div>
<div style="flex: 1; align: center;">
<input type="number" class="form-control form-control-sm" id="id" name="id">
<input type="number" class="form-control form-control-sm" id="id" name="id" required>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
@ -125,7 +125,7 @@
<p class="my-0">Name</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="name" name="name">
<input type="text" class="form-control form-control-sm" id="name" name="name" required>
</div>
</div>
@ -134,7 +134,7 @@
<p class="my-0">Meeting Date and Time</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="meeting" name="meeting">
<input type="text" class="form-control form-control-sm" id="meeting" name="meeting" required>
</div>
</div>
@ -143,7 +143,7 @@
<p class="my-0">Meeting Location</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="link" name="link">
<input type="text" class="form-control form-control-sm" id="link" name="link" required>
</div>
</div>
@ -152,7 +152,7 @@
<p class="my-0">Sponsor</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="sponsor" name="sponsor">
<input type="text" class="form-control form-control-sm" id="sponsor" name="sponsor" required>
</div>
</div>

View File

@ -50,7 +50,7 @@
<form action="events/add" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
@ -63,7 +63,7 @@
<p class="my-0">Title</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="title" name="title">
<input type="text" class="form-control form-control-sm" id="title" name="title" required>
</div>
</div>
@ -72,7 +72,7 @@
<p class="my-0">Location</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="location" name="location">
<input type="text" class="form-control form-control-sm" id="location" name="location" required>
</div>
</div>
@ -81,7 +81,7 @@
<p class="my-0">Information</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="text" name="text">
<input type="text" class="form-control form-control-sm" id="text" name="text" required>
</div>
</div>
@ -90,7 +90,7 @@
<p class="my-0">Date</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="event_date" name="event_date">
<input type="text" class="form-control form-control-sm" id="event_date" name="event_date" required>
</div>
</div>
@ -99,7 +99,7 @@
<p class="my-0">Teacher/Organizer</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="name" name="name">
<input type="text" class="form-control form-control-sm" id="name" name="name" required>
</div>
</div>
@ -108,7 +108,7 @@
<p class="my-0">Teacher/Organizer Email</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="emails" name="emails">
<input type="text" class="form-control form-control-sm" id="emails" name="emails" required>
</div>
</div>
@ -124,13 +124,13 @@
<p class="my-0">ID of event to update</p>
</div>
<div style="flex: 1; align: center;">
<input type="number" class="form-control form-control-sm" id="id" name="id">
<input type="number" class="form-control form-control-sm" id="id" name="id" required>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
@ -143,7 +143,7 @@
<p class="my-0">Title</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="title" name="title">
<input type="text" class="form-control form-control-sm" id="title" name="title" required>
</div>
</div>
@ -152,7 +152,7 @@
<p class="my-0">Location</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="location" name="location">
<input type="text" class="form-control form-control-sm" id="location" name="location" required>
</div>
</div>
@ -161,7 +161,7 @@
<p class="my-0">Information</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="text" name="text">
<input type="text" class="form-control form-control-sm" id="text" name="text" required>
</div>
</div>
@ -170,7 +170,7 @@
<p class="my-0">Date</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="event_date" name="event_date">
<input type="text" class="form-control form-control-sm" id="event_date" name="event_date" required>
</div>
</div>
@ -179,7 +179,7 @@
<p class="my-0">Teacher/Organizer</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="name" name="name">
<input type="text" class="form-control form-control-sm" id="name" name="name" required>
</div>
</div>
@ -188,7 +188,7 @@
<p class="my-0">Teacher/Organizer Email</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="emails" name="emails">
<input type="text" class="form-control form-control-sm" id="emails" name="emails" required>
</div>
</div>
<input type="submit", value="Submit">

View File

@ -1,167 +0,0 @@
{{! vim: set ft=html: }}
<html>
<head>
<link rel="stylesheet" href="/static/style.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Rubik:wght@400;600;700&display=swap" rel="stylesheet">
</head>
<body>
<div class="container-md p-3" style="">
<h2 style="font-size: 24px; font-weight: bold">
Admin Panel
</h2>
</div>
<div class="container-md d-flex gap-4" style="">
<!-- clubs list -->
<div class="p-3" style="flex: 1;">
<h1 style="font-size: 28px;">Important</h1>
<div class="vstack gap-3 mt-4">
{{#each ctx}}
<div class="bg-light border rounded-3 p-2">
<small>ID: {{id}} | LANG: {{lang}}</small>
<h3 class="my-2" style="font-size: 18px;">{{name}}</h3>
<p class="mb-2">{{meeting}}</p>
<p class="mb-2">{{link}}</p>
<p class="mt-2 mb-0">Sponsor: {{sponsor}}</p>
<form action="clubs/del" method="post">
<div class="d-flex mt-3">
<input type="number" class="form-control form-control-sm" id="id" name="id" value = {{id}} style="display: none">
</div>
<input type="submit" value="Delete">
</form>
</div>
{{/each}}
</div>
</div>
<!-- clubs actions -->
<div class="p-3" style="flex: 1;">
<h1 style="font-size: 28px;">Clubs Actions</h1>
<hr/>
<div class="my-4">
<h2 style="font-size: 20px;">Add Club</h2>
<form action="clubs/add" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Lang</p>
<label for="lang" class="form-label"><small>'en' for English, 'es' for Spanish</small></label>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="lang" name="lang">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Name</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="name" name="name">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Meeting</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="meeting" name="meeting">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Link</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="link" name="link">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Sponsor</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="sponsor" name="sponsor">
</div>
</div>
<input type="submit" value="Submit">
</form>
</div>
<div class="my-4">
<h2 style="font-size: 20px;">Update Club</h2>
<form action="anouncements/upd" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">ID of club to update</p>
</div>
<div style="flex: 1; align: center;">
<input type="number" class="form-control form-control-sm" id="id" name="id">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Lang</p>
<label for="lang" class="form-label"><small>'en' for English, 'es' for Spanish</small></label>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="lang" name="lang">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Name</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="name" name="name">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Meeting</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="meeting" name="meeting">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Link</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="link" name="link">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Sponsor</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="sponsor" name="sponsor">
</div>
</div>
<input type="submit", value="Submit">
</form>
</div>
<hr/>
</div>
</div>
</body>
</html>

View File

@ -28,7 +28,7 @@
<p class="mb-2">{{text}}</p>
<p class="mb-2">{{location}}</p>
<p class="mt-2 mb-0">{{time}}</p>
<form action="clubs/del" method="post">
<form action="lunch_events/del" method="post">
<div class="d-flex mt-3">
<input type="number" class="form-control form-control-sm" id="id" name="id" value = {{id}} style="display: none">
</div>
@ -50,7 +50,7 @@
<form action="lunch_events/add" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
@ -63,7 +63,7 @@
<p class="my-0">Title</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="title" name="title">
<input type="text" class="form-control form-control-sm" id="title" name="title" required>
</div>
</div>
@ -72,7 +72,7 @@
<p class="my-0">Information</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="text" name="text">
<input type="text" class="form-control form-control-sm" id="text" name="text" required>
</div>
</div>
@ -81,7 +81,7 @@
<p class="my-0">Location</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="location" name="location">
<input type="text" class="form-control form-control-sm" id="location" name="location" required>
</div>
</div>
@ -90,7 +90,7 @@
<p class="my-0">Time of event</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="time" name="time">
<input type="text" class="form-control form-control-sm" id="time" name="time" required>
</div>
</div>
@ -106,12 +106,12 @@
<p class="my-0">ID of lunch event to update</p>
</div>
<div style="flex: 1; align: center;">
<input type="number" class="form-control form-control-sm" id="id" name="id">
<input type="number" class="form-control form-control-sm" id="id" name="id" required>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<div style="flex: 1; justify-content: center;" required>
<select name="lang", id="lang">
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
@ -125,7 +125,7 @@
<p class="my-0">Title</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="title" name="title">
<input type="text" class="form-control form-control-sm" id="title" name="title" required>
</div>
</div>
@ -134,7 +134,7 @@
<p class="my-0">Information</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="text" name="text">
<input type="text" class="form-control form-control-sm" id="text" name="text" required>
</div>
</div>
@ -143,7 +143,7 @@
<p class="my-0">Location</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="location" name="location">
<input type="text" class="form-control form-control-sm" id="location" name="location" required>
</div>
</div>
@ -152,7 +152,7 @@
<p class="my-0">Time of event</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="time" name="time">
<input type="text" class="form-control form-control-sm" id="time" name="time" required>
</div>
</div>

View File

@ -3,9 +3,148 @@
<html>
<head>
<link rel="stylesheet" href="/static/style.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Rubik:wght@400;600;700&display=swap" rel="stylesheet">
</head>
<body>
<form onsubmit="forwardForImage('new_f', 'new/add')" id="new_f" name="new_f">
<div class="container-md p-3" style="">
<h2 style="font-size: 24px; font-weight: bold">
Admin Panel
</h2>
</div>
<div class="container-md d-flex gap-4" style="">
<!-- announcements list -->
<div class="p-3" style="flex: 1;">
<h1 style="font-size: 28px;">What's New</h1>
<div class="vstack gap-3 mt-4">
{{#each ctx}}
<div class="bg-light border rounded-3 p-2">
<small>ID: {{id}} | LANG: {{lang}}</small>
<h3 class="my-2" style="font-size: 18px;">{{name}}</h3>
<p class="mb-2">{{image}}</p>
<p class="mb-2">{{new_date}}</p>
<form action="new/del" method="post">
<div class="d-flex mt-3">
<input type="number" class="form-control form-control-sm" id="id" name="id" value = {{id}} style="display: none">
</div>
<input type="submit" value="Delete">
</form>
</div>
{{/each}}
</div>
</div>
<!-- announcements actions -->
<div class="p-3" style="flex: 1;">
<h1 style="font-size: 28px;">What's New Actions</h1>
<hr/>
<div class="my-4">
<h2 style="font-size: 20px;">Add New Item</h2>
<form onsubmit="forwardForImage('new_f', 'new/add')" id="new_f" name="new_f" method="post" enctype="multipart/form-data">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
</select>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">What's New Item Image</p>
</div>
<div style="flex: 1; align: center;">
<input type="file" name="image", id="image", accept="image/png" required>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Information</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="text" name="text" required>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Date of What's New Item</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="new_date" name="new_date" required>
</div>
</div>
<input type="submit" value="Submit">
</form>
</div>
<div class="my-4">
<h2 style="font-size: 20px;">Update What's New Item</h2>
<form action="new/upd" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">ID of announcement to update</p>
</div>
<div style="flex: 1; align: center;">
<input type="number" class="form-control form-control-sm" id="id" name="id">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
</select>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">What's New Item Image</p>
</div>
<div style="flex: 1; align: center;">
<input type="file" name="image", id="image", accept="image/png" required>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Information</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="text" name="text" required>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Date of What's New Item</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="new_date" name="new_date" required>
</div>
</div>
<input type="submit", value="Submit">
</form>
</div>
<hr/>
</div>
</div>
<!-- <form onsubmit="forwardForImage('new_f', 'new/add')" id="new_f" name="new_f" method="post" enctype="multipart/form-data">
{{!<form action="new/add" method="post" enctype="multipart/form-data">}}
<select name="lang", id="lang">
<option value="en">en</option>
<option value="es">es</option>
@ -14,7 +153,7 @@
<input type="text", id="name", name="name">
<input type="text", id="new_date", name="new_date">
<input type="submit", value="Submit">
</form>
</form>-->
</body>
<!-- <script src="/static/jquery.min.js"></script> -->
<script src="/static/utils.js"></script>

View File

@ -47,7 +47,7 @@
<form action="polls/add" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
@ -60,7 +60,7 @@
<p class="my-0">URL of poll</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="url" name="url">
<input type="text" class="form-control form-control-sm" id="url" name="url" required>
</div>
</div>
@ -76,13 +76,13 @@
<p class="my-0">ID of Poll to update</p>
</div>
<div style="flex: 1; align: center;">
<input type="number" class="form-control form-control-sm" id="id" name="id">
<input type="number" class="form-control form-control-sm" id="id" name="id" required>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
@ -95,7 +95,7 @@
<p class="my-0">URL of poll</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="url" name="url">
<input type="text" class="form-control form-control-sm" id="url" name="url" required>
</div>
</div>

View File

@ -29,7 +29,7 @@
<p class="mb-2">Message: {{messages}}</p>
<p class="mb-2">Hobbies: {{hobbies}}</p>
<p class="mb-2">Achievements: {{achievements}}</p>
<form action="announcements/del" method="post">
<form action="student/del" method="post">
<div class="d-flex mt-3">
<input type="number" class="form-control form-control-sm" id="id" name="id" value = {{id}} style="display: none">
</div>
@ -51,7 +51,7 @@
<form action="student/add" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
@ -64,7 +64,7 @@
<p class="my-0">Student Name</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="name" name="name">
<input type="text" class="form-control form-control-sm" id="name" name="name" required>
</div>
</div>
@ -73,7 +73,7 @@
<p class="my-0">Student Picture</p>
</div>
<div style="flex: 1; align: center;">
<input type="file" name="image", id="image", accept="image/png">
<input type="file" name="image", id="image", accept="image/png" required>
</div>
</div>
@ -82,7 +82,7 @@
<p class="my-0">Grade</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="grade" name="grade">
<input type="text" class="form-control form-control-sm" id="grade" name="grade" required>
</div>
</div>
@ -91,7 +91,7 @@
<p class="my-0">Message</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="messages" name="messages">
<input type="text" class="form-control form-control-sm" id="messages" name="messages" required>
</div>
</div>
@ -100,7 +100,7 @@
<p class="my-0">Hobbies</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="hobbies" name="hobbies">
<input type="text" class="form-control form-control-sm" id="hobbies" name="hobbies" required>
</div>
</div>
@ -109,7 +109,7 @@
<p class="my-0">Achievements</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="achievements" name="achievements">
<input type="text" class="form-control form-control-sm" id="achievements" name="achievements" required>
</div>
</div>
@ -125,13 +125,13 @@
<p class="my-0">ID of SOTW to update</p>
</div>
<div style="flex: 1; align: center;">
<input type="number" class="form-control form-control-sm" id="id" name="id">
<input type="number" class="form-control form-control-sm" id="id" name="id" required>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
@ -144,7 +144,7 @@
<p class="my-0">Student Name</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="name" name="name">
<input type="text" class="form-control form-control-sm" id="name" name="name" required>
</div>
</div>
@ -153,7 +153,7 @@
<p class="my-0">Student Picture</p>
</div>
<div style="flex: 1; align: center;">
<input type="file" name="image", id="image", accept="image/png">
<input type="file" name="image", id="image", accept="image/png" required>
</div>
</div>
@ -162,7 +162,7 @@
<p class="my-0">Grade</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="grade" name="grade">
<input type="text" class="form-control form-control-sm" id="grade" name="grade" required>
</div>
</div>
@ -171,7 +171,7 @@
<p class="my-0">Message</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="messages" name="messages">
<input type="text" class="form-control form-control-sm" id="messages" name="messages" required>
</div>
</div>
@ -180,7 +180,7 @@
<p class="my-0">Hobbies</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="hobbies" name="hobbies">
<input type="text" class="form-control form-control-sm" id="hobbies" name="hobbies" required>
</div>
</div>
@ -189,7 +189,7 @@
<p class="my-0">Achievements</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="achievements" name="achievements">
<input type="text" class="form-control form-control-sm" id="achievements" name="achievements" required>
</div>
</div>

View File

@ -49,7 +49,7 @@
<h2 style="font-size: 20px;">Add Staff</h2>
<form action="teachers/add" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<div style="flex: 1; justify-content: center;" required>
<select name="lang", id="lang">
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
@ -63,7 +63,7 @@
<p class="my-0">Name</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="name" name="name">
<input type="text" class="form-control form-control-sm" id="name" name="name" required>
</div>
</div>
@ -72,7 +72,7 @@
<p class="my-0">Email</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="email" name="email">
<input type="text" class="form-control form-control-sm" id="email" name="email" required>
</div>
</div>
@ -81,7 +81,7 @@
<p class="my-0">Phone</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="phone" name="phone">
<input type="text" class="form-control form-control-sm" id="phone" name="phone" required>
</div>
</div>
@ -90,7 +90,7 @@
<p class="my-0">Position</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="position" name="position">
<input type="text" class="form-control form-control-sm" id="position" name="position" required>
</div>
</div>
@ -99,7 +99,7 @@
<p class="my-0">Staff Picture</p>
</div>
<div style="flex: 1; align: center;">
<input type="file" name="image", id="image", accept="image/png">
<input type="file" name="image", id="image", accept="image/png" required>
</div>
</div>
@ -115,13 +115,13 @@
<p class="my-0">ID of staff to update</p>
</div>
<div style="flex: 1; align: center;">
<input type="number" class="form-control form-control-sm" id="id" name="id">
<input type="number" class="form-control form-control-sm" id="id" name="id" required>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
@ -134,7 +134,7 @@
<p class="my-0">Name</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="name" name="name">
<input type="text" class="form-control form-control-sm" id="name" name="name" required>
</div>
</div>
@ -143,7 +143,7 @@
<p class="my-0">Email</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="email" name="email">
<input type="text" class="form-control form-control-sm" id="email" name="email" required>
</div>
</div>
@ -152,7 +152,7 @@
<p class="my-0">Phone</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="phone" name="phone">
<input type="text" class="form-control form-control-sm" id="phone" name="phone" required>
</div>
</div>
@ -161,7 +161,7 @@
<p class="my-0">Position</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="position" name="position">
<input type="text" class="form-control form-control-sm" id="position" name="position" required>
</div>
</div>
@ -170,7 +170,7 @@
<p class="my-0">Staff Picture</p>
</div>
<div style="flex: 1; align: center;">
<input type="file" name="image", id="image", accept="image/png">
<input type="file" name="image", id="image", accept="image/png" required>
</div>
</div>