Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ page language="Java" import="java.sql.*"%>
- <%@ page import="java.util.*"%>
- <%@ page import="com.enzen.cis.dao.*"%>
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
- <jsp:useBean id="dao" scope="request"
- class="com.enzen.cis.dao.DAOConsumerAddEdit" />
- <jsp:useBean id="consumer" scope="request"
- class="com.enzen.cis.bean.Consumer" />
- <html>
- <head>
- <link rel="stylesheet" href="${pageContext.request.contextPath}/css/CIS.css" type="text/css">
- <LINK href="${pageContext.request.contextPath}/css/calendar-blue.css" type="text/css" rel="stylesheet">
- <script src="${pageContext.request.contextPath}/js/calendar.js"></script>
- <script src="${pageContext.request.contextPath}/js/calendar-en.js"></script>
- <script src="${pageContext.request.contextPath}/js/calendar-setup.js"></script>
- <SCRIPT TYPE="text/javascript">
- function statusChange() {
- var objDropDown=document.getElementById("d-down");
- var DTobjid=objDropDown.options[objDropDown.selectedIndex].value;
- document.getElementById('selectedval').value=DTobjid;
- }
- function validate(frm) {
- if (frm.consumer_name.value.length ==0)
- {
- alert("Please enter Consumer Name!");
- frm.consumer_name.focus();
- return false
- }
- if (frm.wenexa.value.length ==0)
- {
- alert("Please enter Wenexa ID!");
- frm.wenexa.focus();
- return false;
- }
- if (frm.rr_number.value.length==0)
- {
- alert("Please enter RR Number!");
- frm.rr_number.focus();
- return false;
- }
- if (frm.residing_village.value.length==0)
- {
- alert("Please enter Village Name");
- frm.residing_village.focus();
- return false;
- }
- }
- function setPageView(){
- Calendar.setup({
- inputField : "repdate",
- button : "imgrepdate",
- dateFormat : "dd-MMM-yyyy"
- //,align : "bR"
- });
- }
- function pagesubmit(frm){
- var valid=validate(frm);
- if(valid!=false){
- // variable to display the data saved message successfully. Set to 1 on form submit.
- document.getElementById('msgID').value=1;
- document.getElementById('hdnpageState1').value='1';
- document.getElementById('ID').submit();
- }
- }
- function goBack(){
- document.getElementById('hdnpageState').value='1';
- document.getElementById('Main').submit();
- //document.forms.submit();
- }
- function pageClear(){
- document.form.consumer_name.value="";
- document.form.residing_village.value="";
- document.form.wenexa.value="";
- document.form.rr_number.value="";
- document.form.contact_number.value="";
- document.form.contact_person.value="";
- document.form.repdate.value="";
- var postOptions = document.getElementById("d-down");
- postOptions.options[0].selected = 1;
- }
- function poponclick(){
- var n=document.getElementById('consumer_id').value;
- testwindow = window.open("MeterDetailsServlet?consumer_id="+n, "consumerwindow","resizable=no,scrollbars=yes,width=450px,height=500px,top=200,left=343,toolbars=no,menubar=no,location=no");
- // test`window.moveTo(0, 0);
- }
- </SCRIPT>
- </head>
- <body onload="setPageView();">
- <FORM METHOD="POST" ACTION="${pageContext.request.contextPath}/SearchServlet" NAME="crudForm1" ID="Main">
- <input type="hidden" NAME="hdnpageState" id="hdnpageState" /></FORM>
- <form name="form" method="post" action="${pageContext.request.contextPath}/AddEditServlet" id="ID"
- onsubmit=" return validate(form);"><c:set value="${consumer_id}"
- var="consumer_id" /> <!--<c:out value="${consumer_id}" />-->
- <TABLE class="MasterTable">
- <TR>
- <TD class="header"><%@include file="/includes/header.jsp"%>
- </TD>
- </TR>
- <TR>
- <TD class="menu"><%@include file="/includes/menu.jsp"%>
- </TD>
- </TR>
- <TR>
- <TD class="heading">CONSUMER<%@include file="/includes/heading.jsp"%>
- </TD>
- </TR>
- <TR>
- <TD class="content">
- <Table width="100%" cellpadding="0" cellspacing="0" border="0">
- <c:set value="${consumer_id}" var="consumer_id"/>
- <!-- <c:out value="${consumer_id}"/> -->
- <TR class="odd">
- <td class="FrmBodyColumnLabel">WENEXA ID:</td>
- <td class="FrmBodyMandatorySymbol" width="10px">*</td>
- <td><input type="text" name="wenexa"
- value="${consumer.wenexa_id}" maxlength="30"></td>
- <td class="FrmBodyColumnLabel">RR No:</td>
- <td class="FrmBodyMandatorySymbol" width="10px">*</td>
- <td><input type="text" name="rr_number"
- value="${consumer.rr_number}" maxlength="20"> <INPUT
- TYPE="HIDDEN" NAME="consumer_id" ID="consumer_id"
- value='<c:out value="${consumer_id}"/>'></td>
- </TR>
- <TR class="even">
- <td class="FrmBodyColumnLabel">Consumer Name:</td>
- <td class="FrmBodyMandatorySymbol">*</td>
- <td><input type="text" name="consumer_name"
- value="${consumer.consumer_name}" maxlength="150"></td>
- <td class="FrmBodyColumnLabel">Residing village:</td>
- <td class="FrmBodyMandatorySymbol">*</td>
- <td><textarea name="residing_village">${consumer.residing_village}</textarea></td>
- </TR>
- <TR class="odd">
- <td class="FrmBodyColumnLabel">Contact Number:</td>
- <td class="FrmBodyMandatorySymbol"> </td>
- <td><input type="text" name="contact_number"
- value="${consumer.contact_no}" maxlength="50"></td>
- <td class="FrmBodyColumnLabel">Contact Person:</td>
- <td class="FrmBodyMandatorySymbol"> </td>
- <td><input type="text" name="contact_person"
- value="${consumer.contact_person}" maxlength="100"></td>
- </TR>
- <TR class="even">
- <td class="FrmBodyColumnLabel">Replaced Date:</td>
- <td class="FrmBodyMandatorySymbol"> </td>
- <td><input type="text" name="repdate"
- value="${consumer.rep_date}" id="repdate"> <img
- src="images/calendar.gif" border="0" name="imgrepdate" id="imgrepdate" /></td>
- <td class="FrmBodyColumnLabel">Status:</td>
- <td class="FrmBodyMandatorySymbol"> </td>
- <TD><SELECT name="statusdrop" id="d-down"
- ONCHANGE="statusChange()">
- <OPTION VALUE="0" label="--Select--" id="drpdwnVal"><c:forEach
- items="${dao.dtList}" var="st">
- <OPTION VALUE="${st.objid}"
- <c:if test="${st.objid eq status}">
- selected="${st.objid}"
- </c:if>>
- <c:out value="${st.description}" /></OPTION>
- </c:forEach>
- </SELECT> <INPUT TYPE="HIDDEN" NAME="selectedval" ID="selectedval"
- value="${status}"></td>
- </TR>
- <TR class="odd">
- <td colspan="6" class="FrmBodyMessageSuccess"> <input id="msgID" name="hiddenOne"
- type="hidden"> <c:if test="${not empty str_message}">
- <c:out value="${str_message}" />
- </c:if></td>
- </TR>
- <TR class="even">
- <td class="FrmBodyMandatoryMessage" colspan="2" >Fields marked
- with (*) are mandatory.</td>
- <td align="right">
- <c:if test="${not empty consumer_id}">
- <input type="button"
- class="FrmBodyCommandButton" id="bc" value="Meter Details"
- onclick="poponclick('<c:out value="${consumer_id}"/>');">
- </c:if>
- </td>
- <td colspan=3 align="right"><input type="button"
- class="FrmBodyCommandButton" name="btnSave" id="bc" value="Save"
- onclick="pagesubmit(form);"> <input type="button"
- class="FrmBodyCommandButton" name="cancel" value="<<Back"
- onclick="goBack();"> <INPUT TYPE="button" VALUE="Clear"
- onclick="pageClear();" class="FrmBodyCommandButton" align="right">
- <INPUT TYPE="reset" VALUE="Reset" class="FrmBodyCommandButton"
- align="right"> <input type="hidden" NAME="hdnpageState1"
- id="hdnpageState1" /></td>
- </TR>
- <!-- Proposed table -->
- <TR>
- <TD colspan="7">
- <TABLE class="FrmGridTable">
- <TR class="FrmBodyDataGridAlternateRow">
- <TD colspan="10">HISTORY</TD>
- </TR>
- <c:choose>
- <c:when test="${empty cList}">
- <tr>
- <td class="FrmBodyDataGridHeading">Wenexa ID</td>
- <td class="FrmBodyDataGridHeading">RR Number</td>
- <td class="FrmBodyDataGridHeading">Consumer Name</td>
- <td class="FrmBodyDataGridHeading">Residing Village</td>
- <td class="FrmBodyDataGridHeading">Contact Number</td>
- <td class="FrmBodyDataGridHeading">Contact Person</td>
- <td class="FrmBodyDataGridHeading">Replaced Date</td>
- <td class="FrmBodyDataGridHeading">Status</td>
- <td class="FrmBodyDataGridHeading">Modified By</td>
- <td class="FrmBodyDataGridHeading">Modified Date</td>
- </tr>
- </c:when>
- <c:otherwise>
- <tr>
- <td class="FrmBodyDataGridHeading">Wenexa ID</td>
- <td class="FrmBodyDataGridHeading">RR Number</td>
- <td class="FrmBodyDataGridHeading">Consumer Name</td>
- <td class="FrmBodyDataGridHeading">Residing Village</td>
- <td class="FrmBodyDataGridHeading">Contact Number</td>
- <td class="FrmBodyDataGridHeading">Contact Person</td>
- <td class="FrmBodyDataGridHeading">Replaced Date</td>
- <td class="FrmBodyDataGridHeading">Status</td>
- <td class="FrmBodyDataGridHeading">Modified By</td>
- <td class="FrmBodyDataGridHeading">Modified Date</td>
- </tr>
- <c:forEach var="cl" items="${cList}" varStatus="rowCounter">
- <!-- Result Set thats being displayed -->
- <c:choose>
- <c:when test="${rowCounter.count % 2 == 0}">
- <c:set var="rowStyle" scope="page"
- value="FrmBodyDataGridAlternateRow" />
- </c:when>
- <c:otherwise>
- <c:set var="rowStyle" scope="page" value="FrmBodyDataGridData" />
- </c:otherwise>
- </c:choose>
- <tr class="${rowStyle}">
- <td>${cl.wenexa_id}</td>
- <td>${cl.rr_number}</td>
- <td>${cl.consumer_name}</td>
- <td>${cl.residing_village}</td>
- <td>${cl.contact_no}</td>
- <td>${cl.contact_person}</td>
- <td>${cl.rep_date}</td>
- <td>${cl.strStatus}</td>
- <td>${cl.strmodifiedBy}</td>
- <td>${cl.dtmodifiedDate}</td>
- </tr>
- </c:forEach>
- </c:otherwise>
- </c:choose>
- </TABLE>
- </TD>
- </TR>
- </Table>
- <script>
- document.form.repdate.readOnly = true;
- </script></TD>
- </TR>
- <TR>
- <TD><%@include file="/includes/footer.jsp"%>
- </TD>
- </TR>
- </TABLE>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement