Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Stephane Crozat
apisub
Commits
c40a7baa
Commit
c40a7baa
authored
Jan 12, 2021
by
Stéphane Crozat
Browse files
Correct quotes in adminFunction (JSON )
parent
09b70f99
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/views.php
View file @
c40a7baa
...
...
@@ -224,6 +224,12 @@ class Views {
}
}
private
function
prepare
(
$value
,
$comma
=
true
)
{
$v
=
'"'
.
addslashes
(
$value
)
.
'"'
;
if
(
$comma
)
$v
=
$v
.
','
;
return
$v
;
}
public
function
adminFunction
(
$utclogin
,
$mailresp
,
$students
)
{
echo
'<h2>Super-pouvoirs</h2>'
;
// Resp Emails
...
...
@@ -241,7 +247,16 @@ class Views {
echo
'<script src="js/main.js"></script>'
;
echo
'<script>var csvstudents = [["Semaine","Code","Api","Nom","Prénom","Niveau","Mail","Login"],'
;
foreach
(
$students
as
$s
)
{
echo
"["
.
$s
[
week
]
.
","
.
$s
[
normcode
]
.
","
.
$s
[
name
]
.
","
.
$s
[
surname
]
.
","
.
$s
[
firstname
]
.
","
.
$s
[
level
]
.
","
.
$s
[
email
]
.
","
.
$s
[
utclogin
]]
.
","
;
echo
"["
.
$this
->
prepare
(
$s
[
"week"
])
.
$this
->
prepare
(
$s
[
"normcode"
])
.
$this
->
prepare
(
$s
[
"name"
])
.
$this
->
prepare
(
$s
[
"firstname"
])
.
$this
->
prepare
(
$s
[
"surname"
])
.
$this
->
prepare
(
$s
[
"level"
])
.
$this
->
prepare
(
$s
[
"email"
])
.
$this
->
prepare
(
$s
[
"utclogin"
],
false
)
.
"],"
;
}
echo
"];</script>"
;
// Api Menu
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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