|
<% 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.
<% } %>
<% } 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 { %>
<% } %>
<% } %>
|