diff options
Diffstat (limited to 'index.html')
| -rw-r--r-- | index.html | 65 | 
1 files changed, 65 insertions, 0 deletions
| diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae190b0 --- /dev/null +++ b/index.html @@ -0,0 +1,65 @@ +<!DOCTYPE html> +<html lang="en"> +<head> +    <meta charset="utf-8"> +    <meta name="viewport" content="width=device-width,initial-scale=1"> +    <title>Event Calendar</title> +</head> +<body> +<header class="row"> +    <h4 class="col"><a href="https://github.com/vkurko/calendar">Event Calendar</a> Demo</h4> +</header> +<main> +    <table id="myTable"> +        <thead> +          <tr> +            <th>Select</th> +            <th>Vertiefung</th> +            <th>Name</th> +            <th>Dozent</th> +            <th>Sem.</th> +            <th>SWS</th> +            <th>CP</th> +            <th>Tag1</th> +            <th>Start1</th> +            <th>Ende1</th> +            <th>Raum1</th> +            <th>Tag2</th> +            <th>Start2</th> +            <th>Ende2</th> +            <th>Raum2</th>             +          </tr> +        </thead> +        <tbody id="tableBody"></tbody> +      </table> +</main> + +<script type="text/javascript"> +    const courses = [{"Vertiefung": "Elektronik", "Name": "Mikroelektronik", "Dozent": "Beckmann", "Semester": "WS", "SWS": "4", "CP": "5", "Tag1": "Montag", "Startzeit1": "14:00", "Ende1": "15:30", "Raum1": "E6.04", "Tag2": "", "Startzeit2": "", "Ende2": "", "Raum2": ""}, {"Vertiefung": "Energie", "Name": "Erneuerbare Energien", "Dozent": "Schw\u00e4gerl", "Semester": "SS", "SWS": "4", "CP": "5", "Tag1": "Montag", "Startzeit1": "14:00", "Ende1": "17:10", "Raum1": "A3.10", "Tag2": "", "Startzeit2": "", "Ende2": "", "Raum2": ""}, {"Vertiefung": "Autom./Robotik", "Name": "Robot Systems Engineering", "Dozent": "Dietrich", "Semester": "SS", "SWS": "4", "CP": "5", "Tag1": "Mittwoch", "Startzeit1": "11:40", "Ende1": "13:10", "Raum1": "H1.22", "Tag2": "Donnerstag", "Startzeit2": "11:40", "Ende2": "13:10", "Raum2": "H1.22"}, {"Vertiefung": "Elektronik", "Name": "Schaltungstechnik", "Dozent": "Kopystynski", "Semester": "SS", "SWS": "4", "CP": "5", "Tag1": "Montag", "Startzeit1": "11:40", "Ende1": "13:10", "Raum1": "A3.19", "Tag2": "Donnerstag", "Startzeit2": "14:00", "Ende2": "15:30", "Raum2": "A2.15"}]; + +const table = document.getElementById("tableBody"); +courses.map(course=>{ +   let row = table.insertRow(); +   let checkb = row.insertCell(); +   checkb.innerHTML = "<input id=\"" + course.Name + "\" type=checkbox onclick=\"onCheckBoxClicked(event)\">"; +   for (const [key, value] of Object.entries(course)) { +    box = row.insertCell(); +    box.innerHTML = value; +   }; +}); + +function onCheckBoxClicked(e) { +    console.log("clicked", e); +    let listofchecked = []; +    courses.map(course=>{ +        const checkb = document.getElementById(course.Name); +        if (checkb.checked) { +            listofchecked.push(course.Name); +        } +    }); +    console.log(listofchecked); + +} +</script> +</body> +</html> | 
