관리-도구
편집 파일: view_student.php
<?php $funnel = $this->app_loader->loadFunnel(); $optins_ob = $this->app_loader->loadMember(); global $mysqli; $main_screen_ob = $this->load('course_control'); $cirtificate_ob = $this->load('cirtificate_manager'); $student_id = 0; $funnel_id = 0; $course_id = 0; if (isset($_GET['student_id'])) { $student_id = $_GET['student_id']; } if (isset($_GET['course_id'])) { $course_id = $_GET['course_id']; } if (isset($_GET['funnel_id'])) { $funnel_id = $_GET['funnel_id']; } $courses = $optins_ob->getCourseDetails($student_id, $funnel_id, $course_id); $members = $courses['student']; $course = $courses['courses']; if (isset($_POST['export_cert_for_down'])) { if (isset($_POST['export_cert_for_share'])) { $GLOBALS['export_cert_for_share'] = $_POST; } $GLOBALS['cf_post_cert_data'] = $_POST; $_POST = array(); $_SERVER['REQUEST_METHOD'] = 'GET'; if (isset($_GET['course_id'])) { $course_id = $mysqli->real_escape_string($_GET['course_id']); $cirtificate_ob->export($_GET['funnel_id'], $course_id); $mdata = get_member($_GET['student_id']); ob_start(); $main_screen_ob->getMainScreeUI($course_id, $mdata, $question_ob, $quiz_stud_ob, $lecture_ob, $assign_stud_ob, $assignment_ob, "s"); $course_data = ob_get_clean(); if (strpos($content, '{@-course-@}') !== false) { $content = str_replace('{@-course-@}', $course_data, $content); } else { $content .= $course_data; } } } ?> <style> .sub_button { border: 0px; } .fab { padding: 5px; font-size: 50px; width: 60px; text-align: center; text-decoration: none; margin: 5px 2px; } .fab:hover { opacity: 0.7; } .fa-facebook { background: #3B5998; color: white; } .fa-twitter { background: #55ACEE; color: white; } .fa-linkedin { background: #007bb5; color: white; } .fa-google { background: #dd4b39; color: white; } .fa-instagram { background: #125688; color: white; } .fa-telegram { background: #45bbff; color: white; } </style> <div class="container-fluid view-student"> <div class="card card-top-header"> <div class="card-header d-flex justify-content-between text-dark"> <h4><?= $members->name; ?> <br /> <span style="font-size: 14px">Email: <span style="color:#e57b00"><?= $members->email; ?></span></span> </h4> <h4>Track Course Report <br /> <div class="text-right"> <?php if ($funnel_id) : ?> <a style="font-size: 14px" href="index.php?page=members&student_id=<?= $members->id; ?>&funnelid=<?= $funnel_id; ?>"><i class="fas fa-arrow-left"></i> Go Back</a> <?php else : ?> <a style="font-size: 14px" href="index.php?page=members&student_id=<?= $members->id; ?>&course_id=<?= $course[0]->id; ?>"><i class="fas fa-arrow-left"></i> Go Back</a> <?php endif; ?> </div> </h4> </div> <div class="card-body"> <div id="accordion"> <?php if (count($courses['courses']) > 0) { $count = 1; foreach ($courses['courses'] as $course) { $all_contents = $optins_ob->getCourseContent($course->id); $course_progress = $optins_ob->getCourseProgress($course->id, $student_id); ?> <div class="card card-courses"> <div class="card-header d-flex justify-content-between "> <h5><span class="text-dark courses-title">Course Name: </span> <a class="card-link courses-description" data-bs-toggle="collapse" href="#collapse<?= $count; ?>"> <?php echo $course->title; ?></a> </h5> <h5><span class="text-dark courses-title">Registerd On: </span> <span class="card-link courses-description"> <?php echo date('d-m-Y', $course->createdon); ?></span> </h5> </div> <?php if ($course_progress >= 100) { ?> <div class="card-header d-flex justify-content-between "> <h5> <form method="post" action="" id="certificate-form"> <span class="text-dark courses-title">Course Certificate: </span> <input type="hidden" name="export_cert_for_down" id="export-cert-date" /> <button type="submit" class="btn btn-primary btn-sm text-white"><i class="fas fa-certificate"></i> Download Certificate </button> </form> </h5> </div> <?php } ?> <div id="collapse<?= $count; ?>" class="collapse show" data-parent="#accordion"> <div class="card-body p-0"> <div class="d-flex p-3 justify-content-between"><span><span class="text-primary fw6">Course Id: </span> <?= $course->productid ?> </span> <span> <span class="text-primary fw6">Course Level: </span> <?php if ($course->level == "INT") { echo " Intermediate"; } else if ($course->level == "BEG") { echo " Beginner"; } else if ($course->level == "EXP") { echo " Expert"; } else { echo " ALL"; } ?> </span> <span><span class="text-primary fw6">Course Type: </span> <?php if ($course->course_type == "f") { echo "Free"; } else { if (!empty($course->price)) { echo $course->price . " " . $course->currency; } else { echo "Free"; } } ?> </span> <span><span class="text-primary fw6"> Progress:</span> <span><?php echo number_format((float)$course_progress, 2, '.', ''); ?></span> </span> </div> <hr /> <div class="p-3"> <?php $j = 0; $k = 0; if (count((array)$all_contents) <= 0) echo '<div class="alert alert-info">Not Content Available</div>'; foreach ($all_contents as $section) { $k++; ?> <div id="accordion"> <div class="card course-sec"> <div class="card-header border-0" id="heading<?= $section['id']; ?>"> <h4 class="mb-0 fw7"> <button class="btn btn-link" data-bs-toggle="collapse" data-bs-target="#collapseSec<?= $section['id']; ?>" aria-expanded="true" aria-controls="collapseOne"> <span class="text-dark fw6">Section <?= $k; ?>.</span> <span class="fw6"><?= $section['title']; ?></span> </button> </h4> </div> <div class="card-body p-0 collapse show" id="collapseOne<?= $section['id']; ?>" aria-labelledby="heading<?= $section['id']; ?>"> <table class="table table-striped text-left"> <thead> <tr> <th>Sr. No.</th> <th>Content Type</th> <th>Title</th> <th>Completed</th> <th>Completion Date</th> </tr> </thead> <tbody> <?php if (count($section['content']) > 0) { ?> <?php foreach ($section['content'] as $contents) { $j++; $progress = $optins_ob->getProgress($course->id, $student_id, $contents->id); ?> <tr> <td><?= $j ?></td> <td> <?php if ($contents->option_type == "lecture") { echo "Lecture"; } elseif ($contents->option_type == "assign") { echo "Assignment"; } elseif ($contents->option_type == "quiz") { echo "Quiz"; } elseif ($contents->option_type == "test") { echo "Test"; } ?> </td> <td><?= $contents->title ?></td> <?php if ($progress) { if ($progress->progress == 1) { echo "<td><i class='fas fa-check text-success'></i></td>"; } else if ($progress->progress == 0) { echo "<td><i class='fas text-danger fa-times '></i></td>"; } echo "<td>" . $progress->created_at . "</td>"; } else { echo "<td><i class='fas fa-times text-danger'></i></td><td>N/A</td>"; } ?> </tr> <?php } } ?> </tbody> </table> <ul> </ul> </div> </div> </div> <?php } ?> </div> </div> </div> </div> <?php $count++; } } ?> </div> </div> </div> </div> <script> function cfCourseGetBroswerDate() { var d = new Date(); var n = d.toLocaleString(); return n; } document.getElementById('export-cert-date').value = cfCourseGetBroswerDate(); </script>