<?php
session_start();
include_once("config.php");
$_SESSION['PCD_Login_Error']="";
if(!isset($_SESSION['seas_user_id'])) $_SESSION['seas_user_id']=0;
if($_SESSION['seas_user_id'] <=0) {
	$_SESSION['PCD_page_ref']="report.php";
	header("location:login.php");
}



if(isset($_REQUEST['save_btn'])) {
	$txt_target = $_REQUEST['txt_target'];	
	$tar  = $_REQUEST['trg_id'];	
	
	if(strlen(trim($txt_target))>0) {
		if($tar>0) {
			$inssql = 'update seas_brd_target set tar_desc="'. $txt_target. '" where tar_id ='.  $tar;
			mysql_query($inssql);
			
			if(strlen(mysql_error()) <=0) {
				echo "<script>"	;
				//echo 'opener.location.href = opener.location.href + "?tarid='. $tar .'"';
				echo 'opener.location.href = "managetarget.php?tarid='. $tar .'";';
				//echo 'opener.location.reload();';
				echo "window.close()";
				echo "</script>";
			}
		}
	}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Add New Variable</title>
<style type="text/css">
.tbl_cell {
	font-family:Verdana, Geneva, sans-serif;
	font-size:11px;
	font-weight:100;
	color:#000;
	text-decoration: none;
}
.tbl_cell_hdr {
	font-family:Verdana, Geneva, sans-serif;
	font-size:11px;
	color:#000;
	font-weight:bold;
}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color:#999999;
}
</style>

</head>

<body>
<form id="form1" name="form1" method="post" action="">
  <table width="100%" border="0" cellspacing="0" cellpadding="5">
    <tr>
      <td width="50%" height="32" valign="bottom" bgcolor="#CCCCCC" class="tbl_cell_hdr">Target Description</td>
    </tr>
    <tr>
      <td height="30" valign="top" bgcolor="#CCCCCC">
        <input type="text" name="txt_target" id="txt_target" value="<?php echo $_REQUEST['tardesc']; ?>" />        <?php
		?>
        </td>
    </tr>
    <tr>
      <td valign="middle" bgcolor="#999999"><input type="submit" name="save_btn" id="save_btn" value="Save" />
      <input type="text" name="trg_id" id="trg_id" hidden="hidden"  value="<?php echo $_REQUEST['tarid'];  ?>" />        <div id="red"> </div></td>
    </tr>
  </table>
</form>
</body>
</html>
