anchor.diff:  		    out.println("</select> <input TYPE='submit' NAME='CommitSearch' VALUE='Search'><br>");
               out.println(" <BR></BR>");
               out.println("<b><font color=Gold>Here is the list of all sensor records for satisfied the search condition.</font></b>");
  -
  +>>>>>>> f553d6a5fa074fe7571283318b7c32a20544b99e
  +
  +            String sqlString = "";
  +	    	String fdate = request.getParameter("from");
  +	    	String tdate = request.getParameter("to");
  +			String searchKey = request.getParameter("search_key");
  +            String searchLocation = request.getParameter("search_location");
  +            String searchSType= request.getParameter("search_sensor_type");
           
               if (request.getParameter("CommitSearch") != null) {
  +<<<<<<< HEAD
  +            	
  +            	if(request.getParameter("from").equals("") &&
  +            	   request.getParameter("to").equals("")) {
  +            		out.println("<br><b>Must select a time period to search.</b>");
  +                }
  +            	
  +            	out.println("haha");
  +            	
  +            	
  +            	
  +            	sqlString = "SELECT distinct ar.recording_id,ar.date_created, ar.length, ar.recorded_data, ar.description"
  +				    		+"i.image_id, i.date_created, i.recoreded_data,i.thumbnail, i.description "
  +                          +"sd.id, sd.date_created, sd.value"
  +				    		+"FROM audio_recordings ar, images i, scalar_data sd WHERE "; 
  +            	
  +				
  +				    		
  +            	if(((String)session.getAttribute("role")).equals("s")){
  +            		sqlString = sqlString +"ar.sensor_id ="+sensorId+", AND i.sensor_id = "+sensorId+", AND sd.sensor_id = "+sensorId ;
  +            		out.println("hehe");
  +			    }
  +				    	
  +
  +            	if(fdate != null){
  +				    sqlString = sqlString + "ar.date_created >= to_date('"+fdate+"','MM/DD/YYYY')"
  +				                          +" AND i.date_created  >= to_date('"+fdate+"','MM/DD/YYYY')"
  +                                        +" AND sd.date_created >= to_date('"+fdate+"','MM/DD/YYYY')";
  +				    out.println("heihei");
  +            	}
  +
  +            	if(tdate != null){
  +
  +            		sqlString = sqlString + "ar.date_created <= to_date('"+tdate+"','MM/DD/YYYY') "
  +                                        + " AND i.date_created  >= to_date('"+tdate+"','MM/DD/YYYY') "
  +                                        +" AND sd.date_created >= to_date('"+tdate+"','MM/DD/YYYY') ";
  +            		out.println("lala");
  +            	} 
  +			
  +=======
               	if(!(request.getParameter("search_key").equals("")&&
                   	request.getParameter("search_location").equals("")&&
                       request.getParameter("search_sensor_type").equals("")&&
  
positive.code: 			out.println("<FORM NAME='ConnectFailForm' ACTION='Connector.html' METHOD='get'>");
  			out.println("    <CENTER><INPUT TYPE='submit' NAME='CONNECTION_FAIL' VALUE='Return'></CENTER>");
  			out.println("</FORM>");
      	         }
                   if (canConnect){
                          Statement s =  null;
                          ResultSet rs = null; 
  			String personID = (String)session.getAttribute("person_id");
                          String sqlstr = "SELECT sensor_id FROM subscription WHERE person_id = '"+personID+"'";
                          try {
                                  s = con.createStatement();
                                  rs = s.executeQuery(sqlstr);
                          }
                          catch(Exception e){
                                  out.println("<hr>"+e.getMessage()+"<hr>");
                          }
  
  	                Integer sensorId = null;
  	            	while(rs != null && rs.next()){
  	                        sensorId = (rs.getInt("sensor_id"));
  	            	}
                          
   
              out.println("<BR></BR>");
  
negative.code: 		    out.println("<TABLE>");
  			out.println("<TR>");
  			out.println("<TD><B><I><font color=HotPink>Search keys:&nbsp;&nbsp;&nbsp;</TD>");
  <<<<<<< HEAD
  			out.println("<TD><INPUT TYPE='text' NAME='search_key' VALUE=''>");
  			out.println("</TR>");
  			out.println("<TR>");
              out.println("<TD><B><I><font color=HotPink>Location:&nbsp;</TD>");
              out.println("<TD><INPUT TYPE='text' NAME='search_location' VALUE=''></TD>");
  =======
  			out.println("<TD><INPUT TYPE='text' NAME='search_key' VALUE=''></TD>");
  			out.println("</TR>");
  			out.println("<TR>");
              out.println(" <TD><B><I><font color=HotPink>Location:&nbsp;</TD>");
              out.println(" <TD><INPUT TYPE='text' NAME='search_location' VALUE=''></TD>");
  >>>>>>> f553d6a5fa074fe7571283318b7c32a20544b99e
  			out.println("</TR>");
  			out.println("<TR>");
              out.println(" <TD><B><I><font color=HotPink>Sensor type:&nbsp;</TD>");
  