%!
String getRequestValue(HttpServletRequest r, String name) {
String ret = (String)r.getParameter(name);
if (ret == null) ret = "";
return ret;
}
String getSessionValue(HttpSession s, String name) {
String ret = (String)s.getAttribute(name);
if (ret == null) ret = "";
return ret;
}
boolean isIn(String a[], String t) {
if (a == null) return false;
for (int i = 0; i < a.length; i++) {
if (a[i].equals(t)) return true;
}
return false;
}
%>
<%
boolean displayForm = true;
String Contact_FullName = getSessionValue(session, "Contact_FullName");
String Contact_StreetAddress = getSessionValue(session, "Contact_StreetAddress");
String Contact_City = getSessionValue(session, "Contact_City");
String Contact_State = getSessionValue(session, "Contact_State");
String Contact_ZipCode = getSessionValue(session, "Contact_ZipCode");
String Contact_WorkPhone = getSessionValue(session, "Contact_WorkPhone");
String Contact_HomePhone = getSessionValue(session, "Contact_HomePhone");
String Contact_Email = getSessionValue(session, "Contact_Email");
String Ordering_StreetAddress = getSessionValue(session, "Ordering_StreetAddress");
String Ordering_City = getSessionValue(session, "Ordering_City");
String Ordering_State = getSessionValue(session, "Ordering_State");
String Ordering_ZipCode = getSessionValue(session, "Ordering_ZipCode");
String InspectionDate1 = getSessionValue(session, "InspectionDate1");
Boolean slot11 = (Boolean)session.getAttribute("slot11");
if (slot11 == null) slot11 = new Boolean(false);
Boolean slot12 = (Boolean)session.getAttribute("slot12");
if (slot12 == null) slot12 = new Boolean(false);
Boolean slot13 = (Boolean)session.getAttribute("slot1-3");
if (slot13 == null) slot13 = new Boolean(false);
String OtherInspectionTime1 = getSessionValue(session, "OtherInspectionTime1");
String InspectionDate2 = getSessionValue(session, "InspectionDate2");
Boolean slot21 = (Boolean)session.getAttribute("slot21");
if (slot21 == null) slot21 = new Boolean(false);
Boolean slot22 = (Boolean)session.getAttribute("slot22");
if (slot22 == null) slot22 = new Boolean(false);
Boolean slot23 = (Boolean)session.getAttribute("slot23");
if (slot23 == null) slot23 = new Boolean(false);
String OtherInspectionTime2 = getSessionValue(session, "OtherInspectionTime2");
String InspectionDate3 = getSessionValue(session, "InspectionDate3");
Boolean slot31 = (Boolean)session.getAttribute("slot31");
if (slot31 == null) slot31 = new Boolean(false);
Boolean slot32 = (Boolean)session.getAttribute("slot32");
if (slot32 == null) slot32 = new Boolean(false);
Boolean slot33 = (Boolean)session.getAttribute("slot33");
if (slot33 == null) slot33 = new Boolean(false);
String OtherInspectionTime3 = getSessionValue(session, "OtherInspectionTime3");
String Feet = getSessionValue(session, "Feet");
Boolean inspectionType1 = (Boolean)session.getAttribute("inspectionType1");
if ( inspectionType1 == null) inspectionType1 = new Boolean(false);
Boolean inspectionType2 = (Boolean)session.getAttribute("inspectionType2");
if ( inspectionType2 == null) inspectionType2 = new Boolean(false);
Boolean inspectionType3 = (Boolean)session.getAttribute("inspectionType3");
if ( inspectionType3 == null) inspectionType3 = new Boolean(false);
Boolean inspectionType4 = (Boolean)session.getAttribute("inspectionType4");
if ( inspectionType4 == null) inspectionType4 = new Boolean(false);
Boolean inspectionType5 = (Boolean)session.getAttribute("inspectionType5");
if ( inspectionType5 == null) inspectionType5 = new Boolean(false);
Boolean inspectionType6 = (Boolean)session.getAttribute("inspectionType6");
if ( inspectionType6 == null) inspectionType6 = new Boolean(false);
Boolean exInspectionType1 = (Boolean)session.getAttribute("exInspectionType1");
if ( exInspectionType1 == null) exInspectionType1 = new Boolean(false);
Boolean exInspectionType2 = (Boolean)session.getAttribute("exInspectionType2");
if ( exInspectionType2 == null) exInspectionType2 = new Boolean(false);
Boolean exInspectionType3 = (Boolean)session.getAttribute("exInspectionType3");
if ( exInspectionType3 == null) exInspectionType3 = new Boolean(false);
Boolean exInspectionType4 = (Boolean)session.getAttribute("exInspectionType4");
if ( exInspectionType4 == null) exInspectionType4 = new Boolean(false);
String OtherInspectionType = getSessionValue(session, "OtherInspectionType");
String AgentName = getSessionValue(session, "AgentName");
String AgentCompany = getSessionValue(session, "AgentCompany");
String AgentPhone = getSessionValue(session, "AgentPhone");
String MLS = getSessionValue(session, "MLS");
String AgentEMail = getSessionValue(session, "AgentEMail");
String error = "";
if (request.getMethod().equalsIgnoreCase("post")) {
//process submit button
Contact_FullName = getRequestValue(request, "Contact_FullName");
session.setAttribute("Contact_FullName",Contact_FullName);
if (Contact_FullName.length() == 0) {
error += "Please fill in the Contact Name
";
}
Contact_StreetAddress = getRequestValue(request, "Contact_StreetAddress");
session.setAttribute("Contact_StreetAddress", Contact_StreetAddress);
if ( Contact_StreetAddress.length() == 0) {
error += "Please fill in the Contact Street Address
";
}
Contact_City = getRequestValue(request, "Contact_City");
session.setAttribute("Contact_City", Contact_City);
if ( Contact_City.length() == 0) {
error += "Please fill in the Contact City
";
}
Contact_State = getRequestValue(request, "Contact_State");
session.setAttribute("Contact_State", Contact_State);
if ( Contact_State.length() == 0) {
error += "Please fill in the Contact State
";
}
Contact_ZipCode = getRequestValue(request, "Contact_ZipCode");
session.setAttribute("Contact_ZipCode", Contact_ZipCode);
if ( Contact_ZipCode.length() == 0) {
error += "Please fill in the Contact ZipCode
";
}
Contact_WorkPhone = getRequestValue(request, "Contact_WorkPhone");
session.setAttribute("Contact_WorkPhone", Contact_WorkPhone);
if ( Contact_WorkPhone.length() == 0) {
error += "Please fill in the Contact Work Phone
";
}
Contact_HomePhone = getRequestValue(request, "Contact_HomePhone");
session.setAttribute("Contact_HomePhone", Contact_HomePhone);
if ( Contact_HomePhone.length() == 0) {
error += "Please fill in the Contact Home Phone
";
}
Contact_Email = getRequestValue(request, "Contact_Email");
session.setAttribute("Contact_Email", Contact_Email);
if ( Contact_Email.length() == 0) {
error += "Please fill in the Contact Email
";
}
Ordering_StreetAddress = getRequestValue(request, "Ordering_StreetAddress");
session.setAttribute("Ordering_StreetAddress", Ordering_StreetAddress);
if ( Ordering_StreetAddress.length() == 0) {
error += "Please fill in the Inspection Street Address
";
}
Ordering_City = getRequestValue(request, "Ordering_City");
session.setAttribute("Ordering_City", Ordering_City);
if ( Ordering_City.length() == 0) {
error += "Please fill in the Inspection Address City
";
}
Ordering_State = getRequestValue(request, "Ordering_State");
session.setAttribute("Ordering_State", Ordering_State);
if ( Ordering_State.length() == 0) {
error += "Please fill in the Inspection Address State
";
}
Ordering_ZipCode = getRequestValue(request, "Ordering_ZipCode");
session.setAttribute("Ordering_ZipCode", Ordering_ZipCode);
InspectionDate1 = getRequestValue(request, "InspectionDate1");
session.setAttribute("InspectionDate1", InspectionDate1);
if ( InspectionDate1.length() == 0) {
error += "Please fill in the Inspection Date
";
}
slot11 = request.getParameter("slot11") == null ? new Boolean(false) : new Boolean(true);
session.setAttribute("slot11",slot11);
slot12 = request.getParameter("slot12") == null ? new Boolean(false) : new Boolean(true);
session.setAttribute("slot12",slot12);
slot13 = request.getParameter("slot13") == null ? new Boolean(false) : new Boolean(true);
session.setAttribute("slot13",slot13);
OtherInspectionTime1 = getRequestValue(request, "OtherInspectionTime1");
session.setAttribute("OtherInspectionTime1", OtherInspectionTime1);
if ( slot11.booleanValue() == false && slot12.booleanValue() == false &&
slot13.booleanValue() == false && OtherInspectionTime1.length() == 0) {
error += "Please Select Inspection Time
";
}
InspectionDate2 = getRequestValue(request, "InspectionDate2");
session.setAttribute("InspectionDate2", InspectionDate2);
//if ( InspectionDate2.length() == 0) {
// error += "Please fill in the Inspection Date
";
//}
slot21 = request.getParameter("slot21") == null ? new Boolean(false) : new Boolean(true);
session.setAttribute("slot21",slot21);
slot22 = request.getParameter("slot22") == null ? new Boolean(false) : new Boolean(true);
session.setAttribute("slot22",slot22);
slot23 = request.getParameter("slot23") == null ? new Boolean(false) : new Boolean(true);
session.setAttribute("slot23",slot23);
OtherInspectionTime2 = getRequestValue(request, "OtherInspectionTime2");
session.setAttribute("OtherInspectionTime2", OtherInspectionTime2);
InspectionDate3 = getRequestValue(request, "InspectionDate3");
session.setAttribute("InspectionDate3", InspectionDate3);
//if ( InspectionDate3.length() == 0) {
// error += "Please fill in the Inspection Date
";
//}
slot31 = request.getParameter("slot31") == null ? new Boolean(false) : new Boolean(true);
session.setAttribute("slot31",slot31);
slot32 = request.getParameter("slot32") == null ? new Boolean(false) : new Boolean(true);
session.setAttribute("slot32",slot32);
slot33 = request.getParameter("slot33") == null ? new Boolean(false) : new Boolean(true);
session.setAttribute("slot33",slot33);
OtherInspectionTime3 = getRequestValue(request, "OtherInspectionTime3");
session.setAttribute("OtherInspectionTime3", OtherInspectionTime3);
Feet = getRequestValue(request, "Feet");
session.setAttribute("Feet", Feet);
if ( Feet.length() == 0) {
error += "Please fill in the Home Sq. Feet
";
}
inspectionType1 = request.getParameter("inspectionType1") == null ? new Boolean(false) : new Boolean(true);
session.setAttribute("inspectionType1", inspectionType1);
inspectionType2 = request.getParameter("inspectionType2") == null ? new Boolean(false) : new Boolean(true);
session.setAttribute("inspectionType2", inspectionType2);
inspectionType3 = request.getParameter("inspectionType3") == null ? new Boolean(false) : new Boolean(true);
session.setAttribute("inspectionType3", inspectionType3);
inspectionType4 = request.getParameter("inspectionType4") == null ? new Boolean(false) : new Boolean(true);
session.setAttribute("inspectionType4", inspectionType4);
inspectionType5 = request.getParameter("inspectionType5") == null ? new Boolean(false) : new Boolean(true);
session.setAttribute("inspectionType5", inspectionType5);
inspectionType6 = request.getParameter("inspectionType6") == null ? new Boolean(false) : new Boolean(true);
session.setAttribute("inspectionType6", inspectionType6);
exInspectionType1 = request.getParameter("exInspectionType1") == null ? new Boolean(false) : new Boolean(true);
session.setAttribute("exInspectionType1", exInspectionType1);
exInspectionType2 = request.getParameter("exInspectionType2") == null ? new Boolean(false) : new Boolean(true);
session.setAttribute("exInspectionType2", exInspectionType2);
exInspectionType3 = request.getParameter("exInspectionType3") == null ? new Boolean(false) : new Boolean(true);
session.setAttribute("exInspectionType3", exInspectionType3);
exInspectionType4 = request.getParameter("exInspectionType4") == null ? new Boolean(false) : new Boolean(true);
session.setAttribute("exInspectionType4", exInspectionType4);
OtherInspectionType = getRequestValue(request, "OtherInspectionType");
session.setAttribute("OtherInspectionType", OtherInspectionType);
if (inspectionType1.booleanValue() == false &&
inspectionType2.booleanValue() == false &&
inspectionType3.booleanValue() == false &&
inspectionType4.booleanValue() == false &&
inspectionType5.booleanValue() == false &&
OtherInspectionType.length() == 0) {
error += "Please enter the type of inspection
";
}
AgentName = getRequestValue(request, "AgentName");
session.setAttribute("AgentName", AgentName);
if ( AgentName.length() == 0) {
error += "Please fill in the Agent Name
";
}
AgentCompany = getRequestValue(request, "AgentCompany");
session.setAttribute("AgentCompany", AgentCompany);
if ( AgentCompany.length() == 0) {
error += "Please fill in the Agent Company
";
}
AgentPhone = getRequestValue(request, "AgentPhone");
session.setAttribute("AgentPhone", AgentPhone);
if ( AgentPhone.length() == 0) {
error += "Please fill in the Agent Phone
";
}
MLS = getRequestValue(request, "MLS");
session.setAttribute("MLS", MLS);
AgentEMail = getRequestValue(request, "AgentEMail");
session.setAttribute("AgentEMail", AgentEMail);
if (error.length() == 0) {
//success
displayForm = false;
}
}
%>
![]() |
|
<% if (displayForm) { %>
Click Here To Go Back To The Home Page <% String body = ""; body += "Contact Info:\r\n"; body += Contact_FullName; body += " \r\n"; body += Contact_StreetAddress; body += " \r\n"; body += Contact_City; body += ", "; body += Contact_State; body += " "; body += Contact_ZipCode; body += " \r\n"; body += "Work Phone : "; body += Contact_WorkPhone; body += " \r\n"; body += "Home Phone: " + Contact_HomePhone; body += " \r\n"; body += Contact_Email; body += " \r\n"; body += " \r\n"; body += "Inspection Address: \r\n"; body += Ordering_StreetAddress; body += " \r\n"; body += Ordering_City; body += ", "; body += Ordering_State; body += " "; body += Ordering_ZipCode; body += " \r\n"; body += " \r\n"; body += "Preferred Inspection Time: "; body += InspectionDate1; if (slot11.booleanValue()) body += " 10:00am "; if (slot12.booleanValue()) body += " 1pm"; if (slot13.booleanValue()) body += " 3pm"; body += " \r\n"; body += "Other: " + OtherInspectionTime1; body += " \r\n"; body += "1st Alternate Inspection Time: "; body += InspectionDate2; if (slot21.booleanValue()) body += " 10:00am "; if (slot22.booleanValue()) body += " 1pm"; if (slot23.booleanValue()) body += " 3pm"; body += " \r\n"; body += "Other: " + OtherInspectionTime2; body += " \r\n"; body += "2nd Alternate Inspection Time: "; body += InspectionDate3; if (slot31.booleanValue()) body += " 10:00am "; if (slot32.booleanValue()) body += " 1pm"; if (slot33.booleanValue()) body += " 3pm"; body += " \r\n"; body += "Other: " + OtherInspectionTime3; body += " \r\n"; body += "Sq Feet: "; body += Feet; body += " \r\n"; body += " \r\n"; body += "Inspection Type: "; body += " \r\n"; if (inspectionType1.booleanValue()) { body += "home inspection"; body += " \r\n"; } if (inspectionType2.booleanValue()) { body += "commercial inspection"; body += " \r\n"; } if (inspectionType3.booleanValue()) { body += "townhome/condo"; body += " \r\n"; } if (inspectionType4.booleanValue()) { body += "multi family"; body += " \r\n"; } if (inspectionType5.booleanValue()) { body += "new contruction"; body += " \r\n"; } if (inspectionType6.booleanValue()) { body += "i dont know"; body += " \r\n"; } body += " Extra Services: "; body += " \r\n"; if (exInspectionType1.booleanValue()) { body += "mold inspection and testing"; body += " \r\n"; } if (exInspectionType2.booleanValue()) { body += "water sampling"; body += " \r\n"; } if (exInspectionType3.booleanValue()) { body += "foundation level check"; body += " \r\n"; } if (exInspectionType4.booleanValue()) { body += "wet check"; body += " \r\n"; } body += " \r\n"; body += " \r\n"; body += "Agent Info"; body += " \r\n"; body += AgentName; body += " \r\n"; body += AgentCompany; body += " \r\n"; body += AgentPhone; body += " \r\n"; body += AgentEMail; body += " \r\n"; body += "MLS: " + MLS; body += " \r\n"; body += " \r\n"; com.homegauge.util.SendEmail.sendHtmlEmail("inspector@proteaminspect.com", "support@homegauge.com", "Online Inspection Appointment " + Contact_FullName, body, ""); session.invalidate(); } %> |
ProTeam Inspections, Inc
Email: inspector@proteaminspect.com
Phone: 904-278-6694
Toll Free: 800-780-6694
Fax: 904-215-4936