<%@ page language="java" import="java.sql.*, java.io.*, java.util.*, users.databases.*" %> <%! /***** METHOD DECLARATION *****/ /*** function FOUND-INVALID-DIAL-UP-CHAR checks for null entry but accepts '-' char ***/ boolean foundInvalidDialUpChar (String strToSearch) { int strLength = strToSearch.length(); boolean found = false; for (int pos=0; pos 1) { String[] subStr = new String[count]; index = 0; int endIndex = 0; for (int i=0; i <% /***** VARIABLE DECLARATION and INITIALIZATION *****/ boolean invalidDialUpChar = false, invalidEMailAdd = false, areaCodeOK = false; boolean withError = false, noContactPerson = false, switchButton = false, exitButton = false; boolean cp1Inc = false, cp2Inc = false, cp3Inc = false, cp4Inc = false, cp5Inc = false; boolean cp1NotEmpty = true, cp2NotEmpty = true, cp3NotEmpty = true, cp4NotEmpty = true, cp5NotEmpty = true; String[] arrAreaCode = new String[5]; String strAreaCode = ""; String strFieldName = "OtherCP"; String strTempDB = "product_tmpClientInfoDB"; String strCodeDB = "product_areaCodesPhDB"; String strUserLogName = request.getParameter("usrLog"); int intCompanyID = Integer.parseInt(request.getParameter("CoID")); String strCompanyName = request.getParameter("CoName"); String strFirstTimer = request.getParameter("usr1st"); String strRepeat = request.getParameter("repeat"); String strPageFirst = request.getParameter("page1st"); /** xxx **/ /***** INTERMISSION *****/ String SQLstmt = "SELECT " + strFieldName + " FROM tblCoInfoIndicator WHERE Co_ID=" + intCompanyID + ";"; users.connect(strTempDB); ResultSet rs = users.listQuery(SQLstmt); while (rs.next()) { byte bytValue = rs.getByte(strFieldName); if (bytValue==2) { switchButton = true; } else if (bytValue==1) { exitButton = true; } } %> Other Contact Persons <% if ((switchButton) || (strPageFirst.equals("true") && exitButton)) { %> <% } %> <% /***** END OF INTERMISSION *****/ %> <% String strCP1FName = ""; String strCP1LName = ""; String strCP1Position = ""; String strCP1Dept = ""; String strCP1TelArea = ""; String strCP1TelNum = ""; String strCP1TelLocal = ""; String strCP1EMail = ""; String strCP2FName = ""; String strCP2LName = ""; String strCP2Position = ""; String strCP2Dept = ""; String strCP2TelArea = ""; String strCP2TelNum = ""; String strCP2TelLocal = ""; String strCP2EMail = ""; String strCP3FName = ""; String strCP3LName = ""; String strCP3Position = ""; String strCP3Dept = ""; String strCP3TelArea = ""; String strCP3TelNum = ""; String strCP3TelLocal = ""; String strCP3EMail = ""; String strCP4FName = ""; String strCP4LName = ""; String strCP4Position = ""; String strCP4Dept = ""; String strCP4TelArea = ""; String strCP4TelNum = ""; String strCP4TelLocal = ""; String strCP4EMail = ""; String strCP5FName = ""; String strCP5LName = ""; String strCP5Position = ""; String strCP5Dept = ""; String strCP5TelArea = ""; String strCP5TelNum = ""; String strCP5TelLocal = ""; String strCP5EMail = ""; if (strFirstTimer.equals("true")) { } else { strCP1FName = request.getParameter("cp1FN"); strCP1LName = request.getParameter("cp1LN"); strCP1Position = request.getParameter("cp1Pos"); strCP1Dept = request.getParameter("cp1Dept"); strCP1TelArea = request.getParameter("cp1TArea"); strCP1TelNum = request.getParameter("cp1TNum"); strCP1TelLocal = request.getParameter("cp1TLoc"); strCP1EMail = request.getParameter("cp1EMail"); strCP2FName = request.getParameter("cp2FN"); strCP2LName = request.getParameter("cp2LN"); strCP2Position = request.getParameter("cp2Pos"); strCP2Dept = request.getParameter("cp2Dept"); strCP2TelArea = request.getParameter("cp2TArea"); strCP2TelNum = request.getParameter("cp2TNum"); strCP2TelLocal = request.getParameter("cp2TLoc"); strCP2EMail = request.getParameter("cp2EMail"); strCP3FName = request.getParameter("cp3FN"); strCP3LName = request.getParameter("cp3LN"); strCP3Position = request.getParameter("cp3Pos"); strCP3Dept = request.getParameter("cp3Dept"); strCP3TelArea = request.getParameter("cp3TArea"); strCP3TelNum = request.getParameter("cp3TNum"); strCP3TelLocal = request.getParameter("cp3TLoc"); strCP3EMail = request.getParameter("cp3EMail"); strCP4FName = request.getParameter("cp4FN"); strCP4LName = request.getParameter("cp4LN"); strCP4Position = request.getParameter("cp4Pos"); strCP4Dept = request.getParameter("cp4Dept"); strCP4TelArea = request.getParameter("cp4TArea"); strCP4TelNum = request.getParameter("cp4TNum"); strCP4TelLocal = request.getParameter("cp4TLoc"); strCP4EMail = request.getParameter("cp4EMail"); strCP5FName = request.getParameter("cp5FN"); strCP5LName = request.getParameter("cp5LN"); strCP5Position = request.getParameter("cp5Pos"); strCP5Dept = request.getParameter("cp5Dept"); strCP5TelArea = request.getParameter("cp5TArea"); strCP5TelNum = request.getParameter("cp5TNum"); strCP5TelLocal = request.getParameter("cp5TLoc"); strCP5EMail = request.getParameter("cp5EMail"); } %> <% /***** MAIN *****/ if (strFirstTimer.equals("true")) { withError = true; } else { strCP1TelArea = strCP1TelArea.trim(); strCP1TelNum = strCP1TelNum.trim(); strCP1TelLocal = strCP1TelLocal.trim(); strCP2TelArea = strCP2TelArea.trim(); strCP2TelNum = strCP2TelNum.trim(); strCP2TelLocal = strCP2TelLocal.trim(); strCP3TelArea = strCP3TelArea.trim(); strCP3TelNum = strCP3TelNum.trim(); strCP3TelLocal = strCP3TelLocal.trim(); strCP4TelArea = strCP4TelArea.trim(); strCP4TelNum = strCP4TelNum.trim(); strCP4TelLocal = strCP4TelLocal.trim(); strCP5TelArea = strCP5TelArea.trim(); strCP5TelNum = strCP5TelNum.trim(); strCP5TelLocal = strCP5TelLocal.trim(); strCP1FName = firstLetterCap(strCP1FName); strCP1LName = firstLetterCap(strCP1LName); strCP1LName = replaceOrErase("De La ", strCP1LName, "de la "); strCP1LName = replaceOrErase("De ", strCP1LName, "de "); strCP1LName = replaceOrErase("Dela ", strCP1LName, "dela "); strCP1LName = replaceOrErase("Del ", strCP1LName, "del "); strCP1Position = firstLetterCap(strCP1Position); strCP1Dept = firstLetterCap(strCP1Dept); strCP1TelArea = dashAndZeroesAway(strCP1TelArea); strCP1TelNum = dashAndZeroesAway(strCP1TelNum); strCP1TelLocal = dashAndZeroesAway(strCP1TelLocal); strCP1EMail = strCP1EMail.trim(); strCP1EMail = strCP1EMail.toLowerCase(); strCP2FName = firstLetterCap(strCP2FName); strCP2LName = firstLetterCap(strCP2LName); strCP2LName = replaceOrErase("De La ", strCP2LName, "de la "); strCP2LName = replaceOrErase("De ", strCP2LName, "de "); strCP2LName = replaceOrErase("Dela ", strCP2LName, "dela "); strCP2LName = replaceOrErase("Del ", strCP2LName, "del "); strCP2Position = firstLetterCap(strCP2Position); strCP2Dept = firstLetterCap(strCP2Dept); strCP2TelArea = dashAndZeroesAway(strCP2TelArea); strCP2TelNum = dashAndZeroesAway(strCP2TelNum); strCP2TelLocal = dashAndZeroesAway(strCP2TelLocal); strCP2EMail = strCP2EMail.trim(); strCP2EMail = strCP2EMail.toLowerCase(); strCP3FName = firstLetterCap(strCP3FName); strCP3LName = firstLetterCap(strCP3LName); strCP3LName = replaceOrErase("De La ", strCP3LName, "de la "); strCP3LName = replaceOrErase("De ", strCP3LName, "de "); strCP3LName = replaceOrErase("Dela ", strCP3LName, "dela "); strCP3LName = replaceOrErase("Del ", strCP3LName, "del "); strCP3Position = firstLetterCap(strCP3Position); strCP3Dept = firstLetterCap(strCP3Dept); strCP3TelArea = dashAndZeroesAway(strCP3TelArea); strCP3TelNum = dashAndZeroesAway(strCP3TelNum); strCP3TelLocal = dashAndZeroesAway(strCP3TelLocal); strCP3EMail = strCP3EMail.trim(); strCP3EMail = strCP3EMail.toLowerCase(); strCP4FName = firstLetterCap(strCP4FName); strCP4LName = firstLetterCap(strCP4LName); strCP4LName = replaceOrErase("De La ", strCP4LName, "de la "); strCP4LName = replaceOrErase("De ", strCP4LName, "de "); strCP4LName = replaceOrErase("Dela ", strCP4LName, "dela "); strCP4LName = replaceOrErase("Del ", strCP4LName, "del "); strCP4Position = firstLetterCap(strCP4Position); strCP4Dept = firstLetterCap(strCP4Dept); strCP4TelArea = dashAndZeroesAway(strCP4TelArea); strCP4TelNum = dashAndZeroesAway(strCP4TelNum); strCP4TelLocal = dashAndZeroesAway(strCP4TelLocal); strCP4EMail = strCP4EMail.trim(); strCP4EMail = strCP4EMail.toLowerCase(); strCP5FName = firstLetterCap(strCP5FName); strCP5LName = firstLetterCap(strCP5LName); strCP5LName = replaceOrErase("De La ", strCP5LName, "de la "); strCP5LName = replaceOrErase("De ", strCP5LName, "de "); strCP5LName = replaceOrErase("Dela ", strCP5LName, "dela "); strCP5LName = replaceOrErase("Del ", strCP5LName, "del "); strCP5Position = firstLetterCap(strCP5Position); strCP5Dept = firstLetterCap(strCP5Dept); strCP5TelArea = dashAndZeroesAway(strCP5TelArea); strCP5TelNum = dashAndZeroesAway(strCP5TelNum); strCP5TelLocal = dashAndZeroesAway(strCP5TelLocal); strCP5EMail = strCP5EMail.trim(); strCP5EMail = strCP5EMail.toLowerCase(); arrAreaCode[0] = strCP1TelArea; arrAreaCode[1] = strCP2TelArea; arrAreaCode[2] = strCP3TelArea; arrAreaCode[3] = strCP4TelArea; arrAreaCode[4] = strCP5TelArea; SQLstmt = "SELECT Code FROM tblAreaCodesPh;"; users.connect(strCodeDB); rs = users.listQuery(SQLstmt); for (int i=0; i
         

 


 
<% if (withError) { %>

Log-in Name: <%= strUserLogName %>
Company: <%= strCompanyName %>

<% if (strFirstTimer.equals("true")) { %>

For additional contact persons of your company, please fill up the form below.

<% } else { %>

INVALID ENTRY/ENTRIES were found in your registration form.
<% if (invalidDialUpChar) { %> You had entered a non-numeric character on your PHONE number. <% } %> <% if (invalidEMailAdd) { %> You had entered an invalid or INCOMPLETE e-mail address entry. ( Valid samples of e-mail address: juan@skyinet.net and john_smith@hotmail.com ) <% } %> <% if (areaCodeOK==false) { %> An area code entry (or entries) is not a valid Philippine telephone area code. <% } %> <% if (cp1Inc) { %> Your entries on Contact Person 1 is incomplete. ( You have left a field/fields with an asterisk (*) in Contact Person 1 empty ) <% } %> <% if (cp2Inc) { %> Your entries on Contact Person 2 is incomplete. ( You have left a field/fields with an asterisk (*) in Contact Person 2 empty ) <% } %> <% if (cp3Inc) { %> Your entries on Contact Person 3 is incomplete. ( You have left a field/fields with an asterisk (*) in Contact Person 3 empty ) <% } %> <% if (cp4Inc) { %> Your entries on Contact Person 4 is incomplete. ( You have left a field/fields with an asterisk (*) in Contact Person 4 empty ) <% } %> <% if (cp5Inc) { %> Your entries on Contact Person 5 is incomplete. ( You have left a field/fields with an asterisk (*) in Contact Person 5 empty ) <% } %> Please check.

<% } %>

Contact Persons

Contact Person 1:
First name*:
Last name*:
Position*:
Department*:
Telephone:
area code* phone number* local number
e-mail address:

Contact Person 2:
First name*:
Last name*:
Position*:
Department*:
Telephone:
area code* phone number* local number
e-mail address:

Contact Person 3:
First name*:
Last name*:
Position*:
Department*:
Telephone:
area code* phone number* local number
e-mail address:

Contact Person 4:
First name*:
Last name*:
Position*:
Department*:
Telephone:
area code* phone number* local number
e-mail address:

Contact Person 5:
First name*:
Last name*:
Position*:
Department*:
Telephone:
area code* phone number* local number
e-mail address:

<% if (exitButton) { %> <% } else { %> <% } %>

<% } else { %> <% if (strRepeat.equals("Cancel")) { } else { int ctr = 0; int intID = 0; SQLstmt = "SELECT MAX(CPx_ID) AS CPx_ID FROM tblOtherCPs WHERE Co_ID=" + intCompanyID + ";"; users.connect(strTempDB); rs = users.listQuery(SQLstmt); while (rs.next()) { intID = rs.getInt("CPx_ID"); } intID++; if (cp1NotEmpty) { SQLstmt = "INSERT INTO tblOtherCPs VALUES (" + intCompanyID + ", " + intID + ", '" + strCP1Dept + "', '" + strCP1FName + "', '" + strCP1LName + "', '" + strCP1Position + "', '" + strCP1TelArea + "', '" + strCP1TelNum + "', '" + strCP1TelLocal + "', '" + strCP1EMail + "');"; users.updateData(SQLstmt); ctr++; intID++; } if (cp2NotEmpty) { SQLstmt = "INSERT INTO tblOtherCPs VALUES (" + intCompanyID + ", " + intID + ", '" + strCP2Dept + "', '" + strCP2FName + "', '" + strCP2LName + "', '" + strCP2Position + "', '" + strCP2TelArea + "', '" + strCP2TelNum + "', '" + strCP2TelLocal + "', '" + strCP2EMail + "');"; users.updateData(SQLstmt); ctr++; intID++; } if (cp3NotEmpty) { SQLstmt = "INSERT INTO tblOtherCPs VALUES (" + intCompanyID + ", " + intID + ", '" + strCP3Dept + "', '" + strCP3FName + "', '" + strCP3LName + "', '" + strCP3Position + "', '" + strCP3TelArea + "', '" + strCP3TelNum + "', '" + strCP3TelLocal + "', '" + strCP3EMail + "');"; users.updateData(SQLstmt); ctr++; intID++; } if (cp4NotEmpty) { SQLstmt = "INSERT INTO tblOtherCPs VALUES (" + intCompanyID + ", " + intID + ", '" + strCP4Dept + "', '" + strCP4FName + "', '" + strCP4LName + "', '" + strCP4Position + "', '" + strCP4TelArea + "', '" + strCP4TelNum + "', '" + strCP4TelLocal + "', '" + strCP4EMail + "');"; users.updateData(SQLstmt); ctr++; intID++; } if (cp5NotEmpty) { SQLstmt = "INSERT INTO tblOtherCPs VALUES (" + intCompanyID + ", " + intID + ", '" + strCP5Dept + "', '" + strCP5FName + "', '" + strCP5LName + "', '" + strCP5Position + "', '" + strCP5TelArea + "', '" + strCP5TelNum + "', '" + strCP5TelLocal + "', '" + strCP5EMail + "');"; users.updateData(SQLstmt); ctr++; } if (ctr != 0 ) { SQLstmt = "UPDATE tblCoInfoIndicator SET " + strFieldName + " = 1 WHERE Co_ID = " + intCompanyID + ";"; users.updateData(SQLstmt); } } if (strRepeat.equals("Yes")) { users.disconnect(); %> <% } else { if (strRepeat.equals("No")) { SQLstmt = "UPDATE tblCoInfoIndicator SET " + strFieldName + " = 2 WHERE Co_ID = " + intCompanyID + ";"; users.updateData(SQLstmt); } users.disconnect(); %> <% } %> <% } %>
 

Copyright © 2001-2003 by Grafikoncepts and Designs, Inc.
A joint project of Grafikoncepts and Designs, Inc. and Digital Management and Solutions, Inc.
Layout by MVMG (VPIT), Digital Management and Solutions, Inc.