<%@ page language="java" import="java.sql.*, java.io.*, java.util.*, users.databases.*" %> Company Head Office Information <%! /***** 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; boolean noContactPerson = false, incFax = false, cp1NotEmpty = true, cp2NotEmpty = true, cp3NotEmpty = true; byte bytApplicLvlStatus = 0, bytCoHOStatus = 0; int intUserID = 0, intCompanyID = 0, intCoHOID = 0, intStatus = 0; String[] arrAreaCode = new String[5]; String strCpUser = "", strCheckBox = "", strAreaCode = ""; String strTempDB = "product_tmpClientInfoDB"; String strMainDB = "product_pgpClientInfoDB"; String strWhatDB = request.getParameter("whatDB"); String strUserLogName = request.getParameter("userLogName"); String strCompanyName = request.getParameter("userCoName"); String strCoRefName = request.getParameter("coRefName"); String strUserPosition = request.getParameter("userPosition"); int intConflictStatus = Integer.parseInt(request.getParameter("conflictCoAddress")); int intSType = Integer.parseInt(request.getParameter("stype")); String strCoHOStreetAdd = request.getParameter("CoHOStreetAdd"); String strCoHOBrgyAdd = request.getParameter("CoHOBrgyAdd"); String strCoHOCityAdd = request.getParameter("CoHOCityAdd"); String strCoHOProvAdd = request.getParameter("CoHOProvAdd"); String strProvAdd = strCoHOProvAdd.substring(2); %> <% String strCoHOZipCode = request.getParameter("CoHOZipCode"); String strCoHOTelArea = request.getParameter("CoHOTelArea"); String strCoHOTelNum = request.getParameter("CoHOTelNum"); String strCoHOTelLocal = request.getParameter("CoHOTelLocal"); String strCoHOFaxArea = request.getParameter("CoHOFaxArea"); String strCoHOFaxNum = request.getParameter("CoHOFaxNum"); String strCoHOFaxLocal = request.getParameter("CoHOFaxLocal"); String strCoHOEmail = request.getParameter("CoHOEmail"); String strCoHOWebsite = request.getParameter("CoHOWebsite"); String strFirstTimer = request.getParameter("userFirstTime"); strCpUser = request.getParameter("cpMainUser"); String strCP1FName = request.getParameter("cp1FirstName"); String strCP1LName = request.getParameter("cp1LastName"); String strCP1Position = request.getParameter("cp1Position"); String strCP1TelArea = request.getParameter("cp1TelArea"); String strCP1TelNum = request.getParameter("cp1TelNum"); String strCP1TelLocal = request.getParameter("cp1TelLocal"); String strCP1EMail = request.getParameter("cp1EMail"); String strCP2FName = request.getParameter("cp2FirstName"); String strCP2LName = request.getParameter("cp2LastName"); String strCP2Position = request.getParameter("cp2Position"); String strCP2TelArea = request.getParameter("cp2TelArea"); String strCP2TelNum = request.getParameter("cp2TelNum"); String strCP2TelLocal = request.getParameter("cp2TelLocal"); String strCP2EMail = request.getParameter("cp2EMail"); String strCP3FName = request.getParameter("cp3FirstName"); String strCP3LName = request.getParameter("cp3LastName"); String strCP3Position = request.getParameter("cp3Position"); String strCP3TelArea = request.getParameter("cp3TelArea"); String strCP3TelNum = request.getParameter("cp3TelNum"); String strCP3TelLocal = request.getParameter("cp3TelLocal"); String strCP3EMail = request.getParameter("cp3EMail"); /***** MAIN *****/ strCoHOStreetAdd = firstLetterCap(strCoHOStreetAdd); strCoHOStreetAdd = replaceOrErase("De La ", strCoHOStreetAdd, "de la "); strCoHOStreetAdd = replaceOrErase("De ", strCoHOStreetAdd, "de "); strCoHOStreetAdd = replaceOrErase("Dela ", strCoHOStreetAdd, "dela "); strCoHOStreetAdd = replaceOrErase("Del ", strCoHOStreetAdd, "del "); strCoHOBrgyAdd = firstLetterCap(strCoHOBrgyAdd); strCoHOBrgyAdd = replaceOrErase("De La ", strCoHOBrgyAdd,"de la "); strCoHOBrgyAdd = replaceOrErase("De ", strCoHOBrgyAdd,"de "); strCoHOBrgyAdd = replaceOrErase("Dela ", strCoHOBrgyAdd,"dela "); strCoHOBrgyAdd = replaceOrErase("Del ", strCoHOBrgyAdd,"del "); strCoHOCityAdd = firstLetterCap(strCoHOCityAdd); strCoHOCityAdd = replaceOrErase("De La ", strCoHOCityAdd,"de la "); strCoHOCityAdd = replaceOrErase("De ", strCoHOCityAdd,"de "); strCoHOCityAdd = replaceOrErase("Dela ", strCoHOCityAdd,"dela "); strCoHOCityAdd = replaceOrErase("Del ", strCoHOCityAdd,"del "); strCoHOZipCode = strCoHOZipCode.trim(); strCoHOTelArea = strCoHOTelArea.trim(); strCoHOTelNum = strCoHOTelNum.trim(); strCoHOTelLocal = strCoHOTelLocal.trim(); strCoHOFaxArea = strCoHOFaxArea.trim(); strCoHOFaxNum = strCoHOFaxNum.trim(); strCoHOFaxLocal = strCoHOFaxLocal.trim(); strCoHOEmail = strCoHOEmail.toLowerCase(); strCoHOWebsite = strCoHOWebsite.toLowerCase(); strCoHOZipCode = eraseSubstr("-",strCoHOZipCode); strCoHOTelArea = dashAndZeroesAway(strCoHOTelArea); strCoHOTelNum = dashAndZeroesAway(strCoHOTelNum); strCoHOTelLocal = dashAndZeroesAway(strCoHOTelLocal); strCoHOFaxArea = dashAndZeroesAway(strCoHOFaxArea); strCoHOFaxNum = dashAndZeroesAway(strCoHOFaxNum); strCoHOFaxLocal = dashAndZeroesAway(strCoHOFaxLocal); strCoHOEmail = strCoHOEmail.trim(); strCoHOWebsite = strCoHOWebsite.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] = strCoHOTelArea; arrAreaCode[1] = strCoHOFaxArea; arrAreaCode[2] = strCP1TelArea; arrAreaCode[3] = strCP2TelArea; arrAreaCode[4] = strCP3TelArea; String SQLstmt = "SELECT Code FROM tblAreaCodesPh;"; users.connect("product_areaCodesPhDB"); ResultSet 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.

