Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing #280

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions public/contact-us.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,24 @@
<title>Contact Us</title>
<link rel="stylesheet" href="./css/contact-us.css">
<style>
/* Style for the message area */
#messageArea {
color: red; /* You can change the color based on your preference */
color: red;
text-align: center;
margin: 0;
}

textarea {
display: fixed;
align-items: center;
justify-content: center;
padding: 30px;
}

textarea::placeholder {
text-align: center;
margin: 10px 0;
}
</style>

</head>

<body>
Expand All @@ -37,13 +48,13 @@ <h2 style="text-align: center;">Contact Us</h2>
<br>
<div>
<label for="">Message :</label>
<textarea required name="message" id="message" rows="4" cols="57"
placeholder="Enter Your Message Given to Organization......"></textarea>
<textarea type="email" required name="message" id="message" style="width: 400px; height: 100px;"
placeholder="Enter Your Message"></textarea>
</div>
<div style="text-align: center;">
<button type="submit" class="button" id="button">Submit</button>
</div>
<div id="messageArea"></div> <!-- Area for displaying messages -->
<div id="messageArea"></div>
</form>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion public/fac_login.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ <h4 style="text-align: center; margin: 0px 0px 10px 0px;font-size: 22px;">(for F
<a href="">Forgot Password?</a>
<button type="button" onclick="register()">Login</button>
<div class="register">
<p style="display: inline;">Haven't Register?&nbsp;</p><a href="fac_signup">Register Now</a>
<p style="display: inline;">Haven't Register?&nbsp;</p><a href="fac_signup.html">Register Now</a>
</div>
</form>
</div>
Expand Down
117 changes: 117 additions & 0 deletions public/fac_signup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SignUp (stakeholder)</title>
<link rel="stylesheet" href="css/login_style.css">
</head>

<body>
<img src="images/moon.png" id="icon">
<div id="box2">
<p>Please Try Again! Account Already Exists</p>
</div>
<div id="box3">
<p>Error Occuered! Please Try Again</p>
</div>
<div class="container">
<div class="image">
<img src="images/logo.png" alt="">
</div>
<div class="form">
<form>
<h2 style="text-align: center;">Sign Up</h2>
<h4 style="text-align: center; margin: 0px 0px 10px 0px;font-size: 22px;">(for Faculty)</h4>
<label for="collegeName">College Name</label>
<input type="text" id="colname" name="colname" placeholder="Enter your College Name" required>

<label for="email">Email</label>
<input type="email" id="email" name="email" placeholder="Enter your email" required>

<label for="password">Password</label>
<input type="password" id="password" name="password" placeholder="Enter your password" required>

<button type="button" onclick="register()">Sign Up</button>
</form>
</div>
<div id="box1">
<p>Successfully Registered... Redirecting Please Wait...</p>
</div>
</div>
<script>
var icon = document.getElementById("icon");
icon.onclick = function () {
document.body.classList.toggle("dark-theme");
if (document.body.classList.contains("dark-theme")) {
icon.src = "images/sun.png";
}
else {
icon.src = "images/moon.png";
}
}
const register = async () => {
const email = document.getElementById('email').value;
const colname = document.getElementById('colname').value;
const password = document.getElementById('password').value;
const result1 = document.getElementById('box1')
const result2 = document.getElementById('box2')
const result3 = document.getElementById('box3')

// Allowed email domains
const allowedDomains = ["gmail.com", "outlook.com", "yahoo.com", "protonmail.com", "icloud.com", "tutanota.com"];
const emailDomain = email.split("@").pop();

// Check if the email domain is allowed
if (!allowedDomains.includes(emailDomain)) {
result2.innerHTML = "Invalid email domain. Please use Gmail, Outlook, Yahoo, Protonmail, Icloud, or Tutanota. ";
result2.style.display = 'block';
setTimeout(() => {
result2.style.display = 'none';
}, 2000);
return; // Stop form submission
}

try {
const response = await fetch('/stk_holder_signup', {
method: "POST",
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ colname, email, password }),
});
if (response.status == 201) {
result1.style.opacity = '1';
result1.style.display = 'block';
setTimeout(() => {
result1.style.display = 'none';
window.location.href = 'stk_login.html';
}, 2000);
}
else if (response.status == 409) {
document.getElementById('email').value = ''
document.getElementById('password').value = ''
document.getElementById('colname').value = ''
result2.style.display = 'block';
setTimeout(() => {
result2.style.display = 'none';
}, 2000)
}
else {
result3.style.display = 'block'
document.getElementById('email').value = ''
document.getElementById('password').value = ''
document.getElementById('colname').value = ''
setTimeout(() => {
result3.style.display = 'none'
}, 2000)
}
} catch (error) {
console.error('Error:', error);
}
}
</script>
</body>

</html>
Loading