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

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

				<input id="programme_id" name="programme_id" type="hidden" class="form-control required" value="<?=$programme_id;?>" required />
				
				<div class="form-group row">
				<label for="title" class="col-sm-3 col-form-label text-right">Title : (*)
				</label>
					<div class="col-sm-9">
						<input id="title" name="title" type="text"
						placeholder="Title " class="form-control required" value="<?=$title;?>" required />
					</div>
             </div>
			 
			 <div class="form-group row">
				<label for="code" class="col-sm-3 col-form-label text-right">Code : (*)
				</label>
					<div class="col-sm-9">
						<input id="code" name="code" type="text"
						placeholder="Code " class="form-control required" value="<?=$code;?>" required />
					</div>
             </div>
			 
			 <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="faculty_id" class="col-sm-3 col-form-label text-right">Faculty : (*)
				</label>
					<div class="col-sm-9">
					
					<select class="form-control select21" id="faculty_id"
                                                            title="Select Faculty..." name="faculty_id">
                                                        <option disabled selected>Select Faculty</option>
														<?php
														echo get_all_faculty_drop($con,$faculty_id);
														?>
                                                        
                                                    </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>