Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,
I am designing a webapplication using Eclipse Luna for programming and SQL for database.
I stuck somewhere in code but cant get it done after so many trials.
I attach hereby my code and jsp page too. I do get the data which i required to display but the problem is, for each new input you have refresh the webpage. Otherwise you are getting the same record which was the last input. Please help me.

What I have tried:

DigitRef Servlet:

package servlets;

import java.io.IOException;
import java.sql.SQLException;
import java.util.List;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import bo.Allgetset;

import com.dao.AllDao;

/**
 * Servlet implementation class DigitRef
 */
@WebServlet("/DigitRef")
public class DigitRef extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public DigitRef() 
    {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		System.out.println("digitRef Get");
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		
		
		System.out.println("hello cardnumber chk");
		 
		HttpSession session=request.getSession(true);
		session.removeAttribute("Unbe");
		try
		{
			System.out.println("Inside DigitRef");
		AllDao ad=new AllDao(); 
		
		String cardNo=request.getParameter("cardnumber");
		System.out.println(cardNo);
		// check if the cardnumber is 22 digit?
		
		if (cardNo.length()!=22)
		{
		// error message if No 22 digits
			
			System.out.println("no 22 digits");
//			session.removeAttribute("Unbe");
			session.setAttribute("Unbe", "Unbekannte Karte");
			RequestDispatcher rs = request.getRequestDispatcher("TabStartseit.jsp");
			rs.include(request, response);
			
		}
	
		// check if card belongs to BWM or not?
		
		else if(!ad.CheckCompany(cardNo.substring(0,7)))
		{
			
		// error message if  NO BWM card
			//insert to db
			try {
				ad.insertIfNotBwm(cardNo, "Not BWM card");
			} catch (ClassNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (InstantiationException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (IllegalAccessException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			System.out.println("Not BWM card");
//			session.removeAttribute("Unbe");
			session.setAttribute("Unbe", "Unbekannte Karte");
			RequestDispatcher rs = request.getRequestDispatcher("TabStartseit.jsp");
			rs.include(request, response);
			
		}
		// check if card is KaufKarte or Meldewesen Karte?
			
		else if (ad.chkPre(cardNo.substring(0,4)))
						{
		//  Output Kaufkarte / Prepaid
			
			System.out.println("Prepaid card / Kauf Karte / Kunden Karte");
//			session.removeAttribute("cardNo");
			session.setAttribute("cardNo", cardNo);
			
			
			String s1=(String) session.getAttribute("user");
			System.out.println(s1);
			
			List<Allgetset> servicesList=ad.getServices(session.getAttribute("user").toString(),session.getAttribute("pass").toString());
			System.out.println(servicesList.size());
			
		for(Allgetset s:servicesList) 
						{ 
							System.out.println("Services for Kaufkarte");
							System.out.println(s.getService());
						}
//		session.removeAttribute("servicejsp");
		session.setAttribute("servicejsp", servicesList);
		
		 if(servicesList.size()==1)
		 {
//			 session.removeAttribute("disable");
			 session.setAttribute("disable", "disabled=disabled");
			 System.out.println("===========================================================================");
			 RequestDispatcher rs = request.getRequestDispatcher("Leis1");
			 rs.forward(request, response);
		 }
		 else if(servicesList.size()>1)
		 {
//			 session.removeAttribute("autodisable");
			 session.setAttribute("autodisable", "true");
			 RequestDispatcher rs = request.getRequestDispatcher("Leis1");
			 rs.forward(request, response);
		 }
		 else
		 {
//			 session.removeAttribute("disable");
			 session.setAttribute("disable", "");
		RequestDispatcher rs = request.getRequestDispatcher("TabStartseit.jsp");
	    rs.forward(request, response);
		 }
		
		}
		
		else 
			
		{
			
		// Output  Meldewesen Karte
			
			System.out.println("Instant card / Meldewesen Karte");
			String s1=(String) session.getAttribute("user");
			
			System.out.println(s1);
			List<Allgetset> servicesList=ad.getServices(session.getAttribute("user").toString(),session.getAttribute("pass").toString());
					
			System.out.println("servListSize:"+servicesList.size());
			System.out.println("service :"+servicesList.get(0).getService());

		for(Allgetset s:servicesList) 
						{ 
							System.out.println("Services for Meldewesen Karte");
							System.out.println("service :"+s.getService());
						}
//		 	session.removeAttribute("cardNo");
			session.setAttribute("cardNo", cardNo);
			 
//			 session.removeAttribute("servicejsp");
			 session.setAttribute("servicejsp", servicesList);
			 if(servicesList.size()==1)
			 {
//				 session.removeAttribute("disable");
				 session.setAttribute("disable", "disabled=disabled");
				 System.out.println("===========================================================================");
				 RequestDispatcher rs = request.getRequestDispatcher("Leis1");
				 rs.forward(request, response);
			 }
			 else if(servicesList.size()>1)
			 {
//				 session.removeAttribute("autodisable");
				 session.setAttribute("autodisable", "true");
				 RequestDispatcher rs = request.getRequestDispatcher("Leis1");
				 rs.forward(request, response);
			 }
			 else
			 {
//				 session.removeAttribute("disable");
				 session.setAttribute("disable", "");
				 System.out.println("===========================================================================2");
			 RequestDispatcher rs = request.getRequestDispatcher("TabStartseit.jsp");
			 rs.forward(request, response);
			 }
		}
		
		
		} 
		catch (SQLException e) 
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}


Leis1 Servlet:


package servlets;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.dao.AllDao;

import bo.Allgetset;

import java.sql.SQLException;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

/**
 * Servlet implementation cla<pre><pre lang="java">ss Leis1
 */
@WebServlet("/Leis1")
public class Leis1 extends HttpServlet 
{
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public Leis1() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		System.out.println("Inside leis1");
		
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		HttpSession session=request.getSession(true);
		
		
		
		String carNo=(String) session.getAttribute("cardNo");
		System.out.println(carNo);
		String id;

		id = UUID.randomUUID().toString();
		
		String id1;

		id1 = UUID.randomUUID().toString();
		
		
		
		String id2;
		
		id2 = UUID.randomUUID().toString();
	
		Allgetset allgs=new Allgetset();
		AllDao ad=new AllDao();
		try 
		{
			System.out.println("Inside Leis1");
			String idLeistung="";
			List<Allgetset> li=ad.getCardData(carNo);
			List<Allgetset> gastDetails=ad.getGastCardDetails(carNo);
			String idGastCardType=li.get(0).getIdGastCardType();
			String endDate=li.get(0).getCardExpiry();
			
			
//			Date result =  li.get(0).getCardExpiry().parse(endDate);
//            System.out.println(result); 

			    
			    
			int usableDays=li.get(0).getGct_Nutzungstage();
			int withinDays=li.get(0).getGct_Nutzungsdauer();
			System.out.println("idGastCardType= " + idGastCardType);
			
		
			List<Allgetset> servList=(List<Allgetset>) session.getAttribute("servicejsp");
			System.out.println("Leistungen= "+servList.size());
			String autoDis=(String)session.getAttribute("autodisable");
			int autoDisableCnt=0;
			if(servList.size()==1)
			{
				for(Allgetset all:servList)
				{
					idLeistung=all.getIdLeistun();
				}
			}
			else if(autoDis.equalsIgnoreCase("true"))
			{
				autoDisableCnt=1;
				System.out.println("Inside Autodisable");
				
				for(Allgetset all:servList)
				{
					idLeistung=all.getIdLeistun();
					try
					{
						if(carNo.length()==22)
						{
							String barCode=carNo;
							
							String gac_KartenTypeCode=carNo.substring(0,7);
							System.out.println("gac_KartenTypeCode= "+gac_KartenTypeCode);
							
							String  gac_KartenNummer=carNo.substring(7,14);
							System.out.println("gac_KartenNummer= "+gac_KartenNummer);
							
							String gac_Klasse=carNo.substring(4,5);
							System.out.println("gac_Klasse= "+gac_Klasse);
							
							String gac_Kategorie=carNo.substring(5,7);
							System.out.println("gac_Kategorie= "+gac_Kategorie);
							
							String gac_Aufenthaltsdauer=carNo.substring(18,21);
							System.out.println("Days Stay= "+gac_Aufenthaltsdauer);
							int auf=Integer.parseInt(gac_Aufenthaltsdauer);
							String year=carNo.substring(14,15);
							System.out.println("Arrival year= "+year);
							
							String dayOfYear1=carNo.substring(15,18);
							System.out.println("Arrival Day of Year= "+dayOfYear1);
						
							
							// Program for recognizing Leap year 
							
							SimpleDateFormat format2 = new SimpleDateFormat("EEEE, d. MMMM y",Locale.GERMANY);
							Date date2=new Date();
							String d2 = format2.format(date2);
							System.out.println("d2 :"+d2.substring(d2.length()-4,d2.length()));
							int arrival_yr=Integer.parseInt(d2.substring(d2.length()-4,d2.length()-1).trim()+year.trim());
							year=d2.substring(d2.length()-4,d2.length());
							
							// total no of days in a year 
							
							int NoOfDays_yr=365;
							GregorianCalendar gre_cal = new GregorianCalendar();
							
							if(gre_cal.isLeapYear(arrival_yr))
							{
							    System.out.print("Given year is leap year.");
							    NoOfDays_yr=366;
							}
							
						

//							Calendar cal2 = Calendar.getInstance();
//							SimpleDateFormat format2 = new SimpleDateFormat("EEEE, d. MMMM y",Locale.GERMANY);
////							Date date=new Date();
//							String d2 = format2.format(01-01-2016);
//							Date date1;
//							try {
//								date1 = format2.parse(d2);
//								cal2.setTime(date1);
//								
//								int numOfDays = cal2.getActualMaximum(Calendar.DAY_OF_YEAR);
//								System.out.println("No of days"+numOfDays);
//							} catch (ParseException e1) {
//								// TODO Auto-generated catch block
//								e1.printStackTrace();
//							}
							
							
							//  calculating the dates
							
							int dayOfYear = Integer.parseInt(dayOfYear1);
							int dayOfYear_auf = Integer.parseInt(gac_Aufenthaltsdauer);
							int lastDay=dayOfYear+dayOfYear_auf;
					        Calendar calendar = Calendar.getInstance();
					        calendar.set(Calendar.DAY_OF_YEAR, dayOfYear);
					        calendar.set(Calendar.YEAR, arrival_yr);
					        System.out.println("Guest's Arrival Day= " + dayOfYear );
					        Date arrival_date_cust=calendar.getTime();
					      
					        System.out.println("Arrival Date of Guest :"+arrival_date_cust);
							SimpleDateFormat format1 = new SimpleDateFormat("EEEE, d. MMMM y",Locale.GERMANY);
							System.out.println("Guest's Arrival Date= " + calendar.getTime());
							System.out.println();
							java.util.Date utilDate = (arrival_date_cust);
									SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
									final String stringDate= dateFormat.format(utilDate);
									final java.sql.Date sqlDate=  java.sql.Date.valueOf(stringDate);
							
							// Output Guest's Arrival & Departure day

							String gac_Anreise = format1.format( calendar.getTime());
//							  java.util.Date myDate = new java.util.Date(format1.format(gac_Anreise));
//								 java.sql.Date sqlDate = new java.sql.Date(myDate.getTime());
//							
								
							 
							if(NoOfDays_yr==366)
							{
								if(lastDay>366)
								{
									lastDay=lastDay-366;
									calendar.set(Calendar.DAY_OF_YEAR,lastDay);
									calendar.set(Calendar.YEAR, arrival_yr+1);
								}
								else
								{
									calendar.set(Calendar.DAY_OF_YEAR,lastDay);
									calendar.set(Calendar.YEAR, arrival_yr);
								}
							}
							else
							{
								if(lastDay>365)
								{
								lastDay=lastDay-365;
								calendar.set(Calendar.DAY_OF_YEAR,lastDay);
								calendar.set(Calendar.YEAR, arrival_yr+1);
								}
								else
								{
									calendar.set(Calendar.DAY_OF_YEAR,lastDay);
									calendar.set(Calendar.YEAR, arrival_yr);
								}
							}
							
							Date lastDayDate_cust=calendar.getTime();
							System.out.println("Last day of customer :"+lastDay);
							String gac_Aufenthaltsdauer1 = format1.format( calendar.getTime());

							System.out.println("Guest's Arrival Date= "+gac_Anreise);
							
							System.out.println("Guest's Arrival Day= " +dayOfYear);
							System.out.println("Guest's Departure Day= "+lastDay);
							System.out.println("Guest's Stay Days= "+gac_Aufenthaltsdauer);
					
						
							
							// Output Current Date (Heutige Datum) 
							
							Date date=new Date();
							
							String todayDate = format1.format(date);

							System.out.println("Today's Date= "+date);
							

							li=ad.getLeistungsFreigabe(idGastCardType,idLeistung);
							
							// Current Day is which day of the year
							
							Calendar calendar4 = Calendar.getInstance();
					    	int day = calendar4.get(Calendar.DAY_OF_WEEK);
							Calendar cal = new GregorianCalendar();
							cal.setTime(new Date()); // Give your own date
							System.out.println("Today is Day of the year= "+cal.get(Calendar.DAY_OF_YEAR));
							int todayDay=cal.get(Calendar.DAY_OF_YEAR);
							
							
							int isPre=0;
							
							if(li.size()>0)
						
								
							{
								
								Boolean servNotActive=false;
								allgs=li.get(0);
								
								int gcn_Counter=allgs.getGcn_counter();
								int perDayCnt=allgs.getRemainingServicesPerDay();
								
								System.out.println("Gcn Cnt :"+gcn_Counter);
								
								
							   
								
								String idLeistungsFreigabe=allgs.getIdLeistungsFreigabe();
//								List<Allgetset> gastCardDet=ad.getGastCardDetails(idLeistungsFreigabe, idLeistung);
								 if (ad.chkPre(carNo.substring(0,4)))
								 {
									 isPre=1;
									 
							// Limitation current date <= EndDatum in dbo.GastCardTyp   Prepaid cards
									
								 
//								Date d;
								try {
//									d = format1.parse(endDate);
									
									 SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
									    SimpleDateFormat out = new SimpleDateFormat("dd-MM-yy HH:mm:ss");

									    Date d = in.parse(endDate);
//									    String result = out.format(date);
//									    System.out.println(result);
									
									
									cal.setTime(d); 
									System.out.println("End Day of validity= "+cal.get(Calendar.DAY_OF_YEAR));
									int endDatumDay=cal.get(Calendar.DAY_OF_YEAR);
									
									
									if(!(new Date().compareTo(d)<=0))
									{
										servNotActive=true;
										System.out.println("error msg");
									}
									
									
									// Limitation on uses Per Stay and Per Day Prepaid cards // 0151102467810770010509 
									
									else if(allgs.getGcn_counter()<allgs.getLef_NutzungsAnzahl())
									{
										System.out.println("Inside allgs.getGcn_counter()<allgs.getLef_NutzungsAnzahl()");
										gcn_Counter++;
										

										if(allgs.getLef_EinmalProTag())
										{
											if(new Date().compareTo(allgs.getGcn_TimeStamp())==0)
											{
												if(allgs.getRemainingServicesPerDay()==0)
												{
													perDayCnt=1;
												}
												else
												{
													System.out.println("Inside EnimalProTag");
													System.out.println("Already used for today");
													perDayCnt=allgs.getRemainingServicesPerDay();
													servNotActive=true;
													
//													session.removeAttribute("notactive");
													session.setAttribute("notactive", "Nutzungs-Limit wurde erreicht!");
												}
											}
											else
											{
											perDayCnt=1;
											}
										}
										else if(!allgs.getLef_EinmalProTag())
										{
											System.out.println("Service  per Day limit exceed / Nutzungs-Limit wurde erreicht!");
											perDayCnt=allgs.getRemainingServicesPerDay();
											servNotActive=true;
//											session.removeAttribute("notactive");
											session.setAttribute("notactive", "Nutzungs-Limit wurde erreicht!");
										}
									}
									
									else if(allgs.getGcn_counter()==allgs.getLef_NutzungsAnzahl())
									{
										System.out.println("Inside allgs.getGcn_counter()==allgs.getLef_NutzungsAnzahl()");

										servNotActive=true;
//										session.removeAttribute("notactive");
										session.setAttribute("notactive", "Nutzungs-Limit wurde erreicht!");
										System.out.println("Service per Stay limit exceed / Nutzungs-Limit wurde erreicht!");
										gcn_Counter=allgs.getLef_NutzungsAnzahl();
										perDayCnt=allgs.getRemainingServicesPerDay();
									}
									else if(allgs.getGcn_counter()==0)
									{
										servNotActive=true;
//										session.removeAttribute("notactive");
										session.setAttribute("notactive", "Nutzungs-Limit wurde erreicht!");
									}
									
									
									
									// Limitation on Weekdays Prepaid cards
									
									
									else if(allgs.getLef_Wochentage()!=0)
									{
										if(allgs.getLef_Wochentage()==day)
										{
											
											System.out.println("cannot able to use on"+day+" of week");
											servNotActive=true;
//											session.removeAttribute("notactive");
											session.setAttribute("notactive", "cannot able to use on"+day+" of week");
										}
									}
									
									
								// Limitation on 3 types of prepaid card 
									
									else if(gastDetails.size()!=0)
									{	Calendar c = Calendar.getInstance(); 
									c.setTime(gastDetails.get(0).getGac_TimeStamp()); 
									c.add(Calendar.DATE, withinDays);
										if(!(gastDetails.get(0).getGac_TimeStamp().compareTo(c.getTime())<0))
										{
											servNotActive=true;
//											session.removeAttribute("notactive");
											session.setAttribute("notactive", "NotActive");
										if(!(gastDetails.size()<usableDays))
										{
//											session.removeAttribute("notactive");
											session.setAttribute("notactive", "NotActive");

										}
										
										
										else if(gastDetails.size()==allgs.getGct_Nutzungstage())
										{
											System.out.println("cannot use");
											servNotActive=true;
//											session.removeAttribute("notactive");
											session.setAttribute("notactive", "cannot use");
										}
										}
									}
								} catch (ParseException e) {
									System.out.println("Inside catch");
									// TODO Auto-generated catch block
									e.printStackTrace();
								}
								
								
								 
								 }
								 
								 
								 
								//* Programs for Limitations of Instant cards (Meldewesen) *// 
								 
								// Program for Limitation not on arrival day (Nicht am Anreise Tag) 0150104028614170450119
								 
								 else{
								
									 System.out.println("allgs.getLef_NichtAmAnreisetag() :"+allgs.getLef_NichtAmAnreisetag());
									 System.out.println("allgs.getLef_NichtAmAbreisetag() :"+allgs.getLef_NichtAmAbreisetag());
									 if(allgs.getLef_NichtAmAnreisetag())
									 {
										 if(gac_Anreise.equals(todayDate))
										 {
											
											 //cannot use (error Limitation Anreisetag)  "Fehlermeldung"  // Instant cards
											 
											servNotActive=true;
											System.out.println("Leistung am Anreisetag nicht gültig.");
//											session.removeAttribute("notactive");
											session.setAttribute("notactive", "Leistung am Anreisetag nicht gültig.");
											 
										}
									 }
								 
								 

						
								// Program for Limitation Not on Departure Day (Nicht am Abreise Tag) Instant cards
								
				 
								else if(allgs.getLef_NichtAmAbreisetag())
									 {
									System.out.println("Inside dep Day");
										if(new Date().compareTo(lastDayDate_cust)==0)
										{
											//cannot use (error Limitation Abreisetag)  "Fehlermeldung"  // 
											servNotActive=true;
											System.out.println("Leistung am Abreisetag nicht gültig.");
//											session.removeAttribute("notactive");
											session.setAttribute("notactive", "Leistung am Abreisetag nicht gültig.");
										
											System.out.println("======*****========");
										}
									 }
									 
								// Program for Limitation Today's date in the period of stay (arrival and departure)? Instant cards
				 
								 
								else if(!(arrival_date_cust.compareTo(new Date())<0&&(new Date().compareTo(lastDayDate_cust)<0))) 
								 {
									 servNotActive=true;
										System.out.println("Karte ausserhalb des Gültigkeitszeitraums.");
//										session.removeAttribute("notactive");
										session.setAttribute("notactive", "Karte ausserhalb des Gültigkeitszeitraums.");
								}
								
					
								 
								 
								 // Program for Limitation MindestAufenthalt (Minimum Stay of Guest)  Instant cards
								 
								else if(allgs.getLef_MindestAufenthalt()>Integer.parseInt(gac_Aufenthaltsdauer))
								{
									//cannot use
									servNotActive=true;
									System.out.println("Leistung durch zu geringen MindestAufhenthalt nicht verfügbar. Sie müssen mindestens " + allgs.getLef_MindestAufenthalt()+" Tage Aufenthalten.");
//									session.removeAttribute("notactive");
									session.setAttribute("notactive", "Leistung durch zu geringen MindestAufhenthalt nicht verfügbar.");

								}
								 
								 
								// Program for limitation Anzahl Nutzungen Pro Zeitraum and Anzahl Nutzungen Pro Tag Instant cards
								 
								else if(allgs.getGcn_counter()<allgs.getLef_NutzungsAnzahl())
								{
									
									gcn_Counter++;
									
//									if(allgs.getRemainingServicesPerDay()<allgs.getLef_EinmalProTag())
//									{
//										perDayCnt++;
//									}
//									else if(allgs.getRemainingServicesPerDay()==allgs.getLef_EinmalProTag())
//									{
//										System.out.println("Service  per Day limit exceed / Nutzungs-Limit wurde erreicht!");
//										perDayCnt=allgs.getLef_EinmalProTag();
//										servNotActive=true;
//										session.setAttribute("notactive", "Nutzungs-Limit wurde erreicht!");
//									}
									
									if(allgs.getLef_EinmalProTag())
									{
										if(new Date().compareTo(allgs.getGcn_TimeStamp())==0)
										{
											if(allgs.getRemainingServicesPerDay()==0)
											{
												perDayCnt=1;
											}
											else
											{
												System.out.println("Already used for today");
												perDayCnt=allgs.getRemainingServicesPerDay();
												servNotActive=true;
//												session.removeAttribute("notactive");
												session.setAttribute("notactive", "Nutzungs-Limit wurde erreicht!");
											}
										}
										else
										{
										perDayCnt=1;
										}
									}
									else if(!allgs.getLef_EinmalProTag())
									{
										System.out.println("Service  per Day limit exceed / Nutzungs-Limit wurde erreicht!");
										perDayCnt=allgs.getRemainingServicesPerDay();
										servNotActive=true;
//										session.removeAttribute("notactive");
										session.setAttribute("notactive", "Nutzungs-Limit wurde erreicht!");
									}
								}
								
								else if(allgs.getGcn_counter()==allgs.getLef_NutzungsAnzahl())
								{
									servNotActive=true;
//									session.removeAttribute("notactive");
									session.setAttribute("notactive", "Nutzungs-Limit wurde erreicht!");
									System.out.println("Service per Stay limit exceed / Nutzungs-Limit wurde erreicht!");
									gcn_Counter=allgs.getLef_NutzungsAnzahl();
									perDayCnt=allgs.getRemainingServicesPerDay();
								}
								else if(allgs.getGcn_counter()==0)
								{
									servNotActive=true;
//									session.removeAttribute("notactive");
									session.setAttribute("notactive", "Nutzungs-Limit wurde erreicht!");
								}
									 
									 // Limitation for uses on Weekdays Instant cards
									 
								else if(allgs.getLef_Wochentage()!=0)
								{
									if(allgs.getLef_Wochentage()==day)
									{
										
										System.out.println("cannot able to use on"+day+" of week");
										servNotActive=true;
//										session.removeAttribute("notactive");
										session.setAttribute("notactive", "cannot able to use on"+day+" of week");
									}
								}
								 
									 
								 
								 } 
							
								 
								 // (any of the above conditions not satisfied) Display Error and Save in DB   //  
								
								if(servNotActive)
								{
									String gcn_Meldung=(String)session.getAttribute("notactive");
									try {
										ad.insertBarcodeDetails(id, idGastCardType,carNo,gac_KartenTypeCode,gac_KartenNummer,gac_Klasse,gac_Kategorie,auf,sqlDate,isPre,idLeistungsFreigabe,idLeistung,false,gcn_Meldung);
										
										ad.updateServiceDetails(allgs.getKontaktId(),idGastCardType,idLeistung,idLeistungsFreigabe,false,gcn_Meldung,gcn_Counter,perDayCnt);
									} catch (ClassNotFoundException e) {
										// TODO Auto-generated catch block
										e.printStackTrace();
									} catch (InstantiationException e) {
										// TODO Auto-generated catch block
										e.printStackTrace();
									} catch (IllegalAccessException e) {
										// TODO Auto-generated catch block
										e.printStackTrace();
									}
									System.out.println("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
//									RequestDispatcher rs = request.getRequestDispatcher("TabStartseit.jsp");
//								    rs.forward(request, response);
								}
								
//								if(servNotActive)
//								{
//									session.getAttribute("notactive");
//									
//									try {
//										ad.insertServiceDetails(id,id1,idLeistung,gcn_Gueltig,gcn_Meldung,gcn_Counter,gcn_AnzahlVerwendetNutzungenprotag);
//									} catch (ClassNotFoundException e) {
//										// TODO Auto-generated catch block
//										e.printStackTrace();
//									} catch (InstantiationException e) {
//										// TODO Auto-generated catch block
//										e.printStackTrace();
//									} catch (IllegalAccessException e) {
//										// TODO Auto-generated catch block
//										e.printStackTrace();
//									}
				//
//									RequestDispatcher rs = request.getRequestDispatcher("ServiceMes.jsp");
//								    rs.forward(request, response);
//								
//								}
					
								
								 // (All conditions satisfied) Display Success and Save in DB   //  
								else  
								{
//									session.removeAttribute("active");
									session.setAttribute("active", "Leistung gewähren!");
									String msgActive="Leistung gewähren!";
									
									try 
									{
										ad.insertBarcodeDetails(id, idGastCardType,carNo,gac_KartenTypeCode,gac_KartenNummer,gac_Klasse,gac_Kategorie,auf,sqlDate,isPre,idLeistungsFreigabe,idLeistung,true,(String)session.getAttribute("active"));
										ad.updateServiceDetails(allgs.getKontaktId(),idGastCardType,idLeistung,idLeistungsFreigabe,false,msgActive,gcn_Counter,perDayCnt);
									} catch (ClassNotFoundException e) {
										// TODO Auto-generated catch block
										e.printStackTrace();
									} catch (InstantiationException e) {
										// TODO Auto-generated catch block
										e.printStackTrace();
									} catch (IllegalAccessException e) {
										// TODO Auto-generated catch block
										e.printStackTrace();
									}
									System.out.println("bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
//									RequestDispatcher rs = request.getRequestDispatcher("TabStartseit.jsp");
//								    rs.forward(request, response);
								
								}
								
							}
							
						}
						
						
						} 
						catch (SQLException e) 
						{
							// TODO Auto-generated catch block
							e.printStackTrace();
						}

					
					
					
					
				}
				
				
			}
			else
			{
				String name=request.getParameter("servno");
				System.out.println("ServNo :"+name);
				int i=0;
				for(Allgetset all:servList)
				{
					i++;
					if(name.equals("service"+i+""))
					{
						idLeistung=all.getIdLeistun();
					}
				}
//				Enumeration en=request.getParameterNames();
//				
//				while(en.hasMoreElements())
//				{
//					Object obj=en.nextElement();
//					String name=(String)obj;
//					System.out.println(name);
//					
//					int i=0;
//					for(Allgetset all:servList)
//					{
//						i++;
//						if(name.equals("service"+i+""))
//						{
//							idLeistung=all.getIdLeistun();
//						}
//					}
					
//				}
			}
		// instant card no: 0150104028614163490119 // 0150104028618690013659 
		// prepaid card no: 0132401000018700100119 // 0132401000018070013659 // 0132401000018670130259 // 
		
		
		
		// Separating the Barcode Digits and calculating the dates from it
		
		if(autoDisableCnt==0)
		{
		if(carNo.length()==22)
		{
			String barCode=carNo;
			
			String gac_KartenTypeCode=carNo.substring(0,7);
			System.out.println("gac_KartenTypeCode= "+gac_KartenTypeCode);
			
			String  gac_KartenNummer=carNo.substring(7,14);
			System.out.println("gac_KartenNummer= "+gac_KartenNummer);
			
			String gac_Klasse=carNo.substring(4,5);
			System.out.println("gac_Klasse= "+gac_Klasse);
			
			String gac_Kategorie=carNo.substring(5,7);
			System.out.println("gac_Kategorie= "+gac_Kategorie);
			
			String gac_Aufenthaltsdauer=carNo.substring(18,21);
			System.out.println("Days Stay= "+gac_Aufenthaltsdauer);
			int auf=Integer.parseInt(gac_Aufenthaltsdauer);
			String year=carNo.substring(14,15);
			System.out.println("Arrival year= "+year);
			
			String dayOfYear1=carNo.substring(15,18);
			System.out.println("Arrival Day of Year= "+dayOfYear1);
		
			
			// Program for recognizing Leap year 
			
			SimpleDateFormat format2 = new SimpleDateFormat("EEEE, d. MMMM y",Locale.GERMANY);
			Date date2=new Date();
			String d2 = format2.format(date2);
			System.out.println("d2 :"+d2.substring(d2.length()-4,d2.length()));
			int arrival_yr=Integer.parseInt(d2.substring(d2.length()-4,d2.length()-1).trim()+year.trim());
			year=d2.substring(d2.length()-4,d2.length());
			
			// total no of days in a year 
			
			int NoOfDays_yr=365;
			GregorianCalendar gre_cal = new GregorianCalendar();
			
			if(gre_cal.isLeapYear(arrival_yr))
			{
			    System.out.print("Given year is leap year.");
			    NoOfDays_yr=366;
			}
			

//			Calendar cal2 = Calendar.getInstance();
//			SimpleDateFormat format2 = new SimpleDateFormat("EEEE, d. MMMM y",Locale.GERMANY);
////			Date date=new Date();
//			String d2 = format2.format(01-01-2016);
//			Date date1;
//			try {
//				date1 = format2.parse(d2);
//				cal2.setTime(date1);
//				
//				int numOfDays = cal2.getActualMaximum(Calendar.DAY_OF_YEAR);
//				System.out.println("No of days"+numOfDays);
//			} catch (ParseException e1) {
//				// TODO Auto-generated catch block
//				e1.printStackTrace();
//			}
			
			
			//  calculating the dates
			
			int dayOfYear = Integer.parseInt(dayOfYear1);
			int dayOfYear_auf = Integer.parseInt(gac_Aufenthaltsdauer);
			int lastDay=dayOfYear+dayOfYear_auf;
	        Calendar calendar = Calendar.getInstance();
	        calendar.set(Calendar.DAY_OF_YEAR, dayOfYear);
	        calendar.set(Calendar.YEAR, arrival_yr);
	        System.out.println("Guest's Arrival Day= " + dayOfYear );
	        Date arrival_date_cust=calendar.getTime();
	      
	        System.out.println("Arrival Date of Guest :"+arrival_date_cust);
			SimpleDateFormat format1 = new SimpleDateFormat("EEEE, d. MMMM y",Locale.GERMANY);
			System.out.println("Guest's Arrival Date= " + calendar.getTime());
			System.out.println();
			java.util.Date utilDate = (arrival_date_cust);
					SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
					final String stringDate= dateFormat.format(utilDate);
					final java.sql.Date sqlDate=  java.sql.Date.valueOf(stringDate);
			
			// Output Guest's Arrival & Departure day

			String gac_Anreise = format1.format( calendar.getTime());
//			  java.util.Date myDate = new java.util.Date(format1.format(gac_Anreise));
//				 java.sql.Date sqlDate = new java.sql.Date(myDate.getTime());
//			
				
			 
			if(NoOfDays_yr==366)
			{
				if(lastDay>366)
				{
					lastDay=lastDay-366;
					calendar.set(Calendar.DAY_OF_YEAR,lastDay);
					calendar.set(Calendar.YEAR, arrival_yr+1);
				}
				else
				{
					calendar.set(Calendar.DAY_OF_YEAR,lastDay);
					calendar.set(Calendar.YEAR, arrival_yr);
				}
			}
			else
			{
				if(lastDay>365)
				{
				lastDay=lastDay-365;
				calendar.set(Calendar.DAY_OF_YEAR,lastDay);
				calendar.set(Calendar.YEAR, arrival_yr+1);
				}
				else
				{
					calendar.set(Calendar.DAY_OF_YEAR,lastDay);
					calendar.set(Calendar.YEAR, arrival_yr);
				}
			}
			
			Date lastDayDate_cust=calendar.getTime();
			System.out.println("Last day of customer :"+lastDay);
			String gac_Aufenthaltsdauer1 = format1.format( calendar.getTime());

			System.out.println("Guest's Arrival Date= "+gac_Anreise);
			
			System.out.println("Guest's Arrival Day= " +dayOfYear);
			System.out.println("Guest's Departure Day= "+lastDay);
			System.out.println("Guest's Stay Days= "+gac_Aufenthaltsdauer);
	
		
			
			// Output Current Date (Heutige Datum) 
			
			Date date=new Date();
			
			String todayDate = format1.format(date);

			System.out.println("Today's Date= "+date);
			

			li=ad.getLeistungsFreigabe(idGastCardType,idLeistung);
			
			// Current Day is which day of the year
			
			Calendar calendar4 = Calendar.getInstance();
	    	int day = calendar4.get(Calendar.DAY_OF_WEEK);
			Calendar cal = new GregorianCalendar();
			cal.setTime(new Date()); // Give your own date
			System.out.println("Today is Day of the year= "+cal.get(Calendar.DAY_OF_YEAR));
			int todayDay=cal.get(Calendar.DAY_OF_YEAR);
			
			
			int isPre=0;
			
			if(li.size()>0)
		
				
			{
				
				Boolean servNotActive=false;
				allgs=li.get(0);
				
				int gcn_Counter=allgs.getGcn_counter();
				int perDayCnt=allgs.getRemainingServicesPerDay();
				
				System.out.println("Gcn Cnt :"+gcn_Counter);
				
				
			   
				
				String idLeistungsFreigabe=allgs.getIdLeistungsFreigabe();
//				List<Allgetset> gastCardDet=ad.getGastCardDetails(idLeistungsFreigabe, idLeistung);
				 if (ad.chkPre(carNo.substring(0,4)))
				 {
					 isPre=1;
					 
			// Limitation current date <= EndDatum in dbo.GastCardTyp   Prepaid cards
					
				 
//				Date d;
				try {
//					d = format1.parse(endDate);
					
					 SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
					    SimpleDateFormat out = new SimpleDateFormat("dd-MM-yy HH:mm:ss");

					    Date d = in.parse(endDate);
//					    String result = out.format(date);
//					    System.out.println(result);
					
					
					cal.setTime(d); 
					System.out.println("End Day of validity= "+cal.get(Calendar.DAY_OF_YEAR));
					int endDatumDay=cal.get(Calendar.DAY_OF_YEAR);
					
					
					if(!(new Date().compareTo(d)<=0))
					{
						servNotActive=true;
						System.out.println("error msg");
					}
					
					
					// Limitation on uses Per Stay and Per Day Prepaid cards // 0151102467810770010509 
					
					else if(allgs.getGcn_counter()<allgs.getLef_NutzungsAnzahl())
					{
						System.out.println("Inside allgs.getGcn_counter()<allgs.getLef_NutzungsAnzahl()");
						gcn_Counter++;
						
//						if(allgs.getRemainingServicesPerDay()<allgs.getLef_EinmalProTag())
//						{
//							perDayCnt++;
//						}
//						else if(allgs.getRemainingServicesPerDay()==allgs.getLef_EinmalProTag())
//						{
//							System.out.println("Service  per Day limit exceed / Nutzungs-Limit wurde erreicht!");
//							perDayCnt=allgs.getLef_EinmalProTag();
//							servNotActive=true;
//							session.setAttribute("notactive", "Nutzungs-Limit wurde erreicht!");
//						}
						if(allgs.getLef_EinmalProTag())
						{
							if(new Date().compareTo(allgs.getGcn_TimeStamp())==0)
							{
								if(allgs.getRemainingServicesPerDay()==0)
								{
									perDayCnt=1;
								}
								else
								{
									System.out.println("Inside EnimalProTag");
									System.out.println("Already used for today");
									perDayCnt=allgs.getRemainingServicesPerDay();
									servNotActive=true;
//									session.removeAttribute("notactive");
									session.setAttribute("notactive", "Nutzungs-Limit wurde erreicht!");
								}
							}
							else
							{
							perDayCnt=1;
							}
						}
						else if(!allgs.getLef_EinmalProTag())
						{
							System.out.println("Service  per Day limit exceed / Nutzungs-Limit wurde erreicht!");
							perDayCnt=allgs.getRemainingServicesPerDay();
							servNotActive=true;
//							session.removeAttribute("notactive");
							session.setAttribute("notactive", "Nutzungs-Limit wurde erreicht!");
						}
					}
					
					else if(allgs.getGcn_counter()==allgs.getLef_NutzungsAnzahl())
					{
						System.out.println("Inside allgs.getGcn_counter()==allgs.getLef_NutzungsAnzahl()");

						servNotActive=true;
//						session.removeAttribute("notactive");
						session.setAttribute("notactive", "Nutzungs-Limit wurde erreicht!");
						System.out.println("Service per Stay limit exceed / Nutzungs-Limit wurde erreicht!");
						gcn_Counter=allgs.getLef_NutzungsAnzahl();
						perDayCnt=allgs.getRemainingServicesPerDay();
					}
					else if(allgs.getGcn_counter()==0)
					{
						servNotActive=true;
//						session.removeAttribute("notactive");
						session.setAttribute("notactive", "Nutzungs-Limit wurde erreicht!");
					}
					
					
					
					// Limitation on Weekdays Prepaid cards
					
					
					else if(allgs.getLef_Wochentage()!=0)
					{
						if(allgs.getLef_Wochentage()==day)
						{
							
							System.out.println("cannot able to use on"+day+" of week");
							servNotActive=true;
//							session.removeAttribute("notactive");
							session.setAttribute("notactive", "cannot able to use on"+day+" of week");
						}
					}
					
					
				// Limitation on 3 types of prepaid card 
					
					else if(gastDetails.size()!=0)
					{	Calendar c = Calendar.getInstance(); 
					c.setTime(gastDetails.get(0).getGac_TimeStamp()); 
					c.add(Calendar.DATE, withinDays);
						if(!(gastDetails.get(0).getGac_TimeStamp().compareTo(c.getTime())<0))
						{
							servNotActive=true;
//							session.removeAttribute("notactive");
							session.setAttribute("notactive", "NotActive");
						if(!(gastDetails.size()<usableDays))
						{
//							session.removeAttribute("notactive");
							
							session.setAttribute("notactive", "NotActive");
//							try {
//								ad.insertBarcodeDetails(id, idGastCardType,carNo,gac_KartenTypeCode,gac_KartenNummer,gac_Klasse,gac_Kategorie,auf,sqlDate,isPre,idLeistungsFreigabe,idLeistung,false,(String)session.getAttribute("active"));
//							} catch (ClassNotFoundException e) {
//								// TODO Auto-generated catch block
//								e.printStackTrace();
//							} catch (InstantiationException e) {
//								// TODO Auto-generated catch block
//								e.printStackTrace();
//							} catch (IllegalAccessException e) {
//								// TODO Auto-generated catch block
//								e.printStackTrace();
//							}
						}
						
						
						else if(gastDetails.size()==allgs.getGct_Nutzungstage())
						{
							System.out.println("cannot use");
							servNotActive=true;
//							session.removeAttribute("notactive");
							session.setAttribute("notactive", "cannot use");
						}
						}
					}
				} catch (ParseException e) {
					System.out.println("Inside catch");
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				
				
				 
				 }
				 
				 
				 
				//* Programs for Limitations of Instant cards (Meldewesen) *// 
				 
				// Program for Limitation not on arrival day (Nicht am Anreise Tag) 0150104028614170450119
				 
				 else{
				
					 System.out.println("allgs.getLef_NichtAmAnreisetag() :"+allgs.getLef_NichtAmAnreisetag());
					 System.out.println("allgs.getLef_NichtAmAbreisetag() :"+allgs.getLef_NichtAmAbreisetag());
					 if(allgs.getLef_NichtAmAnreisetag())
					 {
						 if(gac_Anreise.equals(todayDate))
						 {
							
							 //cannot use (error Limitation Anreisetag)  "Fehlermeldung"  // Instant cards
							 
							servNotActive=true;
							System.out.println("Leistung am Anreisetag nicht gültig.");
//							session.removeAttribute("notactive");
							session.setAttribute("notactive", "Leistung am Anreisetag nicht gültig.");
							 
						}
					 }
				 
				 

		
				// Program for Limitation Not on Departure Day (Nicht am Abreise Tag) Instant cards
				
 
				else if(allgs.getLef_NichtAmAbreisetag())
					 {
					System.out.println("Inside dep Day");
						if(new Date().compareTo(lastDayDate_cust)==0)
						{
							//cannot use (error Limitation Abreisetag)  "Fehlermeldung"  // 
							servNotActive=true;
							System.out.println("Leistung am Abreisetag nicht gültig.");
//							session.removeAttribute("notactive");
							session.setAttribute("notactive", "Leistung am Abreisetag nicht gültig.");
						
							System.out.println("======*****========");
						}
					 }
					 
				// Program for Limitation Today's date in the period of stay (arrival and departure)? Instant cards
 
				 
				else if(!(arrival_date_cust.compareTo(new Date())<0&&(new Date().compareTo(lastDayDate_cust)<0))) 
				 {
					 servNotActive=true;
						System.out.println("Karte ausserhalb des Gültigkeitszeitraums.");
//						session.removeAttribute("notactive");
						session.setAttribute("notactive", "Karte ausserhalb des Gültigkeitszeitraums.");
				}
				
	
				 
				 
				 // Program for Limitation MindestAufenthalt (Minimum Stay of Guest)  Instant cards
				 
				else if(allgs.getLef_MindestAufenthalt()>Integer.parseInt(gac_Aufenthaltsdauer))
				{
					//cannot use
					servNotActive=true;
					System.out.println("Leistung durch zu geringen MindestAufhenthalt nicht verfügbar. Sie müssen mindestens " + allgs.getLef_MindestAufenthalt()+" Tage Aufenthalten.");
//					session.removeAttribute("notactive");
					session.setAttribute("notactive", "Leistung durch zu geringen MindestAufhenthalt nicht verfügbar.");

				}
				 
				 
				// Program for limitation Anzahl Nutzungen Pro Zeitraum and Anzahl Nutzungen Pro Tag Instant cards
				 
				else if(allgs.getGcn_counter()<allgs.getLef_NutzungsAnzahl())
				{
					
					gcn_Counter++;
					
//					if(allgs.getRemainingServicesPerDay()<allgs.getLef_EinmalProTag())
//					{
//						perDayCnt++;
//					}
//					else if(allgs.getRemainingServicesPerDay()==allgs.getLef_EinmalProTag())
//					{
//						System.out.println("Service  per Day limit exceed / Nutzungs-Limit wurde erreicht!");
//						perDayCnt=allgs.getLef_EinmalProTag();
//						servNotActive=true;
//						session.setAttribute("notactive", "Nutzungs-Limit wurde erreicht!");
//					}
					
					if(allgs.getLef_EinmalProTag())
					{
						System.out.println("DAteeeeeeeee eerrrrrror"+(allgs.getGcn_TimeStamp()));
						if(new Date().compareTo(allgs.getGcn_TimeStamp())==0)
						{
							if(allgs.getRemainingServicesPerDay()==0)
							{
								perDayCnt=1;
							}
							else
							{
								System.out.println("Already used for today");
								perDayCnt=allgs.getRemainingServicesPerDay();
								servNotActive=true;
//								session.removeAttribute("notactive");
								session.setAttribute("notactive", "Nutzungs-Limit wurde erreicht!");
							}
						}
						else
						{
						perDayCnt=1;
						}
					}
					else if(!allgs.getLef_EinmalProTag())
					{
						System.out.println("Service  per Day limit exceed / Nutzungs-Limit wurde erreicht!");
						perDayCnt=allgs.getRemainingServicesPerDay();
						servNotActive=true;
//						session.removeAttribute("notactive");
						session.setAttribute("notactive", "Nutzungs-Limit wurde erreicht!");
					}
				}
				
				else if(allgs.getGcn_counter()==allgs.getLef_NutzungsAnzahl())
				{
					servNotActive=true;
//					session.removeAttribute("notactive");
					session.setAttribute("notactive", "Nutzungs-Limit wurde erreicht!");
					System.out.println("Service per Stay limit exceed / Nutzungs-Limit wurde erreicht!");
					gcn_Counter=allgs.getLef_NutzungsAnzahl();
					perDayCnt=allgs.getRemainingServicesPerDay();
				}
				else if(allgs.getGcn_counter()==0)
				{
					servNotActive=true;
//					session.removeAttribute("notactive");
					session.setAttribute("notactive", "Nutzungs-Limit wurde erreicht!");
				}
					 
					 // Limitation for uses on Weekdays Instant cards
					 
				else if(allgs.getLef_Wochentage()!=0)
				{
					if(allgs.getLef_Wochentage()==day)
					{
						
						System.out.println("cannot able to use on"+day+" of week");
						servNotActive=true;
//						session.removeAttribute("notactive");
						session.setAttribute("notactive", "cannot able to use on"+day+" of week");
					}
				}
				 
					 
				 
				 } 
			
				 
				 // (any of the above conditions not satisfied) Display Error and Save in DB   //  
				
				if(servNotActive)
				{
//					session.removeAttribute("disable");
					session.setAttribute("disable", "disabled=disabled");
					String gcn_Meldung=(String)session.getAttribute("notactive");
					try {
						ad.insertBarcodeDetails(id, idGastCardType,carNo,gac_KartenTypeCode,gac_KartenNummer,gac_Klasse,gac_Kategorie,auf,sqlDate,isPre,idLeistungsFreigabe,idLeistung,false,gcn_Meldung);
						
						ad.updateServiceDetails(allgs.getKontaktId(),idGastCardType,idLeistung,idLeistungsFreigabe,false,gcn_Meldung,gcn_Counter,perDayCnt);
					} catch (ClassNotFoundException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					} catch (InstantiationException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					} catch (IllegalAccessException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
					System.out.println("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
//					RequestDispatcher rs = request.getRequestDispatcher("TabStartseit.jsp");
//				    rs.forward(request, response);
				}
				
//				if(servNotActive)
//				{
//					session.getAttribute("notactive");
//					
//					try {
//						ad.insertServiceDetails(id,id1,idLeistung,gcn_Gueltig,gcn_Meldung,gcn_Counter,gcn_AnzahlVerwendetNutzungenprotag);
//					} catch (ClassNotFoundException e) {
//						// TODO Auto-generated catch block
//						e.printStackTrace();
//					} catch (InstantiationException e) {
//						// TODO Auto-generated catch block
//						e.printStackTrace();
//					} catch (IllegalAccessException e) {
//						// TODO Auto-generated catch block
//						e.printStackTrace();
//					}
//
//					RequestDispatcher rs = request.getRequestDispatcher("ServiceMes.jsp");
//				    rs.forward(request, response);
//				
//				}
	
				
				 // (All conditions satisfied) Display Success and Save in DB   //  
				else  
				{
//					session.removeAttribute("active");
					session.setAttribute("active", "Leistung gewähren!");
					String msgActive="Leistung gewähren!";
					
					try 
					{
						ad.insertBarcodeDetails(id, idGastCardType,carNo,gac_KartenTypeCode,gac_KartenNummer,gac_Klasse,gac_Kategorie,auf,sqlDate,isPre,idLeistungsFreigabe,idLeistung,true,(String)session.getAttribute("active"));
						ad.updateServiceDetails(allgs.getKontaktId(),idGastCardType,idLeistung,idLeistungsFreigabe,false,msgActive,gcn_Counter,perDayCnt);
					} catch (ClassNotFoundException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					} catch (InstantiationException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					} catch (IllegalAccessException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
					System.out.println("bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
//					RequestDispatcher rs = request.getRequestDispatcher("TabStartseit.jsp");
//				    rs.forward(request, response);
				
				}
				
			}
			
		}
		}
		
		
		} 
		catch (SQLException e) 
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	
	}

}


My jsp:
<pre><%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ page import="java.io.*,java.util.*, javax.servlet.*" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page import="java.io.*,java.util.Locale" %>
<%@ page import="javax.servlet.*,javax.servlet.http.* "%>
<%@ page import="java.text.DateFormat,java.util.Date" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>  
<%@ page import="java.io.*,java.util.*,java.sql.*"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
<%@ page session="true" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="de">
<head>
  <title>Online-Terminal  </title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <link rel="shortcut icon" type="image/x-icon" href="images/Favicon_BWM.ico">
  <link rel="stylesheet" href="css/Style.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  
  
  <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
  <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
 
  
  <script src="http://code.jquery.com/jquery-latest.min.js"></script>
  <script src="js/jquery-1.11.1.js" type="text/javascript"></script>
  <script type="text/javascript" src="ajax.js"></script>
  <script src="js/sorttable.js"></script>
  
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
  <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
  <link rel="stylesheet" href="https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css">
<!--   <script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script> -->
 
 <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
 <script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script>
 <script src="https://cdn.datatables.net/1.10.13/js/dataTables.bootstrap.min.js"></script>
 <script src="https://cdn.datatables.net/buttons/1.2.4/js/dataTables.buttons.min.js"></script>
 <script src="https://cdn.datatables.net/buttons/1.2.4/js/buttons.bootstrap.min.js"></script>
 <script src="//cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.min.js"></script>
 <script src="//cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/pdfmake.min.js"></script>
 <script src="//cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/vfs_fonts.js"></script>
 <script src="//cdn.datatables.net/buttons/1.2.4/js/buttons.html5.min.js"></script>
 <script src="//cdn.datatables.net/buttons/1.2.4/js/buttons.print.min.js"></script>
 <script src="//cdn.datatables.net/buttons/1.2.4/js/buttons.colVis.min.js"></script>
 <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
 <link rel="stylesheet" href="/resources/demos/style.css">
 <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>  
 <script src="js/filter.js"></script>
 <script src="js/column.js"></script>
  
  

  




<!-- ******************************* STATISTICS DATATABLE ************************************** -->
 
<!--  ******************************* DATEPICKER  *************************** -->

<script>
  $( function() {
    $( "#startDate" ).datepicker();
  } );
</script>
<script>
  $( function() {
    $( "#tst" ).datepicker();
  } );
</script>


 
<script type="text/javascript">
      
  $(document).ready(function() {
	    var table = $('#example').DataTable( {
	    	
              
	        
			dom: 'Blfrtip',

	        buttons: [ {
                /* extend: 'print',
                exportOptions: {
                    columns: ':visible'
                }
            },
            
            
            'copy', 'excel', 'pdf' */
            
            extend: 'collection',
            text: 'Export ' ,
            buttons: [
                'copy',
                'excel',
                'pdf',
                'print'
	    
            
            ],
	    }],
	    "language": {
            "url": "//cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/German.json"},
	    
	    } );
	 
	    table.buttons().container()
	        .appendTo( '#example_wrapper .col-sm-6:eq(0)' );
	    
	} ); 
 
 
 /* $('#example').DataTable({
     "iDisplayLength": 20,
     "aLengthMenu": [[10, 20, 50, -1], [10, 20, 50, "All"]],
     "pagingType": "simple_numbers",
     "language": {
         searchPlaceholder: "Search",
         search: "",

     },
     "dom": '<"top"f>rt<"bottom"ilp><"clear">'
 }); */
 
 /* $(document).ready(function() {
	    $('#example').DataTable( {
	        "dom": '<"top"i>rt<"bottom"flp><"clear">'
	    } );
	} ); */
 
 
 /* $(document).ready(function() {
	    $('#example').dataTable( {
	        // Sets the row-num-selection "Show %n entries" for the user
	        "lengthMenu": [ 10,20, 40, 60, 80, 100 ], 
	        
	        // Set the default no. of rows to display
	        "pageLength": 20 
	    } );
	} ); */
</script>
      

<script type="text/javascript">
$(document).ready(function() {
	    // Setup - add a text input to each footer cell
	    $('#example tfoot th').each( function () {
	        var title = $(this).text();
	        $(this).html( '<input type="text" placeholder="Search '+title+'" />' );
	    } );
	 
	    // DataTable
	    var table = $('#example').DataTable();
	 
	    // Apply the search
	    table.columns().every( function () {
	        var that = this;
	 
	        $( 'input', this.footer() ).on( 'keyup change', function () {
	            if ( that.search() !== this.value ) {
	                that
	                    .search( this.value )
	                    .draw();
	            }
	        } );
	    } );
	} );

</script>

   


      
<!--    ************************* VALIDITY ************************* -->

<script type="text/javascript">

 $(document).ready(function() {
	
     $('#preview').click(function(event) {
    	 $("#chkcomments").load("statblock.jsp");
    	 $('#div3').text("");
             var name = $('#Kartennummer').val();
             $.post('GultigkartenServlet', {
           	  Kartennummer : name
             }, function(responseText) {
            	 if(responseText == 'Unbekannte Karte') {
            		 document.getElementById('cardDetDiv').style.visibility = 'hidden';
            		 
            		 $('#div3').text(responseText);
           		
                 } 
            	 else
            		 
            		 document.getElementById('cardDetDiv').style.visibility = 'visible';
//             	     document.getElementById('div1').style.backgroundColor = 'red';
                     $('#div2').text(responseText.substring(0,21));
                     $('#div1').text(responseText.substring(21,responseText.length));
                    
             });
     });
});
 
 
 $(document).ready(function()
		  {
		      $('#Kartennummer').click(function(){  
		           
		               $(this).val(''); 
		           
		      })
		  })
		  
		  
</script>

<!--     ************************************************ DATE FILTER *************************************************** -->

<script type="text/javascript">
$(document).ready(function(){
$('#pre').click(function(event) {
    	 
    	 var stdate = $('#startDate').val();
    	 var type=$( "#myselect" ).val();
    	 var test = $('#tst').val();
    	 
    	 
    	 $.post('DateSet', {
    		 startDate : stdate,
    		 filterType : type,
    		 tst : test
    		
         });
    	 location.reload();
     });
     
});
</script>


<!--     ************************************************ SERVICES *************************************************** -->


<script type="text/javascript">

$(document).ready(function(){
    $("button").click(function(){
        $("#div1").load("demo_test.txt");
    });
});
</script>



<script type="text/javascript">


 
 $(document).ready(function() {
	
     $('#preview2').click(function(event) {
    	 
             var cno = $('#cardnumber').val();
             $.post('DigitRef', {
            	 cardnumber : cno
             });
             
//              window.location.href = window.location.href;
//              window.location.replace(window.location);
              //location.reload(true);
		
     });
     

     
     $('#service1').click(function(event) {
    	 
    	
    	 
         var btn = $('#service1').attr("name");
         $.post('Leis1', {
        	 servno:btn
        	 
         });
         
       
//          window.location.href = window.location.href;
//          window.location.replace(window.location);
//          location.reload();
         
 });
     
    
 $('#service3').click(function(event) {
	 
	
	 
         var btn = $('#service3').attr("name");
         $.post('Leis1', {
        	 servno:btn
         });
         
//          window.location.href = window.location.href;
//          window.location.replace(window.location);
//          location.reload();
         
 });
 
 $('#service2').click(function(event) {
	 
	 
	 
     var btn = $('#service2').attr("name");
     $.post('Leis1', {
    	 servno:btn
     });
     
//      window.location.href = window.location.href;
//      window.location.replace(window.location);
//      location.reload();
     
});
     
     
});
 

</script>

<script>

function ClearFields() {

    document.getElementById("cardnumber").value = "";
    document.getElementById("Kartennummer").value = "";
    document.getElementById("startDate").value = "";
    document.getElementById("tst").value = "";
    document.getElementById("myselect").value = "";
    
    
}


function displaycover() {
    
    var x = document.getElementById('cover1');
    var y = document.getElementById('cover2');
    var z = document.getElementById('Stat');
    
    if (x.style.display === 'none') {
        x.style.display = 'block';
    } else {
        x.style.display = 'none';
    }
    
    if (y.style.display === 'none') {
    	 y.style.display = 'block';
	} else {
    	y.style.display = 'none';
	}
    
    
    if (z.style.display === 'none') {
        z.style.display = 'block';
    } else {
        z.style.display = 'none';
    }
}
</script>


<!-- <script>
function setCookie(cname,cvalue,exdays)
{
var d = new Date();
d.setTime(d.getTime()+(exdays*24*60*60*1000));
var expires = "expires="+d.toGMTString();
document.cookie = cname + "=" + cvalue + "; " + expires;
}

function getCookie(cname)
{
var name = cname + "=";
var ca = document.cookie.split(';');
for(var i=0; i<ca.length; i++)
  {
  var c = ca[i].trim();
  if (c.indexOf(name)==0) return c.substring(name.length,c.length);
}
return "";
}

function checkCookie()
{
var user=getCookie("Benutzername");
if (user!="")
  {

  return user;
  }
else
  {
  return false; 

  }
}

jQuery(document).ready(function(){
    if(checkCookie()){
        $( "#tabs" ).tabs({ active: checkCookie() });
    }else{
        $( "#tabs" ).tabs({ active: 0 });
    }
    jQuery("#tabs ul li a").click(function(){
        var status = jQuery(this).attr("href");       
        setCookie("Benutzername",parseInt(status.replace("#fragment-",""))-1,365);
   
    });
   

});
</script>
 -->


<!-- ************************************** TAB VIEW SCRIPT *****************************************************-->
<script>
$(document).ready(function(){
    $(".nav-tabs a").click(function(){
        $(this).tab('show');
    });
});
</script> 

<script>
/* $('#tab').on('click', '.nav a', function (e) {
    clickEvent = true;
    $('.nav li').removeClass('active');
    $(this).parent().addClass('active');

    localStorage.setItem('slide', $(e.currentTarget).attr('href'));
});

$(function() {
  var slide = localStorage.getItem('slide');
  if (slide) {
    $("a[href='" + slide + "']").click();
  }
}); */


/* $(document).ready(function() {
	  var slide = window.location.hash;
	  if (slide) {
	    $("a[href='" + slide + "']").click();
	  }
	}); */

</script>
<script>


/* $(document).ready(function() {
    var $hash = window.location.hash;
    var $acc = $hash ? $hash : 1;
    $("#myTabs").tab({
     active: false,
     collapsible: true,
     autoHeight: false,
     navigation: true,
     header: '.menuitem',
     activate: $acc
   });
});  
 */
 

</script>



  <script> 
 <%

//Get the client's Locale
Locale locale = request.getLocale( );
String date = DateFormat.getDateTimeInstance(
                              DateFormat.FULL, 
                              DateFormat.SHORT, 
                              locale).format(new Date( ));
%>
</script>


<script type="text/javascript">
$(document).ready(function() {
	 $("#cover1").hide(0); 
	 $("#cover2").hide(0); 
	 $("#cover3").hide(0); 
	
  
});

</script>

<script>
   
        function expand(param)   
        {   
            param.style.display=(param.style.display=="none")?"":"none";   
        }   
    
</script>


<script type="text/javascript">

</script>

</head>

<!-- **************************** GET DATA FROM DATABASE FOR STATISTIC ****************************************** -->

<sql:setDataSource var="bwm_GastCard" driver="com.microsoft.sqlserver.jdbc.SQLServerDriver"
     url="jdbc:sqlserver://81.20.82.195:2433;DatabaseName=bwm_GastCard"
     user="sa"  password="4xf18bw111a"/>
<sql:query dataSource="${bwm_GastCard}" var="rs2">
SELECT  gac_Barcode,gac_TimeStamp,gct_KartenType,lea_Leistungsart 
     FROM GastCard 
     INNER JOIN GastCardTyp
     ON GastCard.idGastCardType = GastCardTyp.idGastCardType 
 
     INNER JOIN Leistung
     ON GastCard.idLeistung = Leistung.idLeistung where (GastCard.gac_TimeStamp >= ? AND GastCard.gac_TimeStamp <= ?) <% if(session.getAttribute("TypeFilter")!=null) {%> <%= session.getAttribute("TypeFilter")%><%}%> ;
   <sql:param value='<%=session.getAttribute("frm")%>' />
   <sql:param value='<%=session.getAttribute("to")%>' />
</sql:query>


<!-- **************************** GET DATA FROM DATABASE FOR STATISTIC ****************************************** -->
 
<%-- <sql:setDataSource var="bwm_GastCard" driver="com.microsoft.sqlserver.jdbc.SQLServerDriver"
     url="jdbc:sqlserver://localhost:1433;DatabaseName=bwm_GastCard"
     user="sa"  password="VianovaWin2016"/>
 
  
<sql:query dataSource="${bwm_GastCard}" var="rs2">
SELECT  gac_Barcode,gac_TimeStamp,gct_KartenType,lea_Leistungsart 
     FROM GastCard 
     INNER JOIN GastCardTyp
     ON GastCard.idGastCardType = GastCardTyp.idGastCardType 
 
     INNER JOIN Leistung
     ON GastCard.idLeistung = Leistung.idLeistung 
     where (GastCard.gac_TimeStamp >= ? AND GastCard.gac_TimeStamp <= ?) <% if(session.getAttribute("TypeFilter")!=null) {%><%= session.getAttribute("TypeFilter")%><%}%> ;
   <sql:param value='<%=session.getAttribute("frm")%>' />
   <sql:param value='<%=session.getAttribute("to")%>' />
</sql:query> 

<body> --%>






<div id="header">
	<div class="container">
		<div class="row">
			<div>
				<a href="http://www.bayerwaldmedia.de"><img src="images/Logo_BWM-Tourismus.png" alt="Logo Tourismus" align="left"/></a>
				<a href="http://www.bayerwaldmedia.de"><img src="images/Logo_Vianova.png" alt="Logo Vianova" align="right" /></a>
			</div> 
		</div>
   	</div>
</div>
<br><br>
<div class="clear"></div>
<div id="content">
	<div class="container" style="background-color: #fff;">
		<div class="row">
			<div id="content-header">
				<div class="w3-navbar">
					<div class="tab"><a style="color: #fff;">Angemeldet als: <%= session.getAttribute("partner") %></a></div>
    				<div class="tab" style="text-align:right; "><a style="color: #fff;" href="TabStartseit.jsp"><span class="glyphicon glyphicon-home" title="Starteseite"></span></a></div>
    				<div class="tab" style="text-align:right; "><a style="color: #fff;" href="Logout.jsp"><span class="glyphicon glyphicon-log-out" title="Abmelden"></span> </a></div>
    				<div class="tab" style="text-align:right; "><a style="color: #fff;" ><% out.print(date);%></a></div>
				</div>
			</div>
			<div class="w3-navbar" >
				<ul class="nav nav-tabs" id="myTabs" style="border-color: #0d4c78; text-align: center;">
				    <li class="active" ><a  data-toggle="tab" role="tab"  href="#Akzeptanz"><h4>Akzeptanz</h4></a></li>
				    <li ><a  data-toggle="tab" role="tab"  href="#Kartengültigkeit"><h4>Gültigkeit</h4></a></li>
				    <li ><a  data-toggle="tab" id="Statistik11"  role="tab" href="#Statistik"><h4>Statistik</h4></a></li>
				 </ul>
			</div> 
			<div class="tab-content">
			
			
<!-- 			************************************************* ACCEPTANCE ********************************************************************** -->




    			<div id="Akzeptanz" class="tab-pane fade in active">
      				<div class="w3-container"  style="text-align: center;">
      					<div>
    					<label><h3>Kartennummer:</h3></label>
     					<input  onclick="ClearFields()" type="text"  class="w3-input" name="cardnumber" id="cardnumber" autofocus="autofocus" title="Geben Sie bitte hier Ihr Kartennummer ein.">
   						<br>
   						
<!--    						<a class="w3-btn"  href="javascript:expand(document.getElementById('cover1'))">Akzeptanz</a>   -->
   						<button onclick= "javascript:expand(document.getElementById('cover1'))"  class="w3-btn" id="preview2" type="submit" name="Akzeptanzen" title="Akzeptanzen" data-toggle="" data-target=""  style="background-color: #0d4c78; color: #fff">Akzeptanz</button> 
   			    		<button class="w3-btn" type="reset"  name="Abbrechen" title="Abbrechen" onclick="ClearFields(), displaycover()" style="background-color: #d9d9d9; color: #0d4c78;">Abbrechen</button><div><br></div>
        					
        							<div id="div9"></div>
        					</div>
        					
        					
        					<div id="cover1">
        					
        					<div id="Leistung" class="panel-collapse collapse in collapse w3-panel w3-card-8" style="font-size:15px; text-align: center; border-width:1px; position: relative; color:#303030; white-space: normal;">
								<div id="CardService">
									<div class="page-header" id="serv6" style="text-align: Left;">
    									<h4>Leistungen:</h4>
    								</div>
    								
    									<div class="form-group">
      										<label id="serv1"></label>
      										<div class="success" id="serv7">
												<c:if test="${not empty active}">
								   					<c:out value="${active}"/>
												</c:if>
												
												
													<% session.setAttribute("active", ""); %>
													
								 			</div>
  			
								 	
								    		
								    		<div id="serv8" class="error">
											<c:if test="${not empty notactive}">
								   					<c:out value="${notactive}"/>
												</c:if>
												<c:if test="${not empty Unbe}">
								   					<c:out value="${Unbe}"/>
												</c:if>
							
<%-- 													<c:out value="${sessionScope.notactive}" /> --%>
													<% session.setAttribute("notactive", ""); %>
													<% session.setAttribute("Unbe", "Unbekannte Karte");%>
								 			</div>
      									</div>
      									<%-- <%
											String session_val = (String)session.getAttribute("servicejsp"); 
											System.out.println(""+session_val);
											%> --%>
<%--       								<input type="button" value="${sessionScope.servicejsp}"/> --%>
    									<%int i=0;%>
   										<c:forEach items="${servicejsp}" var="serv">
   										<%i++; %>						<div id="serv9" class="w3-panel" style="padding: 10px; margin: 10px;">
        								<button  type="submit" name="service<%=i %>" id="service<%=i %>" <% if(session.getAttribute("disable")!=null) {%> <%= session.getAttribute("disable")%><%}%> class="w3-btn"  data-toggle="modal" data-target="#myModalerr" style="align:center; background-color:#ff0000; color:#fff; white-space: normal; opacity:0.7; font-weight:500; font-size: medium; padding: 10px; "><c:out value="${serv.getService()}"/></button>
											

    									</div>
    								<br><br><hr style="margin-left: 20px; margin-right: 20px;">
										</c:forEach>
    								
 									<br><br>
   							</div>
 						</div>
 					</div>
  				</div>
    			<div class="clear"></div>
    
    </div>
  
<!-- 			************************************************** VALIDITY **************************************************************************** -->   

   
 
    			<div id="Kartengültigkeit" class="tab-pane fade">
      				<div class="w3-container"  style="text-align: center;">
      				<div>
    					<label><h3>Kartennummer:</h3></label>
     					<input  type="text" class="w3-input" autofocus="autofocus" name="Kartennummer" id="Kartennummer"  title="Geben Sie bitte hier Ihr Kartennummer ein.">
   						<br>
   						
<!--    						<a class="w3-btn"  href="javascript:expand(document.getElementById('cover2'))">Gültigkeit Prüfen</a>   -->
   						<button onclick="javascript:expand(document.getElementById('cover2'))" class="w3-btn"  id="preview" type="submit" name="Gültigkeit Prüfen" title="Gültigkeit Prüfen" data-toggle="" data-target=""  style="background-color: #0d4c78; color: #fff;">Gültigkeit Prüfen</button> 
   			    		<button  class="w3-btn" type="reset"  onclick="ClearFields(), displaycover()" name="Abbrechen" title="Abbrechen" style="background-color: #d9d9d9; color: #0d4c78;">Abbrechen</button><div><br></div>
   			    	</div>
   			    	<div id="cover2">
        					<div id="validity" class="panel-collapse collapse in collapse w3-panel w3-card-8" style="font-size:15px; text-align: center; border-width:1px; position: relative; color:#303030;">
								<label style="text-align: left;" class="w3-display-middle" id="div3"></label>
								
								<div id="cardDetDiv">
									<div class="page-header" id="div6" style="text-align: Left;">
    									<h4>Gültigkeit Prüfen:</h4></div>
    									<div class="form-group">
      						 				<label class="control-label w3-col" for="cardtype" id="div5" style="width: 30%;">Karten Type:</label>
      											<div class="w3-rest" style="text-align: left; background-color: #fff ; color: #0d4c78;">
      												<label id="div1"> <% request.setAttribute("CardTyp",""); %></label>
      											</div>
      									</div>
 										<br><br>
    									<div class="form-group">
      										<label class="control-label w3-col" id="div4" for="cardvalidity" style="width: 30%;">Karte Gültig bis:</label>
      											<div class="w3-rest" style="text-align: left; background-color: #fff ; color: #0d4c78;">
   					 								<label id="div2"><% request.setAttribute("CardExp",""); %></label>
 												</div>
 												<br><br>	
										</div>   
 								</div>
 							</div>
 					</div>
  				</div>
  				</div>
    			<div class="clear"></div>


<!-- 			************************************************ STATISTICS *************************************************************************** -->      
    
    

    			<div id="Statistik" class="tab-pane fade">
					
					
						<div class="w3-container">
							<div class="w3-row w3-section" style="text-align: center">
								<div class="w3-col" style="width:90px">
									<label>Zeitraum:</label>
								</div>
								<div class="w3-rest" style="overflow: visible;">
									<div class="flexbox">
        								<div class="stretch">
            								<input id="startDate" name="startDate"  class="w3-input w3-border w3-round" type="text"/>
            								<!-- <input id="tst" name="tst" type="text" /> -->
        								</div>    
         								<div class="stretch">
            								<input id="tst" name="tst" class="w3-input w3-border w3-round" type="text" />
        								</div>
        							</div>
							    </div>
							 </div>
							 <br>
							 	<div class="clear"></div>
	          					<div id="akzfilt" class="w3-col" style="width:90px; text-align: center;">
	          						<label>Typ:</label>
	          					</div>
	          					<div class="w3-rest">
									<select class="w3-select w3-border w3-round" name="option" id="myselect">
										<option value="0" disabled selected>Bitte Auswählen:</option>
										<option value="1">Akzeptanzen</option>
										<option value="2">Ablehnungen</option>
									</select>
								</div>
								<div class="clear"></div>
								<br><br>
								<div class="w3-center">
<!-- 								<a class="w3-btn"  href="javascript:expand(document.getElementById('cover3'))">Statistik generieren</a>   -->
									<button class="w3-btn"  id="pre" data-toggle="collapse" data-target="#Stat"  type="submit" name="Statistik generieren" title="Statistik generieren" style="background-color: #0d4c78; color: #fff;">Statistik generieren</button> 
									<button class="w3-btn" type="reset"  name="Abbrechen" title="Abbrechen" onclick="ClearFields(), displaycover()" style="background-color: #d9d9d9; color: #0d4c78;">Abbrechen</button>
								
								</div>
						</div>
					<br>
<!-- 					<div id="cover3"> -->
					<div class="w3-container">
					<div class="w3-row">
						<div id="Stat" class="panel-collapse collapse in collapse  w3-panel w3-card-8">
						<div id="cardStat">	
				
						<div class="form-group"><br>
						
							<table id="example" class="sortable w3-hoverable bordered table-responsive display" >
							
								<thead id="stathead">
								<tr style="background-color: #0d4c78; color: #fff">
									<th>#</th>
									<th>Datum</th>
									<th>Barcode</th>
									<th>Karten Typ</th>
									<th>Leistung</th>
								</tr>
								</thead>
								<tbody id="statbody">
								<%! int i = 1; %> 
									<c:forEach var="row" items="${rs2.rows}">
										<tr id="stattr" style="white-space: normal;">
											<td id="td0" data-label="Eintrag"> <%= i++ %>  </td>
											<td id="td1" data-label="Datum : " style="width: 17%;"><c:out value="${row.gac_TimeStamp}"/></td>
											<td id="td2" data-label="Barcode : " style="width: 10%; "><c:out value="${row.gac_Barcode}"/></td>
											<td id="td3" data-label="Karten Typ : "><c:out value="${row.gct_KartenType}"/></td>
											<td id="td4" data-label="Leistung : " ><c:out value="${row.lea_Leistungsart}"/></td>
										</tr>
									</c:forEach>
									</tbody>
									
							</table>
							
						</div>
					</div>
					</div>
					</div><div class="clear"></div>
					</div>
				</div>
				</div>
			</div>
		</div>
<!-- 	</div> -->
</div>

<div class="clear"></div>


<br>
<div class="clear"></div>

<br>

<div id="footer" style="white-space: normal;">
	<div class="container w3-navbar" style="overflow: auto;">
		<div class="row">
  			<div class="tab" style="white-space: normal">
  				<div id="text-hervorgehoben" style="float:left; text-align: left; ">Support:</div><br>
 				<div id="text-hervorgehoben" style="float:left; text-align: left; ">Tel:0 99 71 - 9 96 98 29 100 </div><br>
				<div id="text-hervorgehoben" style="float:left; text-align: left; "><a href="mailto:support@bayerwaldmedia.de"  title="support@bayerwaldmedia.de">Mail:​ support@​bayerwald​media.de</a></div><br>
			</div>
			
  		
  			<div class="tab" style="white-space: normal">
  				<div id="text-hervorgehoben" style="float:right; text-align: right; ">Bayerwald Media GmbH</div><br>
				<div id="text-standard" style="float:right; text-align: right; ">Kirchplatz 10</div><br>
				<div id="text-standard" style="float:right; text-align: right; ">D-93482 Pemfling</div><br>
			</div>
		
		
 	 		<div class="tab" style="white-space: normal">
  				<div id="text-standard" style="float:right; text-align: right; ">Vertreten durch:</div><br>
      			<div id="text-hervorgehoben" style="float:right; text-align: right; ">Stefan Wistuba</div><br>
      			<div id="text-hervorgehoben" style="float:right; text-align: right; ">Wolfgang Brückl</div><br>
      		</div>
      	
  		
  			<div class="tab" style="white-space: normal">
  				<div id="text-standard" style="float:right; text-align: right; ">Telefon: +49(0) 9971 / 99698 0</div><br>
      			<div id="text-standard" style="float:right; text-align: right; ">Telefax: +49(0) 9971 / 99698 29</div><br>
      			<div id="text-standard" style="float:right; text-align: right; "><a href="mailto:info@bayerwaldmedia.de"  title="info@bayerwaldmedia.de">E-Mail: ​info@bayerwald​media.de</a></div><br>
      		</div>
		</div>
	</div>
</div>
<div class="clear"></div>
</body>
</html>
Posted
Updated 15-Mar-17 0:38am
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900