<?php
if(isset($_POST['token'])){
		
		include_once('../../../db_connect/db.php');
		include_once('functions.php');
		$programme_course_id = $_POST["token"];
		
		$sqlmg=mysqli_query($con, "select * from programmes_courses where  programme_course_id='$programme_course_id' ") or die(mysqli_error());
										
									
									if($sqlmg){
										$sqlmg_row=mysqli_num_rows($sqlmg);
											if($sqlmg_row >0){
												
												while($row=mysqli_fetch_assoc($sqlmg)){				
													
													$programme_course_id=$row['programme_course_id'];
													$school_id=$row['school_id'];
													$department_id=$row['department_id'];
													$programme_id=$row['programme_id'];
													$course_id=$row['course_id'];
													$seen_as_elective=$row['seen_as_elective'];
													$date_added=$row['date_added'];
													$programme_course_status=$row['programme_course_status'];
												
													
												}
											}
									}		
}

?>
<form method="POST" id="edit_form_faculty" >

				<input id="programme_course_id" name="programme_course_id" type="hidden" class="form-control required" value="<?=$programme_course_id;?>" required />
				
				<div class="form-group row">
				<label for="school_id" class="col-sm-3 col-form-label text-right">School : (*)
				</label>
					<div class="col-sm-9">
					
					<select class="form-control select21" id="school_id"
                                                            title="Select School..." name="school_id">
                                                        <option disabled selected>Select School</option>
														<?php
														echo get_all_schools_drop($con,$school_id);
														?>
                                                        
                                                    </select>
					
					</div>
             </div>
			 
			 <div class="form-group row">
				<label for="department_id" class="col-sm-3 col-form-label text-right">Department : (*)
				</label>
					<div class="col-sm-9">
					
					<select class="form-control select21" id="department_id"
                                                            title="Select Department..." name="department_id">
                                                        <option disabled selected>Select Department</option>
														<?php
														echo get_all_departmenta_drop($con,$department_id);
														?>
                                                        
                                                    </select>
					
					</div>
             </div>
			 
			 <div class="form-group row">
				<label for="programme_id" class="col-sm-3 col-form-label text-right">Programme : (*)
				</label>
					<div class="col-sm-9">
					
					<select class="form-control select21" id="programme_id"
                                                            title="Select Programme..." name="programme_id">
                                                        <option disabled selected>Select Programme</option>
														<?php
														echo get_all_programme_drop($con,$programme_id);
														?>
                                                        
                                                    </select>
					
					</div>
             </div>
			 
			 <div class="form-group row">
				<label for="course_id" class="col-sm-3 col-form-label text-right">Course : (*)
				</label>
					<div class="col-sm-9">
						<select class="form-control select21" id="course"
                                                            title="Select Course..." name="course_id">
                                                        <option disabled selected>Select Course</option>
														<?php
														echo get_all_course_drop($con,$course_id);
														?>
                                                        
                                                    </select>
					</div>
             </div>
			 
			 <div class="form-group row">
				<label for="category" class="col-sm-3 col-form-label text-right">Seen As *</label>
                                                <div class="col-sm-9">
                                                    <select class="form-control select21" id="seen_as_elective"
                                                            title="Seen As..." name="seen_as_elective">
                                                        <option disabled selected>Seen As</option>
                                                        <option value="0">Core</option>
                                                        <option value="1">Elective</option>
													</select>
                                                </div>
											</div>
						   
							<div id="button_edit">
							<center>
								<button class="button button-3d button-primary button-rounded btn_3d" type="submit">Update
								</button>
						    </center>			
						</div>
             </form> 
			 
			 <center>
				<div id="output_error_edit">
				
				</div>
			</center>