Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
LaMartin-Webomagic
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Deep Dey
LaMartin-Webomagic
Commits
b20eadaa
Commit
b20eadaa
authored
Jul 02, 2024
by
Deep Dey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add api integration for dashboard form listing and login
parent
f1430816
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
153 additions
and
110 deletions
+153
-110
lamartinDashboard/css/dashboard.css
lamartinDashboard/css/dashboard.css
+16
-3
lamartinDashboard/css/login.css
lamartinDashboard/css/login.css
+1
-1
lamartinDashboard/dashboard.html
lamartinDashboard/dashboard.html
+30
-15
lamartinDashboard/js/constant.js
lamartinDashboard/js/constant.js
+2
-0
lamartinDashboard/js/dashboard.js
lamartinDashboard/js/dashboard.js
+79
-83
lamartinDashboard/js/login.js
lamartinDashboard/js/login.js
+19
-6
lamartinDashboard/login.html
lamartinDashboard/login.html
+6
-2
No files found.
lamartinDashboard/css/dashboard.css
View file @
b20eadaa
...
@@ -46,12 +46,25 @@ body {
...
@@ -46,12 +46,25 @@ body {
}
}
.book-appointment-box
{
.book-appointment-box
{
position
:
absolute
;
display
:
flex
;
top
:
10px
;
justify-content
:
space-between
;
right
:
20px
;
align-items
:
center
;
margin-bottom
:
20px
;
z-index
:
100
;
z-index
:
100
;
}
}
.book-appointment-box2
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
margin-bottom
:
20px
;
z-index
:
100
;
}
.book-appointment-box2
.btn
{
margin
:
0
5px
;
}
.navbar-filter
{
.navbar-filter
{
background-color
:
#fff
;
background-color
:
#fff
;
box-shadow
:
0
2px
4px
rgba
(
0
,
0
,
0
,
0.1
);
box-shadow
:
0
2px
4px
rgba
(
0
,
0
,
0
,
0.1
);
...
...
lamartinDashboard/css/login.css
View file @
b20eadaa
...
@@ -51,5 +51,5 @@ body {
...
@@ -51,5 +51,5 @@ body {
.error-message
{
.error-message
{
color
:
red
;
color
:
red
;
display
:
none
;
display
:
none
;
margin-
top
:
10px
;
margin-
bottom
:
10px
;
}
}
\ No newline at end of file
lamartinDashboard/dashboard.html
View file @
b20eadaa
...
@@ -5,6 +5,9 @@
...
@@ -5,6 +5,9 @@
<meta
charset=
"UTF-8"
/>
<meta
charset=
"UTF-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<title>
Dashboard
</title>
<title>
Dashboard
</title>
<link
href=
"https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap"
rel=
"stylesheet"
>
<link
href=
"https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
rel=
"stylesheet"
/>
<link
href=
"https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
rel=
"stylesheet"
/>
<link
rel=
"stylesheet"
href=
"css/dashboard.css"
/>
<link
rel=
"stylesheet"
href=
"css/dashboard.css"
/>
</head>
</head>
...
@@ -18,22 +21,22 @@
...
@@ -18,22 +21,22 @@
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-lg-3"
>
<div
class=
"col-lg-3"
>
<div
class=
"navbar-filter"
>
<div
class=
"navbar-filter"
>
<h
4>
Filters
</h4
>
<h
5>
Filters
</h5
>
<hr
/>
<hr
/>
<div
class=
"filter-box"
>
<div
class=
"filter-box"
>
<label
for=
"schoolFilter"
class=
"filter-label"
>
School
Wise
</label>
<label
for=
"schoolFilter"
class=
"filter-label"
>
School
</label>
<select
id=
"schoolFilter"
class=
"form-control"
>
<select
id=
"schoolFilter"
class=
"form-control"
>
<option
value=
""
>
All
Schools
</option>
<option
value=
""
>
All
</option>
<option
value=
"La Martiniere for Boys"
>
La Martiniere for Boys
</option>
<option
value=
"La Martiniere for Boys"
>
La Martiniere for Boys
</option>
<option
value=
"La Martiniere for Girls"
>
La Martiniere for
G
irls
</option>
<option
value=
"La Martiniere for Girls"
>
La Martiniere for
g
irls
</option>
</select>
</select>
</div>
</div>
<div
class=
"filter-box"
>
<div
class=
"filter-box"
>
<label
for=
"dateFilter"
class=
"filter-label"
>
Date
</label>
<label
for=
"dateFilter"
class=
"filter-label"
>
Interaction
Date
</label>
<input
type=
"date"
id=
"dateFilter"
class=
"form-control"
/>
<input
type=
"date"
id=
"dateFilter"
class=
"form-control"
/>
</div>
</div>
<div
class=
"filter-box"
>
<div
class=
"filter-box"
>
<label
for=
"timeFilter"
class=
"filter-label"
>
Time
</label>
<label
for=
"timeFilter"
class=
"filter-label"
>
Interaction
Time
</label>
<input
type=
"time"
id=
"timeFilter"
class=
"form-control"
/>
<input
type=
"time"
id=
"timeFilter"
class=
"form-control"
/>
</div>
</div>
<button
id=
"applyFilters"
class=
"btn btn-primary btn-block"
>
Apply Filters
</button>
<button
id=
"applyFilters"
class=
"btn btn-primary btn-block"
>
Apply Filters
</button>
...
@@ -42,24 +45,35 @@
...
@@ -42,24 +45,35 @@
</div>
</div>
<div
class=
"col-lg-9"
>
<div
class=
"col-lg-9"
>
<div
class=
"details-container"
>
<div
class=
"details-container"
>
<h2>
Student Information
</h2>
<div>
<h2
style=
"text-align: center;"
>
Admission Information
</h2>
<div
class=
"book-appointment-box2"
>
<button
class=
"btn btn-success btn-sm"
>
Interaction Sheet
</button>
<button
class=
"btn btn-primary btn-sm"
>
Interaction Scoring Sheet
</button>
<button
class=
"btn btn-secondary btn-sm"
>
Counsellor Scoring Sheet
</button>
</div>
<div
class=
"book-appointment-box"
>
<button
id=
"bookAppointmentBtn"
class=
"btn btn-primary btn-sm"
>
Schedule Appointment
</button>
<button
class=
"btn btn-success btn-sm"
>
Download Admission Data
</button>
</div>
</div>
<div
class=
"table-responsive"
>
<div
class=
"table-responsive"
>
<table
class=
"table table-bordered"
>
<table
class=
"table table-bordered"
>
<thead>
<thead>
<tr>
<tr>
<th
scope=
"col"
>
Select
</th>
<th
scope=
"col"
>
<th
scope=
"col"
>
ID
</th>
<input
type=
"checkbox"
id=
"selectAll"
/>
<th
scope=
"col"
>
DOB
</th>
</th>
<th
scope=
"col"
>
Student Name
</th>
<th
scope=
"col"
>
Candidate Name
</th>
<th
scope=
"col"
>
Parent Name
</th>
<th
scope=
"col"
>
Interaction Date/Time
</th>
<th
scope=
"col"
>
Father Name
</th>
<th
scope=
"col"
>
Mother Name
</th>
</tr>
</tr>
</thead>
</thead>
<tbody
id=
"output"
></tbody>
<tbody
id=
"output"
></tbody>
</table>
</table>
</div>
</div>
<div
class=
"book-appointment-box"
>
<button
id=
"bookAppointmentBtn"
class=
"btn btn-success"
>
Book Appointment
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -95,6 +109,7 @@
...
@@ -95,6 +109,7 @@
<script
src=
"https://code.jquery.com/jquery-3.6.0.min.js"
></script>
<script
src=
"https://code.jquery.com/jquery-3.6.0.min.js"
></script>
<script
src=
"https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"
></script>
<script
src=
"https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"
></script>
<script
src=
"js/constant.js"
></script>
<script
src=
"js/dashboard.js"
></script>
<script
src=
"js/dashboard.js"
></script>
</body>
</body>
...
...
lamartinDashboard/js/constant.js
0 → 100644
View file @
b20eadaa
const
BASE_URL
=
'
http://127.0.0.1:5000/webomagic-user/v1
'
;
const
BASE_URL_LAMARTIN
=
'
http://localhost:8084/webomagic-lamartin
'
;
\ No newline at end of file
lamartinDashboard/js/dashboard.js
View file @
b20eadaa
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
var
studentData
=
[
var
studentData
=
[];
{
id
:
1
,
var
loginData
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'
loginData
'
));
school
:
'
La Martiniere for Boys
'
,
if
(
!
loginData
||
!
loginData
.
apiKey
)
{
date
:
'
2005-06-12
'
,
window
.
location
.
href
=
'
login.html
'
;
name
:
'
John Doe
'
,
}
parent
:
'
Jane Doe
'
,
dob
:
'
2003-12-10
'
,
// initially display all admission data
},
getAdmissionData
(
null
,
null
,
null
,
null
);
{
id
:
2
,
function
displayFilteredStudents
()
{
school
:
'
La Martiniere for Girls
'
,
var
filteredData
=
studentData
;
date
:
'
2007-09-18
'
,
name
:
'
arnab
'
,
parent
:
'
Bob Smith
'
,
dob
:
'
2003-12-10
'
,
},
{
id
:
3
,
school
:
'
La Martiniere for Boys
'
,
date
:
'
2007-09-20
'
,
name
:
'
arnab1
'
,
parent
:
'
Bob Smith
'
,
dob
:
'
2003-12-10
'
,
},
{
id
:
4
,
school
:
'
La Martiniere for Boys
'
,
date
:
'
2007-09-21
'
,
name
:
'
arnab2
'
,
parent
:
'
Bob Smith
'
,
dob
:
'
2003-12-10
'
,
},
{
id
:
5
,
school
:
'
La Martiniere for Girls
'
,
date
:
'
2007-09-15
'
,
name
:
'
arnab3
'
,
parent
:
'
Bob Smith
'
,
dob
:
'
2003-12-10
'
,
},
{
id
:
6
,
school
:
'
La Martiniere for Boys
'
,
date
:
'
2007-09-22
'
,
name
:
'
arnab6
'
,
parent
:
'
Bob Smith
'
,
dob
:
'
2003-12-10
'
,
},
{
id
:
7
,
school
:
'
La Martiniere for Girls
'
,
date
:
'
2007-09-15
'
,
name
:
'
arnab4
'
,
parent
:
'
Bob Smith
'
,
dob
:
'
2003-12-10
'
,
},
{
id
:
8
,
school
:
'
La Martiniere for Girls
'
,
date
:
'
2007-09-05
'
,
name
:
'
arnab5
'
,
parent
:
'
Bob Smith
'
,
dob
:
'
2003-12-10
'
,
},
];
function
displayFilteredStudents
(
schoolFilter
,
dateFilter
,
timeFilter
)
{
var
filteredData
=
studentData
.
filter
(
function
(
student
)
{
return
(
(
!
schoolFilter
||
student
.
school
===
schoolFilter
)
&&
(
!
dateFilter
||
student
.
date
===
dateFilter
)
&&
(
!
timeFilter
||
student
.
time
===
timeFilter
)
);
});
var
outputHtml
=
''
;
var
outputHtml
=
''
;
filteredData
.
forEach
(
function
(
student
)
{
filteredData
.
forEach
(
function
(
student
)
{
...
@@ -82,25 +19,75 @@ $(document).ready(function () {
...
@@ -82,25 +19,75 @@ $(document).ready(function () {
'
<td><input type="checkbox" class="student-checkbox" data-id="
'
+
'
<td><input type="checkbox" class="student-checkbox" data-id="
'
+
student
.
id
+
student
.
id
+
'
"></td>
'
;
'
"></td>
'
;
outputHtml
+=
'
<td>
'
+
student
.
id
+
'
</td>
'
;
outputHtml
+=
'
<td>
'
+
student
.
fullName
+
'
</td>
'
;
outputHtml
+=
'
<td>
'
+
student
.
dob
+
'
</td>
'
;
outputHtml
+=
'
<td>
'
+
(
student
.
interactionDate
||
''
)
+
'
'
+
(
student
.
interactionTime
||
''
)
+
'
</td>
'
;
outputHtml
+=
'
<td>
'
+
student
.
n
ame
+
'
</td>
'
;
outputHtml
+=
'
<td>
'
+
student
.
fatherN
ame
+
'
</td>
'
;
outputHtml
+=
'
<td>
'
+
student
.
parent
+
'
</td>
'
;
outputHtml
+=
'
<td>
'
+
student
.
motherName
+
'
</td>
'
;
outputHtml
+=
'
</tr>
'
;
outputHtml
+=
'
</tr>
'
;
});
});
$
(
'
#output
'
).
html
(
outputHtml
);
$
(
'
#output
'
).
html
(
outputHtml
);
}
}
// Initial display of all students
function
getAdmissionData
(
displayFilteredStudents
(
null
,
null
,
null
);
schoolName
,
className
,
interactionDate
,
interactionTime
)
{
let
queryData
=
{};
if
(
schoolName
)
{
queryData
.
schoolName
=
schoolName
;
}
if
(
className
)
{
queryData
.
className
=
className
;
}
if
(
interactionDate
)
{
queryData
.
interactionDate
=
interactionDate
;
}
if
(
interactionTime
)
{
queryData
.
interactionTime
=
interactionTime
;
}
$
.
ajax
({
url
:
BASE_URL_LAMARTIN
+
'
/admission-form/get-all
'
,
type
:
'
GET
'
,
contentType
:
'
application/json
'
,
dataType
:
'
json
'
,
headers
:
{
apikey
:
loginData
.
apiKey
,
},
data
:
queryData
,
success
:
function
(
response
)
{
console
.
log
(
'
Success:
'
,
response
);
// Handle the response data
if
(
response
.
data
)
{
studentData
=
response
.
data
;
displayFilteredStudents
();
}
},
error
:
function
(
error
)
{
console
.
error
(
'
Error:
'
,
error
);
studentData
=
[];
// Handle error messages
if
(
error
.
responseJSON
&&
error
.
responseJSON
.
message
)
{
alert
(
'
Request failed:
'
+
error
.
responseJSON
.
message
);
}
else
{
alert
(
'
An unexpected error occurred. Please try again.
'
);
}
},
});
}
// Apply filters button click event
// Apply filters button click event
$
(
'
#applyFilters
'
).
click
(
function
()
{
$
(
'
#applyFilters
'
).
click
(
function
()
{
var
schoolFilter
=
$
(
'
#schoolFilter
'
).
val
();
var
schoolFilter
=
$
(
'
#schoolFilter
'
).
val
();
var
dateFilter
=
$
(
'
#dateFilter
'
).
val
();
var
dateFilter
=
$
(
'
#dateFilter
'
).
val
();
var
timeFilter
=
$
(
'
#timeFilter
'
).
val
();
var
timeFilter
=
$
(
'
#timeFilter
'
).
val
();
displayFilteredStudents
(
schoolFilter
,
dateFilter
,
timeFilter
);
getAdmissionData
(
schoolFilter
,
null
,
dateFilter
,
timeFilter
);
});
});
// Reset filters button click event
// Reset filters button click event
...
@@ -108,7 +95,16 @@ $(document).ready(function () {
...
@@ -108,7 +95,16 @@ $(document).ready(function () {
$
(
'
#schoolFilter
'
).
val
(
''
);
$
(
'
#schoolFilter
'
).
val
(
''
);
$
(
'
#dateFilter
'
).
val
(
''
);
$
(
'
#dateFilter
'
).
val
(
''
);
$
(
'
#timeFilter
'
).
val
(
''
);
$
(
'
#timeFilter
'
).
val
(
''
);
displayFilteredStudents
(
null
,
null
,
null
);
getAdmissionData
(
null
,
null
,
null
,
null
);
});
// Select all checkbox click event
$
(
'
#selectAll
'
).
click
(
function
()
{
if
(
$
(
this
).
is
(
'
:checked
'
))
{
$
(
'
.student-checkbox
'
).
prop
(
'
checked
'
,
true
);
}
else
{
$
(
'
.student-checkbox
'
).
prop
(
'
checked
'
,
false
);
}
});
});
// Book appointment button click event
// Book appointment button click event
...
...
lamartinDashboard/js/login.js
View file @
b20eadaa
...
@@ -2,13 +2,26 @@ $(document).ready(function () {
...
@@ -2,13 +2,26 @@ $(document).ready(function () {
$
(
'
#loginForm
'
).
on
(
'
submit
'
,
function
(
event
)
{
$
(
'
#loginForm
'
).
on
(
'
submit
'
,
function
(
event
)
{
event
.
preventDefault
();
event
.
preventDefault
();
var
user
ID
=
$
(
'
#userid
'
).
val
();
var
user
Email
=
$
(
'
#userid
'
).
val
();
var
password
=
$
(
'
#password
'
).
val
();
var
password
=
$
(
'
#password
'
).
val
();
if
(
userID
===
'
admin
'
&&
password
===
'
admin
'
)
{
$
.
ajax
({
url
:
BASE_URL
+
'
/user/login
'
,
type
:
'
POST
'
,
contentType
:
'
application/json
'
,
dataType
:
'
json
'
,
data
:
JSON
.
stringify
({
email
:
userEmail
,
password
:
password
,
}),
success
:
function
(
response
)
{
$
(
'
#errorMessage
'
).
hide
();
sessionStorage
.
setItem
(
'
loginData
'
,
JSON
.
stringify
(
response
.
data
));
window
.
location
.
href
=
'
dashboard.html
'
;
window
.
location
.
href
=
'
dashboard.html
'
;
}
else
{
},
error
:
function
(
error
)
{
$
(
'
#errorMessage
'
).
show
();
$
(
'
#errorMessage
'
).
show
();
}
},
});
});
});
});
});
lamartinDashboard/login.html
View file @
b20eadaa
...
@@ -5,6 +5,9 @@
...
@@ -5,6 +5,9 @@
<meta
charset=
"UTF-8"
>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
Login Page
</title>
<title>
Login Page
</title>
<link
href=
"https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap"
rel=
"stylesheet"
>
<link
href=
"https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
rel=
"stylesheet"
>
<link
href=
"https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
rel=
"stylesheet"
>
<link
rel=
"stylesheet"
href=
"css/login.css"
>
<link
rel=
"stylesheet"
href=
"css/login.css"
>
</head>
</head>
...
@@ -14,18 +17,19 @@
...
@@ -14,18 +17,19 @@
<h2>
Login
</h2>
<h2>
Login
</h2>
<form
id=
"loginForm"
>
<form
id=
"loginForm"
>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<input
type=
"text"
class=
"form-control"
id=
"userid"
name=
"userid"
placeholder=
"Enter
userID
"
required
>
<input
type=
"text"
class=
"form-control"
id=
"userid"
name=
"userid"
placeholder=
"Enter
Email
"
required
>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<input
type=
"password"
class=
"form-control"
id=
"password"
name=
"password"
placeholder=
"Enter Password"
<input
type=
"password"
class=
"form-control"
id=
"password"
name=
"password"
placeholder=
"Enter Password"
required
>
required
>
</div>
</div>
<div
class=
"error-message"
id=
"errorMessage"
>
Invalid
User ID
or Password
</div>
<div
class=
"error-message"
id=
"errorMessage"
>
Invalid
Email
or Password
</div>
<button
type=
"submit"
class=
"btn btn-primary btn-block"
>
Login
</button>
<button
type=
"submit"
class=
"btn btn-primary btn-block"
>
Login
</button>
</form>
</form>
</div>
</div>
<script
src=
"https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"
></script>
<script
src=
"https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"
></script>
<script
src=
"js/constant.js"
></script>
<script
src=
"js/login.js"
></script>
<script
src=
"js/login.js"
></script>
</body>
</body>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment