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

	$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> Faculty not saved sucessfully.
			</div>';
	}

?>