<?php



//include the headers resources

require_once('includes/functions.php');







if($_REQUEST)

{

	$id 	= $_REQUEST['value'];
	$id2 	= $_REQUEST['value1'];
	//$id3 	= $_REQUEST['value2']; //programme type
	
	//when NCE, PRENCE
	$md = '';
	if ($id2 == '1' || $id2 == '2' ) {
		$md = '1';
	}else{
		$md = '2';
		//when NCE LVSP
		if ($id2  == '4' ) {
			$id2= '2'; //same as NCE reg
		}
	}

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

						  FROM programmes p

						  WHERE 

						  p.department_id = '$id'
						  AND p.type_id = '$id2'
						  AND p.mode = '$md'
						  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 School or programme type</option>
          
          
          
          <?php
		  
		}
		  ?>
      </select>	
      <div class="input-group-addon"><span class="ast">*</span></div>
                                    
   </div> 
	


<?php	

}

?>



