Current File : //home/obabain/anms_obaba_in/editJournalVoucherDA.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@include file="Connection.jsp" %>
      <%
Statement st=con.createStatement();
ResultSet rs = null;
String id=request.getParameter("refid");
ResultSet rs1=null;
String loginid=(String)session.getAttribute("logid");
String name=(String)session.getAttribute("uname");
String firstname=(String)session.getAttribute("firstname");

%>
<%!
int refno=0;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%
try
{
	String jno=request.getParameter("jno");
    String jdate=request.getParameter("jdate");
    String narr=request.getParameter("narr");
    String debittotal=request.getParameter("total");
    String credittotal=request.getParameter("total2");
    
    String[] a=null;
	String[] b=null;
	String[] c=null;
	String[] d=null;
	
	a=request.getParameterValues("bytoo[]");
	b=request.getParameterValues("particId[]");
	c=request.getParameterValues("amt[]");
	d=request.getParameterValues("amt2[]");
	
	int i=st.executeUpdate("delete from journalentry where ref_no="+id+"");
	{
		for(int j=1;j<= b.length-1 ;j++){
			
			
		int k=st.executeUpdate("insert into journalentry(journal_no,ref_no,particulars,debit,credit,created_date,narration,createdby,type,paid_amt) values('"+jno+"','"+id+"','"+b[j]+"',"+c[j]+","+d[j]+",'"+jdate+"','"+narr+"',"+loginid+",'"+a[j]+"',0)");
		}
		
		}
		response.sendRedirect("Journalvoucher.jsp");
	
}
catch(Exception el)
{
	
}
%>
</body>
</html>