Commit 00fe9f6f authored by dkasliwal's avatar dkasliwal

add web component in sfa module-resource folder


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@103044 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7911be92
<%@ page contentType="text/html"%>
<%@ page
import="javax.xml.parsers.DocumentBuilderFactory,javax.xml.parsers.DocumentBuilder,org.w3c.dom.*"%>
<%@page import="ibase.dashboard.sfa.ejb.*"%>
<!--<%@page import="ibase.webitm.reports.utility.ResourceConstants"%>
-->
<%@page import="ibase.utility.CommonConstants"%>
<%@ page import="javax.naming.InitialContext"%>
<%@page import="javax.naming.Context"%>
<%@page import="org.w3c.dom.Node"%>
<%@page import="org.w3c.dom.NodeList"%>
<%@page import="ibase.webitm.utility.GenericUtility"%>
<%!GenericUtility genericUtility = GenericUtility.getInstance();
String xmlString = "";
String objName = "";
Document dom = null;
NodeList dtlList = null;
Node parentNode = null;
NodeList childNodeList = null;
Node currDetail = null;
String childNodeName = "";
String yearweek="";
String doctors="";
String chemist="";
String stockist="";
String unlisted="";
String rptTitle="";
StringBuffer xmlData = null;
%>
<%
response.setHeader("Expires", "Sat, 6 May 1995 12:00:00 GMT");
response.setHeader("Cache-Control", "no-store, no-cache,must-revalidate");
response.addHeader("Cache-Control", "post-check=0, pre-check=0");
response.setHeader("Pragma", "no-cache");
int ctr = 0;
CommonConstants.setAPPLICATION_CONTEXT(config.getServletContext().getRealPath("/"));
%>
<html>
<head>
<script type="text/javascript" src="/ibase/FusionChart/js/FusionCharts.js"> </script>
</head>
<body>
<%
try
{
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
String user = userInfo.getLoginCode();
System.out.println("user ::" + user);
rptTitle = request.getParameter("rtitle");
if (rptTitle == null || rptTitle.trim().length() == 0)
{
rptTitle =" " ;
} else
{
if(rptTitle.equalsIgnoreCase("Y") && rptTitle.trim().length()!= 0)
{
rptTitle ="Customer Meeting Trends ";
}
else{
rptTitle =" " ;
}
}
Context context = new InitialContext();
CustomerMeetingTrendsRemote dashboardPortal = (CustomerMeetingTrendsRemote) context.lookup("ibase/CustomerMeetingTrends/remote");
System.out.println("Ejb remote =>" + dashboardPortal);
if (user != null && user.trim().length() != 0)
{
xmlString = dashboardPortal.getData(user);
System.out.println("xmlString length is ==>" + xmlString.length());
System.out.println("xmlString in jsp ==>" + xmlString);
}
xmlData = new StringBuffer("<chart caption='");
xmlData.append(rptTitle);
xmlData.append("' xaxisname='Week' yaxisname='Number of Visits' numdivlines='9' showSum='1' showvalues='0' useRoundEdges='1' showLabels='1'>" );
if (xmlString != null && xmlString.trim().length() > 0)
{
dom = genericUtility.parseString(xmlString);
if(dom !=null )
{
dtlList = dom.getElementsByTagName("Detail1");
System.out.println("Detail Node Length==" + dtlList.getLength());
xmlData.append("<categories font='Arial' >");
for (int cntr = 0; cntr < dtlList.getLength(); cntr++)
{
parentNode = dtlList.item(cntr);
childNodeList = parentNode.getChildNodes();
System.out.println("child Node Length==" + childNodeList.getLength());
for (int nodCtr = 0; nodCtr < childNodeList.getLength(); nodCtr++)
{
currDetail = childNodeList.item(nodCtr);
childNodeName = currDetail.getNodeName();
if (childNodeName.trim().equals("yearweek"))
{
//String yearweek1 = genericUtility.getColumnValueFromNode("yearweek", parentNode);
yearweek =currDetail.getTextContent();
xmlData.append("<category label='"+yearweek+"'/>");
}
}
}
xmlData.append("</categories>");
dtlList = dom.getElementsByTagName("Detail2");
System.out.println("Detail Node Length==" + dtlList.getLength());
xmlData.append("<dataset seriesname='Doctors' color='8BBA00' showValues='0'>");
for (int cntr = 0; cntr < dtlList.getLength(); cntr++)
{
parentNode = dtlList.item(cntr);
childNodeList = parentNode.getChildNodes();
for (int nodCtr = 0; nodCtr < childNodeList.getLength(); nodCtr++)
{
currDetail = childNodeList.item(nodCtr);
childNodeName = currDetail.getNodeName();
if (childNodeName.trim().equals("doctor"))
{
//doctors = genericUtility.getColumnValueFromNode("doctor", parentNode);
doctors = currDetail.getTextContent();
}xmlData.append("<set value='"+doctors+"'/>");
}
}
xmlData.append("</dataset>");
dtlList = dom.getElementsByTagName("Detail3");
System.out.println("Detail Node Length==" + dtlList.getLength());
xmlData.append("<dataset seriesname='Chemist' color='F6BD0F' showValues='0'>");
for (int cntr = 0; cntr < dtlList.getLength(); cntr++)
{
parentNode = dtlList.item(cntr);
childNodeList = parentNode.getChildNodes();
for (int nodCtr = 0; nodCtr < childNodeList.getLength(); nodCtr++)
{
currDetail = childNodeList.item(nodCtr);
childNodeName = currDetail.getNodeName();
if (childNodeName.trim().equals("chemist"))
{
//chemist = genericUtility.getColumnValueFromNode("chemist", parentNode);
chemist = currDetail.getTextContent();
xmlData.append("<set value='"+chemist+"'/>");
}
}
}
xmlData.append("</dataset>");
dtlList = dom.getElementsByTagName("Detail4");
System.out.println("Detail Node Length==" + dtlList.getLength());
xmlData.append("<dataset seriesname='Stockist' color='F781F3' showValues='0'>");
for (int cntr = 0; cntr < dtlList.getLength(); cntr++)
{
parentNode = dtlList.item(cntr);
childNodeList = parentNode.getChildNodes();
for (int nodCtr = 0; nodCtr < childNodeList.getLength(); nodCtr++)
{
currDetail = childNodeList.item(nodCtr);
childNodeName = currDetail.getNodeName();
if (childNodeName.trim().equals("stockist"))
{
//stockist = genericUtility.getColumnValueFromNode("stockist", parentNode);
stockist = currDetail.getTextContent();
xmlData.append("<set value='"+stockist+"'/>");
}
}
}
xmlData.append("</dataset>");
dtlList = dom.getElementsByTagName("Detail5");
System.out.println("Detail Node Length==" + dtlList.getLength());
xmlData.append("<dataset seriesname='Unlisted' color='AFD8F8' showValues='0'>");
for (int cntr = 0; cntr < dtlList.getLength(); cntr++)
{
parentNode = dtlList.item(cntr);
childNodeList = parentNode.getChildNodes();
for (int nodCtr = 0; nodCtr < childNodeList.getLength(); nodCtr++)
{
currDetail = childNodeList.item(nodCtr);
childNodeName = currDetail.getNodeName();
if (childNodeName.trim().equals("unlisted"))
{
//unlisted = genericUtility.getColumnValueFromNode("unlisted", parentNode);
unlisted =currDetail.getTextContent();
xmlData.append("<set value='"+unlisted+"'/>");
}
}
}
xmlData.append("</dataset>");
}
}
xmlData.append("</chart>");
System.out.println("xmlDataString----->"+xmlData.toString());
%>
<div id="chartContainer">FusionCharts XT will load here!</div>
<script type="text/javascript">
var myChart = new FusionCharts( "/ibase/FusionChart/images/StackedColumn2D.swf", "myChartId", "250", "300","0");
myChart.setXMLData("<%=xmlData.toString()%>");
myChart.render("chartContainer");
function view2D()
{
var chartToView2D = getChartFromId("myChartId");
chartToView2D.view2D();
}
</script>
<%
} catch (Exception ex)
{
System.out.println("Exception : ITMWizardHandlerServlet sMessageArguments(String,wizardBean) :" + ex); //$NON-NLS-1$
}
%>
</body>
</html>
<%@ page contentType="text/html"%>
<%@ page
import="javax.xml.parsers.DocumentBuilderFactory,javax.xml.parsers.DocumentBuilder,org.w3c.dom.*"%>
<%@page import="ibase.dashboard.sfa.ejb.*"%>
<!--<%@page import="ibase.webitm.reports.utility.ResourceConstants"%>
-->
<%@page import="ibase.utility.CommonConstants"%>
<%@ page import="javax.naming.InitialContext"%>
<%@page import="javax.naming.Context"%>
<%@page import="org.w3c.dom.Node"%>
<%@page import="org.w3c.dom.NodeList"%>
<%@page import="ibase.webitm.utility.GenericUtility"%>
<%@page import="java.util.Calendar"%>
<%@page import="java.text.SimpleDateFormat"%>
<%!GenericUtility genericUtility = GenericUtility.getInstance();
String xmlString = "";
String objName = "";
Document dom = null;
NodeList dtlList = null;
Node parentNode = null;
NodeList childNodeList = null;
Node currDetailNode = null;
String childNodeName = "";
String visits="";
String category="";
String cyear="";
String cmonth="";
StringBuffer chartData=null;
String xmlData= "";
Calendar calender= Calendar.getInstance();
java.util.Date date = new java.util.Date(calender.getTimeInMillis());
String rptTitle="";
%>
<%
response.setHeader("Expires", "Sat, 6 May 1995 12:00:00 GMT");
response.setHeader("Cache-Control", "no-store, no-cache,must-revalidate");
response.addHeader("Cache-Control", "post-check=0, pre-check=0");
response.setHeader("Pragma", "no-cache");
int ctr = 0;
CommonConstants.setAPPLICATION_CONTEXT(config.getServletContext().getRealPath("/"));
%>
<html>
<head>
<script type="text/javascript"
src="/ibase/FusionChart/js/FusionCharts.js"> </script>
</head>
<body>
<%
try
{
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
cyear = new SimpleDateFormat("yy").format(date);
cmonth = new SimpleDateFormat("MMMM").format(date);
rptTitle = request.getParameter("rtitle");
if (rptTitle == null || rptTitle.trim().length() == 0)
{
rptTitle =" " ;
} else
{
if(rptTitle.equalsIgnoreCase("Y") && rptTitle.trim().length()!= 0)
{
rptTitle =" Doctors Meeting by Class for "+ cmonth + "-"+ cyear;
}
else{
rptTitle =" " ;
}
}
String user = userInfo.getLoginCode();
System.out.println("user ::" + user);
Context context = new InitialContext();
DoctorsMeetingByClassRemote dashboardPortal = (DoctorsMeetingByClassRemote) context.lookup("ibase/DoctorsMeetingByClass/remote");
System.out.println("Ejb remote =>" + dashboardPortal);
if (user != null && user.trim().length() != 0)
{
xmlString = dashboardPortal.getData(user);
}
chartData=new StringBuffer("<chart caption='");
chartData.append(rptTitle);
chartData.append("' baseFont='Arial' xAxisName='Category' yAxisName='Visits' showLabels='0' showLegend='1'>");
dom = genericUtility.parseString(xmlString);
if(dom !=null )
{
dtlList = dom.getElementsByTagName("Detail");
for (int cntr = 0; cntr < dtlList.getLength(); cntr++)
{
parentNode = dtlList.item(cntr);
childNodeList = parentNode.getChildNodes();
for (int nodCtr = 0; nodCtr < childNodeList.getLength(); nodCtr++)
{
currDetailNode = childNodeList.item(nodCtr);
childNodeName = currDetailNode.getNodeName();
if (childNodeName.trim().equals("category"))
{
category = genericUtility.getColumnValueFromNode("category", parentNode);
}
if(childNodeName.trim().equals("visits"))
{
visits = genericUtility.getColumnValueFromNode("visits", parentNode);
}
}
chartData.append("<set label='").append(category+"' value='").append(visits+"'>").append("</set>");
}
}
chartData.append("</chart>");
System.out.println("chartData "+chartData);
%>
<div id="chartContainer">FusionCharts XT will load here!</div>
<script type="text/javascript">
var myChart = new FusionCharts("/ibase/FusionChart/images/Pie2D.swf", "myChartId", "250", "300","0");
myChart.setXMLData("<%= chartData.toString()%>");
myChart.render("chartContainer");
function view2D()
{
var chartToView2D = getChartFromId("myChartId");
chartToView2D.view2D();
}
</script>
<%
} catch (Exception ex)
{
System.out.println("Exception : ITMWizardHandlerServlet sMessageArguments(String,wizardBean) :" + ex);
}
%>
</body>
</html>
<%@ page contentType="text/html"%>
<%@ page
import="javax.xml.parsers.DocumentBuilderFactory,javax.xml.parsers.DocumentBuilder,org.w3c.dom.*"%>
<%@page import="ibase.dashboard.sfa.ejb.*"%>
<!--<%@page import="ibase.webitm.reports.utility.ResourceConstants"%>
-->
<%@page import="ibase.utility.CommonConstants"%>
<%@ page import="javax.naming.InitialContext"%>
<%@page import="javax.naming.Context"%>
<%@page import="org.w3c.dom.Node"%>
<%@page import="org.w3c.dom.NodeList"%>
<%@page import="ibase.webitm.utility.GenericUtility"%>
<%!GenericUtility genericUtility = GenericUtility.getInstance();
String xmlString = "";
String rptTitle = "";
Document dom = null;
NodeList dtlList = null;
Node parentNode = null;
NodeList childNodeList = null;
Node currDetail = null;
String childNodeName = "";
String salePersnName = "", submitted_date = "", amount = "", period = " ",
status = " ", doctorsName = "", notMetSince = "", visitMissed = "";
%>
<%
response.setHeader("Expires", "Sat, 6 May 1995 12:00:00 GMT");
response.setHeader("Cache-Control", "no-store, no-cache,must-revalidate");
response.addHeader("Cache-Control", "post-check=0, pre-check=0");
response.setHeader("Pragma", "no-cache");
int ctr = 0;
CommonConstants.setAPPLICATION_CONTEXT(config.getServletContext().getRealPath("/"));
%>
<html>
<head>
<style type="text/css">
.reportName {
FONT-FAMILY: Arial;
FONT-SIZE: 12pt;
font-weight: bold;
}
.reportTitle {
FONT-FAMILY: Arial;
FONT-SIZE: 10pt;
}
.reportDetail {
FONT-FAMILY: Arial;
FONT-SIZE: 10pt;
width: 280px;
border: 1px solid;
}
.tblHeader
{
font-weight: bold;
}
</style>
</head>
<body>
<%
try
{
rptTitle = request.getParameter("rtitle");
if (rptTitle == null || rptTitle.trim().length() == 0)
{
rptTitle =" " ;
} else
{
if(rptTitle.equalsIgnoreCase("Y") && rptTitle.trim().length()!= 0)
{
rptTitle ="Expense Request Status" ;
}
else{
rptTitle =" " ;
}
}
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
String user = userInfo.getLoginCode();
System.out.println("user ::" + user);
Context context = new InitialContext();
ExpenseProcessStatusRemote dashboardPortal = (ExpenseProcessStatusRemote) context.lookup("ibase/ExpenseProcessStatus/remote");
//DashboardPortal dashboardPortal=(DashboardPortal)context.lookup("ibase.dashboard.sfa.ejb.DashboardPortal.class.getName()");
if (user != null && user.trim().length() != 0)
{
xmlString = dashboardPortal.getData(user);
System.out.println("Return xmlString====" + xmlString);
}
%>
<%
if (xmlString != null && xmlString.trim().length() > 0)
{
%>
<table class="reportName">
<tr>
<td><%=rptTitle%></td>
</tr>
</table>
<table>
<tr class="reportTitle">
<td><b>Sales Person:</b></td>
<td><%=dashboardPortal.getSalePersn()%></td>
</tr>
</table>
<table class="reportDetail" rules="rows" FRAME=BOX >
<tr class="tblHeader">
<th> </th>
<th align="center">Period</th>
<th align="right">Amount</th>
<th align="right">Submitted Date</th>
</tr>
<%
dom = genericUtility.parseString(xmlString);
if(dom !=null )
{
dtlList = dom.getElementsByTagName("Detail");
for (int cntr = 0; cntr < dtlList.getLength(); cntr++)
{
parentNode = dtlList.item(cntr);
childNodeList = parentNode.getChildNodes();
for (int nodCtr = 0; nodCtr < childNodeList.getLength(); nodCtr++)
{
currDetail = childNodeList.item(nodCtr);
childNodeName = currDetail.getNodeName();
if (childNodeName.trim().equals("period"))
{
period = genericUtility.getColumnValueFromNode("period", parentNode);
}
if (childNodeName.trim().equals("amount"))
{
amount = genericUtility.getColumnValueFromNode("amount", parentNode);
}
if (childNodeName.trim().equals("submitted_date"))
{
submitted_date = genericUtility.getColumnValueFromNode("submitted_date", parentNode);
}
if (childNodeName.trim().equals("apporval_status"))
{
status = genericUtility.getColumnValueFromNode("apporval_status", parentNode);
}
}
%>
<tr>
<td>
<%
if (status.equals("S"))
{
%> <img alt="" height="10" width="10" src="../images/check_mark.png">
<%
}
if (status.equals("U"))
{
%> <img alt="" height="10" width="10" src="../images/clock.png">
<%
}
if (status.equals("R"))
{
%> <img alt="" height="10" width="10" src="../images/Reject.jpg">
<%
}
%>
</td>
<td align="center"><%=period%></td>
<td align="right"><%=amount%></td>
<td align="center"><%=submitted_date%></td>
</tr>
<%
}
}
%>
</table>
<%
}
} catch (Exception ex)
{
System.out.println("Exception : ExpenseProcessStatus:" + ex.getMessage());
}
%>
</body>
</html>
<%@ page contentType="text/html"%>
<%@ page import="javax.xml.parsers.DocumentBuilderFactory,javax.xml.parsers.DocumentBuilder,org.w3c.dom.*"%>
<%@page import="ibase.dashboard.sfa.ejb.*"%>
<%@page import="ibase.webitm.reports.utility.ResourceConstants"%>
<%@page import="ibase.utility.CommonConstants"%>
<%@ page import="javax.naming.InitialContext"%>
<%@page import="javax.naming.Context"%>
<%@page import="org.w3c.dom.Node"%>
<%@page import="org.w3c.dom.NodeList"%>
<%@page import="ibase.webitm.utility.GenericUtility"%>
<%!GenericUtility genericUtility = GenericUtility.getInstance();
String xmlString = "";
String objName = "";
Document dom = null;
NodeList dtlList = null;
Node parentNode = null;
NodeList childNodeList = null;
Node currDetail = null;
String childNodeName = "";
String salePersnName = "",doctorsName = "", notMetSince = "",pendingVisits="", visitMissed = "",rptTitle;%>
<%
response.setHeader("Expires", "Sat, 6 May 1995 12:00:00 GMT");
response.setHeader("Cache-Control", "no-store, no-cache,must-revalidate");
response.addHeader("Cache-Control", "post-check=0, pre-check=0");
response.setHeader("Pragma", "no-cache");
int ctr = 0;
CommonConstants.setAPPLICATION_CONTEXT(config.getServletContext().getRealPath("/"));
%>
<html>
<head>
<style type="text/css">
.reportName {
FONT-FAMILY: Arial;
FONT-SIZE: 12pt;
font-weight: bold;
}
.reportTitle {
FONT-FAMILY: Arial;
FONT-SIZE: 10pt;
}
.reportDetail {
FONT-FAMILY: Arial;
FONT-SIZE: 10pt;
width: 350px;
border: 1px solid;
}
.tblHeader
{
font-weight: bold;
}
</style>
<script type="text/javascript" src="FusionCharts.js"></script>
</head>
<body>
<%
try
{
rptTitle = request.getParameter("rtitle");
if (rptTitle == null || rptTitle.trim().length() == 0)
{
rptTitle =" " ;
} else
{
if(rptTitle.equalsIgnoreCase("Y") && rptTitle.trim().length()!= 0)
{
rptTitle ="Important Doctors Missed ";
}
else{
rptTitle =" " ;
}
}
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
String user = userInfo.getLoginCode();
System.out.println("user ::" + user);
Context context = new InitialContext();
ImpDocMissedRemote dashboardPortal = (ImpDocMissedRemote)context.lookup("ibase/ImpDocMissed/remote");
//DashboardPortal dashboardPortal=(DashboardPortal)context.lookup("ibase.dashboard.sfa.ejb.DashboardPortal.class.getName()");
if (user != null && user.trim().length() != 0)
{
xmlString = dashboardPortal.getData(user);
System.out.println("Return xmlString====" + xmlString);
}
%>
<%
if (xmlString != null && xmlString.trim().length() > 0)
{
%>
<table class="reportName">
<tr>
<td><%=rptTitle%></td>
</tr>
</table>
<table class="reportDetail" rules="all" FRAME=BOX>
<tr class="tblHeader">
<td>Doctor Name</td>
<td>Not Met Since</td>
<td>No.of Visits Missed</td>
<td>No.of Visits Pending</td>
</tr>
<tr>
<td colspan="3"><b>Sales Person:</b><%=dashboardPortal.getSalePersn()%></td>
</tr>
<%
dom = genericUtility.parseString(xmlString);
if(dom !=null)
{
dtlList = dom.getElementsByTagName("Detail");
for (int cntr = 0; cntr < dtlList.getLength(); cntr++)
{
parentNode = dtlList.item(cntr);
childNodeList = parentNode.getChildNodes();
for (int nodCtr = 0; nodCtr < childNodeList.getLength(); nodCtr++)
{
currDetail = childNodeList.item(nodCtr);
childNodeName = currDetail.getNodeName();
if (childNodeName.trim().equals("doctors_name"))
{
doctorsName = genericUtility.getColumnValueFromNode("doctors_name", parentNode);
}
if (childNodeName.trim().equals("days_since_not_met"))
{
notMetSince = genericUtility.getColumnValueFromNode("days_since_not_met", parentNode);
}
if (childNodeName.trim().equals("visits_missed"))
{
visitMissed = genericUtility.getColumnValueFromNode("visits_missed", parentNode);
}
if (childNodeName.trim().equals("pending_visits"))
{
pendingVisits = genericUtility.getColumnValueFromNode("pending_visits", parentNode);
}
}
%>
<tr>
<td width="180px"><%=doctorsName%></td>
<td align="right"><%=notMetSince%></td>
<td align="center"><%=visitMissed%></td>
<td align="center"><%=pendingVisits%></td>
</tr>
<%
}}
%>
</table>
<%
}
} catch (Exception ex)
{
System.out.println("Exception in JSP :ImpDocMissed:" + ex.getMessage());
}
%>
</body>
</html>
\ No newline at end of file
<%@ page contentType="text/html"%>
<%@ page
import="javax.xml.parsers.DocumentBuilderFactory,javax.xml.parsers.DocumentBuilder,org.w3c.dom.*"%>
<%@page import="ibase.dashboard.sfa.ejb.*"%>
<!--<%@page import="ibase.webitm.reports.utility.ResourceConstants"%>
-->
<%@page import="ibase.utility.CommonConstants"%>
<%@ page import="javax.naming.InitialContext"%>
<%@page import="javax.naming.Context"%>
<%@page import="org.w3c.dom.Node"%>
<%@page import="org.w3c.dom.NodeList"%>
<%@page import="ibase.webitm.utility.GenericUtility"%>
<%!GenericUtility genericUtility = GenericUtility.getInstance();
String xmlString = "";
String objName = "";
Document dom = null;
NodeList dtlList = null;
Node parentNode = null;
NodeList childNodeList = null;
Node currDetail = null;
String childNodeName = "";
String rptTitle="";
String event = " ", doctorsName = "", eventDate = "";%>
<%
response.setHeader("Expires", "Sat, 6 May 1995 12:00:00 GMT");
response.setHeader("Cache-Control", "no-store, no-cache,must-revalidate");
response.addHeader("Cache-Control", "post-check=0, pre-check=0");
response.setHeader("Pragma", "no-cache");
int ctr = 0;
CommonConstants.setAPPLICATION_CONTEXT(config.getServletContext().getRealPath("/"));
%>
<html>
<head>
<style type="text/css">
.reportName {
FONT-FAMILY: Arial;
FONT-SIZE: 12pt;
font-weight: bold;
}
.reportTitle {
FONT-FAMILY: Arial;
FONT-SIZE: 10pt;
}
.reportDetail {
FONT-FAMILY: Arial;
FONT-SIZE: 10pt;
width: 300px;
border: 1px solid;
}
.reportDetail1 {
FONT-FAMILY: Arial;
FONT-SIZE: 10pt;
width: 350px;
border: 1px solid;
}
.rowColor
{
background-color:#D3D3D3;
text-align:left;
font-weight: bold;
}
</style>
<script type="text/javascript" src="FusionCharts.js"></script>
</head>
<body>
<%
try
{
rptTitle = request.getParameter("rtitle");
if (rptTitle == null || rptTitle.trim().length() == 0)
{
rptTitle =" " ;
} else
{
if(rptTitle.equalsIgnoreCase("Y") && rptTitle.trim().length()!= 0)
{
rptTitle ="Important Events ";
}
else{
rptTitle =" " ;
}
}
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
String user = userInfo.getLoginCode();
System.out.println("user ::" + user);
//String outputFilename = objName + user + System.currentTimeMillis();
Context context = new InitialContext();
ImpEventsRemote impEvents = (ImpEventsRemote) context.lookup("ibase/ImpEvents/remote");
//DashboardPortal dashboardPortal=(DashboardPortal)context.lookup("ibase.dashboard.sfa.ejb.DashboardPortal.class.getName()");
System.out.println("Ejb remote =>" + impEvents);
if (user != null && user.trim().length() != 0)
{
xmlString = impEvents.getData(user);
System.out.println("Return xmlString====" + xmlString);
System.out.println("xmlString length is ==>" + xmlString.length());
}
%>
<%
if (xmlString != null && xmlString.trim().length() > 0)
{
%>
<table class="reportName">
<tr>
<td><%=rptTitle%> </td>
</tr>
</table>
<table class="reportDetail1" FRAME=BOX >
<tr class="rowColor">
<td colspan="3">Today</td>
</tr>
<%
dom = genericUtility.parseString(xmlString);
if (dom != null)
{
dtlList = dom.getElementsByTagName("Detail1");
System.out.println("Detail Node Length==" + dtlList.getLength());
for (int cntr = 0; cntr < dtlList.getLength(); cntr++)
{
parentNode = dtlList.item(cntr);
childNodeList = parentNode.getChildNodes();
for (int nodCtr = 0; nodCtr < childNodeList.getLength(); nodCtr++)
{
currDetail = childNodeList.item(nodCtr);
childNodeName = currDetail.getNodeName();
if (childNodeName.trim().equals("drname"))
{
doctorsName = genericUtility.getColumnValueFromNode("drname", parentNode);
}
if (childNodeName.trim().equals("event"))
{
event = genericUtility.getColumnValueFromNode("event", parentNode);
}
}
%>
<tr >
<td><%=doctorsName%></td>
<td><%=event%></td>
</tr>
<%
}
}
%>
<tr class="rowColor">
<td colspan="3">Tomorrow</td>
</tr>
<%
if (dom != null)
{
dom = genericUtility.parseString(xmlString);
dtlList = dom.getElementsByTagName("Detail2");
for (int cntr = 0; cntr < dtlList.getLength(); cntr++)
{
parentNode = dtlList.item(cntr);
childNodeList = parentNode.getChildNodes();
for (int nodCtr = 0; nodCtr < childNodeList.getLength(); nodCtr++)
{
currDetail = childNodeList.item(nodCtr);
childNodeName = currDetail.getNodeName();
if (childNodeName.trim().equals("drname"))
{
doctorsName = genericUtility.getColumnValueFromNode("drname", parentNode);
}
if (childNodeName.trim().equals("event"))
{
event = genericUtility.getColumnValueFromNode("event", parentNode);
}
}
%>
<tr>
<td><%=doctorsName%> -</td>
<td><%=event%></td>
</tr>
<%
}
}
%>
<tr class="rowColor">
<td colspan="3">Upcoming</td>
</tr>
<%
if (dom != null)
{
dom = genericUtility.parseString(xmlString);
dtlList = dom.getElementsByTagName("Detail3");
for (int cntr = 0; cntr < dtlList.getLength(); cntr++)
{
parentNode = dtlList.item(cntr);
childNodeList = parentNode.getChildNodes();
for (int nodCtr = 0; nodCtr < childNodeList.getLength(); nodCtr++)
{
currDetail = childNodeList.item(nodCtr);
childNodeName = currDetail.getNodeName();
if (childNodeName.trim().equals("event_date"))
{
eventDate = genericUtility.getColumnValueFromNode("event_date", parentNode);
}
if (childNodeName.trim().equals("drname"))
{
doctorsName = genericUtility.getColumnValueFromNode("drname", parentNode);
}
if (childNodeName.trim().equals("event"))
{
event = genericUtility.getColumnValueFromNode("event", parentNode);
}
}
%>
<tr>
<td><%=eventDate%></td>
<td><%=doctorsName%> -</td>
<td><%=event%></td>
</tr>
<%
}
}
%>
</table>
<%
}
} catch (Exception ex)
{
System.out.println("Exception in JSP:ImpEvents:" + ex.getMessage());
}
%>
</body>
</html>
\ No newline at end of file
<%@ page contentType="text/html"%>
<%@ page
import="javax.xml.parsers.DocumentBuilderFactory,javax.xml.parsers.DocumentBuilder,org.w3c.dom.*"%>
<%@page import="ibase.dashboard.sfa.ejb.*"%>
<!--<%@page import="ibase.webitm.reports.utility.ResourceConstants"%>
-->
<%@page import="ibase.utility.CommonConstants"%>
<%@ page import="javax.naming.InitialContext"%>
<%@page import="javax.naming.Context"%>
<%@page import="org.w3c.dom.Node"%>
<%@page import="org.w3c.dom.NodeList"%>
<%@page import="ibase.webitm.utility.GenericUtility"%>
<%!GenericUtility genericUtility = GenericUtility.getInstance();
String xmlString = "";
String objName = "";
Document dom = null;
NodeList dtlList = null;
Node parentNode = null;
NodeList childNodeList = null;
Node currDetail = null;
String childNodeName = "";
String drNotVisited = "", unDrtVisited = "", drVisited = "";
String visitedDr = "", notVisitedDr = "", unPlndDrVisited = "";
ArrayList<String> unDrVisitedList=null;
ArrayList<String> drVisitedList =null;
ArrayList<String> drNotVisitedList =null;
int unDrVisitedListSize=0;
int drVisitedListSize=0;
int drNotVisitedListSize=0;
String rptTitle="";
%>
<%
response.setHeader("Expires", "Sat, 6 May 1995 12:00:00 GMT");
response.setHeader("Cache-Control", "no-store, no-cache,must-revalidate");
response.addHeader("Cache-Control", "post-check=0, pre-check=0");
response.setHeader("Pragma", "no-cache");
int ctr = 0;
CommonConstants.setAPPLICATION_CONTEXT(config.getServletContext().getRealPath("/"));
%>
<%@page import="java.util.ArrayList"%>
<html>
<head>
<style type="text/css">
.reportName {
FONT-FAMILY: Arial;
FONT-SIZE: 12pt;
font-weight: bold;
}
.reportTitle {
FONT-FAMILY: Arial;
FONT-SIZE: 10pt;
}
.reportDetail{
FONT-FAMILY: Arial;
FONT-SIZE: 10pt;
width: 550px;
}
.rowColor {
background-color: grey;
text-align: left;
font-weight: bold;
}
.tblHeader
{
border:1px solid
font-weight: bold;
}
</style>
</head>
<body>
<%
try
{
rptTitle = request.getParameter("rtitle");
if (rptTitle == null || rptTitle.trim().length() == 0)
{
rptTitle =" " ;
} else
{
if(rptTitle.equalsIgnoreCase("Y") && rptTitle.trim().length()!= 0)
{
rptTitle =" Planned v/s Actual Doctors Visit ";
}
else{
rptTitle =" " ;
}
}
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean) session.getAttribute("USER_INFO");
String user = userInfo.getLoginCode();
System.out.println("user ::" + user);
//String outputFilename = objName + user + System.currentTimeMillis();
Context context = new InitialContext();
PlannedVSActualActionTypesRemote plannedVSActualAction = (PlannedVSActualActionTypesRemote) context.lookup("ibase/PlannedVSActualActionTypes/remote");
//DashboardPortal dashboardPortal=(DashboardPortal)context.lookup("ibase.dashboard.sfa.ejb.DashboardPortal.class.getName()");
if (user != null && user.trim().length() != 0)
{
xmlString = plannedVSActualAction.getData(user);
System.out.println("Return xmlString====" + xmlString);
System.out.println("xmlString length is ==>" + xmlString.length());
}
%>
<%
if (xmlString != null && xmlString.trim().length() > 0)
{
%>
<table class="reportName">
<tr>
<td><%=rptTitle %></td>
</tr>
</table>
<table>
<tr class="reportTitle">
<td><b>Sales Person:</b></td>
<td><%=plannedVSActualAction.getSalesPerson()%></td>
</tr>
</table>
<table class="reportDetail" RULES="cols" FRAME=BOX >
<tr class="tblHeader">
<th> Planned Doctors Not Visited</th>
<th> Planned Doctors Visited</th>
<th> Unplanned Doctors Visited</th>
</tr>
<%
unDrVisitedList = new ArrayList<String>();
drVisitedList = new ArrayList<String>();
drNotVisitedList = new ArrayList<String>();
dom = genericUtility.parseString(xmlString);
if (dom != null)
{
dtlList = dom.getElementsByTagName("un_dr_visitd");
System.out.println("Detail Node Length==" + dtlList.getLength());
for (int cntr = 0; cntr < dtlList.getLength(); cntr++)
{
parentNode = dtlList.item(cntr);
unDrtVisited = parentNode.getTextContent();
unDrVisitedList.add(unDrtVisited);
}
dtlList = dom.getElementsByTagName("dr_visitd");
for (int cntr = 0; cntr < dtlList.getLength(); cntr++)
{
parentNode = dtlList.item(cntr);
drVisited = parentNode.getTextContent();
drVisitedList.add(drVisited);
}
dtlList = dom.getElementsByTagName("dr_not_visited");
for (int cntr = 0; cntr < dtlList.getLength(); cntr++)
{
parentNode = dtlList.item(cntr);
drNotVisited = parentNode.getTextContent();
drNotVisitedList.add(drNotVisited);
}
}
unDrVisitedListSize = unDrVisitedList.size();
drVisitedListSize = drVisitedList.size();
drNotVisitedListSize = drNotVisitedList.size();
System.out.print("unDrVisitedListSize ="+unDrVisitedListSize +"drVisitedListSize ="+drVisitedListSize + "drNotVisitedListSize :"+drNotVisitedListSize);
int maxLength = Math.max(unDrVisitedListSize, Math.max(drVisitedListSize, drNotVisitedListSize));
System.out.print("Max Length is ="+maxLength);
for (int i = 0; i < maxLength; i++)
{
if (i<drVisitedListSize)
{
visitedDr = drVisitedList.get(i);
System.out.print("Visited Dr ="+visitedDr);
} else
{
visitedDr = " ";
}
if(i < drNotVisitedListSize)
{
notVisitedDr = drNotVisitedList.get(i);
}else{
notVisitedDr="";
}
if(i< unDrVisitedListSize)
{
unPlndDrVisited = unDrVisitedList.get(i);
System.out.print("unPlndDrVisited Dr are ="+unPlndDrVisited);
}else
{
unPlndDrVisited=" ";
}
%>
<tr>
<td><%=notVisitedDr%></td>
<td><%=visitedDr%></td>
<td><%= unPlndDrVisited%></td>
</tr>
<%
}
%>
</table>
<%
}
} catch (Exception ex)
{
System.out.println("Exception in JSP :PlannedVSActualActionTypes:" + ex.getMessage());
}
%>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment