<?php
session_start();
include('connect.php');
error_reporting(0);

if(isset($_POST["ccampusmid"]) && !empty($_POST["ccampusmid"])){
    //Get all state data
	$campusmid=$_POST['ccampusmid'];
	$_SESSION['selectedcampusmid']=$_POST['ccampusmid'];
	$selectedcountrymid=$_SESSION['selectedcountrymid'];
	 $eve="SELECT coursemid,coursename FROM res_coursename_master,res_course_master WHERE res_coursename_master.cnmid=res_course_master.cnmid and res_course_master.campusmid = $campusmid";
	$re = mysqli_query($conn, $eve);

    //Count total number of rows
    if(mysqli_num_rows($re) > 0)
	{
		echo '<option value="0">Select</option>';
        while($rt = mysqli_fetch_assoc($re))
		{
			/* $coursemid=$rt['coursemid'];
			$_SESSION['selectedcourse']=$coursemid; */
			$coursemid=$rt['coursemid'];
			
			$coursename=$rt['coursename'];
			
            echo '<option value="'.$coursemid.'">'.$coursename.'</option>';
        }
    }else{
        echo '<option value="0">Select </option>';
    }
}
?>
