#myTable {font-family: Signika, Helvetica, sans-serif; border-collapse: collapse;max-width: 100%; margin:0; width:90%; margin-left:5%;} #myTable td, #myTable th { border: 1px solid #ddd; padding: 8px;} #myTable tr:nth-child(even){background-color: #f2f2f2;} #myTable tr:hover {background-color: #ddd;} #myTable th { padding-top: 12px; padding-bottom: 12px; text-align: left;background-color: #4A7C38 ;color: white;text-align: center;cursor:pointer;} .btnpo {font-size:small;} select {width:50%;}
get_results($sql2); foreach( $res2 as $resu2 ) { $title = $resu2->post_title; $ide= $resu2->ID; echo ''.$title.''; } ?>
get_results($sql2); foreach( $res2 as $resu2 ) { $c = $resu2->cours; $parent_lesson_id = learndash_get_setting( $c, 'lesson' ); $parent_course_id = learndash_get_setting( $c, 'course' ); if ($parent_course_id == $cursus){ $title_pl = get_post($parent_lesson_id )->post_title; $title_pc = get_post($parent_course_id )->post_title; $array[] .= $c; $cs= get_post($c)->post_title; echo ''.$title_pc.' - '.$cs.' ('.$title_pl.')'; } } ?>
<?php echo ''; $arraychap = array(); $cptt =0; $tempst = 0; $nbr = 0; $alert = "educhap"; $sql = "SELECT * FROM $alert WHERE cours = $chap"; $res = $wpdb->get_results($sql); foreach( $res as $resu2 ) { $cours = $resu2->cours; $id = $resu2->id; $parent_lesson_id = learndash_get_setting( $cours, 'lesson' ); $parent_course_id = learndash_get_setting( $cours, 'course' ); if ($parent_course_id == $curs){ $title_pl = get_post($parent_lesson_id )->post_title; $title_pc = get_post($parent_course_id )->post_title; $code = $resu2->code; $ide = $resu2->ide; $cours= get_post($cours)->post_title; $cpt = $resu2->cpt; $temps = $resu2->temps; $scroll = $resu2->scroll; $month = $resu2->month; echo ''; $cptt = $cptt + $cpt; $tempst = $tempst + $temps; $nbr++; } } echo ''; echo '
CoursCPTTempsScrollMonth
'.$cours.''.$cpt.''.$temps.''.$scroll.''.$month.'
TOTAL : '.$nbr.''.$cptt.''.$tempst.'
'; } ?> var menu = document.getElementById("menu"); var url = "https://educawa.com/tableau-test/?chap="; menu.onchange = function() { window.open( url + this.options[this.selectedIndex].id, '_self'); }; var menu2 = document.getElementById("menu2"); var loc = window.location.href; var url2 = loc+"&curs="; menu2.onchange = function() { window.open( url2 + this.options[this.selectedIndex].id, '_self'); }; function search() { // Declare variables var input = document.getElementById("myInput"); var filter = input.value.toUpperCase(); var table = document.getElementById("myTable"); var trs = table.tBodies[0].getElementsByTagName("tr"); document.getElementById("alerte").innerHTML = ""; // Loop through first tbody's rows for (var i = 1; i < trs.length; i++) { // define the row's cells var tds = trs[i].getElementsByTagName("td"); // hide the row trs[i].style.display = "none"; // loop through row cells for (var i2 = 0; i2 -1) { // show the row trs[i].style.display = ""; // skip to the next row continue; } } } } function add(s) { var input = document.getElementById("myInput"); input.value = s; search(); } var table = document.getElementById("myTable"); var totalRowCount = table.rows.length; if (totalRowCount <=1) { document.getElementById("alerte").innerHTML = totalRowCount+" résultat"; } else { document.getElementById("alerte").innerHTML = totalRowCount+" résultats"; } function sortTable(n) { var table, rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0; table = document.getElementById("myTable"); switching = true; // Set the sorting direction to ascending: dir = "asc"; /* Make a loop that will continue until no switching has been done: */ while (switching) { // Start by saying: no switching is done: switching = false; rows = table.rows; /* Loop through all table rows (except the first, which contains table headers): */ for (i = 1; i y.innerHTML.toLowerCase()) { // If so, mark as a switch and break the loop: shouldSwitch = true; break; } } else if (dir == "desc") { if (x.innerHTML.toLowerCase() < y.innerHTML.toLowerCase()) { // If so, mark as a switch and break the loop: shouldSwitch = true; break; } } } if (shouldSwitch) { /* If a switch has been marked, make the switch and mark that a switch has been done: */ rows[i].parentNode.insertBefore(rows[i + 1], rows[i]); switching = true; // Each time a switch is done, increase this count by 1: switchcount ++; } else { /* If no switching has been done AND the direction is "asc", set the direction to "desc" and run the while loop again. */ if (switchcount == 0 && dir == "asc") { dir = "desc"; switching = true; } } } }