blob: 253600089559da6f56796e3048a0dffdd3187d6f [file] [log] [blame]
Dani Vilardellaae4e2d2020-09-22 17:33:39 +02001
2function completaLink() {
3 if(linkOutput == "") linkOutput = "https://docs.google.com/forms/d/e/1FAIpQLSfT9o287VqLyhwR8LPdloAQWhuqCgA3NfdhgP5vb9_sVQHL-g/viewform";
Dani Vilardelld4f2c902020-09-23 13:54:19 +02004 for (i = 0; i < dataHorarisAlumne.length; i++) {
Dani Vilardell824ec332020-09-23 16:00:40 +02005 var h = dataHorarisAlumne[i].hora[hora_actual.getDay()].split(":");
Dani Vilardell238a5472020-09-22 18:27:08 +02006 console.log(h[0]);
Dani Vilardelld4f2c902020-09-23 13:54:19 +02007 console.log((hora_actual.getHours()).toString());
Dani Vilardell824ec332020-09-23 16:00:40 +02008 var hAct = hora_actual.getHours() - 1;
Dani Vilardelld4f2c902020-09-23 13:54:19 +02009 if(hAct < 10) hAct = "0" + hAct;
10 if(h[0] == hAct) {
Dani Vilardellaae4e2d2020-09-22 17:33:39 +020011 console.log("trobat");
Dani Vilardelld4f2c902020-09-23 13:54:19 +020012 document.getElementById("assignatura").innerHTML = dataHorarisAlumne[i].nom;
13 document.getElementById("aula").innerHTML = "Aula " + dataHorarisAlumne[i].aula;
Dani Vilardellaae4e2d2020-09-22 17:33:39 +020014
15 var datamap=[
Dani Vilardelld4f2c902020-09-23 13:54:19 +020016 "entry.1063142948=" + dataHorarisAlumne[i].aula,
Dani Vilardell238a5472020-09-22 18:27:08 +020017 "entry.1749141911=" + ((hora_actual.getHours() - 11).toString()) +":00",
18 "entry.1827359679=" + ((hora_actual.getHours() - 10).toString()) +":00",
19 "entry.2115504093=" + getYearFormat() + '-' + getMonthFormat() + '-' + getDayFormat(),
Dani Vilardellaae4e2d2020-09-22 17:33:39 +020020 "entry.1077148310=Columna+" + document.getElementById("seientInput").value
21 ];
Dani Vilardelld4f2c902020-09-23 13:54:19 +020022 window.location.href = linkOutput + "?"+ datamap[1] + "&" + datamap[2] + "&" + datamap[3] + "&" + datamap[0] + "&" + datamap[4] + "&entry." + codisFiles[document.getElementById("seientInput").value.toUpperCase().charCodeAt(0) - 65] + "=Columna+" + document.getElementById("seientInput").value.charAt(1) + "&entry.1600275159=[Autogenerat+per+delefme/covid-tracability]";
Dani Vilardellaae4e2d2020-09-22 17:33:39 +020023 }
24 }
Dani Vilardell824ec332020-09-23 16:00:40 +020025}
26
27function completaLinkNoAnatClasse() {
28 if(linkOutput == "") linkOutput = "https://docs.google.com/forms/d/e/1FAIpQLSfT9o287VqLyhwR8LPdloAQWhuqCgA3NfdhgP5vb9_sVQHL-g/viewform";
29 for (i = 0; i < dataHorarisAlumne.length; i++) {
30 var h = dataHorarisAlumne[i].hora[hora_actual.getDay()].split(":");
31 console.log(h[0]);
32 console.log((hora_actual.getHours()).toString());
33 var hAct = hora_actual.getHours() - 1;
34 if(hAct < 10) hAct = "0" + hAct;
35 if(h[0] == hAct) {
36 console.log("trobat");
37 document.getElementById("assignatura").innerHTML = dataHorarisAlumne[i].nom;
38 document.getElementById("aula").innerHTML = "Aula " + dataHorarisAlumne[i].aula;
39
40 var datamap=[
41 "entry.1063142948=" + dataHorarisAlumne[i].aula,
42 "entry.1749141911=" + ((hora_actual.getHours() - 11).toString()) +":00",
43 "entry.1827359679=" + ((hora_actual.getHours() - 10).toString()) +":00",
44 "entry.2115504093=" + getYearFormat() + '-' + getMonthFormat() + '-' + getDayFormat(),
45 "entry.1077148310=Columna+" + document.getElementById("seientInput").value
46 ];
47 window.location.href = linkOutput + "?"+ datamap[1] + "&" + datamap[2] + "&" + datamap[3] + "&" + datamap[0] + "&entry." + codisFiles[document.getElementById("seientInput").value.toUpperCase().charCodeAt(0) - 65] + "=Columna+" + document.getElementById("seientInput").value.charAt(1) + "&entry.1600275159=___No_he_assistit_a_aquesta_classe___[Autogenerat+per+delefme/covid-tracability]";
48 }
49 }
Dani Vilardellaae4e2d2020-09-22 17:33:39 +020050}