Fix bugs
This commit is contained in:
parent
f2d70afffe
commit
6bc10e3728
167
BlueFireDB.sql
167
BlueFireDB.sql
@ -2,43 +2,30 @@ CREATE DATABASE BLUEFIREDATABASE
|
||||
USE BLUEFIREDATABASE
|
||||
|
||||
---------------------------------------------------------------------------------------------------
|
||||
--LOGIN
|
||||
|
||||
--SELECT * FROM [Admin]
|
||||
--WHERE AdminName = 'Budi' AND [Admin].Password = 'budi321'
|
||||
|
||||
--SELECT * FROM [User]
|
||||
--WHERE UserName='Budi' AND [User].Password='budi321'
|
||||
|
||||
--data.UserName == $('[name="username"]').val() AND data.UserPassword == $('[name="password"]').val()
|
||||
--location.href('')
|
||||
|
||||
|
||||
--Reset Identity
|
||||
|
||||
-- DBCC CHECKIDENT ('Emp', RESEED, 1)
|
||||
|
||||
|
||||
----------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
CREATE TABLE [Admin](
|
||||
AdminID INT PRIMARY KEY IDENTITY(1,1) NOT NULL,
|
||||
AdminName VARCHAR(MAX),
|
||||
AdminPassword VARCHAR(MAX)
|
||||
AdminName VARCHAR(50),
|
||||
AdminPassword VARCHAR(50)
|
||||
)
|
||||
INSERT INTO [Admin] VALUES ('admin', 'admin123');
|
||||
INSERT INTO [Admin] VALUES ('adminHero', 'admin321');
|
||||
GO
|
||||
CREATE TABLE [User](
|
||||
UserID INT PRIMARY KEY IDENTITY(1,1) NOT NULL,
|
||||
[Password] VARCHAR(MAX),
|
||||
UserName VARCHAR(MAX),
|
||||
DOB VARCHAR(MAX),
|
||||
Gender VARCHAR(MAX),
|
||||
[Address] VARCHAR(MAX),
|
||||
Phone VARCHAR(MAX),
|
||||
Email VARCHAR(MAX)
|
||||
[Password] VARCHAR(50),
|
||||
UserName VARCHAR(50),
|
||||
DOB VARCHAR(50),
|
||||
Gender VARCHAR(50),
|
||||
[Address] VARCHAR(50),
|
||||
Phone VARCHAR(50),
|
||||
Email VARCHAR(50)
|
||||
)
|
||||
--DBCC CHECKIDENT ('[User]', RESEED, 0)
|
||||
|
||||
@ -48,10 +35,9 @@ INSERT INTO [User] VALUES('Julia111','Julia','3/1/1999','Female','K Street','089
|
||||
GO
|
||||
CREATE TABLE Country(
|
||||
CountryID INT IDENTITY(1,1) PRIMARY KEY NOT NULL,
|
||||
CountryName VARCHAR (MAX)
|
||||
CountryName VARCHAR (50)
|
||||
)
|
||||
|
||||
|
||||
INSERT INTO Country VALUES('Indonesia')
|
||||
INSERT INTO Country VALUES('Singapore')
|
||||
INSERT INTO Country VALUES('India')
|
||||
@ -59,21 +45,20 @@ GO
|
||||
CREATE TABLE City(
|
||||
CityID INT IDENTITY (1,1) PRIMARY KEY NOT NULL,
|
||||
CountryID INT FOREIGN KEY REFERENCES Country(CountryID),
|
||||
CityName VARCHAR (MAX),
|
||||
AddressDetail VARCHAR(MAX)
|
||||
CityName VARCHAR (50),
|
||||
AddressDetail VARCHAR(50)
|
||||
)
|
||||
INSERT INTO City VALUES(1,'Jakarta','Jakarta Selatan')
|
||||
INSERT INTO City VALUES(1,'Jakarta','Jakarta Selatan')
|
||||
INSERT INTO City VALUES(2,'Singapore','Singapore')
|
||||
INSERT INTO City VALUES(3,'Bengaluru','Bengaluru')
|
||||
GO
|
||||
CREATE TABLE Job(
|
||||
JobID INT PRIMARY KEY IDENTITY(1,1) NOT NULL,
|
||||
JobName VARCHAR(MAX),
|
||||
JobName VARCHAR(50),
|
||||
CityID INT FOREIGN KEY REFERENCES city(cityId),
|
||||
JobLevel VARCHAR(MAX),
|
||||
Deadline VARCHAR (MAX),
|
||||
JobDescription VARCHAR(MAX),
|
||||
JobLevel VARCHAR(50),
|
||||
Deadline VARCHAR (50),
|
||||
JobDescription VARCHAR(50),
|
||||
)
|
||||
INSERT INTO Job VALUES('IT Infrastructure',1,'Easy','12/12/2012','need computer knowledge')
|
||||
INSERT INTO Job VALUES('Trust and Safety Associate',2,'Medium','12/01/2013','cyber knowledge')
|
||||
@ -94,13 +79,13 @@ CREATE TABLE ApplicationEntry(
|
||||
EntryID INT PRIMARY KEY IDENTITY(1,1) NOT NULL,
|
||||
UserID INT FOREIGN KEY REFERENCES [User](userId) ON UPDATE CASCADE ON DELETE CASCADE,
|
||||
JobID INT FOREIGN KEY REFERENCES Job(jobId) ON UPDATE CASCADE ON DELETE CASCADE,
|
||||
Email VARCHAR(MAX),
|
||||
PrevCompanyName VARCHAR(MAX),
|
||||
PrevPosition VARCHAR(MAX),
|
||||
UniversityName VARCHAR(MAX),
|
||||
CvLink VARCHAR(MAX),
|
||||
PortofolioLink VARCHAR(MAX),
|
||||
StatusEntry VARCHAR(MAX)
|
||||
Email VARCHAR(50),
|
||||
PrevCompanyName VARCHAR(50),
|
||||
PrevPosition VARCHAR(50),
|
||||
UniversityName VARCHAR(50),
|
||||
CvLink VARCHAR(50),
|
||||
PortofolioLink VARCHAR(50),
|
||||
StatusEntry VARCHAR(50)
|
||||
)
|
||||
INSERT INTO ApplicationEntry VALUES(1,1,'K@k.com','Grab','Enterprise Security Lead','ITS','www.cvUser1.com','www.portUser1.com','pending')
|
||||
INSERT INTO ApplicationEntry VALUES(2,2,'B@b.coms','Uber','Head of Data Science','Sunib','www.cvUser2.com','www.portUser2.com','pending')
|
||||
@ -115,66 +100,76 @@ SELECT*FROM UserBookmark
|
||||
SELECT*FROM ApplicationEntry
|
||||
GO
|
||||
----------------------------------
|
||||
---------STORED PROCEDURES----------
|
||||
----------------------------------
|
||||
|
||||
--Done
|
||||
CREATE PROC sp_getAllCity
|
||||
AS
|
||||
BEGIN
|
||||
SELECT * FROM City
|
||||
SET NOCOUNT ON
|
||||
SELECT CityID,CountryID,CityName,AddressDetail FROM City
|
||||
END
|
||||
GO
|
||||
--Done
|
||||
CREATE PROC sp_insertAdmin
|
||||
@password VARCHAR(MAX),
|
||||
@name VARCHAR(MAX)
|
||||
@password VARCHAR(50),
|
||||
@name VARCHAR(50)
|
||||
AS
|
||||
BEGIN
|
||||
INSERT INTO [Admin]
|
||||
SET NOCOUNT ON
|
||||
INSERT INTO [Admin] (AdminName,AdminPassword)
|
||||
VALUES (@name,@password)
|
||||
END
|
||||
GO
|
||||
--Done
|
||||
CREATE PROC sp_insertUser
|
||||
@password VARCHAR(MAX),
|
||||
@name VARCHAR(MAX),
|
||||
@DOB VARCHAR(MAX),
|
||||
@gender VARCHAR(MAX),
|
||||
@address VARCHAR(MAX),
|
||||
@phone VARCHAR(MAX),
|
||||
@email VARCHAR(MAX)
|
||||
@password VARCHAR(50),
|
||||
@name VARCHAR(50),
|
||||
@DOB VARCHAR(50),
|
||||
@gender VARCHAR(50),
|
||||
@address VARCHAR(50),
|
||||
@phone VARCHAR(50),
|
||||
@email VARCHAR(50)
|
||||
AS
|
||||
BEGIN
|
||||
INSERT INTO [User] VALUES (@password, @name, @DOB, @gender, @address, @phone, @email)
|
||||
SET NOCOUNT ON
|
||||
INSERT INTO [User] ([Password],UserName,DOB,Gender,Address,Phone,Email)
|
||||
VALUES (@password, @name, @DOB, @gender, @address, @phone, @email)
|
||||
END
|
||||
GO
|
||||
--Done
|
||||
CREATE PROC sp_loginUser
|
||||
@name VARCHAR(MAX)
|
||||
@name VARCHAR(50)
|
||||
AS
|
||||
BEGIN
|
||||
SELECT * FROM [User]
|
||||
SET NOCOUNT ON
|
||||
SELECT UserName FROM [User]
|
||||
WHERE ([User].UserName=@name)
|
||||
END
|
||||
--Done
|
||||
GO
|
||||
CREATE PROC sp_loginAdmin
|
||||
@name VARCHAR(MAX)
|
||||
@name VARCHAR(50)
|
||||
AS
|
||||
BEGIN
|
||||
SELECT * FROM [Admin]
|
||||
SET NOCOUNT ON
|
||||
SELECT AdminName FROM [Admin]
|
||||
WHERE ([Admin].AdminName=@name)
|
||||
END
|
||||
|
||||
---Done
|
||||
GO
|
||||
CREATE PROC sp_insertJob
|
||||
@name VARCHAR(MAX),
|
||||
@name VARCHAR(50),
|
||||
@cityId INT,
|
||||
@jobLevel VARCHAR(MAX),
|
||||
@deadline VARCHAR (MAX),
|
||||
@description VARCHAR(MAX)
|
||||
@jobLevel VARCHAR(50),
|
||||
@deadline VARCHAR (50),
|
||||
@description VARCHAR(50)
|
||||
AS
|
||||
BEGIN
|
||||
INSERT INTO Job
|
||||
SET NOCOUNT ON
|
||||
INSERT INTO Job (JobName,CityID,JobLevel,Deadline,JobDescription)
|
||||
VALUES(@name, @cityId, @jobLevel, @deadline, @description)
|
||||
END
|
||||
GO
|
||||
@ -183,26 +178,29 @@ CREATE PROC sp_deleteJob
|
||||
@jobId INT
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
DELETE FROM Job
|
||||
WHERE JobID = @jobId
|
||||
END
|
||||
GO
|
||||
--Done Without real ID
|
||||
--Done
|
||||
CREATE PROC sp_insertBookmark
|
||||
@userId INT,
|
||||
@jobId INT
|
||||
AS
|
||||
BEGIN
|
||||
INSERT INTO UserBookmark
|
||||
SET NOCOUNT ON
|
||||
INSERT INTO UserBookmark (UserID,JobID)
|
||||
VALUES(@userId, @jobId)
|
||||
END
|
||||
-----------------------------------------
|
||||
GO
|
||||
--Done Without real ID
|
||||
--Done
|
||||
CREATE PROC sp_getBookmark
|
||||
@userId INT
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
SELECT ub.BookmarkID,j.JobID,JobName,CountryName,CityName, COUNT (EntryID) AS ApplicantCount, (CASE WHEN CONVERT(DATE,Deadline) > GETDATE() THEN 1 ELSE 0 END ) As IsOpen FROM Job j
|
||||
JOIN UserBookmark ub
|
||||
ON j.jobId = ub.jobId
|
||||
@ -222,22 +220,25 @@ CREATE PROC sp_deleteBookmark
|
||||
@bookmarkID INT
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
DELETE FROM UserBookmark WHERE BookmarkID = @bookmarkID
|
||||
END
|
||||
GO
|
||||
--DONE Without real Id
|
||||
--DONE
|
||||
CREATE PROC sp_insertEntry
|
||||
@userId INT,
|
||||
@jobId INT,
|
||||
@email VARCHAR(MAX),
|
||||
@prevCompanyName VARCHAR(MAX),
|
||||
@prevPosition VARCHAR(MAX),
|
||||
@universityName VARCHAR(MAX),
|
||||
@cvLink VARCHAR(MAX),
|
||||
@portofolioLink VARCHAR(MAX)
|
||||
@email VARCHAR(50),
|
||||
@prevCompanyName VARCHAR(50),
|
||||
@prevPosition VARCHAR(50),
|
||||
@universityName VARCHAR(50),
|
||||
@cvLink VARCHAR(50),
|
||||
@portofolioLink VARCHAR(50)
|
||||
AS
|
||||
BEGIN
|
||||
INSERT INTO ApplicationEntry VALUES(@userId, @jobId, @email, @prevCompanyName, @prevPosition, @universityName, @cvLink, @portofolioLink, 'pending')
|
||||
SET NOCOUNT ON
|
||||
INSERT INTO ApplicationEntry (UserID,JobID,Email,PrevCompanyName,PrevPosition,UniversityName,CvLink,PortofolioLink,StatusEntry)
|
||||
VALUES(@userId, @jobId, @email, @prevCompanyName, @prevPosition, @universityName, @cvLink, @portofolioLink, 'pending')
|
||||
|
||||
END
|
||||
GO
|
||||
@ -245,7 +246,8 @@ GO
|
||||
CREATE PROC sp_getAllCountry
|
||||
AS
|
||||
BEGIN
|
||||
SELECT *
|
||||
SET NOCOUNT ON
|
||||
SELECT CountryName,CountryID
|
||||
FROM Country
|
||||
END
|
||||
GO
|
||||
@ -253,7 +255,8 @@ GO
|
||||
CREATE PROC sp_getAllJob
|
||||
AS
|
||||
BEGIN
|
||||
SELECT * FROM Job
|
||||
SET NOCOUNT ON
|
||||
SELECT JobName,JobDescription,JobLevel,JobID,Deadline,CityID FROM Job
|
||||
END
|
||||
GO
|
||||
--Done
|
||||
@ -261,6 +264,7 @@ CREATE PROC sp_denyApplicationEntry
|
||||
@applicationID INT
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
UPDATE ApplicationEntry SET StatusEntry='Denied'
|
||||
WHERE EntryID = @applicationID
|
||||
END
|
||||
@ -270,6 +274,7 @@ CREATE PROC sp_getJob
|
||||
@jobId INT
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
SELECT j.JobID,JobName,co.CountryID,CountryName,ci.CityID,CityName,AddressDetail, Deadline,JobLevel,JobDescription, COUNT (EntryID) AS ApplicantCount
|
||||
FROM [Job] j
|
||||
LEFT JOIN ApplicationEntry ae
|
||||
@ -281,21 +286,25 @@ BEGIN
|
||||
WHERE j.JobID = @jobID
|
||||
GROUP BY j.JobID,JobName,co.CountryID,CountryName,ci.CityID,CityName,Deadline,JobLevel,JobDescription,AddressDetail
|
||||
END
|
||||
|
||||
--Done
|
||||
GO
|
||||
CREATE PROC sp_hiredApplicationEntry
|
||||
@applicationID INT
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
UPDATE ApplicationEntry SET StatusEntry='Accepted'
|
||||
WHERE EntryID = @applicationID
|
||||
END
|
||||
GO
|
||||
--done without real ID
|
||||
--Done
|
||||
CREATE PROC sp_getAllEntry
|
||||
-- @userid INT
|
||||
AS
|
||||
BEGIN
|
||||
SELECT * FROM ApplicationEntry ae
|
||||
SET NOCOUNT ON
|
||||
SELECT EntryID,u.UserID,JobID,ae.Email,PrevCompanyName,PrevPosition,UniversityName,CvLink,PortofolioLink,StatusEntry FROM ApplicationEntry ae
|
||||
JOIN [User] u
|
||||
ON ae.UserID=u.UserID
|
||||
-- WHERE UserID = @userID
|
||||
@ -306,6 +315,7 @@ GO
|
||||
CREATE PROC sp_getListJob
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
SELECT j.JobID,JobName,co.CountryID,CountryName,ci.CityID, CityName, COUNT (EntryID) AS ApplicantCount, (CASE WHEN CONVERT(DATE,Deadline) > GETDATE() THEN 1 ELSE 0 END ) As IsOpen
|
||||
FROM Job j
|
||||
LEFT JOIN ApplicationEntry ae
|
||||
@ -320,13 +330,14 @@ GO
|
||||
--Done
|
||||
CREATE PROC sp_updateJob
|
||||
@jobId INT,
|
||||
@name VARCHAR(MAX),
|
||||
@name VARCHAR(50),
|
||||
@cityId INT,
|
||||
@jobLevel VARCHAR(MAX),
|
||||
@deadline VARCHAR (MAX),
|
||||
@description VARCHAR(MAX)
|
||||
@jobLevel VARCHAR(50),
|
||||
@deadline VARCHAR (50),
|
||||
@description VARCHAR(50)
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
UPDATE Job SET JobName=@name,CityID=@cityId,JobLevel=@jobLevel,Deadline=@deadline,JobDescription=@description
|
||||
WHERE JobID=@jobId
|
||||
END
|
||||
|
1
css/app.532182ec.css
Normal file
1
css/app.532182ec.css
Normal file
File diff suppressed because one or more lines are too long
@ -157,6 +157,7 @@ header .selectors {
|
||||
margin-top: 0.5rem;
|
||||
margin-bottom: 0.5rem;
|
||||
padding-right: 2rem;
|
||||
background-color: transparent;
|
||||
|
||||
/* Custom arrow */
|
||||
background-image:
|
||||
@ -235,7 +236,7 @@ header .account .nav-link {
|
||||
}
|
||||
.page-banner-inner {
|
||||
background-color: rgba(255,255,255,0.25);
|
||||
width: 100%;
|
||||
width: 84%;
|
||||
height: calc(100% - 4rem);
|
||||
padding: 2rem 8%;
|
||||
position: relative;
|
||||
|
@ -1 +1 @@
|
||||
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/favicon.ico><title>bluefire-frontend</title><link href=/css/app.2a50c464.css rel=preload as=style><link href=/css/chunk-vendors.e6574c94.css rel=preload as=style><link href=/js/app.fa5962da.js rel=preload as=script><link href=/js/chunk-vendors.bb705174.js rel=preload as=script><link href=/css/chunk-vendors.e6574c94.css rel=stylesheet><link href=/css/app.2a50c464.css rel=stylesheet></head><body><noscript><strong>We're sorry but bluefire-frontend doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/js/chunk-vendors.bb705174.js></script><script src=/js/app.fa5962da.js></script></body></html>
|
||||
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/favicon.ico><title>bluefire-frontend</title><link href=/css/app.532182ec.css rel=preload as=style><link href=/css/chunk-vendors.e6574c94.css rel=preload as=style><link href=/js/app.fa5962da.js rel=preload as=script><link href=/js/chunk-vendors.bb705174.js rel=preload as=script><link href=/css/chunk-vendors.e6574c94.css rel=stylesheet><link href=/css/app.532182ec.css rel=stylesheet></head><body><noscript><strong>We're sorry but bluefire-frontend doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/js/chunk-vendors.bb705174.js></script><script src=/js/app.fa5962da.js></script></body></html>
|
Loading…
Reference in New Issue
Block a user