<% } %>

Company Head Office Address

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 Persons
(Please supply complete information to at least one contact person.)

> Check this box if you are one of the main contact persons of the company.

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

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

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

<% } else { %> <% SQLstmt = "SELECT Pwd_ID, ApplicLvlStatus FROM tblUserPwd WHERE Usr_LogName=\"" + strUserLogName + "\";"; if (strWhatDB.equals("mainDB")) { users.connect(strMainDB); } else { users.connect(strTempDB); } rs = users.listQuery(SQLstmt); // GET THE ASSIGNED VALUE FOR Usr_ID AND ApplicLvlStatus while (rs.next()) { intUserID = rs.getInt("Pwd_ID"); intStatus = rs.getInt("ApplicLvlStatus"); } if (intStatus==2 || intStatus==7 || intStatus==8) { // IF THEY HAVE NOT BEEN UPDATED YET int intCoID = 0; intCompanyID = intUserID; if (intStatus==2) { bytApplicLvlStatus = 5; } else { // IF USER IS GOING TO BE OR ALREADY A MULTI-ACCT USER bytApplicLvlStatus = 6; SQLstmt = "UPDATE tblUserInfo SET Usr_MultiStatus=(Usr_MultiStatus+1) WHERE Usr_ID=" + intUserID + ";"; users.updateData(SQLstmt); // INCREMENT CURRENT VALUE OF Usr_MultiStatus BY 1. } SQLstmt = "UPDATE tblUserPwd SET ApplicLvlStatus=" + bytApplicLvlStatus + " WHERE Usr_LogName=\"" + strUserLogName + "\";"; users.updateData(SQLstmt); if (strWhatDB.equals("mainDB")) { users.disconnect(); users.connect(strTempDB); // CONNECTS AGAIN TO TEMP DATABASE TO RECORD APPLICATION } String strBlankLogName = ""; String strUserID = "" + intUserID; if (intStatus != 2) { // IF USER IS GOING TO BE OR ALREADY A MULTI-ACCT USER bytApplicLvlStatus = 10; users.addUser(strBlankLogName, strUserID, bytApplicLvlStatus); SQLstmt = "SELECT MAX(Pwd_ID) AS Pwd_ID FROM tblUserPwd where Usr_LogName=\"" + strBlankLogName + "\" and Usr_Pwd=\"" + strUserID + "\";"; rs = users.listQuery(SQLstmt); // GET A NEW VALUE FOR COMPANYID while (rs.next()) { intCoID = rs.getInt("Pwd_ID"); } intCompanyID = (intCoID + 80000000); } intCoHOID = intCompanyID; bytCoHOStatus = 1; byte cpctr = 0; if (cp1NotEmpty) { cpctr++; SQLstmt = "INSERT INTO tblContactPersons VALUES (" + intCoHOID + ", " + 1 + ", '" + strCP1FName + "', '" + strCP1LName + "', '" + strCP1Position + "', '" + strCP1TelArea + "', '" + strCP1TelNum + "', '" + strCP1TelLocal + "', '" + strCP1EMail + "', " + cpctr + ");"; users.updateData(SQLstmt); } if (cp2NotEmpty) { cpctr++; SQLstmt = "INSERT INTO tblContactPersons VALUES (" + intCoHOID + ", " + 1 + ", '" + strCP2FName + "', '" + strCP2LName + "', '" + strCP2Position + "', '" + strCP2TelArea + "', '" + strCP2TelNum + "', '" + strCP2TelLocal + "', '" + strCP2EMail + "', " + cpctr + ");"; users.updateData(SQLstmt); } if (cp3NotEmpty) { cpctr++; SQLstmt = "INSERT INTO tblContactPersons VALUES (" + intCoHOID + ", " + 1 + ", '" + 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 + ", " + 1 + ", " + cpuser + ", " + cpctr + ");"; users.updateData(SQLstmt); users.addCoEtcInfo("tblCoHeadOfc", intCoHOID, strCoHOStreetAdd, strCoHOBrgyAdd, strCoHOCityAdd, strProvAdd, strCoHOZipCode, strCoHOTelArea, strCoHOTelNum, strCoHOTelLocal, strCoHOFaxArea, strCoHOFaxNum, strCoHOFaxLocal, strCoHOEmail ,strCoHOWebsite, bytCoHOStatus); users.addCompanyInfo(intCompanyID, intUserID, strCompanyName, strCoRefName, strUserPosition, intConflictStatus); SQLstmt = "INSERT INTO tblCoInfoIndicator VALUES (" + intCompanyID + ", " + 0 + ", " + 0 + ", " + 0 + ", " + 0 + ", " + 0 + ", " + 0 + ", " + 0 + ", " + 0 + ", " + 0 + ", " + 0 + ");"; users.updateData(SQLstmt); users.disconnect(); // Disconnects with strTempDB users.connect(strMainDB); SQLstmt = "INSERT INTO tblSubscriptionType VALUES (" + intCompanyID + "," + intSType + ");"; users.updateData(SQLstmt); users.disconnect(); // Disconnects with strMainDB %> <% if (intConflictStatus==0) { %> <% } else { %> <% } %> <% } else { %> <% } %> <% } %>
 

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.