<?php



//include the headers resources

require_once('includes/functions.php');







if($_REQUEST)

{

	$id 	= $_REQUEST['value'];
	$id2 	= $_REQUEST['value1'];
	//$id3 	= $_REQUEST['value2']; //programme type

	$query = "SELECT p.id as pid,p.type_id, p.title as programme_title, p.department_id 

						  FROM programmes p

						  

						  WHERE 

						  p.department_id = '$id'
						  AND p.type_id = '$id2'
						  AND status = '0'

						  

						  ORDER BY programme_title";

	$results = mysql_query($query);?>

	<label  for="sub_programme_id">Programme</label>
    <div class="input-group">
      <select   name="programme"  id="sub_programme_id" class="form-control input-sm">
  
      <option value="">--Choose Programme --</option>
  
      <?php
  		if(mysql_num_rows($results))
		{
           while ($rows = mysql_fetch_assoc(@$results))
  
			{?>
  
          <option value="<?php echo $rows['pid'];?>"><?php echo $rows['programme_title'];?></option>
  
      <?php
  
			}
			
		}
		else
		{?>
  		
        
          <option value="0">No programmes for such department or programme type</option>
          
          
          
          <?php
		  
		}
		  ?>
      </select>	
      <div class="input-group-addon"><span class="ast">*</span></div>
                                    
   </div> 
	


<?php	

}

?>



