<%@ include file="../pure_header.jsp" %> Chattanooga Metropolitan Airport: Online Survey
 

 

 

       
  Contact Us : Online Survey
   Home
    Contact Us
 
 
<% String surveyId = ""; boolean forUser = true; if( request.getMethod() == "POST" ) { String t=""; String t1=""; String id=""; String value=""; Survey _s = new Survey(); _s.setId(Integer.parseInt(request.getParameter("sid"))); _s.incAnswered(); CustomerAnswer ca = new CustomerAnswer(); for (Enumeration e = request.getParameterNames() ; e.hasMoreElements() ;) { t = (String)e.nextElement(); if( t.length() > 6 ) { t1 = t.substring(0,6); if(t1.equals("ANSWER")) { id = t.substring(7, t.length()); value = request.getParameter(t); ca.setName(value); ca.setQuestionId(Integer.parseInt(id)); //System.out.println("value " + value + " : " + id ); ca.save(); ca.setId(0); } } } %> Thank you! <% } else { Hub hubSurvey = new Hub("Survey"); hubSurvey.select(" status = 'Y' "); Survey s = (Survey)hubSurvey.elementAt(0); if( s == null ) { out.println("
There are no surveys going on rign now.
"); } else { surveyId = Integer.toString(s.getId()); String sName= s.getName(); Hub hubQuestion = new Hub("Question"); hubQuestion.select(" surveyId = " + surveyId + " order by ordernum " ); Hub hubAnswer = new Hub("Answer"); %> - <%= sName %>
<% int i=0; String chk = ""; Question q; Answer a; while ((q = (Question)hubQuestion.elementAt(i))!=null) { out.println("
"); out.println((i+1)+". " + q.getName() ); if( q.getRequired().equals("Y")) out.println(" * Required
"); else out.println("
"); switch(Integer.parseInt(q.getType())) { case 1: out.println("
"); if( q.getRequired().equals("Y")) { chk = chk + " document.cgifrm.ANSWER_"+q.getId() + ".value != \"\" &&"; } break; case 2: hubAnswer.select( "questionId = " + q.getId() + " order by ordernum "); int j = 0; String checked = "checked"; while ((a = (Answer)hubAnswer.elementAt(j))!=null) { out.println("" + a.getName() + "
" ); checked=""; j++; } break; default:break; } i++; } if ( i == 0 ) out.print("not available"); if(chk != "" ) { chk = chk.substring(0, chk.length() - 2 ); %> <% } %>

<% } } %>

home :: legal info :: site map

 2005 Chattanooga Metropolitan Airport. All Rights Reserved.

website design by Alegre Design and developed in partnership with UTC CS.