<%@page import = "java.lang.*,java.util.*, ibase.utility.*, java.io.* , ibase.webitm.utility.ITMException"%>

<jsp:useBean id="MilestonePayGen" class="ibase.webitm.ejb.fin.MilestonePayGen" scope="session"></jsp:useBean>

<%
    HashMap<String,String> chgMap = new HashMap<String,String>();
	System.out.println("@@@@@@@@@ In MilestonePayGen.jsp @@@@@@@@@@@@@@@@");
	System.out.println("request.getParameter(\"SAVE_SAMPLE_DATA\") "+request.getParameter("SAVE_SAMPLE_DATA"));
	
	ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean)request.getSession().getAttribute("USER_INFO"); 
	String chgUser = userInfo.getLoginCode(); 
	String chgTerm = request.getRemoteHost();
	String loginEmpCode= userInfo.getEmpCode();
	System.out.println("loginEmpCode :"+loginEmpCode);
	System.out.println("chgUser["+ chgUser + "] chgTerm["+ chgTerm +"]" );

	chgUser=chgUser==null ? "":chgUser.trim();
	chgTerm=chgTerm==null ? "":chgTerm.trim();
	loginEmpCode=loginEmpCode==null ? "":loginEmpCode.trim();
	
	chgMap.put("chg_user",chgUser);
	chgMap.put("chg_term",chgTerm);
	chgMap.put("login_emp_code",loginEmpCode);
	
	
	
	String saveSampleData = ( String ) request.getParameter("SAVE_SAMPLE_DATA");
	System.out.println("@@@@@@@@@@@@saveSampleData["+saveSampleData+"]");
	
	String msg = MilestonePayGen.getXmlData(saveSampleData,chgMap);
	
	System.out.println("@@@@@@@@@@@@complete--------------");
	System.out.println("@@@@@@@@@@@@msg--------------"+msg);
	
	if (msg.indexOf("Success") > -1)
	{
		System.out.println("@@CLOSE WINDOW---!----");
		
	%>	
		<script type="text/javascript">
		//parent.window.close();
		//this.window.close();
		
		alert("Transcation Saved Successfully");
		window.close();
		</script>

	<%}
	else
	{%>
	<script type="text/javascript">
		//parent.window.close();
		//this.window.close();
		
		alert("Transcation Failed");
		window.close();
		</script>
	
	<%	
	}
	%>


