Dani Vilardell | aae4e2d | 2020-09-22 17:33:39 +0200 | [diff] [blame] | 1 | |
| 2 | function completaLink() { |
| 3 | if(linkOutput == "") linkOutput = "https://docs.google.com/forms/d/e/1FAIpQLSfT9o287VqLyhwR8LPdloAQWhuqCgA3NfdhgP5vb9_sVQHL-g/viewform"; |
Dani Vilardell | d4f2c90 | 2020-09-23 13:54:19 +0200 | [diff] [blame] | 4 | for (i = 0; i < dataHorarisAlumne.length; i++) { |
Dani Vilardell | 824ec33 | 2020-09-23 16:00:40 +0200 | [diff] [blame] | 5 | var h = dataHorarisAlumne[i].hora[hora_actual.getDay()].split(":"); |
Dani Vilardell | 238a547 | 2020-09-22 18:27:08 +0200 | [diff] [blame] | 6 | console.log(h[0]); |
Dani Vilardell | d4f2c90 | 2020-09-23 13:54:19 +0200 | [diff] [blame] | 7 | console.log((hora_actual.getHours()).toString()); |
Dani Vilardell | 824ec33 | 2020-09-23 16:00:40 +0200 | [diff] [blame] | 8 | var hAct = hora_actual.getHours() - 1; |
Dani Vilardell | d4f2c90 | 2020-09-23 13:54:19 +0200 | [diff] [blame] | 9 | if(hAct < 10) hAct = "0" + hAct; |
| 10 | if(h[0] == hAct) { |
Dani Vilardell | aae4e2d | 2020-09-22 17:33:39 +0200 | [diff] [blame] | 11 | console.log("trobat"); |
Dani Vilardell | d4f2c90 | 2020-09-23 13:54:19 +0200 | [diff] [blame] | 12 | document.getElementById("assignatura").innerHTML = dataHorarisAlumne[i].nom; |
| 13 | document.getElementById("aula").innerHTML = "Aula " + dataHorarisAlumne[i].aula; |
Dani Vilardell | aae4e2d | 2020-09-22 17:33:39 +0200 | [diff] [blame] | 14 | |
| 15 | var datamap=[ |
Dani Vilardell | d4f2c90 | 2020-09-23 13:54:19 +0200 | [diff] [blame] | 16 | "entry.1063142948=" + dataHorarisAlumne[i].aula, |
Dani Vilardell | 238a547 | 2020-09-22 18:27:08 +0200 | [diff] [blame] | 17 | "entry.1749141911=" + ((hora_actual.getHours() - 11).toString()) +":00", |
| 18 | "entry.1827359679=" + ((hora_actual.getHours() - 10).toString()) +":00", |
| 19 | "entry.2115504093=" + getYearFormat() + '-' + getMonthFormat() + '-' + getDayFormat(), |
Dani Vilardell | aae4e2d | 2020-09-22 17:33:39 +0200 | [diff] [blame] | 20 | "entry.1077148310=Columna+" + document.getElementById("seientInput").value |
| 21 | ]; |
Dani Vilardell | d4f2c90 | 2020-09-23 13:54:19 +0200 | [diff] [blame] | 22 | 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 Vilardell | aae4e2d | 2020-09-22 17:33:39 +0200 | [diff] [blame] | 23 | } |
| 24 | } |
Dani Vilardell | 824ec33 | 2020-09-23 16:00:40 +0200 | [diff] [blame] | 25 | } |
| 26 | |
| 27 | function 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 Vilardell | aae4e2d | 2020-09-22 17:33:39 +0200 | [diff] [blame] | 50 | } |