Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
Tim11
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dragutin Ostojic
Tim11
Commits
d60ecbdf
Commit
d60ecbdf
authored
Sep 18, 2020
by
Krunoslav Velfel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Final
parent
f76dea00
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
174 additions
and
27 deletions
+174
-27
src/main/java/com/imi/informacionisistem/Server/ControllerMain.java
+2
-2
src/main/resources/static/css/panel.css
+47
-0
src/main/resources/static/js/deliverContent.js
+114
-7
src/main/resources/templates/panel.html
+11
-18
No files found.
src/main/java/com/imi/informacionisistem/Server/ControllerMain.java
View file @
d60ecbdf
...
...
@@ -13,7 +13,7 @@ import com.imi.informacionisistem.Server.ContentDelivery;
@Controller
public
class
ControllerMain
extends
ContentDelivery
{
public
class
ControllerMain
extends
ContentDelivery
{
private
final
int
COOKIE_LENGTH
=
30
;
private
Connection
connection
=
null
;
private
Statement
statement
=
null
;
...
...
@@ -54,7 +54,7 @@ public class ControllerMain extends ContentDelivery{
@RequestParam
(
name
=
"password"
)
String
p
)
throws
SQLException
{
int
id
;
String
role
;
connection
=
DriverManager
.
getConnection
(
"jdbc:mariadb://localhost/security"
,
"root"
,
"
password
"
);
connection
=
DriverManager
.
getConnection
(
"jdbc:mariadb://localhost/security"
,
"root"
,
"
klaric314
"
);
statement
=
connection
.
createStatement
();
sql
=
"SELECT * FROM login WHERE username=\""
+
u
+
"\" AND "
+
"password=\""
+
p
+
"\""
;
...
...
src/main/resources/static/css/panel.css
View file @
d60ecbdf
...
...
@@ -123,4 +123,50 @@ body {
.spectrum-Breadcrumbs-itemSeparator
{
color
:
rgba
(
255
,
255
,
255
)
!important
;
}
.cheque
{
margin-left
:
auto
;
margin-right
:
auto
;
margin-top
:
160px
;
padding
:
10px
;
width
:
800px
;
height
:
500px
;
border
:
1px
solid
black
;
}
.cheque
p
{
font-size
:
12px
;
font-family
:
"Source Sans Pro"
;
color
:
black
;
}
.cheque
.left
{
padding
:
0
;
float
:
left
;
width
:
46%
;
height
:
500px
;
}
.cheque
.right
{
padding
:
0
;
float
:
right
;
width
:
46%
;
height
:
500px
;
}
.cheque
.box-lg
{
display
:
block
;
width
:
96.5%
;
height
:
80px
;
border
:
1px
solid
black
;
padding
:
2px
;
}
.cheque
.box-s
{
width
:
60%
;
height
:
40px
;
border
:
1px
solid
black
;
padding
:
2px
;
}
.cheque
.box-xs
{
width
:
14%
;
height
:
40px
;
border
:
1px
solid
black
;
padding
:
2px
;
}
\ No newline at end of file
src/main/resources/static/js/deliverContent.js
View file @
d60ecbdf
function
overview
()
{
fetch
(
"/overview?token="
+
document
.
cookie
)
var
registeredSubjects
=
new
Array
(
50
);
var
rs
=
0
;
var
eregisteredSubjects
=
new
Array
(
50
);
var
ers
=
0
;
function
eregisterSubject
(
chk
)
{
if
(
chk
.
checked
==
true
)
{
eregisteredSubjects
[
ers
]
=
chk
;
ers
++
;
}
else
{
var
i
,
j
;
for
(
i
=
0
;
i
<
ers
;
i
++
)
{
if
(
chk
===
eregisteredSubjects
[
i
])
{
for
(
j
=
i
;
j
<
rs
-
1
;
j
++
)
{
eregisteredSubjects
[
j
]
=
eregisteredSubjects
[
j
+
1
];
}
ers
--
;
return
;
}
}
}
}
function
submitEregister
()
{
var
i
;
var
result
=
new
String
();
for
(
i
=
0
;
i
<
ers
-
1
;
i
++
)
{
result
+=
eregisteredSubjects
[
i
].
id
+
"__"
;
}
if
(
i
>
0
)
{
result
+=
eregisteredSubjects
[
i
].
id
;
deliverContent
(
"eregistersubmit"
,
result
);
}
else
{
document
.
getElementsByClassName
(
"content"
)[
0
].
innerHTML
+=
"<br><br><p style=
\"
float: right;margin-right: 40px; margin-top: 30px;
\"
class=
\"
spectrum-Body spectrum-Body--M
\"
>Prijava je prazna. Izaberite željene predmete.</p>"
}
}
function
submitRegistration
()
{
var
i
;
var
result
=
new
String
();
for
(
i
=
0
;
i
<
rs
-
1
;
i
++
)
{
result
+=
registeredSubjects
[
i
].
id
+
"__"
;
}
if
(
i
>
0
)
{
result
+=
registeredSubjects
[
i
].
id
;
deliverContent
(
"submit"
,
result
);
}
else
{
document
.
getElementsByClassName
(
"content"
)[
0
].
innerHTML
+=
"<br><br><p style=
\"
float: right;margin-right: 40px; margin-top: 30px;
\"
class=
\"
spectrum-Body spectrum-Body--M
\"
>Prijava je prazna. Izaberite željene predmete.</p>"
}
}
function
registerSubject
(
chk
)
{
if
(
chk
.
checked
==
true
)
{
registeredSubjects
[
rs
]
=
chk
;
rs
++
;
}
else
{
var
i
,
j
;
for
(
i
=
0
;
i
<
rs
;
i
++
)
{
if
(
chk
===
registeredSubjects
[
i
])
{
for
(
j
=
i
;
j
<
rs
-
1
;
j
++
)
{
registeredSubjects
[
j
]
=
registeredSubjects
[
j
+
1
];
}
rs
--
;
return
;
}
}
}
}
function
deliverContent
(
api
,
arg
)
{
if
(
arg
==
null
)
{
fetch
(
"/"
+
api
+
"?token="
+
document
.
cookie
)
.
then
(
function
(
response
)
{
response
.
text
().
then
(
function
(
text
)
{
document
.
getElementsByClassName
(
"content"
)[
0
].
innerHTML
=
text
;
});
})
}
else
{
fetch
(
"/"
+
api
+
"?token="
+
document
.
cookie
+
"&arg="
+
arg
)
.
then
(
function
(
response
)
{
response
.
text
().
then
(
function
(
text
)
{
document
.
getElementsByClassName
(
"content"
)[
0
].
innerHTML
=
text
;
});
})
}
}
function
passed
()
{
function
overview
()
{
deliverContent
(
"overview"
,
null
);
}
function
attending
()
{
function
passed
()
{
deliverContent
(
"passed"
,
null
);
}
function
enrolled
()
{
deliverContent
(
"enroll"
,
null
);
}
function
eregister
()
{
deliverContent
(
"eregister"
,
null
);
}
function
cheque
()
{
deliverContent
(
"cheque"
,
null
);
}
function
waitlist
()
{
deliverContent
(
"waitlist"
,
null
);
}
function
registerMarks
()
{
inpt
=
document
.
getElementsByTagName
(
"input"
);
var
args
=
""
;
var
i
=
0
;
for
(
i
=
0
;
i
<
inpt
.
length
-
1
;
i
++
)
{
args
+=
inpt
[
i
].
id
+
"_"
;
args
+=
inpt
[
i
].
value
+
"_"
;
}
args
+=
inpt
[
i
].
id
;
args
+=
inpt
[
i
].
value
;
deliverContent
(
"registermarks"
,
args
);
}
function
changeActivity
(
b
)
{
function
changeActivity
(
s
)
{
var
b
=
document
.
getElementById
(
s
);
if
(
b
.
className
.
includes
(
"is-open"
))
{
b
.
className
=
"spectrum-Accordion-item"
;
}
else
{
...
...
@@ -31,4 +132,9 @@ function changeActivity(b) {
}
}
function
logout
()
{
document
.
cookie
=
null
;
window
.
location
.
replace
(
"/"
);
}
overview
();
\ No newline at end of file
src/main/resources/templates/panel.html
View file @
d60ecbdf
...
...
@@ -27,17 +27,12 @@
<ul
class=
"spectrum-Breadcrumbs"
>
<li
class=
"spectrum-Breadcrumbs-item"
>
<div
class=
"spectrum-Breadcrumbs-itemLink"
role=
"link"
tabindex=
"0"
>
Studentski portal
</div>
<svg
class=
"spectrum-Icon spectrum-UIIcon-ChevronRightSmall spectrum-Breadcrumbs-itemSeparator"
focusable=
"false"
aria-hidden=
"true"
>
<use
xlink:href=
"#spectrum-css-icon-ChevronRightSmall"
></use>
</svg>
</li>
<li
class=
"spectrum-Breadcrumbs-item"
>
<a
class=
"spectrum-Breadcrumbs-itemLink"
role=
"link"
aria-current=
"page"
>
Ispiti
</a>
</li>
</ul>
</nav>
<li
class=
"spectrum-Breadcrumbs-item user-Account"
>
<li
style=
"cursor: pointer;"
onclick=
"logout()"
class=
"spectrum-Breadcrumbs-item user-Account"
>
<div
class=
"spectrum-Breadcrumbs-itemLink"
role=
"link"
tabindex=
"0"
>
Odjava
</div>
<a
class=
"spectrum-Breadcrumbs-itemLink"
role=
"link"
aria-current=
"page"
th:text=
"${name_surname}"
></a>
<svg
focusable=
"false"
aria-hidden=
"true"
class=
"spectrum-Icon spectrum-Icon--sizeM"
>
<use
xlink:href=
"#spectrum-icon-18-User"
></use>
...
...
@@ -45,38 +40,36 @@
</li>
</div>
<div
class=
"panel"
>
<div
class=
"spectrum-Accordion"
role=
"region"
>
<div
onclick=
"changeActivity(this)
"
class=
"spectrum-Accordion-item is-open"
role=
"presentation"
>
<div
id=
"accordion1
"
class=
"spectrum-Accordion-item is-open"
role=
"presentation"
>
<!-- WAI-ARIA 1.1: Item header is a <button> wrapped within a <h3> element, rather than a <div> element with role="tab" -->
<h3
class=
"spectrum-Accordion-itemHeading"
>
<h3
onclick=
"changeActivity('accordion1')"
class=
"spectrum-Accordion-itemHeading"
>
<!-- WAI-ARIA 1.1: Item header <button> uses aria-expanded attribute to indicate expanded state. -->
<button
class=
"spectrum-Accordion-itemHeader"
type=
"button"
id=
"spectrum-accordion-item-0-header"
aria-controls=
"spectrum-accordion-item-0-content"
aria-expanded=
"true"
>
Početna
</button>
<svg
class=
"spectrum-Icon spectrum-UIIcon-ChevronRightMedium spectrum-Accordion-itemIndicator"
focusable=
"false"
aria-hidden=
"true"
>
<use
xlink:href=
"#spectrum-css-icon-ChevronRightMedium"
></use>
</svg>
</h3>
<div
class=
"spectrum-Accordion-itemContent"
role=
"region"
id=
"spectrum-accordion-item-0-content"
aria-labelledby=
"spectrum-accordion-item-0-header"
>
Pregled
</div>
<div
onclick=
"overview()"
class=
"spectrum-Accordion-itemContent"
role=
"region"
id=
"spectrum-accordion-item-0-content"
aria-labelledby=
"spectrum-accordion-item-0-header"
>
Pregled
</div>
</div>
<div
onclick=
"changeActivity(this)
"
class=
"spectrum-Accordion-item"
role=
"presentation"
>
<h3
class=
"spectrum-Accordion-itemHeading"
>
<div
id=
"accordion2
"
class=
"spectrum-Accordion-item"
role=
"presentation"
>
<h3
onclick=
"changeActivity('accordion2')"
class=
"spectrum-Accordion-itemHeading"
>
<button
class=
"spectrum-Accordion-itemHeader"
type=
"button"
id=
"spectrum-accordion-item-1-header"
aria-controls=
"spectrum-accordion-item-1-content"
aria-expanded=
"false"
>
Ispiti
</button>
<svg
class=
"spectrum-Icon spectrum-UIIcon-ChevronRightMedium spectrum-Accordion-itemIndicator"
focusable=
"false"
aria-hidden=
"true"
>
<use
xlink:href=
"#spectrum-css-icon-ChevronRightMedium"
></use>
</svg>
</h3>
<div
onclick=
""
class=
"spectrum-Accordion-itemContent"
role=
"region"
id=
"spectrum-accordion-item-1-content"
aria-labelledby=
"spectrum-accordion-item-1-header"
>
Položeni ispiti
</div>
<div
class=
"spectrum-Accordion-itemContent"
role=
"region"
id=
"spectrum-accordion-item-2-content"
aria-labelledby=
"spectrum-accordion-item-1-header"
>
Upisani predmeti
</div>
<div
onclick=
"
passed()
"
class=
"spectrum-Accordion-itemContent"
role=
"region"
id=
"spectrum-accordion-item-1-content"
aria-labelledby=
"spectrum-accordion-item-1-header"
>
Položeni ispiti
</div>
<div
onclick=
"enrolled()"
class=
"spectrum-Accordion-itemContent"
role=
"region"
id=
"spectrum-accordion-item-2-content"
aria-labelledby=
"spectrum-accordion-item-1-header"
>
Upisani predmeti
</div>
</div>
<div
class=
"spectrum-Accordion-item"
role=
"presentation"
>
<div
onclick=
"eregister()"
class=
"spectrum-Accordion-item"
role=
"presentation"
>
<h3
class=
"spectrum-Accordion-itemHeading"
>
<button
class=
"spectrum-Accordion-itemHeader"
type=
"button"
id=
"spectrum-accordion-item-2-header"
aria-controls=
"spectrum-accordion-item-2-content"
aria-expanded=
"false"
>
E-prijava
</button>
</h3>
</div>
<div
class=
"spectrum-Accordion-item"
role=
"presentation"
>
<div
onclick=
"cheque()"
class=
"spectrum-Accordion-item"
role=
"presentation"
>
<h3
class=
"spectrum-Accordion-itemHeading"
>
<button
class=
"spectrum-Accordion-itemHeader"
type=
"button"
id=
"spectrum-accordion-item-3-header"
aria-controls=
"spectrum-accordion-item-2-content"
aria-expanded=
"false"
>
Popunjavanje uplatnice
</button>
</h3>
...
...
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