%
'--------------------------------------------------------
' Configurations for this page
'--------------------------------------------------------
myPageName = "bidders.asp"
myPageTable = "orders"
'--------------------------------------------------------
if (request("printer_friendly") = "true" or request("printer_friendly") = "-1") then
displayPrinterFriendlyHeader()
else
displayHeader()
end if
if request("job_id") <> "" then
job_id = request("job_id")
sqlString = "select * from job where id=" & job_id
set jobRS = objConn.Execute(sqlString)
if localAccessCheck(jobRS("hide_all_bidders"), jobRS("company_id")) then
select case request("action")
case "approve"
approveOrder()
case "deny"
denyOrder()
case "willbid"
willBidOrder()
case "list"
list()
case else
list()
end select
else
Response.Write("Either you are not logged in or you are attempting to access a restricted bidder list that you do not have rights to.")
security_getLogonInfo(myPageName)
end if
else
Response.Write("n0 h4x 4 j00. g0 6y3 6y3.")
end if
if (request("printer_friendly") = "true" or request("printer_friendly") = "-1") then
displayPrinterFriendlyFooter()
else
displayFooter()
end if
function approveOrder()
company_id = db_qdSelect("select company_id from job where id="&request("job_id"), "company_id")
if checkSecurity(30) or (checkSecurity(25) and CONST_managerCanEditOrders) or (checkSecurity(20) and company_id = Session("User_Company")) then
sqlString = "update orders set status='Approved' where id="&request("order_id")
objConn.Execute(sqlString)
set orderRS = objConn.Execute("select * from orders where id="&request("order_id"))
set jobRS = objConn.Execute("select * from job where id="&request("job_id"))
emailTxt = "Job: "&jobRS("job")&vbcrlf
emailTxt = emailTxt & "Order ID: "&request("order_id")&vbcrlf
emailTxt = emailTxt & "Company: "&db_qdSelect("select name from company where id="&request("order_id"), "name")&vbcrlf&vbcrlf
emailTxt = emailTxt & "This order has been approved."
select case CONST_webServerOS
case "Exchange"
Set objNewMail = CreateObject("CDO.Message")
objNewMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = CONST_exchangeSMTPServer
objNewMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 ' Use Exhange
objNewMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = CONST_exchangeUsername
objNewMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = CONST_exchangePassword
objNewMail.Configuration.Fields.Update
objNewMail.From = CONST_emailFromAddress
objNewMail.To = CONST_emailApproveDenyNotification
objNewMail.BCC = CONST_emailCarbonCopyList
objNewMail.Subject = "Order Approved: "&jobRS("job")
objNewMail.TextBody = emailTxt
objNewMail.Send
case "Windows 2003", "Windows 2003 Server"
Set objNewMail = CreateObject("CDO.Message")
objNewMail.From = CONST_emailFromAddress
objNewMail.To = CONST_emailApproveDenyNotification
objNewMail.BCC = CONST_emailCarbonCopyList
objNewMail.Subject = "Order Approved: "&jobRS("job")
objNewMail.TextBody = emailTxt
objNewMail.Send
case else
Set objNewMail = Server.CreateObject("CDONTS.NewMail")
objNewMail.From = CONST_emailFromAddress
objNewMail.BCC = CONST_emailCarbonCopyList
objNewMail.To = CONST_emailApproveDenyNotification
objNewMail.Subject = "Order Approved: "&jobRS("job")
objNewMail.BodyFormat = 1
objNewMail.MailFormat = 1
objNewMail.Body = emailTxt
objNewMail.Send
end select
sqlQuery = "insert into log_notifications set "
sqlQuery = sqlQuery & "email_from='"&CONST_emailFromAddress&"', "
sqlQuery = sqlQuery & "email_to='"&CONST_emailApproveDenyNotification&"', "
sqlQuery = sqlQuery & "email_bcc='"&CONST_emailCarbonCopyList&"', "
sqlQuery = sqlQuery & "subject='"&db_addSlashes("Order Approved: "&jobRS("job"))&"', "
sqlQuery = sqlQuery & "email_content='"&db_addSlashes(emailTxt)&"', "
sqlQuery = sqlQuery & "attatchment_name='', "
sqlQuery = sqlQuery & "contact_id="&Session("User_Id")&", "
sqlQuery = sqlQuery & "source='Order Approval'"
objConn.Execute(sqlQuery)
end if
list()
end function
function denyOrder()
company_id = db_qdSelect("select company_id from job where id="&request("job_id"), "company_id")
if checkSecurity(30) or (checkSecurity(25) and CONST_managerCanEditOrders) or (checkSecurity(20) and company_id = Session("User_Company")) then
sqlString = "update orders set status='Not Approved' where id="&request("order_id")
objConn.Execute(sqlString)
emailTxt = "Job: "&request("job_id")&vbcrlf
emailTxt = emailTxt & "Order ID: "&request("order_id")&vbcrlf
emailTxt = emailTxt & "Company: "&db_qdSelect("select name from company where id="&request("order_id"), "name")&vbcrlf&vbcrlf
emailTxt = emailTxt & "This order has been denied."
select case CONST_webServerOS
case "Exchange"
Set objNewMail = CreateObject("CDO.Message")
objNewMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = CONST_exchangeSMTPServer
objNewMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 ' Use Exhange
objNewMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = CONST_exchangeUsername
objNewMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = CONST_exchangePassword
objNewMail.Configuration.Fields.Update
objNewMail.From = CONST_emailFromAddress
objNewMail.To = CONST_emailApproveDenyNotification
objNewMail.BCC = CONST_emailCarbonCopyList
objNewMail.Subject = "Order Denied: "&jobRS("job")
objNewMail.TextBody = emailTxt
objNewMail.Send
case "Windows 2003", "Windows 2003 Server"
objNewMail.From = CONST_emailFromAddress
objNewMail.To = CONST_emailApproveDenyNotification
objNewMail.BCC = CONST_emailCarbonCopyList
objNewMail.Subject = "Order Denied: "&jobRS("job")
objNewMail.TextBody = emailTxt
objNewMail.Send
case else
Set objNewMail = Server.CreateObject("CDONTS.NewMail")
objNewMail.From = CONST_emailFromAddress
objNewMail.BCC = CONST_emailCarbonCopyList
objNewMail.To = CONST_emailApproveDenyNotification
objNewMail.Subject = "Order Denied: "&jobRS("job")
objNewMail.BodyFormat = 1
objNewMail.MailFormat = 1
objNewMail.Body = emailTxt
objNewMail.Send
end select
sqlQuery = "insert into log_notifications set "
sqlQuery = sqlQuery & "email_from='"&CONST_emailFromAddress&"', "
sqlQuery = sqlQuery & "email_to='"&CONST_emailApproveDenyNotification&"', "
sqlQuery = sqlQuery & "email_bcc='"&CONST_emailCarbonCopyList&"', "
sqlQuery = sqlQuery & "subject='"&db_addSlashes("Order Denied: "&jobRS("job"))&"', "
sqlQuery = sqlQuery & "email_content='"&db_addSlashes(emailTxt)&"', "
sqlQuery = sqlQuery & "attatchment_name='', "
sqlQuery = sqlQuery & "contact_id="&Session("User_Id")&", "
sqlQuery = sqlQuery & "source='Order Denial'"
objConn.Execute(sqlQuery)
end if
list()
end function
function willBidOrder()
company_id = db_qdSelect("select company_id from job where id="&request("job_id"), "company_id")
if checkSecurity(30) or (checkSecurity(25) and CONST_managerCanEditOrders) or (checkSecurity(20) and company_id = Session("User_Company")) then
sqlString = "update orders set status='Will Bid' where id="&request("order_id")
objConn.Execute(sqlString)
emailTxt = "Job: "&request("job_id")&vbcrlf
emailTxt = emailTxt & "Order ID: "&request("order_id")&vbcrlf
emailTxt = emailTxt & "Company: "&db_qdSelect("select name from company where id="&request("order_id"), "name")&vbcrlf&vbcrlf
emailTxt = emailTxt & "This order has been set to Will Bid."
select case CONST_webServerOS
case "Exchange"
Set objNewMail = CreateObject("CDO.Message")
objNewMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = CONST_exchangeSMTPServer
objNewMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 ' Use Exhange
objNewMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = CONST_exchangeUsername
objNewMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = CONST_exchangePassword
objNewMail.Configuration.Fields.Update
objNewMail.From = CONST_emailFromAddress
objNewMail.To = CONST_emailApproveDenyNotification
objNewMail.BCC = CONST_emailCarbonCopyList
objNewMail.Subject = "Order Denied: "&jobRS("job")
objNewMail.TextBody = emailTxt
objNewMail.Send
case "Windows 2003", "Windows 2003 Server"
objNewMail.From = CONST_emailFromAddress
objNewMail.To = CONST_emailApproveDenyNotification
objNewMail.BCC = CONST_emailCarbonCopyList
objNewMail.Subject = "Order Denied: "&jobRS("job")
objNewMail.TextBody = emailTxt
objNewMail.Send
case else
Set objNewMail = Server.CreateObject("CDONTS.NewMail")
objNewMail.From = CONST_emailFromAddress
objNewMail.BCC = CONST_emailCarbonCopyList
objNewMail.To = CONST_emailApproveDenyNotification
objNewMail.Subject = "Order Denied: "&jobRS("job")
objNewMail.BodyFormat = 1
objNewMail.MailFormat = 1
objNewMail.Body = emailTxt
objNewMail.Send
end select
sqlQuery = "insert into log_notifications set "
sqlQuery = sqlQuery & "email_from='"&CONST_emailFromAddress&"', "
sqlQuery = sqlQuery & "email_to='"&CONST_emailApproveDenyNotification&"', "
sqlQuery = sqlQuery & "email_bcc='"&CONST_emailCarbonCopyList&"', "
sqlQuery = sqlQuery & "subject='"&db_addSlashes("Order Will Bid: "&jobRS("job"))&"', "
sqlQuery = sqlQuery & "email_content='"&db_addSlashes(emailTxt)&"', "
sqlQuery = sqlQuery & "attatchment_name='', "
sqlQuery = sqlQuery & "contact_id="&Session("User_Id")&", "
sqlQuery = sqlQuery & "source='Order Will Bod'"
objConn.Execute(sqlQuery)
end if
list()
end function
function localAccessCheck(hideBidders, company_id)
select case true
case (hideBidders = "0")
localAccessCheck = true
case (Session("Security_Level") >= 20 and Session("User_Company") = company_id)
localAccessCheck = true
case (checkSecurity(25) and CONST_managerCanEditOrders)
localAccessCheck = true
case (Session("Security_Level") >= 30)
localAccessCheck = true
case else
localAccessCheck = false
end select
end function
function list()
pf = request("printer_friendly")
if (pf = "") then
pf = "0"
end if
orderBy = request("orderBy")
select case orderBy
case "contactName"
orderByTitle = "Contact Name"
case "companyTrade"
orderBytitle = "Trade"
case "bid_category"
orderByTitle = "Bid Category"
case "sets_issued"
orderByTitle = "Sets Issued"
case "zip_code"
orderBy = "billto_zip"
orderByTitle = "Zip Code"
case ""
orderBy = "company"
orderByTitle = "Company"
case else
orderByTitle = generic_firstToUpper(orderBy)
end select
sqlString = "select cmp.name as company, con.Name as contactName, cmp.phone as phone, cmp.fax as fax, con.email as email, job.require_contractor_approval, ord.id as order_id, ord.*, dm.deliverymethod, trd.type as companyTrade, ol.job_item_id as disc_id "
sqlString = sqlString & "from orders ord left outer join company cmp on (ord.company_id = cmp.id) "
sqlString = sqlString & "left outer join contacts con on (ord.contact_id = con.id) "
sqlString = sqlString & "left outer join job on (ord.job_id = job.id) "
sqlString = sqlString & "left outer join lkdeliverymethod dm on (ord.shipment_method = dm.id) "
sqlString = sqlString & "left outer join trades trd on (ord.trade_id = trd.id) "
sqlString = sqlString & "left outer join order_lines ol on (ord.id = ol.order_id) "
sqlString = sqlString & "where ord.job_id = " & job_id & " "
sqlString = sqlString & "group by ord.id "
sqlString = sqlString & "order by " & orderBy
' response.Write("sqlString:
" & sqlString)
set orderRS = objConn.Execute(sqlString)
%>
<%=CONST_linkBidderListName%> for <%=jobRS("job")%>
<% if checkSecurity(30) or (checkSecurity(25) and CONST_managerCanEditOrders) or (Session("User_Company") = jobRS("company_id") and checkSecurity(20)) then %> Bidder Shipping Labels|
Sorted By <%=orderByTitle%> Click on the following links to sort by a category: Company | Trade | Contact Name | Zip Code | Sets Issued <% if CONST_bidCategoriesEnabled then %> | Bid Category <% end if %> |
&printer_friendly=<%=not pf%>">Printer Friendly Version |
<%=CONST_linkBidderListName%> for <%=jobRS("job")%>
<% end function function showFullList(objRS,jobRS) %>| Company Information | <% if CONST_displayTradeInBidderList or CONST_bidCategoriesEnabled then %>
<% if CONST_displayTradeInBidderList then %>
Trade <% end if %> <% if CONST_bidCategoriesEnabled then %> Bid Cat. <% end if %> |
<% end if %>
Contact Information | <% if CONST_biddersListDisplayStatus then %>Status Date Filled Date Returned |
<% end if %>
<% if CONST_biddersListDisplayShipping then %>
Delivery Method Tracking Number |
<% end if %>
<% if CONST_biddersListDisplaySets then %>
Sets Issued |
<% end if %>
<% if CONST_biddersListDisplayDateOrdered then %>
Date <%=CONST_terminologyOrdered%> | <% end if %>||
|---|---|---|---|---|---|---|---|---|
|
<% if (checkSecurity(CONST_securityLevelToEditOrdersForCompanyJob) and Session("User_Company") = jobRS("company_id")) OR checkSecurity(CONST_securityLevelToEditOrdersAll) then %>
<% if not (request("printer_friendly") = "true" or request("printer_friendly") = "-1") then %>
">Edit |
">Delete <% end if %> <% end if %> <%=objRS("order_id")%> |
<%=objRS("company")%> <%=objRS("shipto_address1")%> <% if objRS("shipto_address2") <> "" then %> <%=objRS("shipto_address2")%> <% end if %> <%=objRS("shipto_city")%>, <%=objRS("shipto_state")%> <%=objRS("shipto_zip")%> <% if CONST_displayTradeInBidderList or CONST_bidCategoriesEnabled then %> |
<% if CONST_displayTradeInBidderList then %>
Trade: <%=objRS("companyTrade")%> <% end if %> <% if CONST_bidCategoriesEnabled then %> Bid Cat.: <%=trim(replace(" "&objRS("bid_category"),";","; "))%> <% end if %> <% end if %> |
<%=objRS("contactName")%> Phone: <%=objRS("phone")%> Fax: <%=objRS("fax")%> <% if checkSecurity(CONST_securityBidderListPlanholderEmailView) or checkSecurity(30) or (checkSecurity(20) and Session("User_Company") = jobRS("company_id")) then %> "><%=objRS("email") %> <% end if %> |
<% if CONST_biddersListDisplayStatus then %>
<% if db_getData(objRS,"Require_Contractor_Approval") = "-1" then %>
<% if objRS("status") = "Waiting on Approval" then
%><%
if CONST_biddersListApproveOrderHasWillBidOption then
%><%
end if %>
<% else response.Write(objRS("status")&" ") end if %> <% else %> <%=objRS("status")%> <% end if %> <%=objRS("date_filled")%> <% if db_getData(objRS, "date_returned") <> "" then response.Write("Date Returned: "&db_getData(objRS, "date_returned")) end if %> |
<% end if %>
<% if CONST_biddersListDisplayShipping then %>
<%
shipment_method = objRS("shipment_method")
delivery_method = objRS("deliverymethod")
if delivery_method <> "" then
shipment_method = delivery_method
end if
contact_id = objRS("contact_id")
company_id = objRS("company_id")
response.Write(shipment_method)
if CONST_displayTrackingNumberToAll or (Session("Security_Level")=10 and Session("User_Id")=contact_id) or (Session("Security_Level")=20 and Session("User_Company")=company_id) or (Session("Security_Level")>=30) then
shipment_method = lcase(shipment_method)
trackNumArr = split(objRS("tracking_number")&" ", ",")
If InStr(shipment_method,"fed") > 0 Then
for each tempTrackNum in trackNumArr
trackNum = trim(tempTrackNum)
if trackNum <> "" then
response.Write(" FedEx "&trackNum&" ") end if next elseif InStr(shipment_method,"ups") > 0 Then for each tempTrackNum in trackNumArr trackNum = trim(tempTrackNum) if trackNum <> "" then response.Write(" UPS "&trackNum&" ") end if next elseif InStr(shipment_method,"intelliquick") > 0 Then for each tempTrackNum in trackNumArr trackNum = trim(tempTrackNum) if trackNum <> "" then response.Write(" ") %> |
<% end if %>
<% if CONST_biddersListDisplaySets then %>
<%=objRS("sets_issued")%> <%if CONST_enableDownload then sqlQuery = "select id from disc_to_download where disc_id="&objRS("disc_id") set downloadRS = objConn.Execute(sqlQuery) if not downloadRS.EOF then response.Write("Downloadable") end if end if %> |
<% end if %>
<% if CONST_biddersListDisplayDateOrdered then %>
Specs: <%=objRS("date_ordered")%>
<% if CONST_biddersListDisplayAddendumDownloads then
sqlQuery = "select c2a.download_date, ad.title "
sqlQuery = sqlQuery & "from contact_to_addendum as c2a "
sqlQuery = sqlQuery & "left outer join job_addendums ad on (c2a.addendum_id = ad.id) "
sqlQuery = sqlQuery & "where c2a.contact_id="&objRS("contact_id")&" and ad.job_id="&objRS("job_id")
set c2aRS = objConn.Execute(sqlQuery)
do while not c2aRS.EOF
response.Write(" "&c2aRS("title")&": "&c2aRS("download_date")) c2aRS.MoveNext loop end if %> |
<% end if %>