<%@ page language="java" import="java.sql.*, java.io.*, java.util.*, users.databases.*" %> <%! /***** METHOD DECLARATION *****/ /*** function FOUND-INVALID-DIAL-UP-CHAR checks for validity but also 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; boolean areaCodeOK = false, incFax = false, withError = false; boolean noSType = false; byte bytMultiStatus = 0, bytStatus = 0; int intUserID = 0; String strAreaCode = ""; String[] arrAreaCode = new String[2]; String strTempDB = "product_tmpClientInfoDB"; String strUserLogName = request.getParameter("userLogName"); int intSType = Integer.parseInt(request.getParameter("stype")); String strUserFName = request.getParameter("userFirstName"); String strUserLName = request.getParameter("userLastName"); String strUserTelArea = request.getParameter("userTelArea"); String strUserTelNum = request.getParameter("userTelNum"); String strUserTelLocal = request.getParameter("userTelLocal"); String strUserFaxArea = request.getParameter("userFaxArea"); String strUserFaxNum = request.getParameter("userFaxNum"); String strUserFaxLocal = request.getParameter("userFaxLocal"); String strUserEMail = request.getParameter("userEMail"); String strCompanyName = request.getParameter("userCoName"); String strUserPosition = request.getParameter("userPosition"); String strFirstTimer = request.getParameter("userFirstTime"); /***** MAIN *****/ strUserFName = strUserFName.trim(); strUserLName = strUserLName.trim(); strUserTelArea = strUserTelArea.trim(); strUserTelNum = strUserTelNum.trim(); strUserTelLocal = strUserTelLocal.trim(); strUserFaxArea = strUserFaxArea.trim(); strUserFaxNum = strUserFaxNum.trim(); strUserFaxLocal = strUserFaxLocal.trim(); strUserEMail = strUserEMail.trim(); strCompanyName = strCompanyName.trim(); strUserPosition = strUserPosition.trim(); strUserFName = firstLetterCap(strUserFName); strUserLName = firstLetterCap(strUserLName); strUserLName = replaceOrErase("De La ", strUserLName, "de la "); strUserLName = replaceOrErase("De ", strUserLName, "de "); strUserLName = replaceOrErase("Dela ", strUserLName, "dela "); strUserLName = replaceOrErase("Del ", strUserLName, "del "); strUserPosition = firstLetterCap(strUserPosition); strCompanyName = strCompanyName.toUpperCase(); strUserEMail = strUserEMail.toLowerCase(); strUserTelArea = dashAndZeroesAway(strUserTelArea); strUserTelNum = dashAndZeroesAway(strUserTelNum); strUserTelLocal = dashAndZeroesAway(strUserTelLocal); strUserFaxArea = dashAndZeroesAway(strUserFaxArea); strUserFaxNum = dashAndZeroesAway(strUserFaxNum); strUserFaxLocal = dashAndZeroesAway(strUserFaxLocal); arrAreaCode[0] = strUserTelArea; arrAreaCode[1] = strUserFaxArea; String SQLstmt = "SELECT Code FROM tblAreaCodesPh;"; users.connect("product_areaCodesPhDB"); ResultSet rs = users.listQuery(SQLstmt); for (int i=0; i User Information
         

User Registration


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

Welcome <%= strUserLogName %>!
Please fill up the following:

<% } else { %>

INVALID ENTRY/ENTRIES were found in your registration form.
<% if (noSType) { %> You had not selected a SUBSCRIPTION type. <% } %> <% if (invalidDialUpChar) { %> You had entered a non-numeric character on your PHONE/FAX 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. ( Valid samples of e-mail address: juan@skyinet.net john_smith@hotmail.com ) <% } %> <% if (areaCodeOK==false) { %> An area code entry (or entries) is not a valid Philippine telephone area code. <% } %> Also, please check if you left a mandatory field/fields (with ** on the label) BLANK or EMPTY.

<% } %>

Subscription Type**:

First name**:
Last name**:
Position**:
Company name**:

Contact Information:

Telephone:
area code** phone number** local number
Facsimile:
area code fax number local number
e-mail address**:

<% } else { SQLstmt = "SELECT Pwd_ID, ApplicLvlStatus FROM tblUserPwd WHERE Usr_LogName=\"" + strUserLogName + "\";"; users.connect(strTempDB); rs = users.listQuery(SQLstmt); while (rs.next()) { intUserID = rs.getInt("Pwd_ID"); bytStatus = rs.getByte("ApplicLvlStatus"); } if (bytStatus >= 2) { users.disconnect(); %> <% } else { users.addUserInfo(intUserID, strUserFName, strUserLName, strUserTelArea, strUserTelNum, strUserTelLocal, strUserFaxArea, strUserFaxNum, strUserFaxLocal, strUserEMail, bytMultiStatus); SQLstmt = "UPDATE tblUserPwd SET ApplicLvlStatus=2 WHERE Usr_LogName=\"" + strUserLogName + "\";"; 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.