public ActionForward execute(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response) {
    ComplaintsresponseForm objectForm = new ComplaintsresponseForm();

    String result = "";

    String complainid =
        (request.getParameter("complainid") != null)
            ? request.getParameter("complainid")
            : (String) request.getAttribute("complainid");
    request.setAttribute("complainid", complainid);
    //// System.out.println("complainid..........ComplaintsresponsePreAction.........."+complainid);
    //////
    // System.out.println("request.getParameter.........ComplaintsresponsePreAction.........."+request.getParameter("complainid"));

    String strUserId =
        (request.getParameter("strUserId") != null)
            ? request.getParameter("strUserId")
            : (String) request.getAttribute("strUserId");
    request.setAttribute("strUserId", strUserId);
    //// System.out.println("strUserId..........ComplaintsresponsePreAction.........."+strUserId);
    //////
    // System.out.println("request.getParameter.........ComplaintsresponsePreAction.........."+request.getParameter("strUserId"));

    RootMaster rootMaster = new RootMaster();
    DataSource dataSource = getDataSource(request, "main");

    Vector userData = rootMaster.getUserInfo(dataSource, Integer.parseInt(strUserId));
    String companyId = userData.elementAt(0).toString();
    request.setAttribute("companyId", companyId);
    String first_name = userData.elementAt(4).toString();
    String last_name = userData.elementAt(5).toString();
    //// System.out.println("first_name..........ComplaintsresponsePreAction.........."+first_name);

    Vector compData = rootMaster.getComplaintDetails(dataSource, Integer.parseInt(complainid));
    String fcom_id = compData.elementAt(17).toString();
    String complaint_title = compData.elementAt(1).toString();
    //// System.out.println("fcom_id..........ComplaintsresponsePreAction.........."+fcom_id);
    ////
    // System.out.println("complaint_title..........ComplaintsresponsePreAction.........."+complaint_title);

    // objectForm.setComplainTitle(complaint_title);
    // objectForm.setFcomplainId(fcom_id);
    request.setAttribute("fcom_id", fcom_id);
    request.setAttribute("complaint_title", complaint_title);

    return mapping.findForward("success");
  }
  public ActionForward execute(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    System.out.println("In ResidentBillAction-1");
    RootMaster rootMaster = new RootMaster();

    // String depid = (request.getParameter("depId")!=null) ? (request.getParameter("depId").trim())
    // : "0";
    System.out.println("ResidentBillAction-2");
    // int numCId=Integer.parseInt(depid);

    int city_Id =
        (request.getParameter("cityId") != null)
            ? Integer.parseInt(request.getParameter("cityId").trim())
            : 0;
    int builder_Id =
        (request.getParameter("builderID") != null)
            ? Integer.parseInt(request.getParameter("builderID").trim())
            : 0;

    System.out.println("ResidentBillAction-3-->" + builder_Id);
    System.out.println("ResidentBillAction-4-->" + city_Id);

    Vector streamVec =
        rootMaster.getBuilderFacilityList(getDataSource(request, "main"), city_Id, builder_Id);

    System.out.println("Builder City Vector=>" + streamVec);
    String strStream = getCourseStreamList(city_Id, builder_Id, streamVec);

    response.setContentType("text/html;charset=ISO-8859-1");
    PrintWriter out = response.getWriter();
    out.println(strStream);
    out.flush();
    return null;
  }
