<?php
include_once('../../../db_connect/db.php');
	$faculty_id=mysqli_real_escape_string($con,$_POST["faculty_id"]);
	$title=mysqli_real_escape_string($con,$_POST["title"]);
	$code=mysqli_real_escape_string($con,$_POST["code"]);
	$real_department=mysqli_real_escape_string($con,$_POST["real_department"]);
	$email=mysqli_real_escape_string($con,$_POST["email"]);
	$phone_contacts=mysqli_real_escape_string($con,$_POST["phone_contacts"]);
	
	$insert="INSERT INTO departments(faculty_id,title,code,real_department,email,phone_contacts)
					VALUES('$faculty_id','$title','$code','$real_department','$email','$phone_contacts')";

	$sql_insert=mysqli_query($con,$insert) or die(mysqli_error());
	if($sql_insert){

		echo 1;

	}else{
		echo $error='<div class="alert alert-success alert-dismissible" role="alert">
			 <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
			 <strong>Aert!</strong> Department not saved sucessfully.
			</div>';
	}

?>