<%@ 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, invalidWebsite = false, areaCodeOK = false; boolean noProvSelected = false, withError = false, cp1Inc = false, cp2Inc = false, cp3Inc = false, switchButton = false; boolean noContactPerson = false, incFax = false, cp1NotEmpty = true, cp2NotEmpty = true, cp3NotEmpty = true; String[] arrAreaCode = new String[5]; String strCpUser = "", strCheckBox = "", strAreaCode = ""; String strTblName = "", strFieldName = "", strPageTitle = "", strFormTitle = ""; 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"); byte bytButtonID = Byte.parseByte(request.getParameter("btnID")); String strRepeat = request.getParameter("repeat"); switch (bytButtonID) { case 1: strTblName = "tblForeignOfc"; strFieldName = "ForeignOfc"; strPageTitle = "Foreign Office"; strFormTitle = "FOREIGN OFFICE ADDRESS"; break; case 2: strTblName = "tblSalesOfc"; strFieldName = "SalesOfc"; strPageTitle = "Sales Office"; strFormTitle = "COMPANY SALES OFFICE ADDRESS"; break; case 3: strTblName = "tblShowRm"; strFieldName = "ShowRm"; strPageTitle = "Showroom"; strFormTitle = "COMPANY SHOWROOM ADDRESS"; break; case 4: strTblName = "tblWareHse"; strFieldName = "PlantAndWHse"; strPageTitle = "Plant/Warehouse"; strFormTitle = "COMPANY PLANT OR WAREHOUSE ADDRESS"; break; case 5: strTblName = "tblTechSvc"; strFieldName = "TechlSvc"; strPageTitle = "Technical Services Office"; strFormTitle = "TECHNICAL SERVICES OFFICE ADDRESS"; } /***** INTERMISSION *****/ %> <%= strPageTitle %> Information <% 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==1) { switchButton = true; } } if (strRepeat.equals("Cancel")) { switchButton = true; } %> <% if (switchButton) { %> <% } %> <% /***** END OF INTERMISSION *****/ %> <% String strOfcStreetAdd = ""; String strOfcBrgyAdd = ""; String strOfcCityAdd = ""; String strOfcProvAdd = ""; String strProvAdd = "000"; String strOfcZipCode = ""; String strOfcTelArea = ""; String strOfcTelNum = ""; String strOfcTelLocal = ""; String strOfcFaxArea = ""; String strOfcFaxNum = ""; String strOfcFaxLocal = ""; String strOfcEmail = ""; String strOfcWebsite = ""; String strCP1FName = ""; String strCP1LName = ""; String strCP1Position = ""; String strCP1TelArea = ""; String strCP1TelNum = ""; String strCP1TelLocal = ""; String strCP1EMail = ""; String strCP2FName = ""; String strCP2LName = ""; String strCP2Position = ""; String strCP2TelArea = ""; String strCP2TelNum = ""; String strCP2TelLocal = ""; String strCP2EMail = ""; String strCP3FName = ""; String strCP3LName = ""; String strCP3Position = ""; String strCP3TelArea = ""; String strCP3TelNum = ""; String strCP3TelLocal = ""; String strCP3EMail = ""; if (strFirstTimer.equals("true")) { } else { strOfcStreetAdd = request.getParameter("St"); strOfcBrgyAdd = request.getParameter("Brgy"); strOfcCityAdd = request.getParameter("City"); strOfcProvAdd = request.getParameter("Prov"); strProvAdd = strOfcProvAdd.substring(2); strOfcZipCode = request.getParameter("ZCode"); strOfcTelArea = request.getParameter("TArea"); strOfcTelNum = request.getParameter("TNum"); strOfcTelLocal = request.getParameter("TLoc"); strOfcFaxArea = request.getParameter("FArea"); strOfcFaxNum = request.getParameter("FNum"); strOfcFaxLocal = request.getParameter("FLoc"); strOfcEmail = request.getParameter("EMail"); strOfcWebsite = request.getParameter("WSite"); strCpUser = request.getParameter("cpUsr"); strCP1FName = request.getParameter("cp1FN"); strCP1LName = request.getParameter("cp1LN"); strCP1Position = request.getParameter("cp1Pos"); 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"); 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"); strCP3TelArea = request.getParameter("cp3TArea"); strCP3TelNum = request.getParameter("cp3TNum"); strCP3TelLocal = request.getParameter("cp3TLoc"); strCP3EMail = request.getParameter("cp3EMail"); } %> <% /***** MAIN *****/ if (strFirstTimer.equals("true")) { withError = true; } else { strOfcStreetAdd = firstLetterCap(strOfcStreetAdd); strOfcStreetAdd = replaceOrErase("De La ", strOfcStreetAdd, "de la "); strOfcStreetAdd = replaceOrErase("De ", strOfcStreetAdd, "de "); strOfcStreetAdd = replaceOrErase("Dela ", strOfcStreetAdd, "dela "); strOfcStreetAdd = replaceOrErase("Del ", strOfcStreetAdd, "del "); strOfcBrgyAdd = firstLetterCap(strOfcBrgyAdd); strOfcBrgyAdd = replaceOrErase("De La ", strOfcBrgyAdd, "de la "); strOfcBrgyAdd = replaceOrErase("De ", strOfcBrgyAdd, "de "); strOfcBrgyAdd = replaceOrErase("Dela ", strOfcBrgyAdd, "dela "); strOfcBrgyAdd = replaceOrErase("Del ", strOfcBrgyAdd, "del "); strOfcCityAdd = firstLetterCap(strOfcCityAdd); strOfcCityAdd = replaceOrErase("De La ", strOfcCityAdd, "de la "); strOfcCityAdd = replaceOrErase("De ", strOfcCityAdd, "de "); strOfcCityAdd = replaceOrErase("Dela ", strOfcCityAdd, "dela "); strOfcCityAdd = replaceOrErase("Del ", strOfcCityAdd, "del "); strOfcZipCode = strOfcZipCode.trim(); strOfcTelArea = strOfcTelArea.trim(); strOfcTelNum = strOfcTelNum.trim(); strOfcTelLocal = strOfcTelLocal.trim(); strOfcFaxArea = strOfcFaxArea.trim(); strOfcFaxNum = strOfcFaxNum.trim(); strOfcFaxLocal = strOfcFaxLocal.trim(); strOfcEmail = strOfcEmail.toLowerCase(); strOfcWebsite = strOfcWebsite.toLowerCase(); strOfcZipCode = eraseSubstr("-",strOfcZipCode); strOfcTelArea = dashAndZeroesAway(strOfcTelArea); strOfcTelNum = dashAndZeroesAway(strOfcTelNum); strOfcTelLocal = dashAndZeroesAway(strOfcTelLocal); strOfcFaxArea = dashAndZeroesAway(strOfcFaxArea); strOfcFaxNum = dashAndZeroesAway(strOfcFaxNum); strOfcFaxLocal = dashAndZeroesAway(strOfcFaxLocal); strOfcEmail = strOfcEmail.trim(); strOfcWebsite = strOfcWebsite.trim(); 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(); 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); 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); 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); strCP3TelArea = dashAndZeroesAway(strCP3TelArea); strCP3TelNum = dashAndZeroesAway(strCP3TelNum); strCP3TelLocal = dashAndZeroesAway(strCP3TelLocal); strCP3EMail = strCP3EMail.trim(); strCP3EMail = strCP3EMail.toLowerCase(); arrAreaCode[0] = strOfcTelArea; arrAreaCode[1] = strOfcFaxArea; arrAreaCode[2] = strCP1TelArea; arrAreaCode[3] = strCP2TelArea; arrAreaCode[4] = strCP3TelArea; 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 other appropriate information 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/FAX/ZIPCODE number. <% } %> <% if (incFax) { %> FAX should at least have an AREA CODE and it's NUMBER to be valid. <% } %> <% 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 (invalidWebsite) { %> Your website entry is not a valid site address. ( Samples of valid website: www.productguide.com and http://www.website.net.ph ) <% } %> <% if (areaCodeOK==false) { %> An area code entry (or entries) is not a valid Philippine telephone area code. <% } %> <% if (noContactPerson) { %> You have not indicated a contact person. <% } %> <% 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 (noProvSelected) { %> You have not SELECTED a province. <% } %> Also, please check if you left a mandatory field/fields (with ** on the label) BLANK or EMPTY.

