Commit c40a7baa authored by Stéphane Crozat's avatar Stéphane Crozat
Browse files

Correct quotes in adminFunction (JSON )

parent 09b70f99
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment