public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;

    try {
      response.setContentType("text/html");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;
      _jspx_resourceInjector = (org.glassfish.jsp.api.ResourceInjector) application.getAttribute("com.sun.appserv.jsp.resource.injector");

      out.write("\n");
      out.write("\n");
      out.write("<?php require_once('Connections/config.php'); ?>\n");
      out.write(" <?php\n");
      out.write("if (!function_exists(\"GetSQLValueString\")) {\n");
      out.write("function GetSQLValueString($theValue, $theType, $theDefinedValue = \"\", $theNotDefinedValue = \"\") \n");
      out.write("{\n");
      out.write("  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;\n");
      out.write("\n");
      out.write("  $theValue = function_exists(\"mysql_real_escape_string\") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);\n");
      out.write("\n");
      out.write("  switch ($theType) {\n");
      out.write("    case \"text\":\n");
      out.write("      $theValue = ($theValue != \"\") ? \"'\" . $theValue . \"'\" : \"NULL\";\n");
      out.write("      break;    \n");
      out.write("    case \"long\":\n");
      out.write("    case \"int\":\n");
      out.write("      $theValue = ($theValue != \"\") ? intval($theValue) : \"NULL\";\n");
      out.write("      break;\n");
      out.write("    case \"double\":\n");
      out.write("      $theValue = ($theValue != \"\") ? \"'\" . doubleval($theValue) . \"'\" : \"NULL\";\n");
      out.write("      break;\n");
      out.write("    case \"date\":\n");
      out.write("      $theValue = ($theValue != \"\") ? \"'\" . $theValue . \"'\" : \"NULL\";\n");
      out.write("      break;\n");
      out.write("    case \"defined\":\n");
      out.write("      $theValue = ($theValue != \"\") ? $theDefinedValue : $theNotDefinedValue;\n");
      out.write("      break;\n");
      out.write("  }\n");
      out.write("  return $theValue;\n");
      out.write("}\n");
      out.write("}\n");
      out.write("\n");
      out.write("$gid_a15 = \"-1\";\n");
      out.write("if (isset($_POST['value'])) {\n");
      out.write("  $gid_a15 = $_POST['value'];\n");
      out.write("}\n");
      out.write("mysql_select_db($database_config, $config);\n");
      out.write("$query_a15 = sprintf(\"SELECT DISTINCT a.Group_id,a.Agent_id,b.f_name, b.l_name FROM Booking a JOIN Agent b ON a.Agent_id = b.Agent_id WHERE a.Group_id = %s; \", GetSQLValueString(\"%\" . $gid_a15 . \"%\", \"int\"));\n");
      out.write("$a15 = mysql_query($query_a15, $config) or die(mysql_error());\n");
      out.write("$row_a15 = mysql_fetch_assoc($a15);\n");
      out.write("$totalRows_a15 = mysql_num_rows($a15);\n");
      out.write("\n");
      out.write("$res_a16 = \"null\";\n");
      out.write("if (isset($_POST['value'])) {\n");
      out.write("  $res_a16 = $_POST['value'];\n");
      out.write("}\n");
      out.write("mysql_select_db($database_config, $config);\n");
      out.write("$query_a16 = sprintf(\"SELECT a.name, c.Number_of_sun FROM Resort a JOIN Rate_Resort b ON a.Resort_id = b.Resort_id JOIN Rating c ON b.Rate_id = c.Rate_id WHERE a.Name like %s\", GetSQLValueString(\"%\" . $res_a16 . \"%\", \"text\"));\n");
      out.write("$a16 = mysql_query($query_a16, $config) or die(mysql_error());\n");
      out.write("$row_a16 = mysql_fetch_assoc($a16);\n");
      out.write("$totalRows_a16 = mysql_num_rows($a16);\n");
      out.write("\n");
      out.write("mysql_select_db($database_config, $config);\n");
      out.write("$query_a22 = \"SELECT b.Resort_id, c.Name FROM Resort_Amenities b JOIN Resort c ON b.Resort_id = c.Resort_id GROUP BY b.Resort_id, c.Name HAVING COUNT( b.Resort_id )= (  SELECT COUNT( a.Amen_ID ) FROM Amenities a )\";\n");
      out.write("$a22 = mysql_query($query_a22, $config) or die(mysql_error());\n");
      out.write("$row_a22 = mysql_fetch_assoc($a22);\n");
      out.write("$totalRows_a22 = mysql_num_rows($a22);\n");
      out.write("\n");
      out.write("$coun_a24 = \"null\";\n");
      out.write("if (isset($_POST['value'])) {\n");
      out.write("  $coun_a24 = $_POST['value'];\n");
      out.write("}\n");
      out.write("mysql_select_db($database_config, $config);\n");
      out.write("$query_a24 = sprintf(\"SELECT Count(Resort_id) FROM Resort a Join City b ON a.City_id = b.City_id WHERE b.country like %s \", GetSQLValueString(\"%\" . $coun_a24 . \"%\", \"text\"));\n");
      out.write("$a24 = mysql_query($query_a24, $config) or die(mysql_error());\n");
      out.write("$row_a24 = mysql_fetch_assoc($a24);\n");
      out.write("$totalRows_a24 = mysql_num_rows($a24);\n");
      out.write("\n");
      out.write("mysql_select_db($database_config, $config);\n");
      out.write("$query_a12 = \"SELECT a.Client_ID, c.f_name, c.l_name, a.Resort_ID, b.Name, sum( DATEDIFF( depdate, arrivaldate )) total FROM Booking a JOIN Resort b ON b.Resort_id = a.Resort_id JOIN Client c ON c.Client_ID = a.Client_ID GROUP BY a.Client_ID, a.Resort_ID\";\n");
      out.write("$a12 = mysql_query($query_a12, $config) or die(mysql_error());\n");
      out.write("$row_a12 = mysql_fetch_assoc($a12);\n");
      out.write("$totalRows_a12 = mysql_num_rows($a12);\n");
      out.write("\n");
      out.write("mysql_select_db($database_config, $config);\n");
      out.write("$query_a20a = \"select f.Resort_id from (select * from Booking b natural join (select * from Rate_Resort where Rate_id=1) t) f  GROUP BY f.Resort_id HAVING COUNT(f.Book_id) >= ALL (select COUNT(f2.Book_id) from (select * from Booking b natural join (select * from Rate_Resort where Rate_id=1) t) f2  GROUP BY f2.Resort_id); \";\n");
      out.write("$a20a = mysql_query($query_a20a, $config) or die(mysql_error());\n");
      out.write("$row_a20a = mysql_fetch_assoc($a20a);\n");
      out.write("$totalRows_a20a = mysql_num_rows($a20a);\n");
      out.write("\n");
      out.write("mysql_select_db($database_config, $config);\n");
      out.write("$query_a20b = \" select f.Resort_id from (select * from Booking b natural join (select * from Rate_Resort where Rate_id=2) t) f  GROUP BY f.Resort_id HAVING COUNT(f.Book_id) >= ALL (select COUNT(f2.Book_id) from (select * from Booking b natural join (select * from Rate_Resort where Rate_id=2) t) f2  GROUP BY f2.Resort_id); \";\n");
      out.write("$a20b = mysql_query($query_a20b, $config) or die(mysql_error());\n");
      out.write("$row_a20b = mysql_fetch_assoc($a20b);\n");
      out.write("$totalRows_a20b = mysql_num_rows($a20b);\n");
      out.write("\n");
      out.write("mysql_select_db($database_config, $config);\n");
      out.write("$query_a20c = \" select f.Resort_id from (select * from Booking b natural join (select * from Rate_Resort where Rate_id=2) t) f  GROUP BY f.Resort_id HAVING COUNT(f.Book_id) >= ALL (select COUNT(f2.Book_id) from (select * from Booking b natural join (select * from Rate_Resort where Rate_id=3) t) f2  GROUP BY f2.Resort_id); \";\n");
      out.write("$a20c = mysql_query($query_a20c, $config) or die(mysql_error());\n");
      out.write("$row_a20c = mysql_fetch_assoc($a20c);\n");
      out.write("$totalRows_a20c = mysql_num_rows($a20c);\n");
      out.write("\n");
      out.write("mysql_select_db($database_config, $config);\n");
      out.write("$query_a20d = \"Select Resort_id From  Booking  b  GROUP BY b.Resort_id HAVING COUNT(b.Book_id) >= ALL ( Select COUNT(b2.Book_id) FROM Booking b2 GROUP BY b2.Resort_id);     \";\n");
      out.write("$a20d = mysql_query($query_a20d, $config) or die(mysql_error());\n");
      out.write("$row_a20d = mysql_fetch_assoc($a20d);\n");
      out.write("$totalRows_a20d = mysql_num_rows($a20d);\n");
      out.write("\n");
      out.write("$act_a14 = \"null\";\n");
      out.write("if (isset($_POST['value'])) {\n");
      out.write("  $act_a14 = $_POST['value'];\n");
      out.write("}\n");
      out.write("mysql_select_db($database_config, $config);\n");
      out.write("$query_a14 = sprintf(\"select Activity_name from Activities where Description like %s;\", GetSQLValueString(\"%\" . $act_a14 . \"%\", \"text\"));\n");
      out.write("$a14 = mysql_query($query_a14, $config) or die(mysql_error());\n");
      out.write("$row_a14 = mysql_fetch_assoc($a14);\n");
      out.write("$totalRows_a14 = mysql_num_rows($a14);\n");
      out.write("\n");
      out.write("$name_a11 = \"null\";\n");
      out.write("if (isset($_POST['value'])) {\n");
      out.write("  $name_a11 = $_POST['value'];\n");
      out.write("}\n");
      out.write("mysql_select_db($database_config, $config);\n");
      out.write("$query_a11 = sprintf(\"SELECT b.Book_ID, b.Agent_ID, b.Resort_ID, b.Bookingdate, b.arrivaldate, b.depdate, b.Room_ID, b.Activity_ID FROM Booking b JOIN Client c ON b.Client_id = c.Client_id WHERE c.f_name like %s or   c.l_name like %s\", GetSQLValueString(\"%\" . $name_a11 . \"%\", \"text\"),GetSQLValueString(\"%\" . $name_a11 . \"%\", \"text\"));\n");
      out.write("$a11 = mysql_query($query_a11, $config) or die(mysql_error());\n");
      out.write("$row_a11 = mysql_fetch_assoc($a11);\n");
      out.write("$totalRows_a11 = mysql_num_rows($a11);\n");
      out.write("\n");
      out.write("mysql_select_db($database_config, $config);\n");
      out.write("$query_a25 = \"SELECT b.country, AVG( d.number_of_sun )  FROM Resort c JOIN ResortAdd a ON c.city_id = a.city_iD JOIN City b ON a.city_ID = b.city_ID JOIN Rate_Resort e ON e.Resort_id = c.Resort_id JOIN Rating d ON d.Rate_id = e.Rate_id GROUP BY b.country ORDER BY AVG( d.number_of_sun )DESC;\";\n");
      out.write("$a25 = mysql_query($query_a25, $config) or die(mysql_error());\n");
      out.write("$row_a25 = mysql_fetch_assoc($a25);\n");
      out.write("$totalRows_a25 = mysql_num_rows($a25);\n");
      out.write("?><!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n");
      out.write("<html xmlns=\"http://www.w3.org/1999/xhtml\">\n");
      out.write("<head>\n");
      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n");
      out.write("<title>Untitled Document</title>\n");
      out.write("</head>\n");
      out.write("\n");
      out.write("<body>\n");
      out.write("<?  if($_GET['act'] == 'a11') { ?>\n");
      out.write("\n");
      out.write("<div id='booking'>\n");
      out.write("  <p>This is booking info</p>\n");
      out.write("  <table width=\"959\" border=\"1\">\n");
      out.write("  <tr>\n");
      out.write("    <td width=\"75\">Booking ID</td>\n");
      out.write("    <td width=\"83\">Agent ID</td>\n");
      out.write("    <td width=\"93\">Resort ID</td>\n");
      out.write("    <td width=\"141\">Booking date</td>\n");
      out.write("    <td width=\"147\">Arrival date</td>\n");
      out.write("    <td width=\"167\">Departure date</td>\n");
      out.write("    <td width=\"101\">Room ID</td>\n");
      out.write("    <td width=\"100\">Activity ID</td>\n");
      out.write("  </tr>\n");
      out.write("  <tr>\n");
      out.write("    <td><?php echo $row_a11['Book_ID']; ?></td>\n");
      out.write("    <td><?php echo $row_a11['Agent_ID']; ?></td>\n");
      out.write("    <td><?php echo $row_a11['Resort_ID']; ?></td>\n");
      out.write("    <td><?php echo $row_a11['Bookingdate']; ?></td>\n");
      out.write("    <td><?php echo $row_a11['arrivaldate']; ?></td>\n");
      out.write("    <td><?php echo $row_a11['depdate']; ?></td>\n");
      out.write("    <td><?php echo $row_a11['Room_ID']; ?></td>\n");
      out.write("    <td><?php echo $row_a11['Activity_ID']; ?></td>\n");
      out.write("  </tr>\n");
      out.write("</table>\n");
      out.write("\n");
      out.write("  \n");
      out.write("  \n");
      out.write("  <p>&nbsp;</p>\n");
      out.write("</div>\n");
      out.write("\n");
      out.write("<? } ?>\n");
      out.write("\n");
      out.write("<? if($_GET['act'] == 'a15') { ?> \n");
      out.write("<div id='agentbooked'>\n");
      out.write("  <p>The agent who book the trip by group ID:</p>\n");
      out.write("  <p>Group ID: <?php echo $row_a15['Group_id']; ?> &nbsp;&nbsp;&nbsp;Agent_id <?php echo $row_a15['Agent_id']; ?>&nbsp;&nbsp;&nbsp;Firstname: <?php echo $row_a15['f_name']; ?>&nbsp; Lastname:&nbsp;&nbsp;<?php echo $row_a15['l_name']; ?></p>\n");
      out.write("  <p>&nbsp;</p>\n");
      out.write("</div>\n");
      out.write("<? } ?>\n");
      out.write("\n");
      out.write("<?  if($_GET['act'] == 'a21') { ?> \n");
      out.write("<div id='sunrate'>\n");
      out.write("  <p>The Sun Rating for the resort is</p>\n");
      out.write("  <p>Name of Resort: <?php echo $row_a16['name']; ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sun rate: <?php echo $row_a16['Number_of_sun']; ?></p>\n");
      out.write("  <p>&nbsp;</p>\n");
      out.write("</div>\n");
      out.write("<? } ?>\n");
      out.write("<?  if($_GET['act'] == 'a12') { ?>\n");
      out.write("<div id='sunrate'>\n");
      out.write("  <p>List of all resort and day that client stayed:</p>\n");
      out.write("  <table width=\"1005\" height=\"61\" border=\"1\">\n");
      out.write("    <tr>\n");
      out.write("      <td>Client ID</td>\n");
      out.write("      <td>Firstname</td>\n");
      out.write("      <td>Lastname</td>\n");
      out.write("      <td>resortID</td>\n");
      out.write("      <td>Resort Name</td>\n");
      out.write("      <td>Number of Date</td>\n");
      out.write("      \n");
      out.write("    </tr>\n");
      out.write("    \n");
      out.write("      <?php do { ?>\n");
      out.write("      <tr>\n");
      out.write("        <td><?php echo $row_a12['Client_ID']; ?></td>\n");
      out.write("        <td><?php echo $row_a12['f_name']; ?></td>\n");
      out.write("        <td><?php echo $row_a12['l_name']; ?></td>\n");
      out.write("        <td><?php echo $row_a12['Resort_ID']; ?></td>\n");
      out.write("        <td><?php echo $row_a12['Name']; ?></td>\n");
      out.write("        <td><?php echo $row_a12['total']; ?></td>\n");
      out.write("      </tr>\n");
      out.write("        <?php } while ($row_a12 = mysql_fetch_assoc($a12)); ?>\n");
      out.write("  </table>\n");
      out.write("  <p>&nbsp;</p>\n");
      out.write("</div>\n");
      out.write("<? } ?>\n");
      out.write("<?  if($_GET['act'] == 'a22') { ?>\n");
      out.write("<div id='amenity'>\n");
      out.write("    <p>Resorts have all amenities are</p>   \n");
      out.write("    <p>\n");
      out.write("      <?php do { ?>\n");
      out.write("      <?php foreach ($row_a22 as &$value) { ?>\n");
      out.write("    <? echo \"Resort: \" . $value . \"    \" ;\n");
      out.write("\t} ?>\n");
      out.write(" \n");
      out.write("    <?php } while ($row_a22 = mysql_fetch_assoc($a22)); ?>\n");
      out.write("    </p>\n");
      out.write("  <p>&nbsp;</p>\n");
      out.write("</div>\n");
      out.write("<? } ?>\n");
      out.write("\n");
      out.write("<?  if($_GET['act'] == 'a24') {  ?>\n");
      out.write("  <div id='resortbycity'>\n");
      out.write("    <p>List number of resort:</p>\n");
      out.write("    <p>country:<? echo $_POST['value'] . \"   \" ?> has <?php echo $row_a24['Count(Resort_id)']; ?>   resort</p>\n");
      out.write("    <p>&nbsp;</p>\n");
      out.write(" \n");
      out.write(" \n");
      out.write(" \n");
      out.write("</div>\n");
      out.write("<? } ?>\n");
      out.write("\n");
      out.write("<?  if($_GET['act'] == 'a25') {  ?>\n");
      out.write("  <div id='countrysun'>\n");
      out.write("    <p>The county has highest average sunrate is:</p>\n");
      out.write("    \n");
      out.write("    \n");
      out.write("    <table width=\"248\" border=\"1\">\n");
      out.write("      <tr>\n");
      out.write("        <td width=\"115\">Country</td>\n");
      out.write("        <td width=\"117\">Average</td>\n");
      out.write("      </tr>\n");
      out.write("      <?php do { ?>\n");
      out.write("      <tr>\n");
      out.write("        <td><?php echo $row_a25['country']; ?></td>\n");
      out.write("        <td><?php echo $row_a25['AVG( d.number_of_sun )']; ?></td>\n");
      out.write("      </tr>\n");
      out.write("        <?php } while ($row_a25 = mysql_fetch_assoc($a25)); ?>\n");
      out.write("    </table>\n");
      out.write("    <p>&nbsp;</p>\n");
      out.write("</div>\n");
      out.write("   <? } ?>\n");
      out.write("\n");
      out.write("<?  if($_GET['act'] == 'a14') { ?>\n");
      out.write("  <div id='activity'>\n");
      out.write("    <p>All of the activities in the given string:</p>\n");
      out.write("    \n");
      out.write("    <?php do { ?>\n");
      out.write("      <p> Activities: <?php echo $row_a14['Activity_name']; ?> </p>\n");
      out.write("      <?php } while ($row_a15 = mysql_fetch_assoc($a15)); ?><p>&nbsp;</p>\n");
      out.write("<? } ?>\n");
      out.write("\n");
      out.write("<?  if($_GET['act'] == 'a23') { ?>\n");
      out.write("  <div id='popresort'>\n");
      out.write("  \n");
      out.write("  <? if ($_POST['radio'] == 'radio1'){?>\n");
      out.write("    <p>The most popular resort of 1 sun rate is:</p>\n");
      out.write("     <?php do { ?>\n");
      out.write("      <?php foreach ($row_a20a as &$value) { ?>\n");
      out.write("    <? echo \"Resort: \" . $value . \"    \" ;\n");
      out.write("\t} ?>\n");
      out.write(" \n");
      out.write("    <?php } while ($row_a20a = mysql_fetch_assoc($a20a)); ?>  \n");
      out.write("    <? } ?>\n");
      out.write("    <p>&nbsp;</p>\n");
      out.write("    \n");
      out.write("     <? if ($_POST['radio'] == 'radio2'){  ?>\n");
      out.write("    <p>The most popular resort of 2 sun rate is:</p>\n");
      out.write("     <?php do { ?>\n");
      out.write("      <?php foreach ($row_a20b as &$value) { ?>\n");
      out.write("    <? echo \"ResortID: \" . $value . \"    \" ;\n");
      out.write("\t} ?>\n");
      out.write(" \n");
      out.write("    <?php } while ($row_a20b = mysql_fetch_assoc($a20b)); ?>  \n");
      out.write("    <? } ?>\n");
      out.write("    <p>&nbsp;</p>\n");
      out.write("    \n");
      out.write("     <? if ($_POST['radio'] == 'radio3'){?>\n");
      out.write("    <p>The most popular resort of 3 sun rate is:</p>\n");
      out.write("     <?php do { ?>\n");
      out.write("      <?php foreach ($row_a20c as &$value) { ?>\n");
      out.write("    <? echo \"ResortID: \" . $value . \"    \" ;\n");
      out.write("\t} ?>\n");
      out.write(" \n");
      out.write("    <?php } while ($row_a20c = mysql_fetch_assoc($a20c)); ?>  \n");
      out.write("    <? } ?>\n");
      out.write("    \n");
      out.write("    \n");
      out.write("     <? if(!isset($_POST['radio']) || $_POST['radio'] == 'radio4'){?>\n");
      out.write("    <p>The most popular resort is:</p>\n");
      out.write("     <?php do { ?>\n");
      out.write("      <?php foreach ($row_a20d as &$value) { ?>\n");
      out.write("    <? echo \"ResortID: \" . $value . \"    \" ;\n");
      out.write("\t} ?>\n");
      out.write(" \n");
      out.write("    <?php } while ($row_a20d = mysql_fetch_assoc($a20d)); ?>  \n");
      out.write("    <? } ?>\n");
      out.write("    <p>&nbsp;</p>\n");
      out.write("</div>\n");
      out.write("<? } ?>\n");
      out.write("\n");
      out.write("\n");
      out.write("<p>&nbsp;</p>\n");
      out.write("</body>\n");
      out.write("</html>\n");
      out.write("<?php\n");
      out.write("mysql_free_result($a15);\n");
      out.write("\n");
      out.write("mysql_free_result($a16);\n");
      out.write("\n");
      out.write("mysql_free_result($a22);\n");
      out.write("\n");
      out.write("mysql_free_result($a24);\n");
      out.write("\n");
      out.write("mysql_free_result($a12);\n");
      out.write("\n");
      out.write("mysql_free_result($a20a);\n");
      out.write("\n");
      out.write("mysql_free_result($a20b);\n");
      out.write("\n");
      out.write("mysql_free_result($a20c);\n");
      out.write("\n");
      out.write("mysql_free_result($a20d);\n");
      out.write("\n");
      out.write("mysql_free_result($a14);\n");
      out.write("\n");
      out.write("mysql_free_result($a11);\n");
      out.write("\n");
      out.write("mysql_free_result($a25);\n");
      out.write("?>\n");
      out.write("\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
        else throw new ServletException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }