ASP WEB PROGRAM
IF HHROYALTYCREDITOR="PRODUCER" THEN
SET FALBUMSINGLE=SERVER.CREATEOBJECT("ADODB.RECORDSET")
SQLALBUM=" SELECT * FROM ALBUMSINGLE "
FALBUMSINGLE.OPEN SQLALBUM, CON
REGGAEFLG=0
IF FALBUMSINGLE.BOF THEN
IF FALBUMSINGLE.EOF THEN
REGGAEFLG=1
END IF
END IF
IF REGGAEFLG=0 THEN
FALBUMSINGLE.MOVEFIRST
DO WHILE NOT FALBUMSINGLE.EOF
IF ISNULL(FALBUMSINGLE("CODE")) THEN
HCODE=0
ELSE
ELSE
HCODE= FALBUMSINGLE("CODE")
END IF
HDESCRIPTION="" & FALBUMSINGLE("DESCRIPTION")
HDESCRIPTION=TRIM(HDESCRIPTION)
IF HDESCRIPTION="ALBUM" THEN
SET FPRODUCER=SERVER.CREATEOBJECT("ADODB.RECORDSET")
SQLPRODUCER= " SELECT * FROM PRODUCER "
FPRODUCER.OPEN SQLPRODUCER,CON
REGGAEFLG=0
If FPRODUCER.Bof Then
If FPRODUCER.Eof then
REGGAEFLG=1
End If
End If
If REGGAEFLG=0 Then
FPRODUCER.Movefirst
Do While Not FPRODUCER.Eof
If Isnull(FPRODUCER("PRODUCERCOD")) then
HACCOUNT_NUMBER=0
Else
HACCOUNT_NUMBER=FPRODUCER("PRODUCERCOD")
End If
HACCOUNT_NAME ="" & FPRODUCER("PRODUCERNAM")
REM HEMAIL : Pay Pal Business Account Of
Royalty Creditor ( Producer)
HEMAIL ="" & FPRODUCER("EMAIL")
REM *********************************************************************
Retrieving List Of Albums For Which The Producer has financed
recording From Access Or SQL Server Database Table “ROYALTYALBUM”.
recording From Access Or SQL Server Database Table “ROYALTYALBUM”.
And Calculating Money owed to the Producer on each Album sales.
Other Royalty Creditors that Pay Pal Payments can be transferred
to their Account are: (DISTRIBUTOR, SONG WRITER, ARTIST, MUSICIAN).
to their Account are: (DISTRIBUTOR, SONG WRITER, ARTIST, MUSICIAN).
REM *********************************************************************
SET FROYALTYALBUM=SERVER.CREATEOBJECT("ADODB.RECORDSET")
SQLALBUM=" SELECT * FROM ROYALTYALBUM "
SQLALBUM=SQLALBUM & " WHERE ACCNO=" & HACCOUNT_NUMBER
SQLALBUM=SQLALBUM & " AND ROYALTY_CODE=" & HROYALTY_CODE
FROYALTYALBUM.OPEN SQLALBUM,CON
REGGAEFLG=0
IF FROYALTYALBUM.BOF THEN
IF FROYALTYALBUM.EOF THEN
REGGAEFLG=1
END IF
END IF
IF REGGAEFLG=0 THEN
RESPONSE.WRITE ("<TABLE WIDTH='800' BORDER='10'>")
RESPONSE.WRITE ("<tr>")
RESPONSE.WRITE ("<TH> </TH>")
RESPONSE.WRITE("<TH BGCOLOR='RED' COLSPAN='20'><FONT FACE='ALGERIAN' SIZE='6'
COLOR='YELLOW'> PRODUCER CODE </FONT></TH>
COLOR='YELLOW'> PRODUCER CODE </FONT></TH>
RESPONSE.WRITE ("<TH bgcolor='YELLOW' COLSPAN='30'><FONT FACE='ALGERIAN'
SIZE='6' COLOR='RED'>PRODUCER NAME </FONT></TH>")
RESPONSE.WRITE ("<TH bgcolor='GREEN' COLSPAN='10'><FONT FACE='ALGERIAN'
SIZE='6' COLOR='YELLOW'>ALBUM CODE </FONT></TH>")
RESPONSE.WRITE ("<TH bgcolor='RED' COLSPAN='30'><FONT FACE='ALGERIAN'
SIZE='6' COLOR='YELLOW'>ALBUM NAME </FONT></TH>")
RESPONSE.WRITE ("<TH bgcolor='YELLOW' COLSPAN='15'><FONT FACE='ALGERIAN'
SIZE='6' COLOR='RED'>BALANCE </FONT></TH>")
RESPONSE.WRITE ("</TR>")
FROYALTYALBUM.MOVEFIRST
DO WHILE NOT FROYALTYALBUM.EOF
IF ISNULL(FROYALTYALBUM("ALBUMCOD")) THEN
HALBUMCOD=0
ELSE
HALBUMCOD=FROYALTYALBUM("ALBUMCOD")
END IF
SET FALBUM=SERVER.CREATEOBJECT("ADODB.RECORDSET")
ALBUMSQL=" SELECT * FROM ALBUM "
ALBUMSQL=ALBUMSQL & " WHERE ALBUMCOD=" & HALBUMCOD
FALBUM.OPEN ALBUMSQL,CON
REGGAEFLG=0
IF FALBUM.BOF THEN
IF FALBUM.EOF THEN
REGGAEFLG=1
END IF
END IF
IF REGGAEFLG=0 THEN
HALBUMNAM="" & FALBUM("ALBUMNAM")
END IF
REM *********************************************************************
CALCULATE MUSIC PRODUCER ROYALTY ACCOUNT BALANCE
REM*********************************************************************
SET FROYALTYLEDGER=SERVER.CREATEOBJECT("ADODB.RECORDSET")
SQLROYALTY =" SELECT * FROM ROYALTYLEDGER "
SQLROYALTY =SQLROYALTY & " WHERE ARTCOD=" & HACCOUNT_NUMBER
SQLROYALTY =SQLROYALTY & " AND MUSICNO=" & HALBUMCOD
SQLROYALTY =SQLROYALTY & " AND CODE =" & HCODE
FROYALTYLEDGER.OPEN SQLROYALTY, CON
REGGAEFLG=0
IF FROYALTYLEDGER.BOF THEN
IF FROYALTYLEDGER.EOF THEN
REGGAEFLG=1
END IF
END IF
IF REGGAEFLG=0 THEN
HCURRENT_BALANCE = 0
FLAG = 0
FROYALTYLEDGER.MOVEFIRST
DO WHILE NOT FROYALTYLEDGER.EOF
AMTTOTAL=0
HTRNSDAT =FROYALTYLEDGER("TRNSDAT")
IF ISNULL(FROYALTYLEDGER("TRNSNO")) THEN
HTRNSNO=0
ELSE
HTRNSNO=FROYALTYLEDGER("TRNSNO")
END IF
HTRNSTYPE="" & FROYALTYLEDGER("TRNSTYPE")
HHTRNSNO = HTRNSNO
DO WHILE (HTRNSNO=HHTRNSNO) AND (FLAG=0)
IF ISNULL(FROYALTYLEDGER("AMOUNT")) THEN
HAMOUNT=0
HAMOUNT=0
ELSE
HAMOUNT=FROYALTYLEDGER("AMOUNT")
END IF
END IF
AMTTOTAL=AMTTOTAL + HAMOUNT
FROYALTYLEDGER.MOVENEXT
IF FROYALTYLEDGER.EOF THEN
FLAG=1
ELSE
IF ISNULL(FROYALTYLEDGER("TRNSNO")) THEN
HTRNSNO=0
HTRNSNO=0
ELSE
HTRNSNO=FROYALTYLEDGER("TRNSNO")
END IF
END IF
END IF
IF HTRNSTYPE="I" THEN
HDEBIT=AMTTOTAL
HCREDIT=0
HCURRENT_BALANCE=HCURRENT_BALANCE + AMTTOTAL
END IF
END IF
IF HTRNSTYPE="R" THEN
HDEBIT=0
HCREDIT=AMTTOTAL
HCURRENT_BALANCE=HCURRENT_BALANCE - AMTTOTAL
END IF
IF HTRNSTYPE="C" THEN
HCREDIT=AMTTOTAL
HDEBIT=0
HCURRENT_BALANCE=HCURRENT_BALANCE – AMTTOTAL
END IF
END IF
END IF
IF HCURRENT_BALANCE = 0 THEN
ELSE
REM **********************************************************************
PAY PAL BUTTON ONLY DISPLAYED WHEN ROYALTY ACCOUNT HAS A BALANCE
REM **********************************************************************
HITEM_NAME = ""
HITEM_NAME = HITEM_NAME & HHROYALTYCREDITOR
HITEM_NAME = HITEM_NAME & ","
HITEM_NAME = HITEM_NAME & HACCOUNT_NAME
HITEM_NAME = HITEM_NAME & ","
IF HDESCRIPTION = "ALBUM" THEN
HITEM_NAME = HITEM_NAME & HALBUMNAM
ELSE
HITEM_NAME = HITEM_NAME & HSONGTITLE
END IF
REM **************************************************************************************************
PAY PAL HTML FORM VARIABLES TO BE USED IN
INTEGRATION
REM variable : business = " Pay Pal Business Account (Royalty Creditor -
Producer,Writer, Distributor,Artist - Email Address
HEMAIL )"
REM variable : notify_url = " Website Address Of IPN SCRIPT – ROYALTYIPN_ISTENER.ASP
REM variable : item_name = " Product Name -
(1) Royalty Creditor :
(A) Producer ( Person Or Company Financing Recording Of Music )
(B) Distributor ( Sales Agent Of Album Or Song )
(C) Song Writer
(D) Artist( Singer , Musician )
( Who is due payments Based on Sale Orders generated from Download
Of Music )
( Who is due payments Based on Sale Orders generated from Download
Of Music )
(2) Royalty Creditor Account Name
(3) Album Name OR Song Title for which Royalty Revenue are earned based
on ALBUM , SONG Sales
on ALBUM , SONG Sales
REM variable : amount = Current Balance Of Royalty Creditor Account
REM variable : PAYPALURL ( Pay Pal Website Address ) :
(1) Live Site : https://www.paypal.com/cgi-bin/webscr
REM Live Site PAYPALURL = "https://www.paypal.com/cgi-bin/webscr"
REM Testing Site PAYPALURL = "https://www.sandbox.paypal.com/cgi-bin/webscr"
REM*******************************************************************************
REM ***********************************************************************************
HROYALTYIPN_LISTENER = "http://www.bobbyreggae.com/ROYALTYIPN_LISTENER.ASP"
HROYALTY_PAYMENT_URL = “http://www.bobbyreggae.com/ROYALTY.ASP?
COMMAND=PAYMENT&PAYMENTMETHOD=PAYPAL”
COMMAND=PAYMENT&PAYMENTMETHOD=PAYPAL”
REM***********************************************************************************
SET FPAYMENTMETHOD= SERVER.CREATEOBJECT("ADODB.RECORDSET")
SQLPAYMENT = " SELECT * FROM PAYMENTMETHOD "
SQLPAYMENT = SQLPAYMENT & " WHERE ACCOUNTNO =" & HACCOUNT_NUMBER
FPAYMENTMETHOD.OPEN SQLPAYMENT, CON
PAYMENTMETHOD = "" & FPAYMENTMETHOD("PAYMENTMETHOD")
HPAYMENTMETHOD = TRIM(HPAYMENTMETHOD)
IF HPAYMENTMETHOD = "PAYPAL" THEN
REM ***********************************************************
RESPONSE.WRITE("<TR BGCOLOR='YELLOW'>")
REM ***********************************************************
PAY PAL BUTTON INTEGRATED PROGRAMMATICALLY
REM ***********************************************************
REM ***********************************************************
RESPONSE.WRITE("<FORM METHOD='POST' ACTION='" & PAYPALURL & "'>")
RESPONSE.WRITE("<INPUT TYPE='HIDDEN' NAME='item_number' VALUE='" & HALBUMCOD & "'>")
RESPONSE.WRITE("<INPUT TYPE='HIDDEN' NAME='item_name' VALUE='" & HITEM_NAME & "'>")
RESPONSE.WRITE("<INPUT TYPE='HIDDEN' NAME='business' VALUE='" & HEMAIL & "'>")
RESPONSE.WRITE("<INPUT TYPE='HIDDEN' NAME='cmd' VALUE=’_cart'>")
RESPONSE.WRITE("<INPUT TYPE='HIDDEN' NAME='return' VALUE='" & ROYALTY_PAYMENT_URL & “’>”)
RESPONSE.WRITE("<INPUT TYPE='HIDDEN' NAME='return' VALUE='" & ROYALTY_PAYMENT_URL & “’>”)
RESPONSE.WRITE("<INPUT TYPE='HIDDEN' NAME='notify_url' VALUE='" & ROYALTYIPN_LISTENER & "'>")
RESPONSE.WRITE("<INPUT TYPE='HIDDEN' NAME='amount' VALUE='" & HCURRENT_BALANCE & "'>")
RESPONSE.WRITE("<TD><INPUT TYPE='SUBMIT' VALUE='PAY PAL'></TD>")
RESPONSE.WRITE("</FORM>")
REM ************************************************************
REM ************************************************************
MUSIC ROYALTY PAYMENT DETAILS FOR ACCOUNTS BELOW
( DISTRIBUTOR, PRODUCER, SONG WRITER, ARTIST, MUSICIAN )
REM ************************************************************
RESPONSE.WRITE("<TD COLSPAN='10' BGCOLOR='RED' ALIGN='CENTER'>" & “<B>" & "<FONT FACE='ALGERIAN' SIZE='5' COLOR='YELLOW'>" & HACCOUNT_NUMBER & "</FONT>" & "</B>" & "</TD>")
RESPONSE.WRITE("<TD COLSPAN='30' BGCOLOR='YELLOW' ALIGN=CENTER'>" & "<B>" & "<FONT FACE='ALGERIAN' SIZE='5' color='RED'>" & HACCOUNT_NAME & “</FONT>" & "</B>" & "</TD>")
RESPONSE.WRITE("<TD COLSPAN='10' BGCOLOR='GREEN' ALIGN='CENTER'>" & "<B>" & "<FONT FACE='ALGERIAN' SIZE='5' COLOR='YELLOW'>" & HALBUMCOD & "</FONT>" & “</B>" & </TD>")
RESPONSE.WRITE("<TD COLSPAN='30' BGCOLOR='RED' ALIGN='CENTER'>" & "<B>" & “<FONT FACE='ALGERIAN' SIZE='5' COLOR='YELLOW'>" & HALBUMNAM & "</FONT>" & “</B>" & "</TD>")
RESPONSE.WRITE("<TD COLSPAN='15' BGCOLOR='YELLOW' ALIGN='CENTER'>" & "<B>" & "<FONT FACE='ALGERIAN' SIZE='5' COLOR='RED'>" & HCURRENT_BALANCE & "</FONT>" & "</B>" & </TD>")
RESPONSE.WRITE("</TR>")
REM ************************************************************
REM ************************************************************
END IF
END IF
FROYALTYALBUM.MOVENEXT
END IF
FPRODUCER.MOVENEXT
END IF
END IF
No comments:
Post a Comment