<?php
	include "../db_connection/db_connection.php";
	include "../config/config.php";
	
	
if($_GET['ajax_id']==1)
{
	$vals = $_GET['vals'];
	
	
	$SLCT = "SELECT * FROM mas_cour_det WHERE cour_name = '$vals'";
	$QURY = mysqli_query($connect,$SLCT);
	if(mysqli_num_rows($QURY)> 0)
	{
		echo "yes";
	}
	else
	{
		echo "no";
	}
}
else if($_GET['ajax_id']==2)
{
		$design_id = $_GET['design_id'];
		$ids = $_GET['ids'];
		
		if($_GET['statu_s']==1)
		{
			$UPDATE = "UPDATE mas_cour_det SET statu_s = 'inactive',update_dt = '$cur_time' WHERE mas_cour_det_id = '$design_id'";
			//echo $UPDATE;
			$QRY    = mysqli_query($connect,$UPDATE); 
			$statu_s = 2;
			$stss = 'Inactive';
		}
		else if($_GET['statu_s']==2)
		{
			$UPDATE = "UPDATE mas_cour_det SET statu_s = 'Active',update_dt = '$cur_time' WHERE mas_cour_det_id = '$design_id'";
			$QRY    = mysqli_query($connect,$UPDATE); 
			$statu_s = 1;
			$stss = 'Active';
		}
	
	
		echo "<a href='javascript:0;' id='inactlink$ids' onclick='des_act_ina($design_id,$statu_s,$ids)'>".$stss."</a>";
}
?>
		
     
 	
	
	