<?php
// Include database connection

include_once "config.php";

//$query = "SELECT st_class,class_id FROM class_name order by class_id  ";

$query = "SELECT distinct(a.st_class) as st_class , b.s_l as class_id
FROM student_list_ju a
INNER JOIN class_list b
ON a.st_class=b.class_name
UNION
SELECT DISTINCT(section), section
FROM teacher_profile GROUP BY section
order by class_id
";

    $result = mysqli_query($link, $query);
         $numRows = mysqli_num_rows($result);
 //echo $numRows; 
 $str = "";
    if ($numRows > 0 ) {
        
			//echo '</br>'.'---'.$date.' '.$nameOfDay.' CLASS ROUTINE'.'---'.'</br></br>';
		    while($row = mysqli_fetch_assoc($result)){
		 	$str .='<div class="form-check">
            <label class="form-check-label" style="color:blue;">
              <input type="checkbox" id="class-name" class="form-check-input"  value="'.$row['class_id'].'">' .$row['st_class'].
            '</label>
          </div>';
        }

        echo $str;
	}else{

		echo 'No Subject Found!';
	}

    






?>
