|
Server : Apache/2.4.62 System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64 User : www ( 80) PHP Version : 8.3.8 Disable Function : NONE Directory : /domains/highlandlabs/cqi-bin/ALFA_DATA/alfasymlink/root/domains/howardbender2/jobs/ |
Upload File : |
<%@ Language=VBScript %>
<% Response.Expires = 0 %>
<!--#include file=DataStore.asp-->
<!--#include file="_ScriptLibrary/adovbs.inc"-->
<%
' *** This version is for all jobs as FREE jobs ***
Dim i 'Counter
Dim iTotal
Dim sTitle 'Page Title
sTitle = "Job Cart"
Dim sUserID 'User ID
sUserID = request("userid")
if sUserID = "" then Response.Redirect "default.asp"
Dim sName, sEmail, sSchool ' For email
Dim sSQL 'SQL Statement
sSQL = "SELECT itemid, title, minsalary, SCHOOL.name, price FROM CART INNER JOIN SCHOOL ON CART.school_id = SCHOOL.schoolid WHERE user_id = '" & sUserID & "';"
Dim cnSchoolJobs ' Connection Object
Set cnSchoolJobs = Server.CreateObject("ADODB.Connection")
cnSchoolJobs.Open sConnect
Dim rsJobsInCart 'Recordset Object
Set rsJobsInCart = Server.CreateObject("ADODB.Recordset")
Set rsJobsInCart = cnSchoolJobs.Execute(sSQL)
Dim rsSchool
Set rsSchool = Server.CreateObject("ADODB.Recordset") 'Recordset object
'open the SCHOOL table
rsSchool.Open "SCHOOL", cnSchoolJobs, 0, 3
'filter the recordset
rsSchool.Filter = "manager_id = '" & sUserID & "'"
Dim objConn
Set objConn = server.CreateObject("ADODB.Connection") 'Connection object
'open the connection object
if objConn.State = 0 then 'only open if the connection is closed
objConn.Open sConnect
end if
Dim rsManager
Set rsManager = Server.CreateObject("ADODB.Recordset")
'and open the MANAGER table
rsManager.Open "MANAGER", objConn, 0, 3
'Filter the recordset and verify if information has already been saved with this user id
rsManager.Filter = "managerid = '" & sUserID & "'"
'copy records corresponding to userid in cart, to jobs table
Dim rsJobs
Dim rsCart
Set rsCart = server.CreateObject("ADODB.Recordset") 'Recordset object
Set rsJobs = server.CreateObject("ADODB.Recordset") 'Recordset object
'open the CART table
rsCart.Open "CART", cnSchoolJobs, 3, 3
'open the JOB table
rsJobs.Open "SELECT * FROM JOB", cnSchoolJobs, 3, 3
'Filter the recordset
rsCart.Filter = "user_id = '" & sUserID & "'"
If Not rsCart.EOF then
rsCart.MoveFirst
'copy corresponding records in cart to jobs table
Do While Not rsCart.EOF
rsJobs.AddNew
rsJobs("school_id") = rsCart("school_id")
rsJobs("title") = rsCart("title")
rsJobs("start_date") = rsCart("start_date")
rsJobs("expertise")= rsCart("expertise")
rsJobs("degree_req") = rsCart("degree_req")
rsJobs("special_qual") = rsCart("special_qual")
rsJobs("job_description") = rsCart("job_description")
rsJobs("minsalary") = rsCart("minsalary")
rsJobs("maxsalary") = rsCart("maxsalary")
rsJobs("peryrhr") = rsCart("peryrhr")
rsJobs("contact_name") = rsCart("contact_name")
rsJobs("contact_areacode") = rsCart("contact_areacode")
rsJobs("contact_phone") = rsCart("contact_phone")
rsJobs("contact_email") = rsCart("contact_email")
rsJobs("date_submitted")= Date()
rsJobs("graceperiod")= rsCart("graceperiod")
rsJobs("price") = rsCart("price")
rsJobs("active")= -1
rsJobs.Update
rsCart.MoveNext
Loop
'delete related records in cart.
cnSchoolJobs.Execute "DELETE * FROM CART WHERE user_id = '" & sUserID & "'"
end if 'end test empty cart
'Close and release recordset
rsJobs.Close
'close and release recordset
rsCart.Close
Set rsCart = Nothing
cnSchoolJobs.Close
Set cnSchoolJobs = Nothing
' Email area
'set the to address
sSchool = "SELECT SCHOOL.* FROM (MANAGER INNER JOIN SCHOOL ON MANAGER.managerid = SCHOOL.manager_id) WHERE MANAGER.managerid='" & sUserID & "';"
rsJobs.Open sSchool, objConn, adOpenStatic
'Instantiate the SMTP Mailer address
Set sendmail = Server.CreateObject("SMTPsvg.Mailer")
'put the webmaster address here
sendmail.FromName = "Dr. Howard J. Bender"
sendmail.FromAddress = "[email protected]"
sName = rsJobs("contact_name")
sEmail = rsJobs("contact_email")
sendmail.AddRecipient sName, sEmail
'Set remote host (SMTP) Host
sendmail.RemoteHost = "smtp.rcn.com"
'Set the return receipt flag to false
sendmail.ReturnReceipt = false
'send the confirm read flag to false
sendmail.ConfirmRead = false
'Enter the subject of your mail here
sendmail.Subject = "Don't forget our restaurant sponsors. They paid for your ads!"
'This is the content of thr message.
sendmail.BodyText = "Dear Colleague �" & vbCrlf & vbCrlf _
& "Help us keep School Jobs free for you." & vbCrlf & vbCrlf _
& "The local restaurants who sponsor us are helping this service to continue." & vbCrlf _
& "And they'll give you something when you visit them." & vbCrlf _
& "You can find them on our home page (www.school-jobs.net) by clicking on your telephone area code." & vbCrlf & vbCrlf _
& "So, if you're going out to eat, think about those restaurants who support you." & vbCrlf & vbCrlf _
& "If we all help each other, we'll all win." & vbCrlf & vbCrlf _
& "Cheers," & vbCrlf & vbCrlf _
& "Dr. Howard J. Bender" & vbCrlf _
& "President" & vbCrlf _
& "Education Process Improvement Center, Inc." & vbCrlf _
& "[email protected]"
'this sets mail priority.... 5=low 3=normal 1=high
sendmail.Priority = 2
'send mail (now set to a comment - remove comment if you want to send a message)
'sendmail.SendMail
Set sendmail = Nothing
rsJobs.Close
Set rsJobs = Nothing
rsManager.close
Set rsManager = Nothing
response.redirect "listjobs.asp?userid=" & sUserID
%>