This commit is contained in:
Damillora 2020-02-09 19:21:09 +07:00
parent f2d70afffe
commit 6bc10e3728
4 changed files with 93 additions and 80 deletions

View File

@ -2,43 +2,30 @@ CREATE DATABASE BLUEFIREDATABASE
USE 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 --Reset Identity
-- DBCC CHECKIDENT ('Emp', RESEED, 1) -- DBCC CHECKIDENT ('Emp', RESEED, 1)
---------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
CREATE TABLE [Admin]( CREATE TABLE [Admin](
AdminID INT PRIMARY KEY IDENTITY(1,1) NOT NULL, AdminID INT PRIMARY KEY IDENTITY(1,1) NOT NULL,
AdminName VARCHAR(MAX), AdminName VARCHAR(50),
AdminPassword VARCHAR(MAX) AdminPassword VARCHAR(50)
) )
INSERT INTO [Admin] VALUES ('admin', 'admin123'); INSERT INTO [Admin] VALUES ('admin', 'admin123');
INSERT INTO [Admin] VALUES ('adminHero', 'admin321'); INSERT INTO [Admin] VALUES ('adminHero', 'admin321');
GO GO
CREATE TABLE [User]( CREATE TABLE [User](
UserID INT PRIMARY KEY IDENTITY(1,1) NOT NULL, UserID INT PRIMARY KEY IDENTITY(1,1) NOT NULL,
[Password] VARCHAR(MAX), [Password] VARCHAR(50),
UserName VARCHAR(MAX), UserName VARCHAR(50),
DOB VARCHAR(MAX), DOB VARCHAR(50),
Gender VARCHAR(MAX), Gender VARCHAR(50),
[Address] VARCHAR(MAX), [Address] VARCHAR(50),
Phone VARCHAR(MAX), Phone VARCHAR(50),
Email VARCHAR(MAX) Email VARCHAR(50)
) )
--DBCC CHECKIDENT ('[User]', RESEED, 0) --DBCC CHECKIDENT ('[User]', RESEED, 0)
@ -48,10 +35,9 @@ INSERT INTO [User] VALUES('Julia111','Julia','3/1/1999','Female','K Street','089
GO GO
CREATE TABLE Country( CREATE TABLE Country(
CountryID INT IDENTITY(1,1) PRIMARY KEY NOT NULL, CountryID INT IDENTITY(1,1) PRIMARY KEY NOT NULL,
CountryName VARCHAR (MAX) CountryName VARCHAR (50)
) )
INSERT INTO Country VALUES('Indonesia') INSERT INTO Country VALUES('Indonesia')
INSERT INTO Country VALUES('Singapore') INSERT INTO Country VALUES('Singapore')
INSERT INTO Country VALUES('India') INSERT INTO Country VALUES('India')
@ -59,21 +45,20 @@ GO
CREATE TABLE City( CREATE TABLE City(
CityID INT IDENTITY (1,1) PRIMARY KEY NOT NULL, CityID INT IDENTITY (1,1) PRIMARY KEY NOT NULL,
CountryID INT FOREIGN KEY REFERENCES Country(CountryID), CountryID INT FOREIGN KEY REFERENCES Country(CountryID),
CityName VARCHAR (MAX), CityName VARCHAR (50),
AddressDetail VARCHAR(MAX) AddressDetail VARCHAR(50)
) )
INSERT INTO City VALUES(1,'Jakarta','Jakarta Selatan') 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(2,'Singapore','Singapore')
INSERT INTO City VALUES(3,'Bengaluru','Bengaluru') INSERT INTO City VALUES(3,'Bengaluru','Bengaluru')
GO GO
CREATE TABLE Job( CREATE TABLE Job(
JobID INT PRIMARY KEY IDENTITY(1,1) NOT NULL, JobID INT PRIMARY KEY IDENTITY(1,1) NOT NULL,
JobName VARCHAR(MAX), JobName VARCHAR(50),
CityID INT FOREIGN KEY REFERENCES city(cityId), CityID INT FOREIGN KEY REFERENCES city(cityId),
JobLevel VARCHAR(MAX), JobLevel VARCHAR(50),
Deadline VARCHAR (MAX), Deadline VARCHAR (50),
JobDescription VARCHAR(MAX), JobDescription VARCHAR(50),
) )
INSERT INTO Job VALUES('IT Infrastructure',1,'Easy','12/12/2012','need computer knowledge') 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') 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, EntryID INT PRIMARY KEY IDENTITY(1,1) NOT NULL,
UserID INT FOREIGN KEY REFERENCES [User](userId) ON UPDATE CASCADE ON DELETE CASCADE, 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, JobID INT FOREIGN KEY REFERENCES Job(jobId) ON UPDATE CASCADE ON DELETE CASCADE,
Email VARCHAR(MAX), Email VARCHAR(50),
PrevCompanyName VARCHAR(MAX), PrevCompanyName VARCHAR(50),
PrevPosition VARCHAR(MAX), PrevPosition VARCHAR(50),
UniversityName VARCHAR(MAX), UniversityName VARCHAR(50),
CvLink VARCHAR(MAX), CvLink VARCHAR(50),
PortofolioLink VARCHAR(MAX), PortofolioLink VARCHAR(50),
StatusEntry VARCHAR(MAX) 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(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') 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 SELECT*FROM ApplicationEntry
GO GO
---------------------------------- ----------------------------------
---------STORED PROCEDURES----------
----------------------------------
--Done --Done
CREATE PROC sp_getAllCity CREATE PROC sp_getAllCity
AS AS
BEGIN BEGIN
SELECT * FROM City SET NOCOUNT ON
SELECT CityID,CountryID,CityName,AddressDetail FROM City
END END
GO GO
--Done --Done
CREATE PROC sp_insertAdmin CREATE PROC sp_insertAdmin
@password VARCHAR(MAX), @password VARCHAR(50),
@name VARCHAR(MAX) @name VARCHAR(50)
AS AS
BEGIN BEGIN
INSERT INTO [Admin] SET NOCOUNT ON
INSERT INTO [Admin] (AdminName,AdminPassword)
VALUES (@name,@password) VALUES (@name,@password)
END END
GO GO
--Done --Done
CREATE PROC sp_insertUser CREATE PROC sp_insertUser
@password VARCHAR(MAX), @password VARCHAR(50),
@name VARCHAR(MAX), @name VARCHAR(50),
@DOB VARCHAR(MAX), @DOB VARCHAR(50),
@gender VARCHAR(MAX), @gender VARCHAR(50),
@address VARCHAR(MAX), @address VARCHAR(50),
@phone VARCHAR(MAX), @phone VARCHAR(50),
@email VARCHAR(MAX) @email VARCHAR(50)
AS AS
BEGIN 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 END
GO GO
--Done --Done
CREATE PROC sp_loginUser CREATE PROC sp_loginUser
@name VARCHAR(MAX) @name VARCHAR(50)
AS AS
BEGIN BEGIN
SELECT * FROM [User] SET NOCOUNT ON
SELECT UserName FROM [User]
WHERE ([User].UserName=@name) WHERE ([User].UserName=@name)
END END
--Done --Done
GO GO
CREATE PROC sp_loginAdmin CREATE PROC sp_loginAdmin
@name VARCHAR(MAX) @name VARCHAR(50)
AS AS
BEGIN BEGIN
SELECT * FROM [Admin] SET NOCOUNT ON
SELECT AdminName FROM [Admin]
WHERE ([Admin].AdminName=@name) WHERE ([Admin].AdminName=@name)
END END
---Done ---Done
GO GO
CREATE PROC sp_insertJob CREATE PROC sp_insertJob
@name VARCHAR(MAX), @name VARCHAR(50),
@cityId INT, @cityId INT,
@jobLevel VARCHAR(MAX), @jobLevel VARCHAR(50),
@deadline VARCHAR (MAX), @deadline VARCHAR (50),
@description VARCHAR(MAX) @description VARCHAR(50)
AS AS
BEGIN BEGIN
INSERT INTO Job SET NOCOUNT ON
INSERT INTO Job (JobName,CityID,JobLevel,Deadline,JobDescription)
VALUES(@name, @cityId, @jobLevel, @deadline, @description) VALUES(@name, @cityId, @jobLevel, @deadline, @description)
END END
GO GO
@ -183,26 +178,29 @@ CREATE PROC sp_deleteJob
@jobId INT @jobId INT
AS AS
BEGIN BEGIN
SET NOCOUNT ON
DELETE FROM Job DELETE FROM Job
WHERE JobID = @jobId WHERE JobID = @jobId
END END
GO GO
--Done Without real ID --Done
CREATE PROC sp_insertBookmark CREATE PROC sp_insertBookmark
@userId INT, @userId INT,
@jobId INT @jobId INT
AS AS
BEGIN BEGIN
INSERT INTO UserBookmark SET NOCOUNT ON
INSERT INTO UserBookmark (UserID,JobID)
VALUES(@userId, @jobId) VALUES(@userId, @jobId)
END END
----------------------------------------- -----------------------------------------
GO GO
--Done Without real ID --Done
CREATE PROC sp_getBookmark CREATE PROC sp_getBookmark
@userId INT @userId INT
AS AS
BEGIN 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 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 JOIN UserBookmark ub
ON j.jobId = ub.jobId ON j.jobId = ub.jobId
@ -222,22 +220,25 @@ CREATE PROC sp_deleteBookmark
@bookmarkID INT @bookmarkID INT
AS AS
BEGIN BEGIN
SET NOCOUNT ON
DELETE FROM UserBookmark WHERE BookmarkID = @bookmarkID DELETE FROM UserBookmark WHERE BookmarkID = @bookmarkID
END END
GO GO
--DONE Without real Id --DONE
CREATE PROC sp_insertEntry CREATE PROC sp_insertEntry
@userId INT, @userId INT,
@jobId INT, @jobId INT,
@email VARCHAR(MAX), @email VARCHAR(50),
@prevCompanyName VARCHAR(MAX), @prevCompanyName VARCHAR(50),
@prevPosition VARCHAR(MAX), @prevPosition VARCHAR(50),
@universityName VARCHAR(MAX), @universityName VARCHAR(50),
@cvLink VARCHAR(MAX), @cvLink VARCHAR(50),
@portofolioLink VARCHAR(MAX) @portofolioLink VARCHAR(50)
AS AS
BEGIN 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 END
GO GO
@ -245,7 +246,8 @@ GO
CREATE PROC sp_getAllCountry CREATE PROC sp_getAllCountry
AS AS
BEGIN BEGIN
SELECT * SET NOCOUNT ON
SELECT CountryName,CountryID
FROM Country FROM Country
END END
GO GO
@ -253,7 +255,8 @@ GO
CREATE PROC sp_getAllJob CREATE PROC sp_getAllJob
AS AS
BEGIN BEGIN
SELECT * FROM Job SET NOCOUNT ON
SELECT JobName,JobDescription,JobLevel,JobID,Deadline,CityID FROM Job
END END
GO GO
--Done --Done
@ -261,6 +264,7 @@ CREATE PROC sp_denyApplicationEntry
@applicationID INT @applicationID INT
AS AS
BEGIN BEGIN
SET NOCOUNT ON
UPDATE ApplicationEntry SET StatusEntry='Denied' UPDATE ApplicationEntry SET StatusEntry='Denied'
WHERE EntryID = @applicationID WHERE EntryID = @applicationID
END END
@ -270,6 +274,7 @@ CREATE PROC sp_getJob
@jobId INT @jobId INT
AS AS
BEGIN BEGIN
SET NOCOUNT ON
SELECT j.JobID,JobName,co.CountryID,CountryName,ci.CityID,CityName,AddressDetail, Deadline,JobLevel,JobDescription, COUNT (EntryID) AS ApplicantCount SELECT j.JobID,JobName,co.CountryID,CountryName,ci.CityID,CityName,AddressDetail, Deadline,JobLevel,JobDescription, COUNT (EntryID) AS ApplicantCount
FROM [Job] j FROM [Job] j
LEFT JOIN ApplicationEntry ae LEFT JOIN ApplicationEntry ae
@ -281,21 +286,25 @@ BEGIN
WHERE j.JobID = @jobID WHERE j.JobID = @jobID
GROUP BY j.JobID,JobName,co.CountryID,CountryName,ci.CityID,CityName,Deadline,JobLevel,JobDescription,AddressDetail GROUP BY j.JobID,JobName,co.CountryID,CountryName,ci.CityID,CityName,Deadline,JobLevel,JobDescription,AddressDetail
END END
--Done
GO GO
CREATE PROC sp_hiredApplicationEntry CREATE PROC sp_hiredApplicationEntry
@applicationID INT @applicationID INT
AS AS
BEGIN BEGIN
SET NOCOUNT ON
UPDATE ApplicationEntry SET StatusEntry='Accepted' UPDATE ApplicationEntry SET StatusEntry='Accepted'
WHERE EntryID = @applicationID WHERE EntryID = @applicationID
END END
GO GO
--done without real ID --Done
CREATE PROC sp_getAllEntry CREATE PROC sp_getAllEntry
-- @userid INT -- @userid INT
AS AS
BEGIN 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 JOIN [User] u
ON ae.UserID=u.UserID ON ae.UserID=u.UserID
-- WHERE UserID = @userID -- WHERE UserID = @userID
@ -306,6 +315,7 @@ GO
CREATE PROC sp_getListJob CREATE PROC sp_getListJob
AS AS
BEGIN 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 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 FROM Job j
LEFT JOIN ApplicationEntry ae LEFT JOIN ApplicationEntry ae
@ -320,13 +330,14 @@ GO
--Done --Done
CREATE PROC sp_updateJob CREATE PROC sp_updateJob
@jobId INT, @jobId INT,
@name VARCHAR(MAX), @name VARCHAR(50),
@cityId INT, @cityId INT,
@jobLevel VARCHAR(MAX), @jobLevel VARCHAR(50),
@deadline VARCHAR (MAX), @deadline VARCHAR (50),
@description VARCHAR(MAX) @description VARCHAR(50)
AS AS
BEGIN BEGIN
SET NOCOUNT ON
UPDATE Job SET JobName=@name,CityID=@cityId,JobLevel=@jobLevel,Deadline=@deadline,JobDescription=@description UPDATE Job SET JobName=@name,CityID=@cityId,JobLevel=@jobLevel,Deadline=@deadline,JobDescription=@description
WHERE JobID=@jobId WHERE JobID=@jobId
END END

1
css/app.532182ec.css Normal file

File diff suppressed because one or more lines are too long

View File

@ -157,6 +157,7 @@ header .selectors {
margin-top: 0.5rem; margin-top: 0.5rem;
margin-bottom: 0.5rem; margin-bottom: 0.5rem;
padding-right: 2rem; padding-right: 2rem;
background-color: transparent;
/* Custom arrow */ /* Custom arrow */
background-image: background-image:
@ -235,7 +236,7 @@ header .account .nav-link {
} }
.page-banner-inner { .page-banner-inner {
background-color: rgba(255,255,255,0.25); background-color: rgba(255,255,255,0.25);
width: 100%; width: 84%;
height: calc(100% - 4rem); height: calc(100% - 4rem);
padding: 2rem 8%; padding: 2rem 8%;
position: relative; position: relative;

View File

@ -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>