<?php
	//Connects to your Database
	include "../db_connection/db_connection.php";
	include "../config/config.php";		
	    
    foreach($_POST as $key =>$values){
			${$key}	=	$values;
		}
	$country = trim($cat_name);	
	$SLCT_comp = "SELECT * FROM master_country WHERE country_name='$country'";
	$QURY_comp = mysqli_query($connect,$SLCT_comp);
	$res_comp = mysqli_num_rows($QURY_comp);
	if($res_comp==0){

	$country = trim($cat_name);
	$INSRT		= "INSERT INTO master_country(`country_name`,`post_dt`) VALUES ('$country','$cur_time')";
	$QURY		= mysqli_query($connect,$INSRT);
	header('location:../master_country_list.php');	
		
?>
		<?php } else { ?>
		<script type="text/javascript">
		alert("Country Name Already Exists!!!");
		//history.back();
		window.location='../master_country_add.php';
	</script>

	<?php } ?>
		
	
