<?php
	session_start();

	$reportid = $_POST['uid1'];
	$groupid = $_POST['uid2'];
	$userlogin = $_SESSION['userloginname'];

	//echo "{$userid},{$groupid},{$userlogin}";

	include "../../../Connections/connect_mysql.php";
	//mysql_query("set names utf8");

	$sql_s = "SELECT * FROM groupreport_tb where groprpRepID={$groupid} and groprpGTeamID={$reportid}  ";
	$result_s = mysql_query($sql_s) or die(mysql_error());
	if (mysql_num_rows($result_s)==0){
		$sql = " INSERT INTO groupreport_tb (groprpRepID, groprpGTeamID, groprpCreateTime, groprpCreateBy, groprpUpdateTime, groprpUpdateBy)"; 
		$sql .=  " VALUES ({$groupid}, {$reportid}, NOW(), '{$userlogin}', NOW(), '{$userlogin}')";

		$result = mysql_query($sql) or die(mysql_error());

		echo "Y";

	}else{

		echo "N";
	}



	mysql_close($c);

 ?>
