Skip to content

Commit

Permalink
add job/show student profile
Browse files Browse the repository at this point in the history
  • Loading branch information
sangmesh04 committed Aug 21, 2022
1 parent cd5c22d commit 925c68d
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 51 deletions.
13 changes: 4 additions & 9 deletions 09th aug meet even.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ cgpa aggre.

Engineering cgpa while adding company
}
//kedar and gaurav
//kedar and gaurav -> done

$Adding pdf while adding company
//rohit
//rohit -> done in backend

@Adding logo in copyright

Expand All @@ -34,24 +34,19 @@ $Generating report
@Placement report generation automatically ChartJS
1. PiChart - branchwise
2. Graphs
->done in frontend

@Form for adding company
->done in frontend
//sangmeshwar

//12 Aug, fri


Adding criterion for documents






Validation of name and all fields



Image of student
//upload when login

Expand Down
5 changes: 1 addition & 4 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ function App() {
<Route path="company-table" element={<AdminCompanyTable />} />
<Route path="add-company" element={<BasicForm />} />
<Route path="add-job" element={<AddJobOpen />} />
<Route
path="student/profile/:studentId"
element={<AdminStudentDetails />}
/>
<Route path="student/profile" element={<AdminStudentDetails />}/>
<Route
path="company/details/:companyId"
element={<AdminCompanyDetails />}
Expand Down
2 changes: 1 addition & 1 deletion src/assets/css/admincompanytable.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@
background-color: white;
}

