
		<?php 
error_reporting(0);
session_start();

include_once('../../../db_connect/db.php'); 
if(isset($_SESSION['admin_id'])){

	$admin_id = $_SESSION['admin_id'];
}else{
	$admin_id =0;
}
	$course_id=mysqli_real_escape_string($con,$_POST["course_id"]);
	$title=mysqli_real_escape_string($con,$_POST["title"]);
	$code=mysqli_real_escape_string($con,$_POST["code"]);
	$unit=mysqli_real_escape_string($con,$_POST["unit"]);
	$course_type=mysqli_real_escape_string($con,$_POST["course_type"]);
	$level=mysqli_real_escape_string($con,$_POST["level"]);
	$semester=mysqli_real_escape_string($con,$_POST["semester"]);
	
	 $insert = mysqli_query($con,"UPDATE courses SET modified_by='$admin_id',date_modified=now(),title='$title',code='$code',unit='$unit',course_type='$course_type',level='$level',semester='$semester' WHERE course_id='$course_id'");
                
							if($insert){ 
							
								echo 1; 
								
								
							} else{
								
								echo '<div class="alert alert-danger alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button><strong>Alert!</strong> not updated </div>';
							} 
		 
		 
		 
		 
		?>