anchor.diff:  <BODY>
   	<%@ page import="java.sql.*, db.Database"%>
   	<%
  -		String kWord = request.getParameter("searchKeyword");
  -		String kTime1 = request.getParameter("searchTime1");
  -		String kTime2 = request.getParameter("searchTime2");
  -
   		String checkClass = (String) session.getAttribute("class");
   		String userID = (String) session.getAttribute("person_id");
   		out.println("<H1>Search</H1>");
   
   		String sql = "select r.*, p.first_name, p.last_name ";
  -
  -		// Test sql for images:
  -		// String sql = "select r.*, p.first_name, p.last_name, pi.image_id from radiology_record r FULL JOIN persons p ON r.patient_id = p.person_id FULL JOIN pacs_images pi ON pi.record_id = r.record_id where ";
   
   		String class_id = "";
   		if (checkClass.equals("a")) {
  
positive.code: 			sql = sql + class_id + "r.test_date between to_date('" + kTime1
  					+ "', 'DD/MM/YYYY') AND to_date('" + kTime2
  					+ "', 'DD/MM/YYYY') ORDER BY " + SQLOrder;
  			/*
  			if (checkClass.equals("a")) {
  			sql = sql
  			//"select r.*, p.first_name, p.last_name from radiology_record r FULL JOIN persons p ON r.patient_id = p.person_id where test_date between to_date('"
  			+ kTime1 + "', 'DD/MM/YYYY') AND to_date('"
  			+ kTime2 + "', 'DD/MM/YYYY') ORDER BY '" + SQLOrder
  			+ "'";
  			}
  
  			else if (checkClass.equals("p")) {
  			sql = sql
  			//"select r.*, p.first_name, p.last_name from radiology_record r FULL JOIN persons p ON r.patient_id = p.person_id where '"
  			+ "r.patient_id = '" + userID
  			+ "' AND test_date between to_date('" + kTime1
  			+ "', 'DD/MM/YYYY') AND to_date('" + kTime2
  			+ "', 'DD/MM/YYYY') ORDER BY '" + SQLOrder + "'";
  			}
  
  			else if (checkClass.equals("d")) {
  			sql = sql
  			//"select r.*, p.first_name, p.last_name from radiology_record r FULL JOIN persons p ON r.patient_id = p.person_id where '"
  			+ "r.doctor_id = '" + userID
  			+ "'  AND test_date between to_date('" + kTime1
  			+ "', 'DD/MM/YYYY') AND to_date('" + kTime2
  			+ "', 'DD/MM/YYYY') ORDER BY '" + SQLOrder + "'";
  			}
  
  			else if (checkClass.equals("r")) {
  			sql = sql
  			//"select r.*, p.first_name, p.last_name from radiology_record r FULL JOIN persons p ON r.patient_id = p.person_id where '"
  			+ "r.radiologist_id = '" + userID
  			+ "' AND test_date between to_date('" + kTime1
  			+ "', 'DD/MM/YYYY') AND to_date('" + kTime2
  			+ "', 'DD/MM/YYYY') ORDER BY '" + SQLOrder + "'";
  			}
  			 */
  		}
  
  		//no time period entered
  
negative.code: 				countNum = countNum + 4;
  			}
  			sql = sql + "ORDER BY " + SQLOrder;
  		}
  
  		//neither entered 
  