Apresentações
connect_error) { die("Connection failed: " . $conn->connect_error); } $conn->set_charset("utf8"); $sql0 = "SELECT id, name, sequence FROM mdl_course_sections where course=2 and section>0 and visible=1 order by section"; $result0 = $conn->query($sql0); if ($result0->num_rows > 0) { while($row0 = $result0->fetch_assoc()) { echo "
" . $row0["name"] . "
";
$sql2 = "SELECT instance, cm.id atividadeId, m.name moduloNome FROM mdl_course_modules cm INNER JOIN mdl_modules m ON m.id = module " .
"WHERE course=2 AND cm.visible=1 AND cm.deletioninprogress=0 AND section=" . $row0["id"] . " AND m.name IN ('resource','dtmplaylist') ORDER BY FIELD (cm.id, " . $row0["sequence"] . ")";
$result2 = $conn->query($sql2);
if ($result2->num_rows > 0) {
while($row2 = $result2->fetch_assoc()) {
$sql3 = "SELECT name, intro FROM mdl_". $row2["moduloNome"] ." WHERE id=" . $row2["instance"];
$result3 = $conn->query($sql3);
if ($result3->num_rows > 0) {
while($row3 = $result3->fetch_assoc()) {
echo "" . $row3["name"] . "
";
echo "" . $row3["intro"] . "
";
echo "";
}
}
}
}
}
}
$conn->close();
?>