<?php
   if (isset($_POST['course'])) {
      

      $cs = $_POST['course'];

      if ( $cs != '') {

          $session = get_current_session($id = 1);
         $sch_id =  get_school_id_by_programme($cs);
         $dept_id = get_department_id_by_programme($cs);
         $q = 1;
        //*/ echo  $sch_id;
        /* echo  $cs . '-----' .$dept_id;

         exit();*/
    
/*
      $q=mysqli_query(dbc(),"UPDATE applicants_nce SET programme_applied_for ='$cs',
                     department_applied_for ='$dept_id', school_applied_for='$sch_id',
                     qualified = '$q'
                     WHERE id='$user_id'") ;*/

      $sql = "UPDATE applicants_nce SET prog_applied_for_change ='$cs', prog_change_status = '0',
              prog_change_date = NOW()
              WHERE id= '$user_id'";

      $q = mysqli_query($sql) ;

      if($q){

          if (isset($_SESSION['course_sugg'])) {
           unset($_SESSION['course_sugg']);
         }

         $msg = 'Course Changed Succesfully';
         header('location:dashboard.php?is='.$msg);

      }else{
         $msg = 'Course Not Changed';
         header('location:dashboard.php?error='.$msg);
      }
      



      }


   

		

   }
		
   
   ?>