#companyFormadd .col-md-5, #companyFormadd .col-md-10, #companyFormadd .col-md-3, #companyFormadd .col-md-4,#companyFormadd .col-md-2{
#companyFormadd .col-md-5, #companyFormadd .col-md-10, #companyFormadd .col-md-3, #companyFormadd .col-md-4,#companyFormadd .col-md-2, #companyFormadd .col-md-6{
margin: 10px;
}
Binary file added src/assets/img/pictfossclublogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 18 additions & 18 deletions src/components/adminDashboard/AdminSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,26 @@ export default function AdminSidebar() {



setInterval(()=>{
var initial_url = window.location.href;
var url = initial_url .split( '/' );
// setInterval(()=>{
// var initial_url = window.location.href;
// var url = initial_url .split( '/' );

var path = url[url.length-1];
if(path=='dashboard'){
setActive({...active,dash:'active',company:'',student:'',changePass:'',placeStudent:''});
}else if(path=='student-table'){
setActive({...active,dash:'',company:'',student:'active',changePass:'',placeStudent:''});
}else if(path=='company-table'){
setActive({...active,dash:'',company:'active',student:'',changePass:'',placeStudent:''});
}else if(path=='update'){
setActive({...active,dash:'',company:'',student:'',changePass:'active',placeStudent:''});
}else if(path=='placedStudents'){
setActive({...active,dash:'',company:'',student:'',changePass:'',placeStudent:'active'})
}else{
setActive({...active,dash:'',company:'',student:'',changePass:'',placeStudent:''})
}
// var path = url[url.length-1];
// if(path=='dashboard'){
// setActive({...active,dash:'active',company:'',student:'',changePass:'',placeStudent:''});
// }else if(path=='student-table'){
// setActive({...active,dash:'',company:'',student:'active',changePass:'',placeStudent:''});
// }else if(path=='company-table'){
// setActive({...active,dash:'',company:'active',student:'',changePass:'',placeStudent:''});
// }else if(path=='update'){
// setActive({...active,dash:'',company:'',student:'',changePass:'active',placeStudent:''});
// }else if(path=='placedStudents'){
// setActive({...active,dash:'',company:'',student:'',changePass:'',placeStudent:'active'})
// }else{
// setActive({...active,dash:'',company:'',student:'',changePass:'',placeStudent:''})
// }

},10)
// },10)

const handleSignOut = () => {
axios.post("http://localhost:8080/admin/logout", {}, { withCredentials: true})
Expand Down
3 changes: 2 additions & 1 deletion src/components/utilities/Footer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import "../../assets/css/style.css";
import {Link} from "react-router-dom";
import pictfossclublogo from "../../assets/img/pictfossclublogo.png";

export default function Footer() {
return (
Expand All @@ -15,7 +16,7 @@ export default function Footer() {
</li>
<li className="nav-item">
<a href="https://pict-foss-club.github.io/" className="nav-link px-2 text-muted">
PICT FOSS CLUB
<img src={pictfossclublogo} style={{width:"22px"}} alt="PICT FOSS CLUB" /> PICT FOSS CLUB
</a>
</li>
<li className="nav-item">
Expand Down
7 changes: 5 additions & 2 deletions src/pages/admin/AdminStudentDetails.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react';
import { Link, useParams } from 'react-router-dom';
import { Link, useParams, useLocation } from 'react-router-dom';
import axios from 'axios';

import "../../assets/css/studentprofile.css"
Expand All @@ -11,8 +11,11 @@ const AdminStudentDetails = () => {
const [isLoading, setLoading] = useState(true);
const [student, setStudent] = useState({});

const location = useLocation();
const state = location.state;

useEffect(() => {
axios.get(`http://localhost:8080/admin/student/profile/${params.studentId}`, { withCredentials: true })
axios.get(`http://localhost:8080/admin/student/profile/${state.studentId}`, {withCredentials: true})
.then((res) => {
console.log('After get request:', res.data);
setStudent(res.data.data);
Expand Down
9 changes: 7 additions & 2 deletions src/pages/admin/AdminStudentTable.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from 'axios';
import * as XLSX from 'xlsx'
import React, { useEffect, useState } from 'react';
import { Link } from 'react-router-dom';
import { useNavigate } from 'react-router-dom';
import "../../assets/css/admincompanytable.css";


Expand All @@ -18,6 +18,8 @@ const AdminStudentTable = () => {
const [excelFile, setExcelFile] = useState(null);
const [excelFileError, setExcelFileError] = useState(null);

const navigate = useNavigate();

// handle File
const fileType = ['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'];
const handleFile = (e) => {
Expand Down Expand Up @@ -139,7 +141,10 @@ const AdminStudentTable = () => {
<td>{(student.isGT20 || student.isLTE20) ? "Yes" : "No"}</td>
<td>{(student.isGT20) ? "Yes" : "No"}</td>
<td>{(student.isLTE20) ? "Yes" : "No"}</td>
<td><Link to={`/admin/student/profile/${student._id}`}>View</Link></td>
<td onClick={(e) => {
e.preventDefault();
navigate("/admin/student/profile", { state: {studentId: student._id}});
}}>View</td>
</tr>
))}
</tbody>
Expand Down
57 changes: 43 additions & 14 deletions src/pages/admin/addCompany/AddJobOpen.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@ import { useState } from "react";
import "../../../assets/css/admincompanytable.css";
import "../../../assets/css/studentprofile.css"
import { Link, useLocation } from 'react-router-dom';
import axios from "axios";

const AddJobOpen = () => {

const location = useLocation();
const state = location.state;
console.log(state.companyId);
const [company, setCompany] = useState({
companyId: state.companyId,
ctc: "",
name: "",
totalRounds: "",
totalRounds: "3",
currentRound: 0,
// startDate: "",
endDate: "",
endDate: "27-08-2022",
criteria: {
branch: {
cs: false,
Expand All @@ -31,9 +33,10 @@ const AddJobOpen = () => {
},
},
skillsRequired: [],
driveDetails: [],
roundDetails: [],
});


// Making a state specifically for branches:
const [branch, setBranch] = useState({
cs: false,
Expand Down Expand Up @@ -96,19 +99,21 @@ const AddJobOpen = () => {
const list = [...skills];
list[index][name] = value;
setSkill(list);
setCompany({...company,skillsRequired:list});
};

// handle click event of the Remove button
const handleSkillRemoveClick = index => {
const list = [...skills];
list.splice(index, 1);
setSkill(list);
setCompany({...company,skillsRequired:list});
};

// handle click event of the Add button
const handleSkillAddClick = () => {
setSkill([...skills, { skill:"" }]);
console.log(skills);
// console.log(skills);
};

// handle input change
Expand All @@ -117,13 +122,17 @@ const AddJobOpen = () => {
const list = [...drive];
list[index][name] = value;
setDrive(list);
var lislen = list.length;
setCompany({...company,roundDetails:list,totalRounds:lislen,endDate:list[lislen-1].date});
};

// handle click event of the Remove button
const handleRoundRemoveClick = index => {
const list = [...drive];
list.splice(index, 1);
setDrive(list);
var lislen = list.length;
setCompany({...company,roundDetails:list,totalRounds:lislen,endDate:list[lislen-1].date});
};

// handle click event of the Add button
Expand All @@ -133,12 +142,26 @@ const AddJobOpen = () => {
venue: "",
date: "",
time: "" }]);
console.log(drive);
// console.log(drive);
};

const handleSubmit = async(e) =>{
e.preventDefault();

await axios.post('http://localhost:8080/company/job/add', company, {withCredentials: true})
.then((res)=>{
console.log("Res: ",res);
alert("New job opening added successfully!");
window.location.reload();
})
.catch((err)=>{
console.log("err: ",err);
})
}
return (
<div id="adminCOmpanyTable">
<div className="col-md-6 col-sm-6 cl-sx-6 col-6"><h3>PhonePe - Add new job opening</h3></div>
<form>
<form onSubmit={handleSubmit}>
<p style={{ fontSize: "15px" }}>
<span style={{ color: "red" }}>*</span> All fields are mandatory
</p>
Expand All @@ -161,13 +184,13 @@ const AddJobOpen = () => {
<div className="row">
<div className="col-md-6">
<input className="form-control"
name="profile"
value={company.profile}
onChange={(e)=>{setCompany({...company,profile: e.target.value})}}
name="name"
value={company.name}
onChange={(e)=>{setCompany({...company,name: e.target.value})}}
placeholder="Job description"
/>
</div>
<div className="col-md-6">
<div className="col-md-4">
<input className="form-control"
name="ctc"
value={company.ctc}
Expand Down Expand Up @@ -683,7 +706,7 @@ const AddJobOpen = () => {
placeholder="Attendance percentage"
id="attend"
aria-describedby="inputGroupPrepend"
required

/>
</div>
</div>
Expand All @@ -704,7 +727,7 @@ const AddJobOpen = () => {
placeholder="Active backlog"
id="alog"
aria-describedby="inputGroupPrepend"
required

/>
</div>
</div>
Expand All @@ -721,7 +744,7 @@ const AddJobOpen = () => {
placeholder="Passive backlog"
id="plog"
aria-describedby="inputGroupPrepend"
required

/>
</div>
</div>
Expand All @@ -741,7 +764,7 @@ const AddJobOpen = () => {
placeholder="AMCAT percentage"
id="amcat"
aria-describedby="inputGroupPrepend"
required

/>
</div>
</div>
Expand Down Expand Up @@ -913,6 +936,12 @@ const AddJobOpen = () => {
</div>
</div>
</div>
<div className="form-check mx-3 my-2">
<input className="form-check-input" type="checkbox" value="" id="flexCheckDefault" required />
<label className="form-check-label" htmlFor="flexCheckDefault">
Are you sure to add the new job opening?
</label>
</div>
<hr className="my-2" />
<div className="col-md-12 mx-3 my-2">
<button className="btn btn-primary" type="submit">
Expand Down

0 comments on commit 925c68d

Please sign in to comment.