<?php



//include the headers resources

require_once('includes/functions.php');



if($_REQUEST)

{

	$id 	= db_escape($_REQUEST['value']);
	$id2 	= db_escape($_REQUEST['value1']);
	
	if($_REQUEST['value'] == '2') //if $id = D.E
	{
		$query = "SELECT id as pid, title as programme_title

						  FROM courses

						  WHERE  de_mode = 1 AND real_ = 0

						  ORDER BY programme_title";
	}
	else
	{
		$query = "SELECT id as pid, title as programme_title

						  FROM courses

						  WHERE entry_mode = $id AND real_ = 0

						  ORDER BY programme_title";
	}

	

	$results = mysqli_query(dbc(), $query); ?>
  	
      <?php
  		if(mysqli_num_rows($results) > 0)
		{
			echo '<option value="0"  > --Please Select-- </option>';
           while ($rows = mysqli_fetch_assoc(@$results))
  
			{?>
  
          <option value="<?php echo $rows['pid'];?>"><?php echo $rows['programme_title'];?></option>
  
      <?php
  
			}
			
		}
		else
		{
  		
        
          echo '<option value="0">'.$id.'No courses for such Mode of Entry</option>';
 		}
		  

}

?>



