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

		include_once('../../../db_connect/db.php');
		$course_id = $_POST["token"];

		$sqlmg=mysqli_query($conn_1, "select * from courses where  course_id='$course_id' ") or die(mysqli_error());


									if($sqlmg){
										$sqlmg_row=mysqli_num_rows($sqlmg);
											if($sqlmg_row >0){

												while($row=mysqli_fetch_assoc($sqlmg)){

													$course_id=$row['course_id'];
													$school_id=$row['school_id'];
													$department_id=$row['department_id'];
													$title=$row['title'];
													$code=$row['code'];
													$unit=$row['unit'];
													$course_type=$row['course_type'];
													$level=$row['level'];
													$course_description=$row['course_description'];
													$semester=$row['semester'];
													$date_added=$row['date_added'];
													$course_status=$row['course_status'];


												}
											}
									}

}



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

				<input id="course_id" name="course_id" type="hidden" class="form-control required" value="<?=$course_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="unit" class="col-sm-3 col-form-label text-right">Unit : (*)
				</label>
					<div class="col-sm-9">
						<input id="Unit" name="unit" type="text"
						placeholder="Unit " class="form-control required" value="<?=$unit;?>" required />
					</div>
             </div>

			 <div class="form-group row">
			 <label for="course_type" class="col-sm-3 col-form-label text-right">Type : (*)
			 </label>
			 <div class="col-sm-9">
                               <select name="course_type" class="form-control form-control-lg" required>
									<option value="0">Core/Elective</option>
									<option value="1">Core</option>
									<option value="2">Elective</option>
									</select>
                            </div>
                           </div>

			 <div class="form-group row">
				<label for="level" class="col-sm-3 col-form-label text-right">Level : (*)
				</label>
					<div class="col-sm-9">
						<input id="Level" name="level" type="text"
						placeholder="Level " class="form-control required" value="<?=$level;?>" required />
					</div>
             </div>



			 <div class="form-group row">
			 <label for="semester" class="col-sm-3 col-form-label text-right">Semester : (*)
			 </label>
			 <div class="col-sm-9">
                               <select name="semester" class="form-control form-control-lg" required>
									<option value="0">First/Second</option>
									<option value="1">First Semester</option>
									<option value="2">Second Semester</option>
									</select>
                            </div>
                           </div>

							<div id="button_edit">
							<center>
														<button class="button button-3d button-primary button-rounded btn_3d" type="submit">Update
												</button>
						</div>
             </form>

			 <center>
				<div id="output_error_edit">

				</div>
			</center>
