<?php
	session_start();

	$GroupName = $_POST['ugup1'];
	$userlogin = $_SESSION['userloginname'];

	//echo "{$dpmcode},{$dpmname},{$userlogin}";

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

	$sql_s = "SELECT * FROM group_tb where GroupName='{$GroupName}' ";
	$result_s = mysql_query($sql_s) or die(mysql_error());
	if (mysql_num_rows($result_s)==0){
		$sql = " INSERT INTO group_tb (GroupName, GroupCreateTime, GroupCreateBy, GroupUpdateTime, GroupUpdateBy)"; 
		$sql .=  " VALUES ('{$GroupName}', NOW(), '{$userlogin}', NOW(), '{$userlogin}')";

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

		echo "Y";

	}else{

		echo "N";
	}



	mysql_close($c);

 ?>
