KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /domains/highlandlabs/cqi-bin/ALFA_DATA/alfasymlink/root/domains/howardbender2/jobs/checkout1-6.asp
<%@ Language=VBScript %>
<% Option Explicit %>
<%
'Script used to test if transaction succeeded or not.
'If transaction is successful records present in cart
'that match userid are copied in jobs table.
%>

<!--#include file="_ScriptLibrary/adovbs.inc"-->
<!--#include file="datastore.asp"-->
<%
'get userid
Dim sUserID
sUserID = trim(Request.Form("userid"))

'check that userid is not empty. if empty redirect to sorry page
if sUserID = "" then Response.Redirect "http://www.epi-center.net/orders/sorry.html"

'get total charge
Dim iTotal
iTotal = trim(Request.Form("chargetotal"))
'get credit card type
Dim sCCType
sCCType = Trim(Request.Form("cctype"))
'get Status
Dim sStatus
sStatus = Trim(Request.Form("status"))

'test status to find out if transaction succeeded	
if sStatus = "APPROVED" then 
	'copy records corresponding to userid in cart, to jobs table
	Dim objConn
	Dim rsJobs
	Dim rsCart
	Dim sSQL

	Set objConn = server.CreateObject("ADODB.Connection")	'Connection object	
	Set rsCart = server.CreateObject("ADODB.Recordset") 	'Recordset object
	Set rsJobs = server.CreateObject("ADODB.Recordset")		'Recordset object

	'open the connection object
	objConn.Open sConnect

	'open the CART table
	rsCart.Open "CART", objConn, 3, 3

	'open the JOB table
	rsJobs.Open "SELECT * FROM JOB", objConn, 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.
	objConn.Execute "DELETE * FROM CART WHERE user_id = '" & sUserID & "'"
	
	'add transaction to the transaction table
	if iTotal <> 0 then
		sSQL = "INSERT INTO JOBTRANSACT (user_id, amount, payment, datepaid) VALUES ('" & sUserID & "', " & iTotal & ", '" & sCCType & "', " & formatdatetime(Date(),0) &  ");"
		objConn.Execute (sSQL)
	end if
	
	end if 'end test empty cart
	
	'Close and release recordset
	rsJobs.Close
	Set rsJobs = Nothing
	
	'close and release recordset
	rsCart.Close
	Set rsCart = Nothing

	'close and release connection
	objConn.Close
	Set objConn = Nothing
	
	'yes: display thank you page
	Response.redirect "http://www.school-jobs.net/jobs/thanks.asp?userid=" & sUserID
else
	'transaction failed
	Response.redirect "http://www.school-jobs.net/jobs/sorry.asp"
end if
%>

Anon7 - 2021