<?php
include_once '../session/admin-session.php';
include_once '../classes/class_admin.php';
include_once '../classes/validation.php';
include_once '../classes/common.php';
include_once 'read-configration.php';
ob_start();

$ObjDB = new class_db();
$log = new common();
$objadm = new class_admin();
$val = new validation();

$action = $val->ValidateString($_REQUEST["action"]);

if($action=="GetCourseBySem"){
    $SemVal = $_REQUEST['SemVal'];
    
    $currsublist = "c".$SemVal;
    $objadm->res_sem = $currsublist;
    $cur_sub = $objadm->GetcurriculumList();

    $view_option = "<option value=''>Select Course</option>";
    while($row = mysqli_fetch_array($cur_sub)){
        
        	$sub_list = $row["sub_list"];
				$sub_code = $row["sub_code"];
				$sub_title = $row["sub_title"];
				$stu_year = $row["stu_year"];
        
        $view_option .='<option value="'.$sub_list.'$'.$sub_code.'$'.$sub_title.'$'.$stu_year.'">'.$row['sub_code']." - ".$row['sub_title'].'</option>';
    }
    
    echo $view_option;
}
?>