<?php
	include "../db_connection/db_connection.php";
	include "../config/config.php";	
	
	$pg_id  = $_GET['pg_id'];
?>
	
<?php
	if($pg_id==1)
	{
		$remarks_desc = $_GET['remarks_desc'];
	
		$SLCT	=	"SELECT master_cad_remarks_id FROM master_cad_remarks WHERE description='$remarks_desc'";
		$QRY	=	mysqli_query($connect,$SLCT);
		if(mysqli_num_rows($QRY)>0)
		{
			echo "1";
		}
		else
		{
			echo "2";
		}		
	}
	else if($pg_id==2)
	{
		$remarks_id = $_GET['remarks_id'];
		$ids = $_GET['ids'];
		
		if($_GET['statu_s']==1)
		{
			$UPDATE = "UPDATE master_cad_remarks SET statu_s = 'inactive',update_dt = '$cur_time' WHERE mas_cour_det_id = '$remarks_id'";
			//echo $UPDATE;
			$QRY    = mysqli_query($connect,$UPDATE); 
			$statu_s = 2;
			$stss = 'Inactive';
		}
		else if($_GET['statu_s']==2)
		{
			$UPDATE = "UPDATE master_cad_remarks SET statu_s = 'active',update_dt = '$cur_time' WHERE mas_cour_det_id = '$remarks_id'";
			$QRY    = mysqli_query($connect,$UPDATE); 
			$statu_s = 1;
			$stss = 'Active';
		}
		echo "<a href='javascript:0;' id='inactlink$ids' onclick='des_act_ina($remarks_id,$statu_s,$ids)'>".$stss."</a>";
	}
?>
   