%@ page language="java"
import="java.sql.*, java.io.*, java.util.*, users.databases.*"
%>
<%
String strMainDB = "product_pgpClientInfoDB";
byte bytForeignStat = 0, bytSalesStat = 0, bytShowRmStat = 0, bytPWHseStat = 0, bytTSvcStat = 0;
byte bytBrandStat = 0, bytProdStat = 0, bytBranchStat = 0, bytDstrbtrStat = 0, bytOtherCPStat = 0;
String strLabel1 = "", strLabel2 = "", strLabel3 = "", strLabel4 = "", strLabel5 = "";
String strLabel6 = "", strLabel7 = "", strLabel8 = "", strLabel9 = "", strLabel10 = "";
int intUserID = Integer.parseInt(request.getParameter("uid"));
int intCompanyID = Integer.parseInt(request.getParameter("cid"));
byte bytDeptID = Byte.parseByte(request.getParameter("did"));
String SQLstmt = "SELECT * FROM tblCoInfoIndicator WHERE Co_ID=" + intCompanyID + ";";
users.connect(strMainDB);
ResultSet rs = users.listQuery(SQLstmt);
while (rs.next()) {
bytForeignStat = rs.getByte("ForeignOfc");
bytSalesStat = rs.getByte("SalesOfc");
bytShowRmStat = rs.getByte("ShowRm");
bytPWHseStat = rs.getByte("PlantAndWHse");
bytTSvcStat = rs.getByte("TechlSvc");
bytBrandStat = rs.getByte("Brands");
bytProdStat = rs.getByte("Products");
bytBranchStat = rs.getByte("Branches");
bytDstrbtrStat = rs.getByte("Distributors");
bytOtherCPStat = rs.getByte("OtherCP");
}
users.disconnect();
if (bytDeptID==2) {
if (bytSalesStat==0) {
bytDeptID = 1;
}
} else if (bytDeptID==3) {
if (bytShowRmStat==0) {
bytDeptID = 1;
}
} else if (bytDeptID==4) {
if (bytPWHseStat==0) {
bytDeptID = 1;
}
} else if (bytDeptID==5) {
if (bytTSvcStat==0) {
bytDeptID = 1;
}
} else if (bytDeptID==10) {
if (bytForeignStat==0) {
bytDeptID = 1;
}
}
if (bytForeignStat==1) {
strLabel1 = "value=\"Foreign Office\" onClick=\"goForeign()\"> View, edit, blah blah...";
} else {
strLabel1 = "value=\"Add Foreign Office\" disabled > Submit information on company's Foreign Office.";
}
if (bytSalesStat==1) {
strLabel2 = "value=\"Sales Office\" onClick=\"goSales()\"> View, edit, blah blah...";
} else {
strLabel2 = "value=\"Add Sales Office\" onClick=\"javascript:location.replace('ofcadd.jsp?uid=" +
intUserID + "&cid=" + intCompanyID + "&did=2')\"> Submit information on company's Sales Office.";
}
if (bytShowRmStat==1) {
strLabel3 = "value=\"Show Room\" onClick=\"goShow()\"> View, edit, blah blah...";
} else {
strLabel3 = "value=\"Add Show Room\" onClick=\"javascript:location.replace('ofcadd.jsp?uid=" +
intUserID + "&cid=" + intCompanyID + "&did=3')\"> Submit information on company's Show Room.";
}
if (bytPWHseStat==1) {
strLabel4 = "value=\"Warehouse\" onClick=\"goWHse()\"> View, edit, blah blah...";
} else {
strLabel4 = "value=\"Add Warehouse\" onClick=\"javascript:location.replace('ofcadd.jsp?uid=" +
intUserID + "&cid=" + intCompanyID + "&did=4')\"> Submit information on company's Plant or Warehouse.";
}
if (bytTSvcStat==1) {
strLabel5 = "value=\"Technical\" onClick=\"goTechl()\"> View, edit, blah blah...";
} else {
strLabel5 = "value=\"Add Technical\" onClick=\"javascript:location.replace('ofcadd.jsp?uid=" +
intUserID + "&cid=" + intCompanyID + "&did=5')\"> Submit information on company's Technical Service Office.";
}
if (bytBrandStat>=1) {
strLabel6 = "value=\"Brands\" onClick=\"goBrands()\"> View, edit, blah blah...";
} else {
strLabel6 = "value=\"Add Brands\" onClick=\"javascript:location.replace('bpadd.jsp?uid=" +
intUserID + "&cid=" + intCompanyID + "&did=6')\"> Submit data on different Brand Names that the company carries.";
}
if (bytProdStat>=1) {
strLabel7 = "value=\"Products\" onClick=\"goProds()\"> View, edit, blah blah...";
} else {
strLabel7 = "value=\"Add Products\" onClick=\"javascript:location.replace('bpadd.jsp?uid=" +
intUserID + "&cid=" + intCompanyID + "&did=7')\"> Submit data on different Products that the company is selling.";
}
if (bytBranchStat>=1) {
strLabel8 = "value=\"Branches\" onClick=\"goBr()\"> View, edit, blah blah...";
} else {
strLabel8 = "value=\"Add Branches\" onClick=\"javascript:location.replace('bdadd.jsp?uid=" +
intUserID + "&bid=0&cid=" + intCompanyID + "&did=8')\"> Submit information on company's existing branches.";
}
if (bytDstrbtrStat>=1) {
strLabel9 = "value=\"Distributors\" onClick=\"goDstbtr()\"> View, edit, blah blah...";
} else {
strLabel9 = "value=\"Add Distributors\" onClick=\"javascript:location.replace('bdedit.jsp?uid=" +
intUserID + "&bid=0&cid=" + intCompanyID + "&did=9')\"> Submit information on company's different downlines.";
}
if (bytOtherCPStat>=1) {
strLabel10 = "value=\"Contact Person\" onClick=\"goCP()\"> View, edit, blah blah...";
} else {
strLabel10 = "value=\"Add Contact Person\" onClick=\"javascript:location.replace('cpadd.jsp?uid=" +
intUserID + "&cid=" + intCompanyID + "&did=11&p1=0&p2=5')\"> Submit other contact persons found on other departments.";
}
%>
<% if (bytDeptID==1) { %>
<% } else { %>
View, edit...
<% } %>
<% if (bytDeptID==10) { %>
<% } else { %>
<% } %>
<% if (bytDeptID==2) { %>
<% } else { %>
<% } %>
<% if (bytDeptID==3) { %>
<% } else { %>
<% } %>
<% if (bytDeptID==4) { %>
<% } else { %>
<% } %>
<% if (bytDeptID==5) { %>
<% } else { %>
<% } %>
<% if (bytDeptID==6) { %>
<% } else { %>
<% } %>
<% if (bytDeptID==7) { %>
<% } else { %>
<% } %>
<% if (bytDeptID==8) { %>
<% } else { %>
<% } %>
<% if (bytDeptID==9) { %>
<% } else { %>
<% } %>
<% if (bytDeptID==11) { %>
<% } else { %>
<% } %>