<?php
	session_start();

	$repName = $_POST['rept1'];
	$repLink = $_POST['rept2'];
	$userlogin = $_SESSION['userloginname'];

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

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

	$sql_s = "SELECT * FROM report_tb where repName='{$repName}' ";
	$result_s = mysql_query($sql_s) or die(mysql_error());
	if (mysql_num_rows($result_s)==0){
		$sql = " INSERT INTO report_tb (repName, repLink, repCreateTime, repCreateBy, repUpdateTime, repUpdateBy)"; 
		$sql .=  " VALUES ('{$repName}', '{$repLink}', NOW(), '{$userlogin}', NOW(), '{$userlogin}')";

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

		echo "Y";

	}else{

		echo "N";
	}



	mysql_close($c);

 ?>
