<?php


            include("../../../config/config.php");
            
            
            $campus = $_POST["campus"];
            $institution = $_POST["institution"];
            $userID = $_POST["userID"];
            $usertype = $_POST["usertype"];
            
            
            if($usertype == 'teacher')
            {
                
                      $prosgetsubjectteacheclass = mysqli_query($link,"SELECT * FROM `courseorsubjectallocation` INNER JOIN `classordepartment` ON `courseorsubjectallocation`.`ClassOrDepartmentID` = `classordepartment`.`ClassOrDepartmentID` WHERE
                  `courseorsubjectallocation`.`CourseOrSubjectTeacherUserID`='$userID' AND `courseorsubjectallocation`.`CampusID`='$campus'  GROUP BY `classordepartment`.`ClassOrDepartmentName`, `classordepartment`.`CampusID`");
                    
            }else
            {
                

                  $prosgetsubjectteacheclass = mysqli_query($link,"SELECT * FROM `classordepartmentstudentallocation` INNER JOIN `classordepartment` ON `classordepartmentstudentallocation`.`ClassOrDepartmentID` = `classordepartment`.`ClassOrDepartmentID` 
                  INNER JOIN `section` ON `classordepartment`.`SectionID` = `section`.`SectionID`
                  WHERE `classordepartment`.`CampusID`='$campus' GROUP BY `classordepartment`.`ClassOrDepartmentName`, `classordepartment`.`CampusID`");

            }
            
           
        
                 $prosgetsubjectteacheclassrowcnt = mysqli_num_rows($prosgetsubjectteacheclass);
                 $prosgetsubjectteacheclassrow = mysqli_fetch_assoc($prosgetsubjectteacheclass);
                     
                 if($prosgetsubjectteacheclassrowcnt > 0)
                 {
                    
                     
                     do{
                         
                         
                             $ClassOrDepartmentNamesubject_teacher = $prosgetsubjectteacheclassrow['ClassOrDepartmentName'];
                             $ClassOrDepartmentIDsubject_teacher = $prosgetsubjectteacheclassrow['ClassOrDepartmentID'];
                             
                              $prosclass_shortend = substr($ClassOrDepartmentNamesubject_teacher, 0, 6);
                              
                             
                             echo '<option value="'.$ClassOrDepartmentIDsubject_teacher.'">'.$prosclass_shortend.'</option>';
                         
                         
                         
                     }while($prosgetsubjectteacheclassrow = mysqli_fetch_assoc($prosgetsubjectteacheclass));
                     
                     
                     
                 }else
                 {
                     
                 }
                     
        
											            
											  
            
            
            
            
            
                        


?>