





<?php

        error_reporting(E_ALL);
        ini_set('display_errors', 1);
        include('../../../config/config.php');
        $UserID = $_POST['UserID'];

        $UserType = $_POST['UserType'];
       echo  $studentID = $_POST['studentID'];

        



        $select_studnent = mysqli_query($link,"SELECT * FROM `student` 
        WHERE `StudentID`='$studentID'");

        $select_studnent_cnt  = mysqli_fetch_assoc($select_studnent);
       echo $select_studnent_cnt_row = mysqli_num_rows($select_studnent);

        


        if($select_studnent_cnt_row  > 0)
        {

                            $StudentID =  $select_studnent_cnt['StudentID'];
                            $CampusID =  $select_studnent_cnt['CampusID'];




                            $abba_sql_term = ("SELECT * FROM `termorsemester` INNER JOIN termalias ON termorsemester.TermOrSemesterID=termalias.TermOrSemesterID WHERE CampusID='$CampusID ' ORDER BY termalias.TermOrSemesterID ASC");
                            $abba_result_term = mysqli_query($link, $abba_sql_term);
                            $abba_row_term = mysqli_fetch_assoc($abba_result_term);
                            $abba_row_cnt_term = mysqli_num_rows($abba_result_term);
                            
                            
                        
                            if($abba_row_cnt_term > 0)
                            {
                        
                                do{
                                    if($abba_row_term['status'] == '1')
                                    {
                                        $abba_selected_term = 'selected';
                                    }
                                    else
                                    {
                                        $abba_selected_term = '';
                                    }
                        
                                    echo '<option value="'.$abba_row_term['TermOrSemesterID'].'" '.$abba_selected_term.'>'.$abba_row_term['TermAliasName'].'</option>';
                        
                                }while($abba_row_term = mysqli_fetch_assoc($abba_result_term));
                        
                        
                               
                        
                            }
                            else
                            {
                                echo '<option value="NULL">No Records Found</option>';
                            }


        }else
        {

        }



?>