<% } %>

<%= strFormTitle %>

Street**:
Barangay/District:
Municipality/City**:
Province**:
Zip Code**:

Contact Numbers

Telephone:
area code** phone number** local number
Facsimile:
area code fax number fax local
Company email address:
Company website:

Contact Numbers
(Please supply complete information to at least one contact person.)

> Check this box if you are one of the main contact persons for <%= strPageTitle %>.

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

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

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

<% } else { %> <% byte cpctr = 0; if (bytButtonID == 1) { bytButtonID = 10; } users.connect(strTempDB); if (cp1NotEmpty) { cpctr++; SQLstmt = "INSERT INTO tblContactPersons VALUES (" + intCompanyID + ", " + bytButtonID + ", '" + strCP1FName + "', '" + strCP1LName + "', '" + strCP1Position + "', '" + strCP1TelArea + "', '" + strCP1TelNum + "', '" + strCP1TelLocal + "', '" + strCP1EMail + "', " + cpctr + ");"; users.updateData(SQLstmt); } if (cp2NotEmpty) { cpctr++; SQLstmt = "INSERT INTO tblContactPersons VALUES (" + intCompanyID + ", " + bytButtonID + ", '" + strCP2FName + "', '" + strCP2LName + "', '" + strCP2Position + "', '" + strCP2TelArea + "', '" + strCP2TelNum + "', '" + strCP2TelLocal + "', '" + strCP2EMail + "', " + cpctr + ");"; users.updateData(SQLstmt); } if (cp3NotEmpty) { cpctr++; SQLstmt = "INSERT INTO tblContactPersons VALUES (" + intCompanyID + ", " + bytButtonID + ", '" + strCP3FName + "', '" + strCP3LName + "', '" + strCP3Position + "', '" + strCP3TelArea + "', '" + strCP3TelNum + "', '" + strCP3TelLocal + "', '" + strCP3EMail + "', " + cpctr + ");"; users.updateData(SQLstmt); } byte cpuser = 0; if (strCheckBox.equals("checked")) { cpuser = 1; } SQLstmt = "INSERT INTO tblCPIndicator VALUES (" + intCompanyID + ", " + bytButtonID + ", " + cpuser + ", " + cpctr + ");"; users.updateData(SQLstmt); SQLstmt = "UPDATE tblCoInfoIndicator SET " + strFieldName + " = 1 WHERE Co_ID = " + intCompanyID + ";"; users.updateData(SQLstmt); byte bytStatus = 1; users.addCoEtcInfo(strTblName, intCompanyID, strOfcStreetAdd, strOfcBrgyAdd, strOfcCityAdd, strProvAdd, strOfcZipCode, strOfcTelArea, strOfcTelNum, strOfcTelLocal, strOfcFaxArea, strOfcFaxNum, strOfcFaxLocal, strOfcEmail ,strOfcWebsite, bytStatus); 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.