Skip to content

Commit

Permalink
added favicon and usertypes by asc
Browse files Browse the repository at this point in the history
  • Loading branch information
ChandelAnish committed May 19, 2024
1 parent d58bdc6 commit 0f5412b
Show file tree
Hide file tree
Showing 18 changed files with 788 additions and 45 deletions.
10 changes: 7 additions & 3 deletions backend/controllers/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,18 @@ const login = (req, res) => {
return res.status(200).json({ login: false, msg: 'not found' })
}
else {
connectDB.query('select password,usertype from userdetails.userinfo where username=?', [req.body.username], (err, row) => {
connectDB.query('select * from userdetails.userinfo where username=?', [req.body.username], (err, row) => {
if (err) {
console.log(err);
}
else {
if (row[0].password == req.body.password && row[0].usertype == req.body.usertype) {
if (row[0].password == req.body.password) {
// res.sendFile(path.resolve(__dirname,'./public/main-page/index1.html'))
return res.status(200).json({ login: true, msg: 'login successful' })
return res.status(200).json({
login: true,
userdetails:{...row[0]},
msg: 'login successful'
})
// return res.status(200).redirect('./main-page/index1.html')
}
else {
Expand Down
Binary file added client/assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>hireHUB.com</title>
<link rel="icon" href="assets/favicon.png">
<link rel="stylesheet" href="style.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
Expand Down
5 changes: 3 additions & 2 deletions client/login-page/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>login</title>
<link rel="icon" href="../assets/favicon.png">
<!-- bootstrap -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
Expand Down Expand Up @@ -75,11 +76,11 @@ <h4>"Welcome to our hiring platform! Join us to discover exciting career opportu
<input name="password" class="input" type="password">
</div>

<select class="input0" name="usertype" id="">
<!-- <select class="input0" name="usertype" id="">
<option value="recruiter">recruiter</option>
<option value="labour">labour</option>
<option value="admin">admin</option>
</select>
</select> -->

<div class="warning">

Expand Down
60 changes: 34 additions & 26 deletions client/login-page/script.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
const slidebutton=document.querySelector("#slidebutton");
function changeSlide()
{
setInterval(()=>{
const slidebutton = document.querySelector("#slidebutton");
function changeSlide() {
setInterval(() => {
slidebutton.click();
},3000)
}, 3000)
}
changeSlide();

const warning=document.querySelector(".warning")
const warning = document.querySelector(".warning")

const form=document.getElementById('form')
form.addEventListener('submit',async(e)=>{
const form = document.getElementById('form')
form.addEventListener('submit', async (e) => {
e.preventDefault();
const username=form.elements.username.value;
const password=form.elements.password.value;
const usertype=form.elements.usertype.value;
const formdata={username,password,usertype};
const username = form.elements.username.value;
const password = form.elements.password.value;
// const usertype=form.elements.usertype.value;

const formdata = { username, password };
// try
// {
// let response=await signup(formdata);//must use await since fetch is used in a the signup function
Expand All @@ -33,22 +32,31 @@ form.addEventListener('submit',async(e)=>{
// window.location.href='/index1.html'
// }

let response=await signup(formdata);//must use await since fetch is used in a the signup function
response=await response.json();
if(!response.login)
{
return warning.innerHTML=response.msg;
}
return window.open("../main-page/index.html","_parent");
let response = await signup(formdata);//must use await since fetch is used in a the signup function
response = await response.json();
if (!response.login) {
return warning.innerHTML = response.msg;
}
// console.log(response.userdetails.usertype)
sessionStorage.setItem('userdetails', JSON.stringify(response.userdetails));
if (response.userdetails.usertype === 'recruiter') {
return window.open("../main-page/recruiter/index.html", "_parent");
}
else if (response.userdetails.usertype === 'labour') {
return window.open("../main-page/labour/index.html", "_parent");
}
if (response.userdetails.usertype === 'admin') {
return window.open("../main-page/admin/index.html", "_parent");
}
})

const signup=async(formdata)=>{
const response=fetch('http://localhost:5000/login',{
method:'post',
headers:{
'content-type':'application/json'
const signup = async (formdata) => {
const response = fetch('http://localhost:5000/login', {
method: 'post',
headers: {
'content-type': 'application/json'
},
body:JSON.stringify(formdata)
body: JSON.stringify(formdata)
})
// const data =(await response).json();
// return data;
Expand Down
1 change: 1 addition & 0 deletions client/login-page/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
{
/* border: 2px solid black; */
width: 17rem;
height: 22px;
border-radius: 10px;
display: flex;
align-items: center;
Expand Down
23 changes: 12 additions & 11 deletions client/main-page/index.html → client/main-page/admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>hireHUB</title>
<title>hireHUB - admin</title>
<link rel="icon" href="../../assets/favicon.png">
<!-- bootstrap css -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">

Expand All @@ -28,11 +29,11 @@ <h1>hireHUB</h1>

<div class="form-check form-switch" id="darkiconbtn">

<img src="../assets/icon-sun.png" class="darklogo" alt="">
<img src="../../assets/icon-sun.png" class="darklogo" alt="">

<input class="form-check-input" type="checkbox" role="switch" id="flexSwitchCheckChecked">

<img src="../assets/icon-moon.png" class="darklogo" alt="">
<img src="../../assets/icon-moon.png" class="darklogo" alt="">
</div>

</div>
Expand All @@ -42,11 +43,11 @@ <h1>hireHUB</h1>

<nav>
<div id="search">
<img class="logo" src="../assets/icons-search.png" alt="">
<img class="logo" src="../../assets/icons-search.png" alt="">
<input type="text" placeholder="filter by job title">
</div>
<div id="location">
<img class="logo" src="../assets/icons-location.png" alt="">
<img class="logo" src="../../assets/icons-location.png" alt="">
<input type="text" placeholder="filter by location">
</div>
<button id="btn">search</button>
Expand All @@ -66,7 +67,7 @@ <h1>hireHUB</h1>


<div class="jobcard">
<div class="joblogo"><img src="../assets/plumber-logo.png" alt=""></div>
<div class="joblogo"><img src="../../assets/plumber-logo.png" alt=""></div>
<div class="time">
<h3>2d ago</h3>
<div></div>
Expand All @@ -79,7 +80,7 @@ <h4 class="state">Bihar</h4>


<div class="jobcard">
<div class="joblogo"><img src="../assets/plumber-logo.png" alt=""></div>
<div class="joblogo"><img src="../../assets/plumber-logo.png" alt=""></div>
<div class="time">
<h3>2d ago</h3>
<div></div>
Expand All @@ -92,7 +93,7 @@ <h4 class="state">Bihar</h4>


<div class="jobcard">
<div class="joblogo"><img src="../assets/plumber-logo.png" alt=""></div>
<div class="joblogo"><img src="../../assets/plumber-logo.png" alt=""></div>
<div class="time">
<h3>2d ago</h3>
<div></div>
Expand All @@ -105,7 +106,7 @@ <h4 class="state">Bihar</h4>


<div class="jobcard">
<div class="joblogo"><img src="../assets/plumber-logo.png" alt=""></div>
<div class="joblogo"><img src="../../assets/plumber-logo.png" alt=""></div>
<div class="time">
<h3>2d ago</h3>
<div></div>
Expand All @@ -118,7 +119,7 @@ <h4 class="state">Bihar</h4>


<div class="jobcard">
<div class="joblogo"><img src="../assets/plumber-logo.png" alt=""></div>
<div class="joblogo"><img src="../../assets/plumber-logo.png" alt=""></div>
<div class="time">
<h3>2d ago</h3>
<div></div>
Expand All @@ -131,7 +132,7 @@ <h4 class="state">Bihar</h4>


<div class="jobcard">
<div class="joblogo"><img src="../assets/plumber-logo.png" alt=""></div>
<div class="joblogo"><img src="../../assets/plumber-logo.png" alt=""></div>
<div class="time">
<h3>2d ago</h3>
<div></div>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ body
.navbar::before
{
content: "";
background: url(../assets/nav-background.jpg) no-repeat center/cover rgb(243, 243, 243);
background: url(../../assets/nav-background.jpg) no-repeat center/cover rgb(243, 243, 243);
width: 100%;
height: 170px;
z-index: -1;
Expand Down
Loading

0 comments on commit 0f5412b

Please sign in to comment.