<?php
 error_reporting(E_ALL);
 ini_set('display_errors', 1);

 include('../../../config/config.php');

 $classid = $_POST["classid"];
 $campus = $_POST["campus"];
 $term = $_POST["term"];
 $subject = $_POST["subject"];

 $slect_topic_ekene = " SELECT * FROM `curriculumtopic` WHERE `CampusID` = '$campus' AND `SubjectOrCourseID` = '$subject' AND `ClassOrDepartmentID` = '$classid' AND `TermOrSemesterName` = '$term'";
 $ekene_query_link_class = mysqli_query($link, $slect_topic_ekene);
 $ekene_get_details_subject = mysqli_fetch_assoc($ekene_query_link_class);
 $ekene_row_cnt_ekene = mysqli_num_rows($ekene_query_link_class);
 if ($ekene_row_cnt_ekene > 0)
 {
     do{

        $CurriculumTopicID = $ekene_get_details_subject['CurriculumTopicID'];
        $CampusID = $ekene_get_details_subject['CampusID'];
        $SubjectOrCourseID = $ekene_get_details_subject['SubjectOrCourseID'];
        $ClassOrDepartmentID = $ekene_get_details_subject['ClassOrDepartmentID'];
        $TopicName = $ekene_get_details_subject['TopicName'];
        $TermOrSemesterName = $ekene_get_details_subject['TermOrSemesterName'];
       $select_progess_report = " SELECT * FROM `progressreport` WHERE `CurriculumTopicID` = '$CurriculumTopicID' AND `CampusID`= '$CampusID' AND `SubjectOrCourseID` = '$SubjectOrCourseID' 
       AND `ClassOrDepartmentID` = '$ClassOrDepartmentID' AND  `TermOrSemesterName`= '$TermOrSemesterName' AND `TopicName` = '$TopicName'";
        $ekene_query_link_progress = mysqli_query($link, $select_progess_report);
        $ekene_get_details_progress = mysqli_fetch_assoc($ekene_query_link_progress);
        $ekene_row_cnt_progress = mysqli_num_rows($ekene_query_link_progress);
        if ($ekene_row_cnt_progress > 0)
        {
             echo '<div class="card chiPerCardLeft">
             <div class="card-body">
                 <div class="row g-2">
                     <div class="col-12" style="display: flex;">
                         <div class="form-check" style="margin-top: 5px;">
                             <input class="form-check-input" checked  style="height: 20px; width: 20px;" type="checkbox" value="" id="flexCheckIndeterminate">
                         </div>
                         <div style="margin-left: 10px;">
                             <a href="" style="color: #666666; text-decoration: none;">
                                 <strong style="font-size: 13px;color: #d8d8d8; "><s>English Language</s></strong>
                                 <br>
                                 <small style="color: #d8d8d8; font-weight: 600;"><i class="bx bx-time-five"></i>Submitted</small>
                             </a>
                         </div>
                     </div>
                 </div>
             </div>
         </div>
       ';
        }else
        {
       echo '                               <div class="card chiPerCardLeft">
       <div class="card-body">
           <div class="row g-2">
               <div class="col-12" style="display: flex;">
                   <div class="form-check" style="margin-top: 5px;">
                       <input class="form-check-input" checked  style="height: 20px; width: 20px;" type="checkbox" value="" id="flexCheckIndeterminate">
                   </div>
                   <div style="margin-left: 10px;">
                       <a href="" style="color: #666666; text-decoration: none;">
                           <strong style="font-size: 13px;color: #d8d8d8; "><s>mathsiii</s></strong>
                           <br>
                           <small style="color: #d8d8d8; font-weight: 600;"><i class="bx bx-time-five"></i>Submitted</small>
                       </a>
                   </div>
               </div>
           </div>
       </div>
   </div>
 ';
        }


     }while( $ekene_get_details_subject = mysqli_fetch_assoc($ekene_query_link_class));
 }


 ?>