Esempio n. 3
0
  protected ActionForm buildUserDetailForm(int numTestId, HttpServletRequest request)
      throws Exception {
    TestquestionForm tqf = new TestquestionForm();

    RootMaster rm = new RootMaster();
    Vector dataVec = rm.getTestQuestions(getDataSource(request, "advt"), numTestId);
    //// System.out.println("dataVec "+dataVec.size());
    tqf.setTestid(String.valueOf(numTestId));
    tqf.setTestname(dataVec.elementAt(140).toString().trim());
    tqf.setTotalmarks(dataVec.elementAt(141).toString().trim());
    tqf.setTestremark(dataVec.elementAt(142).toString().trim());
    tqf.setTesttyp(dataVec.elementAt(143).toString().trim());
    tqf.setTestcategory(dataVec.elementAt(144).toString().trim());

    tqf.setQues1(dataVec.elementAt(0).toString().trim());
    tqf.setQues2(dataVec.elementAt(1).toString().trim());
    tqf.setQues3(dataVec.elementAt(2).toString().trim());
    tqf.setQues4(dataVec.elementAt(3).toString().trim());
    tqf.setQues5(dataVec.elementAt(4).toString().trim());
    tqf.setQues6(dataVec.elementAt(5).toString().trim());
    tqf.setQues7(dataVec.elementAt(6).toString().trim());
    tqf.setQues8(dataVec.elementAt(7).toString().trim());
    tqf.setQues9(dataVec.elementAt(8).toString().trim());
    tqf.setQues10(dataVec.elementAt(9).toString().trim());
    tqf.setQues11(dataVec.elementAt(10).toString().trim());
    tqf.setQues12(dataVec.elementAt(11).toString().trim());
    tqf.setQues13(dataVec.elementAt(12).toString().trim());
    tqf.setQues14(dataVec.elementAt(13).toString().trim());
    tqf.setQues15(dataVec.elementAt(14).toString().trim());
    tqf.setQues16(dataVec.elementAt(15).toString().trim());
    tqf.setQues17(dataVec.elementAt(16).toString().trim());
    tqf.setQues18(dataVec.elementAt(17).toString().trim());
    tqf.setQues19(dataVec.elementAt(18).toString().trim());
    tqf.setQues20(dataVec.elementAt(19).toString().trim());
    tqf.setQues21(dataVec.elementAt(20).toString().trim());
    tqf.setQues22(dataVec.elementAt(21).toString().trim());
    tqf.setQues23(dataVec.elementAt(22).toString().trim());
    tqf.setQues24(dataVec.elementAt(23).toString().trim());
    tqf.setQues25(dataVec.elementAt(24).toString().trim());
    tqf.setQues26(dataVec.elementAt(25).toString().trim());
    tqf.setQues27(dataVec.elementAt(26).toString().trim());
    tqf.setQues28(dataVec.elementAt(27).toString().trim());
    tqf.setQues29(dataVec.elementAt(28).toString().trim());
    tqf.setQues30(dataVec.elementAt(29).toString().trim());
    tqf.setQues31(dataVec.elementAt(30).toString().trim());
    tqf.setQues32(dataVec.elementAt(31).toString().trim());
    tqf.setQues33(dataVec.elementAt(32).toString().trim());
    tqf.setQues34(dataVec.elementAt(33).toString().trim());
    tqf.setQues35(dataVec.elementAt(34).toString().trim());
    tqf.setQuestype1(dataVec.elementAt(35).toString().trim());
    tqf.setQuestype2(dataVec.elementAt(36).toString().trim());
    tqf.setQuestype3(dataVec.elementAt(37).toString().trim());
    tqf.setQuestype4(dataVec.elementAt(38).toString().trim());
    tqf.setQuestype5(dataVec.elementAt(39).toString().trim());
    tqf.setQuestype6(dataVec.elementAt(40).toString().trim());
    tqf.setQuestype7(dataVec.elementAt(41).toString().trim());
    tqf.setQuestype8(dataVec.elementAt(42).toString().trim());
    tqf.setQuestype9(dataVec.elementAt(43).toString().trim());
    tqf.setQuestype10(dataVec.elementAt(44).toString().trim());
    tqf.setQuestype11(dataVec.elementAt(45).toString().trim());
    tqf.setQuestype12(dataVec.elementAt(46).toString().trim());
    tqf.setQuestype13(dataVec.elementAt(47).toString().trim());
    tqf.setQuestype14(dataVec.elementAt(48).toString().trim());
    tqf.setQuestype15(dataVec.elementAt(49).toString().trim());
    tqf.setQuestype16(dataVec.elementAt(50).toString().trim());
    tqf.setQuestype17(dataVec.elementAt(51).toString().trim());
    tqf.setQuestype18(dataVec.elementAt(52).toString().trim());
    tqf.setQuestype19(dataVec.elementAt(53).toString().trim());
    tqf.setQuestype20(dataVec.elementAt(54).toString().trim());
    tqf.setQuestype21(dataVec.elementAt(55).toString().trim());
    tqf.setQuestype22(dataVec.elementAt(56).toString().trim());
    tqf.setQuestype23(dataVec.elementAt(57).toString().trim());
    tqf.setQuestype24(dataVec.elementAt(58).toString().trim());
    tqf.setQuestype25(dataVec.elementAt(59).toString().trim());
    tqf.setQuestype26(dataVec.elementAt(60).toString().trim());
    tqf.setQuestype27(dataVec.elementAt(61).toString().trim());
    tqf.setQuestype28(dataVec.elementAt(62).toString().trim());
    tqf.setQuestype29(dataVec.elementAt(63).toString().trim());
    tqf.setQuestype30(dataVec.elementAt(64).toString().trim());
    tqf.setQuestype31(dataVec.elementAt(65).toString().trim());
    tqf.setQuestype32(dataVec.elementAt(66).toString().trim());
    tqf.setQuestype33(dataVec.elementAt(67).toString().trim());
    tqf.setQuestype34(dataVec.elementAt(68).toString().trim());
    tqf.setQuestype35(dataVec.elementAt(69).toString().trim());
    tqf.setQuescheck1(dataVec.elementAt(70).toString().trim());
    tqf.setQuescheck2(dataVec.elementAt(71).toString().trim());
    tqf.setQuescheck3(dataVec.elementAt(72).toString().trim());
    tqf.setQuescheck4(dataVec.elementAt(73).toString().trim());
    tqf.setQuescheck5(dataVec.elementAt(74).toString().trim());
    tqf.setQuescheck6(dataVec.elementAt(75).toString().trim());
    tqf.setQuescheck7(dataVec.elementAt(76).toString().trim());
    tqf.setQuescheck8(dataVec.elementAt(77).toString().trim());
    tqf.setQuescheck9(dataVec.elementAt(78).toString().trim());
    tqf.setQuescheck10(dataVec.elementAt(79).toString().trim());
    tqf.setQuescheck11(dataVec.elementAt(80).toString().trim());
    tqf.setQuescheck12(dataVec.elementAt(81).toString().trim());
    tqf.setQuescheck13(dataVec.elementAt(82).toString().trim());
    tqf.setQuescheck14(dataVec.elementAt(83).toString().trim());
    tqf.setQuescheck15(dataVec.elementAt(84).toString().trim());
    tqf.setQuescheck16(dataVec.elementAt(85).toString().trim());
    tqf.setQuescheck17(dataVec.elementAt(86).toString().trim());
    tqf.setQuescheck18(dataVec.elementAt(87).toString().trim());
    tqf.setQuescheck19(dataVec.elementAt(88).toString().trim());
    tqf.setQuescheck20(dataVec.elementAt(89).toString().trim());
    tqf.setQuescheck21(dataVec.elementAt(90).toString().trim());
    tqf.setQuescheck22(dataVec.elementAt(91).toString().trim());
    tqf.setQuescheck23(dataVec.elementAt(92).toString().trim());
    tqf.setQuescheck24(dataVec.elementAt(93).toString().trim());
    tqf.setQuescheck25(dataVec.elementAt(94).toString().trim());
    tqf.setQuescheck26(dataVec.elementAt(95).toString().trim());
    tqf.setQuescheck27(dataVec.elementAt(96).toString().trim());
    tqf.setQuescheck28(dataVec.elementAt(97).toString().trim());
    tqf.setQuescheck29(dataVec.elementAt(98).toString().trim());
    tqf.setQuescheck30(dataVec.elementAt(99).toString().trim());
    tqf.setQuescheck31(dataVec.elementAt(100).toString().trim());
    tqf.setQuescheck32(dataVec.elementAt(101).toString().trim());
    tqf.setQuescheck33(dataVec.elementAt(102).toString().trim());
    tqf.setQuescheck34(dataVec.elementAt(103).toString().trim());
    tqf.setQuescheck35(dataVec.elementAt(104).toString().trim());
    tqf.setQuesvisible1(dataVec.elementAt(105).toString().trim());
    tqf.setQuesvisible2(dataVec.elementAt(106).toString().trim());
    tqf.setQuesvisible3(dataVec.elementAt(107).toString().trim());
    tqf.setQuesvisible4(dataVec.elementAt(108).toString().trim());
    tqf.setQuesvisible5(dataVec.elementAt(109).toString().trim());
    tqf.setQuesvisible6(dataVec.elementAt(110).toString().trim());
    tqf.setQuesvisible7(dataVec.elementAt(111).toString().trim());
    tqf.setQuesvisible8(dataVec.elementAt(112).toString().trim());
    tqf.setQuesvisible9(dataVec.elementAt(113).toString().trim());
    tqf.setQuesvisible10(dataVec.elementAt(114).toString().trim());
    tqf.setQuesvisible11(dataVec.elementAt(115).toString().trim());
    tqf.setQuesvisible12(dataVec.elementAt(116).toString().trim());
    tqf.setQuesvisible13(dataVec.elementAt(117).toString().trim());
    tqf.setQuesvisible14(dataVec.elementAt(118).toString().trim());
    tqf.setQuesvisible15(dataVec.elementAt(119).toString().trim());
    tqf.setQuesvisible16(dataVec.elementAt(120).toString().trim());
    tqf.setQuesvisible17(dataVec.elementAt(121).toString().trim());
    tqf.setQuesvisible18(dataVec.elementAt(122).toString().trim());
    tqf.setQuesvisible19(dataVec.elementAt(123).toString().trim());
    tqf.setQuesvisible20(dataVec.elementAt(124).toString().trim());
    tqf.setQuesvisible21(dataVec.elementAt(125).toString().trim());
    tqf.setQuesvisible22(dataVec.elementAt(126).toString().trim());
    tqf.setQuesvisible23(dataVec.elementAt(127).toString().trim());
    tqf.setQuesvisible24(dataVec.elementAt(128).toString().trim());
    tqf.setQuesvisible25(dataVec.elementAt(129).toString().trim());
    tqf.setQuesvisible26(dataVec.elementAt(130).toString().trim());
    tqf.setQuesvisible27(dataVec.elementAt(131).toString().trim());
    tqf.setQuesvisible28(dataVec.elementAt(132).toString().trim());
    tqf.setQuesvisible29(dataVec.elementAt(133).toString().trim());
    tqf.setQuesvisible30(dataVec.elementAt(134).toString().trim());
    tqf.setQuesvisible31(dataVec.elementAt(135).toString().trim());
    tqf.setQuesvisible32(dataVec.elementAt(136).toString().trim());
    tqf.setQuesvisible33(dataVec.elementAt(137).toString().trim());
    tqf.setQuesvisible34(dataVec.elementAt(138).toString().trim());
    tqf.setQuesvisible35(dataVec.elementAt(139).toString().trim());

    return tqf;
  }
  /**
   * Method execute
   *
   * @param mapping
   * @param form
   * @param request
   * @param response
   * @return ActionForward
   */
  public ActionForward execute(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response) {
    MentorReqResponseForm responseForm =
        (MentorReqResponseForm) form; // TODO Auto-generated method stub
    RootMaster rootMaster = new RootMaster();
    AdvtMaster advtMaster = new AdvtMaster();
    HttpSession session = request.getSession();
    String uId = (String) session.getAttribute("uId");

    String compId = (String) session.getAttribute("compId");
    Vector allRights = (Vector) session.getAttribute("allRights");
    String adminFlag = allRights.elementAt(18).toString();
    if (((String) session.getAttribute("flag1")).equalsIgnoreCase("1")) {

      Vector<String> dataVec = new Vector<String>();
      String responseTextt = responseForm.getResponsetext();
      ////
      // System.out.println("request.getParameter...respIdrespIdrespId>>>>>"+request.getParameter("respid"));
      String respId = request.getParameter("respid");
      String complaintId = request.getParameter("compId");
      String flagforcom =
          (request.getParameter("flagforcom") != null) ? request.getParameter("flagforcom") : "";
      String recpType =
          (request.getParameter("respType") != null) ? request.getParameter("respType") : "";
      String accept1 =
          (request.getParameter("accept") != null) ? request.getParameter("accept") : "";
      //// System.out.println("to accept...in respons  .....accept....."+accept1);
      String flag = (request.getParameter("flag") != null) ? request.getParameter("flag") : "";
      if (request.getParameter("flag") != null) {
        flag = request.getParameter("flag").trim();
      } else {
        flag = "0";
      }
      //////// System.out.println("to flag...in respons  .....flag.IN RESPaCTION	...."+flag);
      String uid = (String) session.getAttribute("uId");
      java.util.Date dt = new java.util.Date();
      SimpleDateFormat sform = new SimpleDateFormat("yyyy-MM-dd, HH:mm:ss");
      String completeRemDate = sform.format(dt);
      StringTokenizer sttotal = new StringTokenizer(completeRemDate, ",");
      String creationDate = sttotal.nextToken();
      String creationTime = sttotal.nextToken();

      dataVec.add(responseTextt);
      dataVec.add(creationDate);
      dataVec.add(complaintId);
      dataVec.add(uid);
      dataVec.add(creationTime);
      dataVec.add(respId);
      dataVec.add(flag);
      dataVec.add("0");
      dataVec.add("1");
      dataVec.add("0");
      if (flag.equalsIgnoreCase("1")) {
        dataVec.add("Accept");

      } else if (flag.equalsIgnoreCase("0")) {
        dataVec.add("Reject");

      } else {
        dataVec.add("");
      }
      dataVec.add(flagforcom);
      String result = rootMaster.insertMenResponse(getDataSource(request, "advt"), dataVec);

      if ((result.equalsIgnoreCase("success")) && (!respId.equalsIgnoreCase("0"))) {
        ActionErrors errors = new ActionErrors();
        errors.clear();
        errors.add("reply", new ActionError("errors.entp.replySuccess"));
        saveErrors(request, errors);
        result = "success";
      } else if (result.equalsIgnoreCase("success")) {
        ActionErrors errors = new ActionErrors();
        errors.clear();
        errors.add("response", new ActionError("errors.entp.responseSuccess"));
        saveErrors(request, errors);
        result = "success";
      }

      if (result.equalsIgnoreCase("success")) {
        if (!respId.equalsIgnoreCase("0")) {
          Vector<String> respVec = new Vector<String>();
          respVec.add(respId);
          respVec.add("advt");
          // update `entp_rflag` for communication table.
          result = rootMaster.updateResponseFlag(getDataSource(request, "advt"), respVec);
        }
      }

      ////////////// for mail///////////////
      if (result.equalsIgnoreCase("success")) {

        EntpMaster entpMaster = new EntpMaster();
        IndvMaster indvMaster = new IndvMaster();
        Vector<String> complaintVec = new Vector<String>();
        int cid = Integer.parseInt(complaintId);
        complaintVec = entpMaster.getComplaintDetails(getDataSource(request, "advt"), cid);
        String login_id = complaintVec.elementAt(3).toString();
        String cu_id = complaintVec.elementAt(6).toString();
        String fcomId = complaintVec.elementAt(7).toString();

        Vector<String> paramVec = new Vector<String>();

        //////// System.out.println("to Enterprise.............mail");
        paramVec.add(uid);
        paramVec.add(login_id);
        if (!cu_id.equalsIgnoreCase("0")) {
          paramVec.add(cu_id);
          //////// System.out.println(" to Enterprise..in if...........mail");
        }
        Vector emailVec = indvMaster.getEmailList(getDataSource(request, "advt"), paramVec);
        //////// System.out.println("emailVec..............."+emailVec);

        Vector<String> tempMailParam = new Vector<String>();
        tempMailParam.add("Corporates"); // sender company type Advertiser
        tempMailParam.add("Student"); // receipient company type Enterprise
        if (respId.equalsIgnoreCase("0")) {
          //////// System.out.println("Response if status in brand");
          tempMailParam.add("Response"); // mail description
        } else {
          //////// System.out.println("Reply else status in brand");
          tempMailParam.add("Reply"); // mail description
        }

        // get mail text alert fot sending mail to core user and admin core user
        String mailTextLAlert =
            rootMaster.getMailText(getDataSource(request, "advt"), tempMailParam);
        Vector brandVec = (Vector) emailVec.elementAt(0);
        String brandName =
            brandVec.elementAt(0).toString() + " " + brandVec.elementAt(1).toString();
        String brandmail = brandVec.elementAt(2).toString().trim();
        String subject = "";
        if (flag.equalsIgnoreCase("1")) {
          // dataVec.add("Accept");
          subject = "Acceptance of the mentoring request having reference id as (" + fcomId + ").";

        } else if (flag.equalsIgnoreCase("0")) {
          // dataVec.add("Reject");
          subject = "Denial of the mentoring request having reference id as (" + fcomId + ").";

        } else if (respId.equalsIgnoreCase("0")) {

          subject = "Response on mentoring request Id (" + fcomId + ") By " + brandName + ".";
        } else {

          subject =
              "Reply to your mail on mentoring request Id (" + fcomId + ") By " + brandName + ".";
        }

        for (int i = 1; i < emailVec.size(); i++) {
          MailText mt = new MailText();
          Resource resr = new Resource();
          Vector coreMailVec = (Vector) emailVec.elementAt(i);
          String strMailText =
              mt.getReplyByBrand(coreMailVec, fcomId, mailTextLAlert, brandName, flag);

          ////// System.out.println("strMailText....."+strMailText);

          String strEmailStatus =
              resr.sendMail(
                  strMailText,
                  Constant.Email_Sender,
                  ((Vector) emailVec.elementAt(i)).elementAt(2).toString(),
                  subject);
          ////// System.out.println("str Email status in corpo....."+strEmailStatus);
        }
      }
      ///////////////// end mail////////////

      session.setAttribute("numCid", complaintId);
      session.setAttribute("strResult", result);

      Vector dataVec1 = new Vector();
      dataVec1.add(uId);
      dataVec1.add(compId);
      dataVec1.add(adminFlag);
      Vector advtCountVec = advtMaster.complaintCountAdvt(getDataSource(request, "advt"), dataVec1);
      session.setAttribute("advtCountVec", advtCountVec);
      //////// System.out.println("advtCountVec.............ResponseAction...........
      // "+advtCountVec);
      if (result.equalsIgnoreCase("success")) {
        session.setAttribute("flag1", "0");
      }
      return mapping.findForward(result);
    } else {

      return mapping.findForward("success");
    }
  }
  /**
   * Method execute
   *
   * @param mapping
   * @param form
   * @param request
   * @param response
   * @return ActionForward
   */
  public ActionForward execute(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    HttpSession session = request.getSession();
    //	System.out.println("checkpoint13");
    String numCount = (String) session.getAttribute("numCount");

    int count = Integer.parseInt(numCount);
    int remander = count % 2;
    System.out.println("checkpoint at corpo 2");
    AdvtMaster advtMaster = new AdvtMaster();
    RootMaster rootMaster = new RootMaster();
    IndvMaster indvMaster = new IndvMaster();

    String uId = (String) session.getAttribute("uId");
    String compId = (String) session.getAttribute("compId");

    System.out.println("compId..in Action avdt ........." + compId);
    //	int regFlag= rootMaster.getRegisteredFlag(getDataSource(request, "corpo"), compId);
    //	System.out.println("regFlag..in Action avdt ........."+regFlag);

    Vector allRights = (Vector) session.getAttribute("allRights");
    String adminFlag = allRights.elementAt(18).toString();

    //	 System.out.println("checkpoint at corpo 3");

    String pageid =
        (request.getParameter("pageid") != null) ? request.getParameter("pageid").trim() : "1";
    String aType =
        (request.getParameter("aType") != null) ? request.getParameter("aType").trim() : "0";
    String lowerSubTag =
        (request.getParameter("lowerSubTag") != null)
            ? request.getParameter("lowerSubTag").trim()
            : "1";
    String categoryid =
        (request.getParameter("categoryid") != null)
            ? request.getParameter("categoryid").trim()
            : "0";

    //	System.out.println("lowerSubTag..in Action avdt ........."+lowerSubTag);
    java.util.Date dt = new java.util.Date();
    SimpleDateFormat sform = new SimpleDateFormat("yyyy-MM-dd");
    String completeRemDate = sform.format(dt);
    StringTokenizer sttotal = new StringTokenizer(completeRemDate, ",");
    String creationDate = sttotal.nextToken();
    String dateToday[] = creationDate.split("-");
    String YR = dateToday[0];
    String DaY = dateToday[2];
    String MTH = dateToday[1];

    String month = (request.getParameter("Month") != null) ? request.getParameter("Month") : MTH;
    String nYear = (request.getParameter("Year") != null) ? request.getParameter("Year") : YR;

    System.out.println("month and yesar" + month + " " + nYear);
    String strShortBy =
        (request.getParameter("sby") != null) ? request.getParameter("sby") : "creation_date";
    String strSOrder = "";
    String strComFIdOrder = "asc";
    String strCTitelOrder = "asc";
    String strDateOrder = "asc";

    if (request.getParameter("sby") != null) {
      if (request.getParameter("fidorder") != null) {
        if (request.getParameter("fidorder").trim().equalsIgnoreCase("asc")) {
          strSOrder = "desc";
          strComFIdOrder = "desc";
        } else if (request.getParameter("fidorder").trim().equalsIgnoreCase("desc")) {
          strSOrder = "asc";
          strComFIdOrder = "asc";
        }
      }

      if (request.getParameter("ctorder") != null) {
        if (request.getParameter("ctorder").trim().equalsIgnoreCase("asc")) {
          strSOrder = "desc";
          strCTitelOrder = "desc";
        } else if (request.getParameter("ctorder").trim().equalsIgnoreCase("desc")) {
          strSOrder = "asc";
          strCTitelOrder = "asc";
        }
      }
      if (request.getParameter("dateorder") != null) {
        if (request.getParameter("dateorder").trim().equalsIgnoreCase("asc")) {
          strSOrder = "desc";
          strDateOrder = "desc";
        } else if (request.getParameter("dateorder").trim().equalsIgnoreCase("desc")) {
          strSOrder = "asc";
          strDateOrder = "asc";
        }
      }
    }
    String strFShortBy = strShortBy + " " + strSOrder;
    int minVal =
        (request.getParameter("numMin") != null)
            ? Integer.parseInt(request.getParameter("numMin"))
            : 0;
    int maxVal = 10;
    //// System.out.println("countVec.............InboxAction......minVal..... "+minVal);
    //// System.out.println("countVec.............InboxAction......maxVal..... "+maxVal);

    Vector<String> paramVec1 = new Vector<String>();
    paramVec1.add(uId);
    paramVec1.add(compId);
    paramVec1.add(adminFlag);
    paramVec1.add(pageid);

    Vector<String> paramVec = new Vector<String>();
    paramVec.add(String.valueOf(minVal));
    paramVec.add(String.valueOf(maxVal));
    paramVec.add(strFShortBy);
    paramVec.add(uId);
    paramVec.add(compId);
    paramVec.add(adminFlag);
    paramVec.add(pageid);

    int Cid = Integer.parseInt(compId);
    int Uid = Integer.parseInt(uId);
    int aFid = Integer.parseInt(adminFlag);

    Vector comVec = new Vector();
    Vector comListVec = new Vector();
    String comList = "";

    paramVec1.add("0");
    paramVec.add("0");

    ////// System.out.println("comList................on page."+comList);
    int totalRow = 0;
    paramVec1.add(lowerSubTag);
    paramVec1.add(categoryid);
    paramVec1.add(month);
    paramVec1.add(nYear);

    paramVec.add(lowerSubTag);
    paramVec.add(categoryid);
    paramVec.add(month);
    paramVec.add(nYear);
    totalRow = advtMaster.getComplaintCountL(getDataSource(request, "corpo"), paramVec1);
    Vector UserVec = advtMaster.getBrandComplaintList1L(getDataSource(request, "corpo"), paramVec);

    String country = "", state = "", city = "", brand = "", category = "", firstName = "";

    String countryName = "", stateName = "", cityName = "", brandName = "", categoryName = "";
    String searchFor = "";
    DataSource dataSource = getDataSource(request, "corpo");

    Vector userVec = (Vector) session.getAttribute("userVec");
    Vector cscVec = (Vector) session.getAttribute("cscVec");
    cscVec = userVec;
    Vector userTempVec = new Vector();
    if (session.getAttribute("userVec") != null) {
      userTempVec = (Vector) session.getAttribute("userVec");
      for (int i = 0; i < userTempVec.size(); i++) {
        if (userTempVec.elementAt(i).toString().equals("city =")) {
          city = userTempVec.elementAt(i + 1).toString().trim();
          cityName = rootMaster.getPlaceName(dataSource, Integer.parseInt(city));
          break;
        }
      }
    }
    Vector searchVec = new Vector();

    /*
     *  searchFor (0) Student.
     */

    if (searchFor.equalsIgnoreCase("0")) {
      if (session.getAttribute("searchVec") != null) {
        searchVec = (Vector) session.getAttribute("searchVec");
        for (int i = 0; i < searchVec.size(); i++) {
          paramVec.add(searchVec.elementAt(i).toString());
          if (searchVec.elementAt(i).toString().equals("course =")) {
            category = searchVec.elementAt(i + 1).toString().trim();
            Vector categoryNameVec =
                indvMaster.getCourseName(dataSource, Integer.parseInt(category.trim()));
            categoryName = categoryNameVec.elementAt(0).toString();
          }
          if (searchVec.elementAt(i).toString().equals("first_name like")) {
            firstName = searchVec.elementAt(i + 1).toString().trim();

            String teamCat1[] = firstName.split("%");
            ////////// System.out.println("teamCat[]>>>>>>>searchVec>>>>>>>"+teamCat1[1]);
            firstName = teamCat1[1];
          }
          if (searchVec.elementAt(i).toString().equals("college_id =")) {
            brand = searchVec.elementAt(i + 1).toString().trim();

            String StrArr[] = brand.split("~");
            int compnyid = Integer.parseInt(StrArr[0]);

            if (compnyid == 0) {
              compnyid = Integer.parseInt(userVec.elementAt(27).toString());
              Vector name = indvMaster.getOtherCollege(dataSource, compnyid);
              brandName = name.elementAt(0).toString().trim();
            } else if (StrArr[1].equalsIgnoreCase("1")) {
              brandName = rootMaster.getCompnyName(dataSource, compnyid);
            } else {
              brandName = rootMaster.getCollegeName(dataSource, compnyid);
            }
            // brandName

          }
        }
      }
      if (session.getAttribute("userVec") != null) {
        for (int i = 0; i < userVec.size(); i++) {
          paramVec.add(userVec.elementAt(i).toString());
        }
      }
    }

    String strPageHtml = getPages(minVal, maxVal, totalRow, lowerSubTag, pageid, numCount);

    int regFlag = 0;
    int numcount = UserVec.size();
    String strComplaintList =
        getComplaintList(
            searchFor,
            dataSource,
            numcount,
            strComFIdOrder,
            strCTitelOrder,
            strDateOrder,
            minVal,
            maxVal,
            totalRow,
            strPageHtml,
            UserVec,
            pageid,
            lowerSubTag,
            regFlag,
            city,
            brand,
            categoryName,
            cityName,
            brandName,
            remander,
            firstName,
            month,
            nYear);
    // System.out.println("Users "+strComplaintList);
    /**
     * setContentType - text/html to write String on page. PrintWriter - This line use to get writer
     * to write on page. out.println - use to write string.
     */
    response.setContentType("text/html;charset=ISO-8859-1");
    PrintWriter out = response.getWriter();
    out.println(strComplaintList);
    out.flush();

    // TODO Auto-generated method stub
    return null;
  }
  private String getComplaintList(
      String searchFor,
      DataSource dataSource,
      int numcount,
      String strComFIdOrder,
      String strCTitelOrder,
      String strDateOrder,
      int minVal,
      int maxVal,
      int totalRow,
      String strPageHtml,
      Vector userVec,
      String pageid,
      String lowerSubTag,
      int regFlag,
      String City,
      String brand,
      String category,
      String city,
      String brandname,
      int remander,
      String firstname,
      String mon,
      String nYr) {
    RootMaster rootMaster = new RootMaster();

    String strValue = "";
    strValue += "<div style=\"float:left; width:775px;\">";
    strValue += "<div style=\"float:left; width:640px;\">";
    strValue += "<div class=\"Page_Heading\" style=\"width:99%;\">";
    strValue += "<div class=\"Page_Heading_Text\" style=\"width: 70%;\">List of complaints</div>";

    if (numcount != 0) {
      strValue += "<div style=\"float: left;\">";
      strValue +=
          "<a style=\"font-size: 10px; font-weight: bold; color: rgb(0, 0, 0);\">Total matches Found "
              + numcount
              + "</a></div>";
    }
    strValue += "</div>";

    if (userVec.size() == 0) {
      strValue += "<div class=\"Fields_Container\">";
      strValue += "<div>";

      if (lowerSubTag.equalsIgnoreCase("2")) {
        strValue += "<div class=\"Fields_Row_2_head\">";
        strValue += "<div class=\"Fields_Col_1a\">No Complaints Found.";
        strValue += "</div></div>";

      } else {
        strValue += "<div class=\"Fields_Row_2_head\">";
        strValue += "<div class=\"Fields_Col_1a\">No Complaints Found.";
        strValue += "</div></div>";
      }
      strValue += "</div></div>";
    } else {

      strValue += "<div class=\"Fields_Container\">";
      strValue += "<div>";

      strValue += "<div class=\"Fields_Row_2_head\" style=\"font-size:11px; width:99%;\">";
      strValue += "<div class=\"Row_2_Fields_head_2\" style=\"width: 18%;\">From</div>";
      strValue += "<div class=\"Row_2_Fields_head_2\" style=\"width: 14%;\">Title</div>";
      strValue +=
          "<div class=\"Row_2_Fields_head_2\" style=\"width: 12%; text-align: left;\">Category</div>";
      strValue +=
          "<div class=\"Row_2_Fields_head_2\" style=\"width: 12%; text-align: left;\">Open Date</div>";
      strValue +=
          "<div class=\"Row_2_Fields_head_2\" style=\"width: 12%; text-align: left;\">Close Date</div>";
      strValue +=
          "<div class=\"Row_2_Fields_head_2\" style=\"width: 12%; text-align: left;\">Status</div>";
      strValue += "</div>";

      String strLoginIdSymbol =
          (strComFIdOrder.trim().equalsIgnoreCase("asc"))
              ? "<img style=\"cursor:hand\" src=\"../images/downarrow.gif\" onClick=\"retrieveClistURL('brandsExistingComplaint.do?sby=log.first_name&lowerSubTag="
                  + lowerSubTag
                  + "&pageid="
                  + pageid
                  + "&numMin="
                  + minVal
                  + "&fidorder="
                  + strComFIdOrder
                  + "');\">"
              : "<img style=\"cursor:hand\" src=\"../images/uparrow.gif\" onClick=\"retrieveClistURL('brandsExistingComplaint.do?sby=log.first_name&lowerSubTag="
                  + lowerSubTag
                  + "&pageid="
                  + pageid
                  + "&numMin="
                  + minVal
                  + "&fidorder="
                  + strComFIdOrder
                  + "');\">";
      String strUnameSymbol =
          (strCTitelOrder.trim().equalsIgnoreCase("asc"))
              ? "<img style=\"cursor:hand\" src=\"../images/downarrow.gif\" onClick=\"retrieveClistURL('brandsExistingComplaint.do?sby=com.complaint_title&lowerSubTag="
                  + lowerSubTag
                  + "&pageid="
                  + pageid
                  + "&numMin="
                  + minVal
                  + "&ctorder="
                  + strCTitelOrder
                  + "');\">"
              : "<img style=\"cursor:hand\" src=\"../images/uparrow.gif\" onClick=\"retrieveClistURL('brandsExistingComplaint.do?sby=com.complaint_title&lowerSubTag="
                  + lowerSubTag
                  + "&pageid="
                  + pageid
                  + "&numMin="
                  + minVal
                  + "&ctorder="
                  + strCTitelOrder
                  + "');\">";
      String strDateSymbol =
          (strDateOrder.trim().equalsIgnoreCase("asc"))
              ? "<img style=\"cursor:hand\" src=\"../images/downarrow.gif\" onClick=\"retrieveClistURL('brandsExistingComplaint.do?sby=com.creation_date&lowerSubTag="
                  + lowerSubTag
                  + "&pageid="
                  + pageid
                  + "&numMin="
                  + minVal
                  + "&dateorder="
                  + strDateOrder
                  + "');\">"
              : "<img style=\"cursor:hand\" src=\"../images/uparrow.gif\" onClick=\"retrieveClistURL('brandsExistingComplaint.do?sby=com.creation_date&lowerSubTag="
                  + lowerSubTag
                  + "&pageid="
                  + pageid
                  + "&numMin="
                  + minVal
                  + "&dateorder="
                  + strDateOrder
                  + "');\">";

      for (int i = 0; i < userVec.size(); i++) {
        int j = i + 1;
        int numTotal = j % 2;
        String strColor = (numTotal == 0) ? "#FFFFFF" : "#FFFFFF";
        String strImg = (numTotal == 0) ? "detail_white.gif" : "detail_white.gif";
        Vector tempVec = (Vector) userVec.elementAt(i);

        int comId = Integer.parseInt(tempVec.elementAt(0).toString().trim());

        String strFid = tempVec.elementAt(1).toString().trim();

        String strFname = tempVec.elementAt(6).toString().trim();
        String strLname = tempVec.elementAt(7).toString().trim();
        String strCompText = tempVec.elementAt(10).toString().trim();
        //	 String strCity = tempVec.elementAt(8).toString().trim();
        int catId = Integer.parseInt(tempVec.elementAt(8).toString().trim());
        int tagId = Integer.parseInt(tempVec.elementAt(9).toString().trim());
        int dealerId = Integer.parseInt(tempVec.elementAt(11).toString().trim());

        strColor = "#404040";
        if (tagId == 1) {
          strColor = "#990099";
        }
        if (tagId == 2) {
          strColor = "#999900";
        }
        if (tagId == 3) {
          strColor = "#00CC00";
        }
        if (tagId == 4) {
          strColor = "#B00000";
        }
        Vector catVec = rootMaster.getCategoryName(dataSource, catId);
        Vector tagVec = rootMaster.getTagName(dataSource, tagId);
        String Staff = "NA";
        if (dealerId != 0) {
          Vector StaffVec = rootMaster.getStaffName(dataSource, dealerId);
          System.out.println("staff is " + StaffVec);
          Staff = StaffVec.elementAt(0).toString().trim();
        }
        String cat_name = catVec.elementAt(0).toString().trim();
        String tagname = "";
        if (tagVec.size() == 0) {
          tagname = "NA";
        } else {
          tagname = tagVec.elementAt(0).toString().trim();
        }

        // for check length of Complaint text
        String strText = "";
        String strFMsg = "";

        String strMessage = tempVec.elementAt(2).toString().trim();
        //////// System.out.println("complaintMessage........."+strMessage.length());
        //////// System.out.println("complaintMessage........."+strMessage);
        int numChar = (strMessage.length() > 45) ? 45 : strMessage.length();
        for (int k = 0; k < numChar; k++) {

          strFMsg = strFMsg + strMessage.charAt(k);
        }
        if (strFMsg.lastIndexOf(strFMsg) != -1) {
          strText = strFMsg;
          ////// System.out.println("...strFMsgTeam......"+strFMsg.lastIndexOf(strFMsg));

        } else {
          strText = strFMsg.substring(0, strFMsg.lastIndexOf(" "));
          ////// System.out.println("...strText......");
        }
        String strDate[] = tempVec.elementAt(3).toString().trim().split("-");
        // starting to represent complaints listing here in different format
        strValue += "<div class=\"Fields_Row_2a\" style=\"font-size:11px; width:99%\">";
        strValue +=
            "<div class=\"Row_2_Fields_head_2\" style=\"width: 18%; font-weight: normal;\">"
                + strFname
                + " "
                + strLname
                + "</div>";
        strValue +=
            "<div class=\"Row_2_Fields_head_2\" style=\"width: 14%; font-weight: normal;\">"
                + strText
                + "</div>";
        strValue +=
            "<div class=\"Row_2_Fields_head_2\" style=\"width: 12%; font-weight: normal; text-align: left;\">"
                + cat_name
                + "</div>";
        strValue +=
            "<div class=\"Row_2_Fields_head_2\" style=\"width: 12%; font-size:9px; font-weight: normal; text-align: left;\">"
                + strDate[2]
                + "-"
                + strDate[1]
                + "-"
                + strDate[0]
                + "</div>";
        strValue +=
            "<div class=\"Row_2_Fields_head_2\" style=\"width: 12%; font-size:9px; font-weight: normal; text-align: left;\">"
                + strDate[2]
                + "-"
                + strDate[1]
                + "-"
                + strDate[0]
                + "</div>";
        strValue +=
            "<div class=\"Row_2_Fields_head_2\" style=\"width: 10%; font-size:9px; font-weight: bold; color: "
                + strColor
                + "; text-align: right;\">"
                + tagname
                + "</div>";
        //	    strValue += "<div class=\"Row_2_Fields_head_2\" style=\"width: 8%;\"
        // onclick=\"popup('popUpDiv')\"><a
        // href=\"compdetres.jsp?numCid="+numCid+"&pageid1="+pageid+"&lowerSubTag="+lowerSubTag+"\"><img alt=\"Click here to see detail\" src=\"../images/"+strImg.trim()+"\" width=\"16\" height=\"16\" border=\"0\"></img></a></div>";
        strValue +=
            "<div class=\"Row_2_Fields_head_2\"><img id=\"imgplus"
                + i
                + "\" style=\"cursor: pointer\" src=\"../images/add.png\" onclick=\"fnShow('imgplus"
                + i
                + "', 'compdet"
                + i
                + "', 'imgminus"
                + i
                + "');\"><img id=\"imgminus"
                + i
                + "\" style=\"display: none; cursor: pointer\" src=\"../images/add.png\" onclick=\"fnHide('imgplus"
                + i
                + "', 'compdet"
                + i
                + "', 'imgminus"
                + i
                + "');\"></div>";
        strValue += "</div>";
        strValue += "<div>";
        strValue += "<span id=\"compdet" + i + "\" style=\"display: none;\">";
        strValue += "<div class=\"top_panel-1\"  style =\"width:600px;\">";
        strValue += "<div class=\"Page_Heading-2\">";
        strValue += "<div class=\"Page_Heading_Text\" style=\"width: 70%;\">Details</div></div>";

        strValue += "<div class=\"Fields_Container-2\"  style =\"width:600px;\">";
        strValue += "<div class=\"Fields_Container_Inside\" >";
        strValue += "<div class=\"Fields_Row_1\">";
        strValue +=
            "<div style=\"float: left; width: 25%; text-align: left; margin-left: 25px; display: inline; font-weight: bold;\">Complaint Title:</div>";
        strValue +=
            "<div style=\"float: left; width: 60%; text-align: left; margin-left: 25px; display: inline; font-weight: normal;\">"
                + strText
                + "</div>";
        strValue += "</div>";

        strValue += "<div class=\"Fields_Row_1\">";
        strValue +=
            "<div style=\"float: left; width: 25%; text-align: left; margin-left: 25px; display: inline; font-weight: bold;\">From:</div>";
        strValue +=
            "<div style=\"float: left; width: 60%; text-align: left; margin-left: 25px; display: inline; font-weight: normal;\">"
                + strFname
                + " "
                + strLname
                + "</div>";
        strValue += "</div>";

        strValue += "<div class=\"Fields_Row_1\">";
        strValue +=
            "<div style=\"float: left; width: 15%; text-align: left; margin-left: 25px; display: inline; font-weight: bold;\">Category:</div>";
        strValue +=
            "<div style=\"float: left; width: 20%; text-align: left; margin-left: 25px; display: inline; font-weight: normal;\">"
                + cat_name
                + "</div>";
        strValue +=
            "<div style=\"float: left; width: 20%; text-align: left; margin-left: 25px; display: inline; font-weight: bold;\">Complaint ID:</div>";
        strValue +=
            "<div style=\"float: left; width: 20%; text-align: left; margin-left: 25px; display: inline; font-weight: normal;\">"
                + comId
                + "</div>";
        strValue += "</div>";

        strValue += "<div class=\"Fields_Row_1\">";
        strValue +=
            "<div style=\"float: left; width: 15%; text-align: left; margin-left: 25px; display: inline; font-weight: bold;\">Filed on:</div>";
        strValue +=
            "<div style=\"float: left; width: 20%; text-align: left; margin-left: 25px; display: inline; font-weight: normal;\">"
                + strDate[2]
                + "-"
                + strDate[1]
                + "-"
                + strDate[0]
                + "</div>";
        strValue +=
            "<div style=\"float: left; width: 20%; text-align: left; margin-left: 25px; display: inline; font-weight: bold;\">Assigned To:</div>";
        strValue +=
            "<div style=\"float: left; width: 20%; text-align: left; margin-left: 25px; display: inline; font-weight: normal;\">"
                + Staff
                + "</div>";
        strValue += "</div>";

        strValue += "<div class=\"Fields_Row_1\">";
        strValue +=
            "<div style=\"float: left; width: 25%; text-align: left; margin-left: 25px; display: inline; font-weight: bold;\">Complaint Details:</div>";
        strValue +=
            "<div style=\"float: left; width: 60%; text-align: left; margin-left: 25px; display: inline; font-weight: normal;\"><p>"
                + strCompText
                + "</p></div>";
        strValue += "</div>";

        strValue += "<div class=\"Fields_Row_1\">";
        strValue +=
            "<div style=\"float: left; width: 20%; text-align: left; margin-left: 25px; display: inline; font-weight: bold;\">Status:</div>";
        strValue +=
            "<div style=\"float: left; width: 25%; text-align: left; margin-left: 25px; display: inline; font-weight: normal;\">"
                + tagname
                + "</div>";
        strValue +=
            "<div style=\"float: left; width: 25%; text-align: left; margin-left: 25px; display: inline; font-weight: normal;\">Change Status to: </div>";
        strValue +=
            "<div style=\"float: left; width: 25%; text-align: left; margin-left: 25px; display: inline; font-weight: normal;\"><select name=\"status\" onchange=\"xyz.do?compid=comId&numStatus=this.value\">";
        strValue += "<option value=\"1\">Open</option>";
        strValue += "<option value=\"2\">Under Process</option>";
        strValue += "<option value=\"3\">Resolved</option>";
        strValue += "<option value=\"4\">Closed</option>";
        strValue += "</select></div>";
        strValue += "</div>";

        strValue += "</div></div>";

        strValue += "</div></span></div>";

        //	strValue += "</div>";
      }

      if (totalRow > maxVal) {
        strValue += "<tr >";
        strValue += "<td colspan=\"7\" align=\"right\" >Page Number" + strPageHtml + "</td>";
        strValue += "</tr>";
      }
      strValue += "</div></div>";
    }

    strValue += "</div>";

    strValue += "<div style=\"float:right;\">";
    // strValue +="<div class=\"Page_Heading\">";
    // strValue +="<div class=\"Page_Heading_Text\" style=\"width: 70%;\">Search
    // Criteria</div></div>";

    strValue +=
        "<div style=\"width:130px; float:left; border-left:solid 1px #ccc; margin-left:3px;\">";
    strValue +=
        "<span style=\"font-size:12px; font-weight:bold; text-align:center; width:90%; float:left;\">Category</span>";
    strValue += "<ul style=\"font-size:11px;\">";

    Vector CatVec = rootMaster.getAllCategory(dataSource);
    Vector tempCatVec = new Vector();
    for (int i = 1; i < CatVec.size() - 1; i++) {
      tempCatVec.add(CatVec.elementAt(i));
    }
    int tempInt = tempCatVec.size() / 10;
    int tempRest = tempCatVec.size() % 10;
    //		////////System.out.println("tempInt>>>>>>>>>"+tempInt);
    //		////////System.out.println("tempRest>>>>>>>>>"+tempRest);
    int y3 = 10;
    if (tempRest != 0) {
      tempInt += 1;
    }

    for (int k = 0; k < tempInt; k++, y3 += 10) {
      if (y3 > tempCatVec.size()) {
        if (tempRest != 0) {
          y3 = y3 + tempRest - 10;
        } else {
          y3 = tempCatVec.size();
        }
      }

      System.out.println("temp Vec at Brand Existing complaints " + tempCatVec);
      if (k == 0) {

        strValue += " <TR id=\"city" + k + "\" style=\"display:inline\">";
      } else {
        strValue += " <TR id=\"city" + k + "\" style=\"display:none\">";
      }
      strValue += " <TD colspan=\"2\"  align=\"left\" valign=\"top\">";
      if (k == 0) {
        // strValue +=" <A
        // href=\"searchresult.jsp?cityStr=&brandStr="+brand+"&categoryStr="+category+"\"><b
        // >ALL</b></A><BR>";
        // strValue +=" <><b>ALL</b></A><BR>";
        strValue +=
            "<li  style=\"padding:2px 5px;\"><A onclick=\"retrieveClistURL('brandsExistingComplaint.do?lowerSubTag="
                + lowerSubTag
                + "&pageid="
                + pageid
                + "&Month="
                + mon
                + "&Year="
                + nYr
                + "&categoryid=0&numCount=6');\" href=\"#\">ALL</li>";
      }
      for (int j = k * 10; j < y3; j++) {
        strValue +=
            "<li  style=\"padding:2px 5px;\"><A onclick=\"retrieveClistURL('brandsExistingComplaint.do?lowerSubTag="
                + lowerSubTag
                + "&pageid="
                + pageid
                + "&Month="
                + mon
                + "&Year="
                + nYr
                + "&categoryid="
                + ((Vector) tempCatVec.elementAt(j)).elementAt(0).toString().trim()
                + "&numCount=6');\" href=\"#\">"
                + ((Vector) tempCatVec.elementAt(j)).elementAt(1).toString().trim()
                + "</A></li>";
        //		strValue +=" <A
        // onclick=\"retrieveClistURL('brandsExistingComplaint.do?lowerSubTag="+lowerSubTag+"&pageid="+pageid+"&Month="+mon+"&Year="+nYr+"&categoryid="+((Vector)tempCatVec.elementAt(j)).elementAt(0).toString().trim()+"&numCount=6');\" href=\"#\"><b >"+((Vector)tempCatVec.elementAt(j)).elementAt(1).toString().trim()+"</b></A><BR>";

      }
    }
    strValue += "</ul>";
    strValue += "<span style=\"float:left; margin-left:5px; font-size:11px;\">Prev</span>";
    strValue += "<span style=\"float:right; margin-right:5px; font-size:11px;\">Next</span>";
    // strValue +="</div>";
    // strValue +=" <tr id=\"city\" style=\"display:none\"><td width=\"60\" align=\"center\"
    // id=\"Previous\" onclick=\"showCity(this.id,"+(tempInt-1)+")\"
    // style=\"cursor:hand\">Previous&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td
    // class=\"bold\"id=\"next\" onclick=\"showCity(this.id,"+(tempInt-1)+")\"
    // style=\"cursor:hand\">Next</td></tr>";

    strValue +=
        "<div style=\"width:130px; float:left; border-top:solid 1px #ccc; margin-top:10px; margin-left:3px;\">";
    strValue +=
        "<span style=\"font-size:12px; font-weight:bold; text-align:center; width:90%; float:left;\">Status</span>";
    strValue += "<ul style=\"font-size:11px;\">";
    strValue += " <tr><td ><b>Status not Availlable</b></A><BR></TD>";
    strValue += " </TR>";

    /*		Vector collegeVec = new Vector();
    	Vector collegeVecCom = new Vector();

    	if(cscVec.size()==6){

    	 collegeVec = rootMaster.getCollege(dataSource,cscVec.elementAt(1).toString(), cscVec.elementAt(3).toString(), cscVec.elementAt(5).toString());
    	 collegeVecCom = rootMaster.getCollegeCom(dataSource, cscVec.elementAt(1).toString(), cscVec.elementAt(3).toString(), cscVec.elementAt(5).toString());
    	}
    	else if(cscVec.size()==4){

    		collegeVec = rootMaster.getCollegeState(dataSource,cscVec.elementAt(1).toString(), cscVec.elementAt(3).toString());
    		 collegeVecCom = rootMaster.getCollegeComState(dataSource, cscVec.elementAt(1).toString(), cscVec.elementAt(3).toString());

    	}
    	else {

    		collegeVec = rootMaster.getCollegeCountry(dataSource,cscVec.elementAt(1).toString());
    		 collegeVecCom = rootMaster.getCollegeComCountry(dataSource, cscVec.elementAt(1).toString());

    	}
    */
    /*	Vector<Vector>brandVec = new Vector<Vector>();
    Vector<String>tempVec = new Vector<String>();

    for(int i=0;i<collegeVecCom.size();i++)
    {
    	Vector teamp = (Vector)collegeVecCom.elementAt(i);
    	Vector<String>teamp1 = new Vector<String>();

    	String teampId = teamp.elementAt(0).toString();

    	teamp1.add(teampId+"~1");
    	teamp1.add(teamp.elementAt(1).toString());

    	brandVec.add(teamp1);

    }

    for(int i=0;i<collegeVec.size();i++)
    {
    	Vector teamp = (Vector)collegeVec.elementAt(i);
    	Vector<String>teamp1 = new Vector<String>();

    	String teampId = teamp.elementAt(0).toString();

    	teamp1.add(teampId+"~0");
    	teamp1.add(teamp.elementAt(1).toString());

    	brandVec.add(teamp1);


    }
    */
    /*Vector tempBrandVec = new Vector();
    		if(brandVec.size()>0){
    			for(int i=0 ; i<brandVec.size();i++)
    			{
    				tempBrandVec.add(brandVec.elementAt(i));
    			}
    		int tempInt1 = tempBrandVec.size()/10;
    		int tempRest1 = tempBrandVec.size()%10;
    //		////////System.out.println("tempBrandVec.size()>>>>>>>>>"+tempBrandVec.size());
    //		////////System.out.println("tempInt1>>>>>>>>>"+tempInt1);
    //		////////System.out.println("tempRest1>>>>>>>>>"+tempRest1);
    		int y1 = 10;
    		if(tempRest1!=0)
    		{
    		tempInt1 += 1;
    		}*/
    /*
    		for(int k1=0;k1<tempInt1;k1++,y1+=10){
    		if(y1>tempBrandVec.size())
    		{
    			if(tempRest1!=0)
    			{
    				y1=y1+tempRest1-10;
    			}
    			else
    			{
    				y1=tempBrandVec.size();
    			}
    		}
    */
    /*	if(k1==0){


    		strValue +=" <TR id=\"brand"+k1+"\" style=\"display:inline\">";
    		}else{
    		strValue +=" <TR id=\"brand"+k1+"\" style=\"display:none\">";
    		}
    		strValue +=" <TD colspan=\"2\"  align=\"left\" valign=\"top\">";
    		if(k1==0){
    		strValue +=" <A href=\"searchresult.jsp?cityStr=0&brandStr=&categoryStr="+category+"\"></A><BR>";
    		}
    		for(int j1=k1*10;j1<y1;j1++){
    //		////////System.out.println(k+">>>>>>>>>>>>>>>>>>"+tempCityVec.elementAt(j).toString());




    		Vector tempBrandVec1 = (Vector)tempBrandVec.elementAt(j1);

    		strValue +=" <A href=\"searchresult.jsp?cityStr=0&brandStr="+tempBrandVec1.elementAt(0).toString()+"&categoryStr="+category+"\"><b >"+tempBrandVec1.elementAt(1).toString()+"</b></A><BR>";



    		} +=" </TD>";
    		strValue +=" </TR>";
    	}*/
    /*	if(tempBrandVec.size()>10)
    		{


    		strValue +=" <tr id=\"brandnext\" style=\"display:inline\"><td width=\"60\"></td><td  align=\"right\"  id=\"next\" onclick=\"showBrand(this.id,"+(tempInt1-1)+")\" style=\"cursor:hand\">Next</td></tr>";
    		strValue +=" <tr id=\"brand\" style=\"display:none\"><td width=\"60\" align=\"center\"  id=\"Previous\" onclick=\"showBrand(this.id,"+(tempInt1-1)+")\" style=\"cursor:hand\">Previous&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td  class=\"bold\"id=\"next\" onclick=\"showBrand(this.id,"+(tempInt1-1)+")\" style=\"cursor:hand\">Next</td></tr>";
    		strValue +=" <tr id=\"brandpre\" style=\"display:none\"><td width=\"60\" align=\"left\"  id=\"Previous\" onclick=\"showBrand(this.id,"+(tempInt1-1)+")\" style=\"cursor:hand\">Previous</td><td></td></tr>";

    		}}else{
    		strValue +=" <tr><td ><b>No College Availlable</b><BR></TD>";
    		strValue +=" </TR>";
    		}
    */

    strValue += " </TBODY>";
    strValue += " </TABLE>";
    strValue += " </TD>";
    strValue += " </TR>";
    strValue += " <TR>";
    strValue += " <TD background=blogs_files/1x1white.gif></TD>";
    strValue += " </TR>";
    strValue += " </TBODY>";
    strValue += " </TABLE>";
    strValue += " </TD>";
    strValue += " </TR>";

    strValue += " <TR>";
    strValue += " <TD><TABLE cellSpacing=0 cellPadding=0 width=\"100%\" border=0>";
    strValue += " <TBODY>";
    strValue += " <TD background=blogs_files/1x1white.gif></TD></TR>";
    strValue += " <TR>";
    strValue += "  <TD>";
    strValue += " <TABLE cellSpacing=0 cellPadding=0 width=\"95%\" align=center border=0>";
    strValue += " <TBODY>";

    // Vector categoryVec = rootMaster.getCategories(dataSource);
    Vector<Vector> resultVec = new Vector<Vector>();

    resultVec = rootMaster.getCourse(dataSource);

    Vector tempCategoryVec = new Vector();
    if (resultVec.size() > 0) {
      for (int i = 1; i < resultVec.size(); i++) {
        tempCategoryVec.add(resultVec.elementAt(i));
      }
      int tempInt2 = tempCategoryVec.size() / 10;
      int tempRest2 = tempCategoryVec.size() % 10;
      int y2 = 10;
      if (tempRest2 != 0) {
        tempInt2 += 1;
      }

      for (int k2 = 0; k2 < tempInt2; k2++, y2 += 10) {
        if (y2 > tempCategoryVec.size()) {
          if (tempRest2 != 0) {
            y2 = y2 + tempRest2 - 10;
          } else {
            y2 = tempCategoryVec.size();
          }
        }
        /*
        		if(k2==0){


        		strValue +=" <TR id=\"category"+k2+"\" style=\"display:inline\">";
        		}else{
        		strValue +=" <TR id=\"category"+k2+"\" style=\"display:none\">";
        		}
        		strValue +=" <TD colspan=\"2\" align=\"left\" valign=\"top\">";
        		if(k2==0){
        		strValue +="  <A href=\"searchresult.jsp?cityStr=0&brandStr="+brand+"&categoryStr=\"></A><BR>";
        		}
        		for(int j2=k2*10;j2<y2;j2++){
        //		////////System.out.println(k+">>>>>>>>>>>>>>>>>>"+tempCityVec.elementAt(j).toString());


        		Vector tempCat = (Vector)tempCategoryVec.elementAt(j2);

        		strValue +=" <A href=\"searchresult.jsp?cityStr=0&brandStr="+brand+"&categoryStr="+tempCat.elementAt(0).toString()+"\"><b >"+tempCat.elementAt(1).toString()+"</b></A><BR>";



        		}*/
        strValue += " </TD>";
        strValue += " </TR>";
      }

      strValue += " </TBODY>";
      strValue += " </TABLE>";
      strValue += " </TD>";
      strValue += " </TR>";
      strValue += " <TR>";
      strValue += "  <TD height=\"2\" background=blogs_files/1x1white.gif></TD>";
      strValue +=
          "  </TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD>";
      strValue += " <TD width=6></TD>";
      strValue += "  </TR>";

      strValue += "  <TR>";
      strValue += " <TD height=\"2\" colSpan=4></TD>";
      strValue += " </TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD>";
      strValue += " <TD width=4></TD>";
      strValue +=
          " </TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR>";
      strValue +=
          " </TBODY></TABLE>                              </TD></TR></TBODY></TABLE></TD></TR>";
      strValue +=
          " </TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>";
      strValue += "  </div>  </div>";
      strValue += "    </div>";
    }
    strValue += "    </div>";
    return strValue;
  }
  public ActionForward execute(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {

    MyPreferencesForm myPreferencesForm = new MyPreferencesForm();

    HttpSession session = request.getSession();
    String uId = (String) session.getAttribute("uId");
    String compId = (String) session.getAttribute("compId");

    int numCompId = Integer.parseInt(compId);
    int numUId = Integer.parseInt(uId);

    EntpMaster entpMaster = new EntpMaster();
    RootMaster rootMaster = new RootMaster();

    Vector resultVec = entpMaster.getCommunityUnnamedMap(getDataSource(request, "indv"), numCompId);
    request.setAttribute("resultVec", resultVec);
    System.out.println("resultVec//////MyPreferencesPreAction////////" + resultVec);

    Vector consumerUnName = new Vector();
    if (resultVec.size() != 0) {

      consumerUnName =
          rootMaster.getUserUnNameInfo(getDataSource(request, "indv"), numUId, numCompId);
      request.setAttribute("consumerUnName", consumerUnName);
      System.out.println("consumerUnName//////MyPreferencesPreAction////////" + consumerUnName);

      if (consumerUnName.size() != 0) {
        myPreferencesForm.setField1(consumerUnName.elementAt(0).toString());
        myPreferencesForm.setField2(consumerUnName.elementAt(1).toString());
        myPreferencesForm.setField3(consumerUnName.elementAt(2).toString());
        myPreferencesForm.setField4(consumerUnName.elementAt(3).toString());
        myPreferencesForm.setField5(consumerUnName.elementAt(4).toString());
        myPreferencesForm.setField6(consumerUnName.elementAt(5).toString());
        myPreferencesForm.setField7(consumerUnName.elementAt(6).toString());
        myPreferencesForm.setField8(consumerUnName.elementAt(7).toString());
        myPreferencesForm.setField9(consumerUnName.elementAt(8).toString());
        myPreferencesForm.setField10(consumerUnName.elementAt(9).toString());
        myPreferencesForm.setField11(consumerUnName.elementAt(10).toString());
        myPreferencesForm.setField12(consumerUnName.elementAt(11).toString());
        myPreferencesForm.setField13(consumerUnName.elementAt(12).toString());
        myPreferencesForm.setField14(consumerUnName.elementAt(13).toString());
        myPreferencesForm.setField15(consumerUnName.elementAt(14).toString());
        myPreferencesForm.setField16(consumerUnName.elementAt(15).toString());
        myPreferencesForm.setField17(consumerUnName.elementAt(16).toString());
        myPreferencesForm.setField18(consumerUnName.elementAt(17).toString());
        myPreferencesForm.setField19(consumerUnName.elementAt(18).toString());
        myPreferencesForm.setField20(consumerUnName.elementAt(19).toString());
        myPreferencesForm.setField21(consumerUnName.elementAt(20).toString());
        myPreferencesForm.setField22(consumerUnName.elementAt(21).toString());
        myPreferencesForm.setField23(consumerUnName.elementAt(22).toString());
        myPreferencesForm.setField24(consumerUnName.elementAt(23).toString());
        myPreferencesForm.setField25(consumerUnName.elementAt(24).toString());
        myPreferencesForm.setField26(consumerUnName.elementAt(25).toString());
        myPreferencesForm.setField27(consumerUnName.elementAt(26).toString());
        myPreferencesForm.setField28(consumerUnName.elementAt(27).toString());
        myPreferencesForm.setField29(consumerUnName.elementAt(28).toString());
        myPreferencesForm.setField30(consumerUnName.elementAt(29).toString());
        myPreferencesForm.setField31(consumerUnName.elementAt(30).toString());
        myPreferencesForm.setField32(consumerUnName.elementAt(31).toString());
        myPreferencesForm.setField33(consumerUnName.elementAt(32).toString());
        myPreferencesForm.setField34(consumerUnName.elementAt(33).toString());
        myPreferencesForm.setField35(consumerUnName.elementAt(34).toString());
      }
    }
    request.setAttribute("indvMyPreferencesForm", myPreferencesForm);
    return mapping.findForward("success");
  }